diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index e69de29..0000000 diff --git a/.docgen b/.docgen deleted file mode 100644 index 3fdb95a..0000000 --- a/.docgen +++ /dev/null @@ -1 +0,0 @@ -pipenv shell && pdoc3 --html upwork diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 1b4540c..0000000 --- a/.flake8 +++ /dev/null @@ -1,3 +0,0 @@ -[flake8] -max-line-length = 88 -ignore = E501, E203, W503, E231 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 5a0ca71..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: build - -on: - push: - paths-ignore: - - '**.md' - pull_request: - paths-ignore: - - '**.md' - -jobs: - test: - - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest] - python: [ '3.12' ] - - name: Python ${{ matrix.python }} - steps: - - uses: actions/checkout@v2 - - name: Setup python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python }} - # step 1: install dependencies - - run: pip install nox - # step 2: run test - - run: nox diff --git a/.gitignore b/.gitignore deleted file mode 100644 index ba208f0..0000000 --- a/.gitignore +++ /dev/null @@ -1,114 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# pipenv -Pipfile* - -# C extensions -*.so - -# nox -.nox/ - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -.hypothesis/ -.pytest_cache/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# pyenv -.python-version - -# celery beat schedule file -celerybeat-schedule - -# SageMath parsed files -*.sage.py - -# dotenv -.env - -# virtualenv -.venv -venv/ -ENV/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# pdoc3 documentation -html/ - -# mypy -.mypy_cache/ - -# IDE settings -.vscode/ diff --git a/.tests b/.tests deleted file mode 100644 index 816817c..0000000 --- a/.tests +++ /dev/null @@ -1 +0,0 @@ -nox diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 36819d8..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,13 +0,0 @@ -# Release History - -## 3.1.0 -* Add support for Client Credentials Grant - -## 3.0.4 -* Add GraphQL support - -## 3.0.3 -* Send Message to a Batch of Rooms API - -## 3.0.0 -* Release of Python 3 compatible library for OAuth2 workflow diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 7fc598e..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,23 +0,0 @@ -Install project automation tool [`nox`](https://nox.thea.codes/en/stable/): - -``` -python -m pip install --user nox -``` - -### Unit Tests - -``` -nox -s tests -``` - -### Lint - -``` -nox -s lint -``` - -### Publish to PyPI - -``` -nox -s publish -``` \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index d9a10c0..0000000 --- a/LICENSE +++ /dev/null @@ -1,176 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index f5769cd..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,8 +0,0 @@ -include * -include *.md LICENSE - -recursive-include example * - -exclude .flake8 noxfile.py .coverage .coveragerc .gitignore .github .tests .docgen Pipfile* -prune example -prune tests diff --git a/README.md b/README.md deleted file mode 100644 index c46e7b3..0000000 --- a/README.md +++ /dev/null @@ -1,57 +0,0 @@ -Python bindings for Upwork API (OAuth2) -============ - -[![License](https://img.shields.io/github/license/upwork/python-upwork-oauth2)](http://www.apache.org/licenses/LICENSE-2.0.html) -[![PyPI Version](https://badge.fury.io/py/python-upwork.svg)](http://badge.fury.io/py/python-upwork) -[![GitHub release](https://img.shields.io/github/release/upwork/python-upwork.svg)](https://github.com/upwork/python-upwork/releases) -[![Build Status](https://github.com/upwork/python-upwork-oauth2/workflows/build/badge.svg)](https://github.com/upwork/python-upwork-oauth2/actions) - -# Upwork API - -This project provides a set of resources of Upwork API from http://developers.upwork.com - based on OAuth 2.0. - -# Features -The library supports all GraphQL calls, which are publicly shared at Upwork - -# License - -Copyright 2020 Upwork Corporation. All Rights Reserved. - -python-upwork is licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -## SLA -The usage of this API is ruled by the Terms of Use at: - - https://developers.upwork.com/api-tos.html - -# Requirements -To integrate this library you need to have: - -* Python 3.8+ -* requests_oauthlib == 1.3.1 - -## Installation - - pip3 install python-upwork-oauth2 - -All the dependencies will be automatically installed as well. - -## Usage - -1. -Follow instructions from the `Installation` section. - -2. -Run `myapp.py` and follow the instructions, or open `myapp.py` and type the `client_id` and `client_secret` that you previously got from the API Center. -***That's all. Run your app as `python myapp.py` and have fun.***' diff --git a/client.html b/client.html new file mode 100644 index 0000000..b16df83 --- /dev/null +++ b/client.html @@ -0,0 +1,725 @@ + + + + + + +upwork.client API documentation + + + + + + + + + + + +
+
+
+

Module upwork.client

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+from . import upwork
+from oauthlib.oauth2 import BackendApplicationClient
+from requests_oauthlib import OAuth2Session  # type: ignore
+from urllib.parse import parse_qsl, urlencode
+
+
+class Client(object):
+    """API client for OAuth2 authorization
+    
+    *Parameters:*
+    :config: An instance of upwork.Config class, which contains the configuration keys and tokens
+    """
+
+    __data_format = "json"
+    __overload_var = "http_method"
+
+    __uri_auth = "/ab/account-security/oauth2/authorize"
+    __uri_rtoken = "/v3/oauth2/token"
+    __uri_atoken = "/v3/oauth2/token"
+
+    epoint = upwork.DEFAULT_EPOINT
+
+    def __init__(self, config):
+        self.config = config
+        self.config.tenant_id = None
+        try:
+            # token is known, use it
+            self.__oauth = OAuth2Session(
+                self.config.client_id,
+                token=self.config.token,
+                auto_refresh_url=full_url(self.__uri_rtoken, upwork.DEFAULT_EPOINT),
+                auto_refresh_kwargs={
+                    "client_id": self.config.client_id,
+                    "client_secret": self.config.client_secret,
+                },
+                token_updater=self.refresh_config_from_access_token,
+            )
+        except AttributeError as e:
+            if self.config.grant_type == "client_credentials":
+                client = BackendApplicationClient(client_id=self.config.client_id)
+                self.__oauth = OAuth2Session(
+                    client=client
+                )
+            else:
+                # start from authorization step
+                self.__oauth = OAuth2Session(
+                    self.config.client_id, redirect_uri=self.config.redirect_uri
+                )
+
+    def get_authorization_url(self):
+        """Get authorization URL
+
+        :param redirect_uri:  (Default value = None)
+
+        """
+        return self.__oauth.authorization_url(
+            "{0}{1}".format(upwork.BASE_HOST, self.__uri_auth)
+        )
+
+    def get_access_token(self, authorization_response=None):
+        """Finish auth process and get access token
+
+        :param authorization_response: 
+
+        """
+        self.config.token = self.__oauth.fetch_token(
+            full_url(self.__uri_atoken, upwork.DEFAULT_EPOINT),
+            authorization_response=authorization_response,
+            client_secret=self.config.client_secret,
+        )
+        return self.config.token
+
+    def refresh_config_from_access_token(self, token):
+        """Callback from OAuth2 client which will refresh config with actual data"""
+        self.config.token = token
+
+    def set_org_uid_header(self, tenant_id):
+        """Configure X-Upwork-API-TenantId header"""
+        self.config.tenant_id = tenant_id
+
+    def get_actual_config(self):
+        """Get actual client config"""
+        return self.config
+
+    def get(self, uri, params=None):
+        """Execute GET request
+
+        :param uri: 
+        :param params:  (Default value = None)
+
+        """
+        return self.send_request(uri, "get", params)
+
+    def post(self, uri, params=None):
+        """Execute POST request
+
+        :param uri: 
+        :param params:  (Default value = None)
+
+        """
+        return self.send_request(uri, "post", params)
+
+    def put(self, uri, params=None):
+        """Execute PUT request
+
+        :param uri: 
+        :param params:  (Default value = None)
+
+        """
+        return self.send_request(uri, "put", params)
+
+    def delete(self, uri, params=None):
+        """Execute DELETE request
+
+        :param uri: 
+        :param params:  (Default value = None)
+
+        """
+        return self.send_request(uri, "delete", params)
+
+    def send_request(self, uri, method="get", params={}):
+        """Send request
+
+        :param uri: 
+        :param method:  (Default value = 'get')
+        :param params:  (Default value = {})
+
+        """
+        # delete does not support passing the parameters
+        if method == "delete":
+            params[self.__overload_var] = method
+
+        url = full_url(get_uri_with_format(uri, self.epoint), self.epoint)
+
+        if method == "get":
+            r = self.__oauth.get(url, params=params)
+        elif method == "put":
+            headers = {"Content-type": "application/json"}
+            r = self.__oauth.put(url, json=params, headers=headers)
+        elif method in {"post", "delete"}:
+            headers = {"Content-type": "application/json"}
+            if self.epoint == "graphql" and self.config.tenant_id:
+                headers["X-Upwork-API-TenantId"] = self.config.tenant_id
+            r = self.__oauth.post(url, json=params, headers=headers)
+        else:
+            raise ValueError(
+                'Do not know how to handle http method "{0}"'.format(method)
+            )
+
+        return r.json()
+
+
+"""
+
+"""
+
+
+def full_url(uri, epoint=None):
+    """Get full URL
+
+    :param uri: 
+    :param epoint:  (Default value = None)
+
+    """
+    if epoint == "graphql":
+        return upwork.GQL_EPOINT
+
+    if not epoint:
+        epoint = upwork.DEFAULT_EPOINT
+    return "{0}/{1}{2}".format(upwork.BASE_HOST, epoint, uri)
+
+
+def get_uri_with_format(uri, epoint):
+    """Get URI with format ending
+
+    :param uri: 
+    :param epoint: 
+
+    """
+    if epoint == upwork.DEFAULT_EPOINT:
+        uri += ".json"
+    return uri
+
+
+
+
+
+
+
+

Functions

+
+
+def full_url(uri, epoint=None) +
+
+

Get full URL

+

:param uri: +:param epoint: +(Default value = None)

+
+ +Expand source code + +
def full_url(uri, epoint=None):
+    """Get full URL
+
+    :param uri: 
+    :param epoint:  (Default value = None)
+
+    """
+    if epoint == "graphql":
+        return upwork.GQL_EPOINT
+
+    if not epoint:
+        epoint = upwork.DEFAULT_EPOINT
+    return "{0}/{1}{2}".format(upwork.BASE_HOST, epoint, uri)
+
+
+
+def get_uri_with_format(uri, epoint) +
+
+

Get URI with format ending

+

:param uri: +:param epoint:

+
+ +Expand source code + +
def get_uri_with_format(uri, epoint):
+    """Get URI with format ending
+
+    :param uri: 
+    :param epoint: 
+
+    """
+    if epoint == upwork.DEFAULT_EPOINT:
+        uri += ".json"
+    return uri
+
+
+
+
+
+

Classes

+
+
+class Client +(config) +
+
+

API client for OAuth2 authorization

+

Parameters: +:config: An instance of upwork.Config class, which contains the configuration keys and tokens

+
+ +Expand source code + +
class Client(object):
+    """API client for OAuth2 authorization
+    
+    *Parameters:*
+    :config: An instance of upwork.Config class, which contains the configuration keys and tokens
+    """
+
+    __data_format = "json"
+    __overload_var = "http_method"
+
+    __uri_auth = "/ab/account-security/oauth2/authorize"
+    __uri_rtoken = "/v3/oauth2/token"
+    __uri_atoken = "/v3/oauth2/token"
+
+    epoint = upwork.DEFAULT_EPOINT
+
+    def __init__(self, config):
+        self.config = config
+        self.config.tenant_id = None
+        try:
+            # token is known, use it
+            self.__oauth = OAuth2Session(
+                self.config.client_id,
+                token=self.config.token,
+                auto_refresh_url=full_url(self.__uri_rtoken, upwork.DEFAULT_EPOINT),
+                auto_refresh_kwargs={
+                    "client_id": self.config.client_id,
+                    "client_secret": self.config.client_secret,
+                },
+                token_updater=self.refresh_config_from_access_token,
+            )
+        except AttributeError as e:
+            if self.config.grant_type == "client_credentials":
+                client = BackendApplicationClient(client_id=self.config.client_id)
+                self.__oauth = OAuth2Session(
+                    client=client
+                )
+            else:
+                # start from authorization step
+                self.__oauth = OAuth2Session(
+                    self.config.client_id, redirect_uri=self.config.redirect_uri
+                )
+
+    def get_authorization_url(self):
+        """Get authorization URL
+
+        :param redirect_uri:  (Default value = None)
+
+        """
+        return self.__oauth.authorization_url(
+            "{0}{1}".format(upwork.BASE_HOST, self.__uri_auth)
+        )
+
+    def get_access_token(self, authorization_response=None):
+        """Finish auth process and get access token
+
+        :param authorization_response: 
+
+        """
+        self.config.token = self.__oauth.fetch_token(
+            full_url(self.__uri_atoken, upwork.DEFAULT_EPOINT),
+            authorization_response=authorization_response,
+            client_secret=self.config.client_secret,
+        )
+        return self.config.token
+
+    def refresh_config_from_access_token(self, token):
+        """Callback from OAuth2 client which will refresh config with actual data"""
+        self.config.token = token
+
+    def set_org_uid_header(self, tenant_id):
+        """Configure X-Upwork-API-TenantId header"""
+        self.config.tenant_id = tenant_id
+
+    def get_actual_config(self):
+        """Get actual client config"""
+        return self.config
+
+    def get(self, uri, params=None):
+        """Execute GET request
+
+        :param uri: 
+        :param params:  (Default value = None)
+
+        """
+        return self.send_request(uri, "get", params)
+
+    def post(self, uri, params=None):
+        """Execute POST request
+
+        :param uri: 
+        :param params:  (Default value = None)
+
+        """
+        return self.send_request(uri, "post", params)
+
+    def put(self, uri, params=None):
+        """Execute PUT request
+
+        :param uri: 
+        :param params:  (Default value = None)
+
+        """
+        return self.send_request(uri, "put", params)
+
+    def delete(self, uri, params=None):
+        """Execute DELETE request
+
+        :param uri: 
+        :param params:  (Default value = None)
+
+        """
+        return self.send_request(uri, "delete", params)
+
+    def send_request(self, uri, method="get", params={}):
+        """Send request
+
+        :param uri: 
+        :param method:  (Default value = 'get')
+        :param params:  (Default value = {})
+
+        """
+        # delete does not support passing the parameters
+        if method == "delete":
+            params[self.__overload_var] = method
+
+        url = full_url(get_uri_with_format(uri, self.epoint), self.epoint)
+
+        if method == "get":
+            r = self.__oauth.get(url, params=params)
+        elif method == "put":
+            headers = {"Content-type": "application/json"}
+            r = self.__oauth.put(url, json=params, headers=headers)
+        elif method in {"post", "delete"}:
+            headers = {"Content-type": "application/json"}
+            if self.epoint == "graphql" and self.config.tenant_id:
+                headers["X-Upwork-API-TenantId"] = self.config.tenant_id
+            r = self.__oauth.post(url, json=params, headers=headers)
+        else:
+            raise ValueError(
+                'Do not know how to handle http method "{0}"'.format(method)
+            )
+
+        return r.json()
+
+

Class variables

+
+
var epoint
+
+
+
+
+

Methods

+
+
+def delete(self, uri, params=None) +
+
+

Execute DELETE request

+

:param uri: +:param params: +(Default value = None)

+
+ +Expand source code + +
def delete(self, uri, params=None):
+    """Execute DELETE request
+
+    :param uri: 
+    :param params:  (Default value = None)
+
+    """
+    return self.send_request(uri, "delete", params)
+
+
+
+def get(self, uri, params=None) +
+
+

Execute GET request

+

:param uri: +:param params: +(Default value = None)

+
+ +Expand source code + +
def get(self, uri, params=None):
+    """Execute GET request
+
+    :param uri: 
+    :param params:  (Default value = None)
+
+    """
+    return self.send_request(uri, "get", params)
+
+
+
+def get_access_token(self, authorization_response=None) +
+
+

Finish auth process and get access token

+

:param authorization_response:

+
+ +Expand source code + +
def get_access_token(self, authorization_response=None):
+    """Finish auth process and get access token
+
+    :param authorization_response: 
+
+    """
+    self.config.token = self.__oauth.fetch_token(
+        full_url(self.__uri_atoken, upwork.DEFAULT_EPOINT),
+        authorization_response=authorization_response,
+        client_secret=self.config.client_secret,
+    )
+    return self.config.token
+
+
+
+def get_actual_config(self) +
+
+

Get actual client config

+
+ +Expand source code + +
def get_actual_config(self):
+    """Get actual client config"""
+    return self.config
+
+
+
+def get_authorization_url(self) +
+
+

Get authorization URL

+

:param redirect_uri: +(Default value = None)

+
+ +Expand source code + +
def get_authorization_url(self):
+    """Get authorization URL
+
+    :param redirect_uri:  (Default value = None)
+
+    """
+    return self.__oauth.authorization_url(
+        "{0}{1}".format(upwork.BASE_HOST, self.__uri_auth)
+    )
+
+
+
+def post(self, uri, params=None) +
+
+

Execute POST request

+

:param uri: +:param params: +(Default value = None)

+
+ +Expand source code + +
def post(self, uri, params=None):
+    """Execute POST request
+
+    :param uri: 
+    :param params:  (Default value = None)
+
+    """
+    return self.send_request(uri, "post", params)
+
+
+
+def put(self, uri, params=None) +
+
+

Execute PUT request

+

:param uri: +:param params: +(Default value = None)

+
+ +Expand source code + +
def put(self, uri, params=None):
+    """Execute PUT request
+
+    :param uri: 
+    :param params:  (Default value = None)
+
+    """
+    return self.send_request(uri, "put", params)
+
+
+
+def refresh_config_from_access_token(self, token) +
+
+

Callback from OAuth2 client which will refresh config with actual data

+
+ +Expand source code + +
def refresh_config_from_access_token(self, token):
+    """Callback from OAuth2 client which will refresh config with actual data"""
+    self.config.token = token
+
+
+
+def send_request(self, uri, method='get', params={}) +
+
+

Send request

+

:param uri: +:param method: +(Default value = 'get') +:param params: +(Default value = {})

+
+ +Expand source code + +
def send_request(self, uri, method="get", params={}):
+    """Send request
+
+    :param uri: 
+    :param method:  (Default value = 'get')
+    :param params:  (Default value = {})
+
+    """
+    # delete does not support passing the parameters
+    if method == "delete":
+        params[self.__overload_var] = method
+
+    url = full_url(get_uri_with_format(uri, self.epoint), self.epoint)
+
+    if method == "get":
+        r = self.__oauth.get(url, params=params)
+    elif method == "put":
+        headers = {"Content-type": "application/json"}
+        r = self.__oauth.put(url, json=params, headers=headers)
+    elif method in {"post", "delete"}:
+        headers = {"Content-type": "application/json"}
+        if self.epoint == "graphql" and self.config.tenant_id:
+            headers["X-Upwork-API-TenantId"] = self.config.tenant_id
+        r = self.__oauth.post(url, json=params, headers=headers)
+    else:
+        raise ValueError(
+            'Do not know how to handle http method "{0}"'.format(method)
+        )
+
+    return r.json()
+
+
+
+def set_org_uid_header(self, tenant_id) +
+
+

Configure X-Upwork-API-TenantId header

+
+ +Expand source code + +
def set_org_uid_header(self, tenant_id):
+    """Configure X-Upwork-API-TenantId header"""
+    self.config.tenant_id = tenant_id
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/config.html b/config.html new file mode 100644 index 0000000..7440419 --- /dev/null +++ b/config.html @@ -0,0 +1,134 @@ + + + + + + +upwork.config API documentation + + + + + + + + + + + +
+
+
+

Module upwork.config

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Config:
+    """Configuration container"""
+
+    def __init__(self, config):
+        self.client_id, self.client_secret = (
+            config["client_id"],
+            config["client_secret"],
+        )
+
+        if "grant_type" in config:
+            self.grant_type = config["grant_type"]
+        else:
+            self.grant_type = None # Authorization Code Grant flow is used by default
+
+        if "redirect_uri" in config:
+            self.redirect_uri = config["redirect_uri"]
+
+        # access-, refresh token, and expires_in/at data
+        if "token" in config:
+            self.token = config["token"]
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Config +(config) +
+
+

Configuration container

+
+ +Expand source code + +
class Config:
+    """Configuration container"""
+
+    def __init__(self, config):
+        self.client_id, self.client_secret = (
+            config["client_id"],
+            config["client_secret"],
+        )
+
+        if "grant_type" in config:
+            self.grant_type = config["grant_type"]
+        else:
+            self.grant_type = None # Authorization Code Grant flow is used by default
+
+        if "redirect_uri" in config:
+            self.redirect_uri = config["redirect_uri"]
+
+        # access-, refresh token, and expires_in/at data
+        if "token" in config:
+            self.token = config["token"]
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/example/myapp.py b/example/myapp.py deleted file mode 100644 index e803712..0000000 --- a/example/myapp.py +++ /dev/null @@ -1,80 +0,0 @@ -import upwork -from pprint import pprint -from upwork.routers import graphql - - -def get_desktop_client(): - """Emulation of desktop app. - Your keys should be created with project type "Desktop". - - Returns: ``upwork.Client`` instance ready to work. - - """ - print("Emulating desktop app") - - consumer_key = input("Please enter consumer key: > ") - consumer_secret = input("Please enter key secret: > ") - config = upwork.Config( - { - "client_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - "client_secret": "xxxxxxxxxxxxx", - "redirect_uri": "https://a.callback.url", - } - ) - - # If token data already known and saved, you can reuse them - # by adding 'token' parameter to the config - # token = {'access_token': 'xxxxxxxxxxxxxxxxxx', 'expires_at': 1590479276.547947, 'expires_in': '86400', 'refresh_token': 'xxxxxxxxxxxxxxxxxxxxxxxx', 'token_type': 'Bearer'} - # config = upwork.Config({'client_id': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'client_secret': 'xxxxxxxxxxxxx', 'token': token}) - - # For Client Credentials Grant the following config must be used, no other parameters are needed - # config = upwork.Config({'client_id': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'client_secret': 'xxxxxxxxxxxxx', 'grant_type': 'client_credentials'}) - - client = upwork.Client(config) - - try: - config.token - except AttributeError: - # remove client.get_authorization_url and authz_code input in case Client Credentials Grant is used - authorization_url, state = client.get_authorization_url() - # cover "state" flow if needed - authz_code = input( - "Please enter the full callback URL you get " - "following this link:\n{0}\n\n> ".format(authorization_url) - ) - - print("Retrieving access and refresh tokens.... ") - token = client.get_access_token(authz_code) - # token = client.get_access_token() # for Client Credentials Grant - # WARNING: the access token will be refreshed automatically for you - # in case it's expired, i.e. expires_at < time(). Make sure you replace the - # old token accordingly in your security storage. Call client.get_actual_config - # periodically to sync-up the data - pprint(token) - print("OK") - - # For further use you can store ``token`` data somewhere - - return client - - -if __name__ == "__main__": - client = get_desktop_client() - - try: - query = """ - query { - user { - id - nid - rid - } - organization { - id - } - }""" - # client.set_org_uid_header("1234567890") # Organization UID (optional) - pprint(graphql.Api(client).execute({'query': query})) - except Exception as e: - # print("Exception at %s %s" % (client.last_method, client.last_url)) - raise e diff --git a/index.html b/index.html new file mode 100644 index 0000000..8984779 --- /dev/null +++ b/index.html @@ -0,0 +1,540 @@ + + + + + + +upwork API documentation + + + + + + + + + + + +
+
+
+

Package upwork

+
+
+

Top-level package for python-upwork.

+
+ +Expand source code + +
"""Top-level package for python-upwork."""
+
+from upwork.config import Config
+from upwork.client import Client
+from . import routers
+
+__author__ = """Maksym Novozhylov"""
+__email__ = "mnovozhilov@upwork.com"
+__version__ = "3.1.0"
+
+__all__ = ("Config", "Client", "routers")
+
+
+
+

Sub-modules

+
+
upwork.client
+
+
+
+
upwork.config
+
+
+
+
upwork.routers
+
+

routers

+
+
upwork.upwork
+
+

Main module.

+
+
+
+
+
+
+
+
+

Classes

+
+
+class Client +(config) +
+
+

API client for OAuth2 authorization

+

Parameters: +:config: An instance of upwork.Config class, which contains the configuration keys and tokens

+
+ +Expand source code + +
class Client(object):
+    """API client for OAuth2 authorization
+    
+    *Parameters:*
+    :config: An instance of upwork.Config class, which contains the configuration keys and tokens
+    """
+
+    __data_format = "json"
+    __overload_var = "http_method"
+
+    __uri_auth = "/ab/account-security/oauth2/authorize"
+    __uri_rtoken = "/v3/oauth2/token"
+    __uri_atoken = "/v3/oauth2/token"
+
+    epoint = upwork.DEFAULT_EPOINT
+
+    def __init__(self, config):
+        self.config = config
+        self.config.tenant_id = None
+        try:
+            # token is known, use it
+            self.__oauth = OAuth2Session(
+                self.config.client_id,
+                token=self.config.token,
+                auto_refresh_url=full_url(self.__uri_rtoken, upwork.DEFAULT_EPOINT),
+                auto_refresh_kwargs={
+                    "client_id": self.config.client_id,
+                    "client_secret": self.config.client_secret,
+                },
+                token_updater=self.refresh_config_from_access_token,
+            )
+        except AttributeError as e:
+            if self.config.grant_type == "client_credentials":
+                client = BackendApplicationClient(client_id=self.config.client_id)
+                self.__oauth = OAuth2Session(
+                    client=client
+                )
+            else:
+                # start from authorization step
+                self.__oauth = OAuth2Session(
+                    self.config.client_id, redirect_uri=self.config.redirect_uri
+                )
+
+    def get_authorization_url(self):
+        """Get authorization URL
+
+        :param redirect_uri:  (Default value = None)
+
+        """
+        return self.__oauth.authorization_url(
+            "{0}{1}".format(upwork.BASE_HOST, self.__uri_auth)
+        )
+
+    def get_access_token(self, authorization_response=None):
+        """Finish auth process and get access token
+
+        :param authorization_response: 
+
+        """
+        self.config.token = self.__oauth.fetch_token(
+            full_url(self.__uri_atoken, upwork.DEFAULT_EPOINT),
+            authorization_response=authorization_response,
+            client_secret=self.config.client_secret,
+        )
+        return self.config.token
+
+    def refresh_config_from_access_token(self, token):
+        """Callback from OAuth2 client which will refresh config with actual data"""
+        self.config.token = token
+
+    def set_org_uid_header(self, tenant_id):
+        """Configure X-Upwork-API-TenantId header"""
+        self.config.tenant_id = tenant_id
+
+    def get_actual_config(self):
+        """Get actual client config"""
+        return self.config
+
+    def get(self, uri, params=None):
+        """Execute GET request
+
+        :param uri: 
+        :param params:  (Default value = None)
+
+        """
+        return self.send_request(uri, "get", params)
+
+    def post(self, uri, params=None):
+        """Execute POST request
+
+        :param uri: 
+        :param params:  (Default value = None)
+
+        """
+        return self.send_request(uri, "post", params)
+
+    def put(self, uri, params=None):
+        """Execute PUT request
+
+        :param uri: 
+        :param params:  (Default value = None)
+
+        """
+        return self.send_request(uri, "put", params)
+
+    def delete(self, uri, params=None):
+        """Execute DELETE request
+
+        :param uri: 
+        :param params:  (Default value = None)
+
+        """
+        return self.send_request(uri, "delete", params)
+
+    def send_request(self, uri, method="get", params={}):
+        """Send request
+
+        :param uri: 
+        :param method:  (Default value = 'get')
+        :param params:  (Default value = {})
+
+        """
+        # delete does not support passing the parameters
+        if method == "delete":
+            params[self.__overload_var] = method
+
+        url = full_url(get_uri_with_format(uri, self.epoint), self.epoint)
+
+        if method == "get":
+            r = self.__oauth.get(url, params=params)
+        elif method == "put":
+            headers = {"Content-type": "application/json"}
+            r = self.__oauth.put(url, json=params, headers=headers)
+        elif method in {"post", "delete"}:
+            headers = {"Content-type": "application/json"}
+            if self.epoint == "graphql" and self.config.tenant_id:
+                headers["X-Upwork-API-TenantId"] = self.config.tenant_id
+            r = self.__oauth.post(url, json=params, headers=headers)
+        else:
+            raise ValueError(
+                'Do not know how to handle http method "{0}"'.format(method)
+            )
+
+        return r.json()
+
+

Class variables

+
+
var epoint
+
+
+
+
+

Methods

+
+
+def delete(self, uri, params=None) +
+
+

Execute DELETE request

+

:param uri: +:param params: +(Default value = None)

+
+ +Expand source code + +
def delete(self, uri, params=None):
+    """Execute DELETE request
+
+    :param uri: 
+    :param params:  (Default value = None)
+
+    """
+    return self.send_request(uri, "delete", params)
+
+
+
+def get(self, uri, params=None) +
+
+

Execute GET request

+

:param uri: +:param params: +(Default value = None)

+
+ +Expand source code + +
def get(self, uri, params=None):
+    """Execute GET request
+
+    :param uri: 
+    :param params:  (Default value = None)
+
+    """
+    return self.send_request(uri, "get", params)
+
+
+
+def get_access_token(self, authorization_response=None) +
+
+

Finish auth process and get access token

+

:param authorization_response:

+
+ +Expand source code + +
def get_access_token(self, authorization_response=None):
+    """Finish auth process and get access token
+
+    :param authorization_response: 
+
+    """
+    self.config.token = self.__oauth.fetch_token(
+        full_url(self.__uri_atoken, upwork.DEFAULT_EPOINT),
+        authorization_response=authorization_response,
+        client_secret=self.config.client_secret,
+    )
+    return self.config.token
+
+
+
+def get_actual_config(self) +
+
+

Get actual client config

+
+ +Expand source code + +
def get_actual_config(self):
+    """Get actual client config"""
+    return self.config
+
+
+
+def get_authorization_url(self) +
+
+

Get authorization URL

+

:param redirect_uri: +(Default value = None)

+
+ +Expand source code + +
def get_authorization_url(self):
+    """Get authorization URL
+
+    :param redirect_uri:  (Default value = None)
+
+    """
+    return self.__oauth.authorization_url(
+        "{0}{1}".format(upwork.BASE_HOST, self.__uri_auth)
+    )
+
+
+
+def post(self, uri, params=None) +
+
+

Execute POST request

+

:param uri: +:param params: +(Default value = None)

+
+ +Expand source code + +
def post(self, uri, params=None):
+    """Execute POST request
+
+    :param uri: 
+    :param params:  (Default value = None)
+
+    """
+    return self.send_request(uri, "post", params)
+
+
+
+def put(self, uri, params=None) +
+
+

Execute PUT request

+

:param uri: +:param params: +(Default value = None)

+
+ +Expand source code + +
def put(self, uri, params=None):
+    """Execute PUT request
+
+    :param uri: 
+    :param params:  (Default value = None)
+
+    """
+    return self.send_request(uri, "put", params)
+
+
+
+def refresh_config_from_access_token(self, token) +
+
+

Callback from OAuth2 client which will refresh config with actual data

+
+ +Expand source code + +
def refresh_config_from_access_token(self, token):
+    """Callback from OAuth2 client which will refresh config with actual data"""
+    self.config.token = token
+
+
+
+def send_request(self, uri, method='get', params={}) +
+
+

Send request

+

:param uri: +:param method: +(Default value = 'get') +:param params: +(Default value = {})

+
+ +Expand source code + +
def send_request(self, uri, method="get", params={}):
+    """Send request
+
+    :param uri: 
+    :param method:  (Default value = 'get')
+    :param params:  (Default value = {})
+
+    """
+    # delete does not support passing the parameters
+    if method == "delete":
+        params[self.__overload_var] = method
+
+    url = full_url(get_uri_with_format(uri, self.epoint), self.epoint)
+
+    if method == "get":
+        r = self.__oauth.get(url, params=params)
+    elif method == "put":
+        headers = {"Content-type": "application/json"}
+        r = self.__oauth.put(url, json=params, headers=headers)
+    elif method in {"post", "delete"}:
+        headers = {"Content-type": "application/json"}
+        if self.epoint == "graphql" and self.config.tenant_id:
+            headers["X-Upwork-API-TenantId"] = self.config.tenant_id
+        r = self.__oauth.post(url, json=params, headers=headers)
+    else:
+        raise ValueError(
+            'Do not know how to handle http method "{0}"'.format(method)
+        )
+
+    return r.json()
+
+
+
+def set_org_uid_header(self, tenant_id) +
+
+

Configure X-Upwork-API-TenantId header

+
+ +Expand source code + +
def set_org_uid_header(self, tenant_id):
+    """Configure X-Upwork-API-TenantId header"""
+    self.config.tenant_id = tenant_id
+
+
+
+
+
+class Config +(config) +
+
+

Configuration container

+
+ +Expand source code + +
class Config:
+    """Configuration container"""
+
+    def __init__(self, config):
+        self.client_id, self.client_secret = (
+            config["client_id"],
+            config["client_secret"],
+        )
+
+        if "grant_type" in config:
+            self.grant_type = config["grant_type"]
+        else:
+            self.grant_type = None # Authorization Code Grant flow is used by default
+
+        if "redirect_uri" in config:
+            self.redirect_uri = config["redirect_uri"]
+
+        # access-, refresh token, and expires_in/at data
+        if "token" in config:
+            self.token = config["token"]
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/noxfile.py b/noxfile.py deleted file mode 100644 index 01ea236..0000000 --- a/noxfile.py +++ /dev/null @@ -1,65 +0,0 @@ -import nox # type: ignore -from pathlib import Path - -nox.options.sessions = ["tests", "lint", "build"] - -python = ["3.12"] - - -lint_dependencies = [ - "-e", - ".", - "black", - "flake8", - "flake8-bugbear", - "mypy", - "check-manifest", -] - - -@nox.session(python=python) -def tests(session): - session.install("-e", ".", "pytest", "pytest-cov") - tests = session.posargs or ["tests"] - session.run( - "pytest", "--cov=upwork", "--cov-config", ".coveragerc", "--cov-report=", *tests - ) - session.notify("cover") - - -@nox.session -def cover(session): - """Coverage analysis""" - session.install("coverage") - session.run("coverage", "report", "--show-missing", "--fail-under=0") - session.run("coverage", "erase") - - -@nox.session(python="3.12") -def lint(session): - session.install(*lint_dependencies) - files = ["tests"] + [str(p) for p in Path(".").glob("*.py")] - session.run("black", "--check", *files) - session.run("flake8", *files) - session.run("mypy", *files) - session.run("python", "setup.py", "check", "--metadata", "--strict") - if "--skip_manifest_check" in session.posargs: - pass - else: - session.run("check-manifest") - - -@nox.session(python="3.12") -def build(session): - session.install("setuptools") - session.install("wheel") - session.install("twine") - session.run("rm", "-rf", "dist", "build", external=True) - session.run("python", "setup.py", "--quiet", "sdist", "bdist_wheel") - - -@nox.session(python="3.12") -def publish(session): - build(session) - print("REMINDER: Has the changelog been updated?") - session.run("python", "-m", "twine", "upload", "dist/*") diff --git a/routers/activities/engagement.html b/routers/activities/engagement.html new file mode 100644 index 0000000..cc3d189 --- /dev/null +++ b/routers/activities/engagement.html @@ -0,0 +1,260 @@ + + + + + + +upwork.routers.activities.engagement API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.activities.engagement

+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_specific(self, engagement_ref):
+        """List activities for specific engagement
+
+        :param engagement_ref: String
+
+        """
+        return self.client.get("/tasks/v2/tasks/contracts/{0}".format(engagement_ref))
+
+    def assign(self, company, team, engagement, params):
+        """Assign engagements to the list of activities
+        
+        Parameters:
+        :param company: 
+        :param team: 
+        :param engagement: 
+        :param params: 
+
+        """
+        return self.client.put(
+            "/otask/v1/tasks/companies/{0}/teams/{1}/engagements/{2}/tasks".format(
+                company, team, engagement
+            ),
+            params,
+        )
+
+    def assign_to_engagement(self, engagement_ref, params):
+        """Assign to specific engagement the list of activities
+        
+        Parameters:
+        :param engagement_ref: 
+        :param params: 
+
+        """
+        return self.client.put(
+            "/tasks/v2/tasks/contracts/{0}".format(engagement_ref), params
+        )
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_specific(self, engagement_ref):
+        """List activities for specific engagement
+
+        :param engagement_ref: String
+
+        """
+        return self.client.get("/tasks/v2/tasks/contracts/{0}".format(engagement_ref))
+
+    def assign(self, company, team, engagement, params):
+        """Assign engagements to the list of activities
+        
+        Parameters:
+        :param company: 
+        :param team: 
+        :param engagement: 
+        :param params: 
+
+        """
+        return self.client.put(
+            "/otask/v1/tasks/companies/{0}/teams/{1}/engagements/{2}/tasks".format(
+                company, team, engagement
+            ),
+            params,
+        )
+
+    def assign_to_engagement(self, engagement_ref, params):
+        """Assign to specific engagement the list of activities
+        
+        Parameters:
+        :param engagement_ref: 
+        :param params: 
+
+        """
+        return self.client.put(
+            "/tasks/v2/tasks/contracts/{0}".format(engagement_ref), params
+        )
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def assign(self, company, team, engagement, params) +
+
+

Assign engagements to the list of activities

+

Parameters: +:param company: +:param team: +:param engagement: +:param params:

+
+ +Expand source code + +
def assign(self, company, team, engagement, params):
+    """Assign engagements to the list of activities
+    
+    Parameters:
+    :param company: 
+    :param team: 
+    :param engagement: 
+    :param params: 
+
+    """
+    return self.client.put(
+        "/otask/v1/tasks/companies/{0}/teams/{1}/engagements/{2}/tasks".format(
+            company, team, engagement
+        ),
+        params,
+    )
+
+
+
+def assign_to_engagement(self, engagement_ref, params) +
+
+

Assign to specific engagement the list of activities

+

Parameters: +:param engagement_ref: +:param params:

+
+ +Expand source code + +
def assign_to_engagement(self, engagement_ref, params):
+    """Assign to specific engagement the list of activities
+    
+    Parameters:
+    :param engagement_ref: 
+    :param params: 
+
+    """
+    return self.client.put(
+        "/tasks/v2/tasks/contracts/{0}".format(engagement_ref), params
+    )
+
+
+
+def get_specific(self, engagement_ref) +
+
+

List activities for specific engagement

+

:param engagement_ref: String

+
+ +Expand source code + +
def get_specific(self, engagement_ref):
+    """List activities for specific engagement
+
+    :param engagement_ref: String
+
+    """
+    return self.client.get("/tasks/v2/tasks/contracts/{0}".format(engagement_ref))
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/activities/index.html b/routers/activities/index.html new file mode 100644 index 0000000..90f38a7 --- /dev/null +++ b/routers/activities/index.html @@ -0,0 +1,77 @@ + + + + + + +upwork.routers.activities API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.activities

+
+
+

routers

+
+ +Expand source code + +
"""routers"""
+
+
+
+

Sub-modules

+
+
upwork.routers.activities.engagement
+
+
+
+
upwork.routers.activities.team
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/activities/team.html b/routers/activities/team.html new file mode 100644 index 0000000..62f73cb --- /dev/null +++ b/routers/activities/team.html @@ -0,0 +1,513 @@ + + + + + + +upwork.routers.activities.team API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.activities.team

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_list(self, company, team):
+        """List all oTask/Activity records within a team
+
+        :param company: String
+        :param team: String
+
+        """
+        return self.__get_by_type(company, team)
+
+    def get_specific_list(self, company, team, code):
+        """List all oTask/Activity records within a Company by specified code(s)
+
+        :param company: String
+        :param team: String
+        :param code: String
+
+        """
+        return self.__get_by_type(company, team, code)
+
+    def add_activity(self, company, team, params):
+        """Create an oTask/Activity record within a team
+        
+        Parameters:
+        :param company: 
+        :param team: 
+        :param params: 
+
+        """
+        return self.client.post(
+            "/otask/v1/tasks/companies/{0}/teams/{1}/tasks".format(company, team),
+            params,
+        )
+
+    def update_activities(self, company, team, code, params):
+        """Update specific oTask/Activity record within a team
+        
+        Parameters:
+        :param company: 
+        :param team: 
+        :param code: 
+        :param params: 
+
+        """
+        return self.client.put(
+            "/otask/v1/tasks/companies/{0}/teams/{1}/tasks/{2}".format(
+                company, team, code
+            ),
+            params,
+        )
+
+    def archive_activities(self, company, team, code):
+        """Archive specific oTask/Activity record within a team
+
+        :param company: String
+        :param team: String
+        :param code: String
+
+        """
+        return self.client.put(
+            "/otask/v1/tasks/companies/{0}/teams/{1}/archive/{2}".format(
+                company, team, code
+            )
+        )
+
+    def unarchive_activities(self, company, team, code):
+        """Unarchive specific oTask/Activity record within a team
+
+        :param company: String
+        :param team: String
+        :param code: String
+
+        """
+        return self.client.put(
+            "/otask/v1/tasks/companies/{0}/teams/{1}/unarchive/{2}".format(
+                company, team, code
+            )
+        )
+
+    def update_batch(self, company, params):
+        """Update a group of oTask/Activity records within a company
+        
+        Parameters:
+        :param company: 
+        :param params: 
+
+        """
+        return self.client.put(
+            "/otask/v1/tasks/companies/{0}/tasks/batch".format(company), params
+        )
+
+    def __get_by_type(self, company, team, code=None):
+        url = ""
+        if code is not None:
+            url = "/" + code
+
+        return self.client.get(
+            "/otask/v1/tasks/companies/{0}/teams/{1}/tasks{2}".format(
+                company, team, url
+            )
+        )
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_list(self, company, team):
+        """List all oTask/Activity records within a team
+
+        :param company: String
+        :param team: String
+
+        """
+        return self.__get_by_type(company, team)
+
+    def get_specific_list(self, company, team, code):
+        """List all oTask/Activity records within a Company by specified code(s)
+
+        :param company: String
+        :param team: String
+        :param code: String
+
+        """
+        return self.__get_by_type(company, team, code)
+
+    def add_activity(self, company, team, params):
+        """Create an oTask/Activity record within a team
+        
+        Parameters:
+        :param company: 
+        :param team: 
+        :param params: 
+
+        """
+        return self.client.post(
+            "/otask/v1/tasks/companies/{0}/teams/{1}/tasks".format(company, team),
+            params,
+        )
+
+    def update_activities(self, company, team, code, params):
+        """Update specific oTask/Activity record within a team
+        
+        Parameters:
+        :param company: 
+        :param team: 
+        :param code: 
+        :param params: 
+
+        """
+        return self.client.put(
+            "/otask/v1/tasks/companies/{0}/teams/{1}/tasks/{2}".format(
+                company, team, code
+            ),
+            params,
+        )
+
+    def archive_activities(self, company, team, code):
+        """Archive specific oTask/Activity record within a team
+
+        :param company: String
+        :param team: String
+        :param code: String
+
+        """
+        return self.client.put(
+            "/otask/v1/tasks/companies/{0}/teams/{1}/archive/{2}".format(
+                company, team, code
+            )
+        )
+
+    def unarchive_activities(self, company, team, code):
+        """Unarchive specific oTask/Activity record within a team
+
+        :param company: String
+        :param team: String
+        :param code: String
+
+        """
+        return self.client.put(
+            "/otask/v1/tasks/companies/{0}/teams/{1}/unarchive/{2}".format(
+                company, team, code
+            )
+        )
+
+    def update_batch(self, company, params):
+        """Update a group of oTask/Activity records within a company
+        
+        Parameters:
+        :param company: 
+        :param params: 
+
+        """
+        return self.client.put(
+            "/otask/v1/tasks/companies/{0}/tasks/batch".format(company), params
+        )
+
+    def __get_by_type(self, company, team, code=None):
+        url = ""
+        if code is not None:
+            url = "/" + code
+
+        return self.client.get(
+            "/otask/v1/tasks/companies/{0}/teams/{1}/tasks{2}".format(
+                company, team, url
+            )
+        )
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def add_activity(self, company, team, params) +
+
+

Create an oTask/Activity record within a team

+

Parameters: +:param company: +:param team: +:param params:

+
+ +Expand source code + +
def add_activity(self, company, team, params):
+    """Create an oTask/Activity record within a team
+    
+    Parameters:
+    :param company: 
+    :param team: 
+    :param params: 
+
+    """
+    return self.client.post(
+        "/otask/v1/tasks/companies/{0}/teams/{1}/tasks".format(company, team),
+        params,
+    )
+
+
+
+def archive_activities(self, company, team, code) +
+
+

Archive specific oTask/Activity record within a team

+

:param company: String +:param team: String +:param code: String

+
+ +Expand source code + +
def archive_activities(self, company, team, code):
+    """Archive specific oTask/Activity record within a team
+
+    :param company: String
+    :param team: String
+    :param code: String
+
+    """
+    return self.client.put(
+        "/otask/v1/tasks/companies/{0}/teams/{1}/archive/{2}".format(
+            company, team, code
+        )
+    )
+
+
+
+def get_list(self, company, team) +
+
+

List all oTask/Activity records within a team

+

:param company: String +:param team: String

+
+ +Expand source code + +
def get_list(self, company, team):
+    """List all oTask/Activity records within a team
+
+    :param company: String
+    :param team: String
+
+    """
+    return self.__get_by_type(company, team)
+
+
+
+def get_specific_list(self, company, team, code) +
+
+

List all oTask/Activity records within a Company by specified code(s)

+

:param company: String +:param team: String +:param code: String

+
+ +Expand source code + +
def get_specific_list(self, company, team, code):
+    """List all oTask/Activity records within a Company by specified code(s)
+
+    :param company: String
+    :param team: String
+    :param code: String
+
+    """
+    return self.__get_by_type(company, team, code)
+
+
+
+def unarchive_activities(self, company, team, code) +
+
+

Unarchive specific oTask/Activity record within a team

+

:param company: String +:param team: String +:param code: String

+
+ +Expand source code + +
def unarchive_activities(self, company, team, code):
+    """Unarchive specific oTask/Activity record within a team
+
+    :param company: String
+    :param team: String
+    :param code: String
+
+    """
+    return self.client.put(
+        "/otask/v1/tasks/companies/{0}/teams/{1}/unarchive/{2}".format(
+            company, team, code
+        )
+    )
+
+
+
+def update_activities(self, company, team, code, params) +
+
+

Update specific oTask/Activity record within a team

+

Parameters: +:param company: +:param team: +:param code: +:param params:

+
+ +Expand source code + +
def update_activities(self, company, team, code, params):
+    """Update specific oTask/Activity record within a team
+    
+    Parameters:
+    :param company: 
+    :param team: 
+    :param code: 
+    :param params: 
+
+    """
+    return self.client.put(
+        "/otask/v1/tasks/companies/{0}/teams/{1}/tasks/{2}".format(
+            company, team, code
+        ),
+        params,
+    )
+
+
+
+def update_batch(self, company, params) +
+
+

Update a group of oTask/Activity records within a company

+

Parameters: +:param company: +:param params:

+
+ +Expand source code + +
def update_batch(self, company, params):
+    """Update a group of oTask/Activity records within a company
+    
+    Parameters:
+    :param company: 
+    :param params: 
+
+    """
+    return self.client.put(
+        "/otask/v1/tasks/companies/{0}/tasks/batch".format(company), params
+    )
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/auth.html b/routers/auth.html new file mode 100644 index 0000000..3e94d2a --- /dev/null +++ b/routers/auth.html @@ -0,0 +1,144 @@ + + + + + + +upwork.routers.auth API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.auth

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_user_info(self):
+        """Get info of authenticated user"""
+        return self.client.get("/auth/v1/info")
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_user_info(self):
+        """Get info of authenticated user"""
+        return self.client.get("/auth/v1/info")
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def get_user_info(self) +
+
+

Get info of authenticated user

+
+ +Expand source code + +
def get_user_info(self):
+    """Get info of authenticated user"""
+    return self.client.get("/auth/v1/info")
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/freelancers/index.html b/routers/freelancers/index.html new file mode 100644 index 0000000..840a758 --- /dev/null +++ b/routers/freelancers/index.html @@ -0,0 +1,80 @@ + + + + + + +upwork.routers.freelancers API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.freelancers

+
+
+

routers

+
+ +Expand source code + +
"""routers"""
+from . import profile, search
+
+__all__ = ("profile", "search")
+
+
+
+

Sub-modules

+
+
upwork.routers.freelancers.profile
+
+
+
+
upwork.routers.freelancers.search
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/freelancers/profile.html b/routers/freelancers/profile.html new file mode 100644 index 0000000..2217e63 --- /dev/null +++ b/routers/freelancers/profile.html @@ -0,0 +1,193 @@ + + + + + + +upwork.routers.freelancers.profile API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.freelancers.profile

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_specific(self, key):
+        """Get specific profile
+
+        :param key: String
+
+        """
+        return self.client.get("/profiles/v1/providers/{0}".format(key))
+
+    def get_specific_brief(self, key):
+        """Get brief info on specific profile
+
+        :param key: String
+
+        """
+        return self.client.get("/profiles/v1/providers/{0}/brief".format(key))
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_specific(self, key):
+        """Get specific profile
+
+        :param key: String
+
+        """
+        return self.client.get("/profiles/v1/providers/{0}".format(key))
+
+    def get_specific_brief(self, key):
+        """Get brief info on specific profile
+
+        :param key: String
+
+        """
+        return self.client.get("/profiles/v1/providers/{0}/brief".format(key))
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def get_specific(self, key) +
+
+

Get specific profile

+

:param key: String

+
+ +Expand source code + +
def get_specific(self, key):
+    """Get specific profile
+
+    :param key: String
+
+    """
+    return self.client.get("/profiles/v1/providers/{0}".format(key))
+
+
+
+def get_specific_brief(self, key) +
+
+

Get brief info on specific profile

+

:param key: String

+
+ +Expand source code + +
def get_specific_brief(self, key):
+    """Get brief info on specific profile
+
+    :param key: String
+
+    """
+    return self.client.get("/profiles/v1/providers/{0}/brief".format(key))
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/freelancers/search.html b/routers/freelancers/search.html new file mode 100644 index 0000000..fe56457 --- /dev/null +++ b/routers/freelancers/search.html @@ -0,0 +1,164 @@ + + + + + + +upwork.routers.freelancers.search API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.freelancers.search

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def find(self, params):
+        """Search profiles
+        
+        Parameters:
+
+        :param params: 
+
+        """
+        return self.client.get("/profiles/v2/search/providers", params)
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def find(self, params):
+        """Search profiles
+        
+        Parameters:
+
+        :param params: 
+
+        """
+        return self.client.get("/profiles/v2/search/providers", params)
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def find(self, params) +
+
+

Search profiles

+

Parameters:

+

:param params:

+
+ +Expand source code + +
def find(self, params):
+    """Search profiles
+    
+    Parameters:
+
+    :param params: 
+
+    """
+    return self.client.get("/profiles/v2/search/providers", params)
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/graphql.html b/routers/graphql.html new file mode 100644 index 0000000..1ad896f --- /dev/null +++ b/routers/graphql.html @@ -0,0 +1,153 @@ + + + + + + +upwork.routers.graphql API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.graphql

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2021(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+    entry_point = "graphql"
+
+    def __init__(self, client):
+        self.client = client
+        self.client.epoint = self.entry_point
+
+    def execute(self, params):
+        """Execute GraphQL request"""
+        return self.client.post("", params)
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+    entry_point = "graphql"
+
+    def __init__(self, client):
+        self.client = client
+        self.client.epoint = self.entry_point
+
+    def execute(self, params):
+        """Execute GraphQL request"""
+        return self.client.post("", params)
+
+

Class variables

+
+
var client
+
+
+
+
var entry_point
+
+
+
+
+

Methods

+
+
+def execute(self, params) +
+
+

Execute GraphQL request

+
+ +Expand source code + +
def execute(self, params):
+    """Execute GraphQL request"""
+    return self.client.post("", params)
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/hr/clients/applications.html b/routers/hr/clients/applications.html new file mode 100644 index 0000000..1b60ea2 --- /dev/null +++ b/routers/hr/clients/applications.html @@ -0,0 +1,217 @@ + + + + + + +upwork.routers.hr.clients.applications API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.hr.clients.applications

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_list(self, params):
+        """Get list of applications
+        
+        Parameters:
+
+        :param params: 
+
+        """
+        return self.client.get("/hr/v4/clients/applications", params)
+
+    def get_specific(self, reference, params):
+        """Get specific application
+        
+        Parameters:
+
+        :param reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/hr/v4/clients/applications/{0}".format(reference), params
+        )
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_list(self, params):
+        """Get list of applications
+        
+        Parameters:
+
+        :param params: 
+
+        """
+        return self.client.get("/hr/v4/clients/applications", params)
+
+    def get_specific(self, reference, params):
+        """Get specific application
+        
+        Parameters:
+
+        :param reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/hr/v4/clients/applications/{0}".format(reference), params
+        )
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def get_list(self, params) +
+
+

Get list of applications

+

Parameters:

+

:param params:

+
+ +Expand source code + +
def get_list(self, params):
+    """Get list of applications
+    
+    Parameters:
+
+    :param params: 
+
+    """
+    return self.client.get("/hr/v4/clients/applications", params)
+
+
+
+def get_specific(self, reference, params) +
+
+

Get specific application

+

Parameters:

+

:param reference: +:param params:

+
+ +Expand source code + +
def get_specific(self, reference, params):
+    """Get specific application
+    
+    Parameters:
+
+    :param reference: 
+    :param params: 
+
+    """
+    return self.client.get(
+        "/hr/v4/clients/applications/{0}".format(reference), params
+    )
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/hr/clients/index.html b/routers/hr/clients/index.html new file mode 100644 index 0000000..f5b5d1b --- /dev/null +++ b/routers/hr/clients/index.html @@ -0,0 +1,80 @@ + + + + + + +upwork.routers.hr.clients API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.hr.clients

+
+
+

routers

+
+ +Expand source code + +
"""routers"""
+from . import applications, offers
+
+__all__ = ("applications", "offers")
+
+
+
+

Sub-modules

+
+
upwork.routers.hr.clients.applications
+
+
+
+
upwork.routers.hr.clients.offers
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/hr/clients/offers.html b/routers/hr/clients/offers.html new file mode 100644 index 0000000..af2f5a4 --- /dev/null +++ b/routers/hr/clients/offers.html @@ -0,0 +1,260 @@ + + + + + + +upwork.routers.hr.clients.offers API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.hr.clients.offers

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_list(self, params):
+        """Get list of offers
+        
+        Parameters:
+
+        :param params: 
+
+        """
+        return self.client.get("/offers/v1/clients/offers", params)
+
+    def get_specific(self, reference, params):
+        """Get specific offer
+        
+        Parameters:
+
+        :param reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/offers/v1/clients/offers/{0}".format(reference), params
+        )
+
+    def make_offer(self, params):
+        """Make an Offer
+        
+        Parameters:
+
+        :param params: 
+
+        """
+        return self.client.post("/offers/v1/clients/offers", params)
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_list(self, params):
+        """Get list of offers
+        
+        Parameters:
+
+        :param params: 
+
+        """
+        return self.client.get("/offers/v1/clients/offers", params)
+
+    def get_specific(self, reference, params):
+        """Get specific offer
+        
+        Parameters:
+
+        :param reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/offers/v1/clients/offers/{0}".format(reference), params
+        )
+
+    def make_offer(self, params):
+        """Make an Offer
+        
+        Parameters:
+
+        :param params: 
+
+        """
+        return self.client.post("/offers/v1/clients/offers", params)
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def get_list(self, params) +
+
+

Get list of offers

+

Parameters:

+

:param params:

+
+ +Expand source code + +
def get_list(self, params):
+    """Get list of offers
+    
+    Parameters:
+
+    :param params: 
+
+    """
+    return self.client.get("/offers/v1/clients/offers", params)
+
+
+
+def get_specific(self, reference, params) +
+
+

Get specific offer

+

Parameters:

+

:param reference: +:param params:

+
+ +Expand source code + +
def get_specific(self, reference, params):
+    """Get specific offer
+    
+    Parameters:
+
+    :param reference: 
+    :param params: 
+
+    """
+    return self.client.get(
+        "/offers/v1/clients/offers/{0}".format(reference), params
+    )
+
+
+
+def make_offer(self, params) +
+
+

Make an Offer

+

Parameters:

+

:param params:

+
+ +Expand source code + +
def make_offer(self, params):
+    """Make an Offer
+    
+    Parameters:
+
+    :param params: 
+
+    """
+    return self.client.post("/offers/v1/clients/offers", params)
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/hr/contracts.html b/routers/hr/contracts.html new file mode 100644 index 0000000..998e29a --- /dev/null +++ b/routers/hr/contracts.html @@ -0,0 +1,262 @@ + + + + + + +upwork.routers.hr.contracts API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.hr.contracts

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def suspend_contract(self, reference, params):
+        """Suspend Contract
+        
+        Parameters:
+
+        :param reference: 
+        :param params: 
+
+        """
+        return self.client.put("/hr/v2/contracts/{0}/suspend".format(reference), params)
+
+    def restart_contract(self, reference, params):
+        """Restart Contract
+        
+        Parameters:
+
+        :param reference: 
+        :param params: 
+
+        """
+        return self.client.put("/hr/v2/contracts/{0}/restart".format(reference), params)
+
+    def end_contract(self, reference, params):
+        """End Contract
+        
+        Parameters:
+
+        :param reference: 
+        :param params: 
+
+        """
+        return self.client.delete("/hr/v2/contracts/{0}".format(reference), params)
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def suspend_contract(self, reference, params):
+        """Suspend Contract
+        
+        Parameters:
+
+        :param reference: 
+        :param params: 
+
+        """
+        return self.client.put("/hr/v2/contracts/{0}/suspend".format(reference), params)
+
+    def restart_contract(self, reference, params):
+        """Restart Contract
+        
+        Parameters:
+
+        :param reference: 
+        :param params: 
+
+        """
+        return self.client.put("/hr/v2/contracts/{0}/restart".format(reference), params)
+
+    def end_contract(self, reference, params):
+        """End Contract
+        
+        Parameters:
+
+        :param reference: 
+        :param params: 
+
+        """
+        return self.client.delete("/hr/v2/contracts/{0}".format(reference), params)
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def end_contract(self, reference, params) +
+
+

End Contract

+

Parameters:

+

:param reference: +:param params:

+
+ +Expand source code + +
def end_contract(self, reference, params):
+    """End Contract
+    
+    Parameters:
+
+    :param reference: 
+    :param params: 
+
+    """
+    return self.client.delete("/hr/v2/contracts/{0}".format(reference), params)
+
+
+
+def restart_contract(self, reference, params) +
+
+

Restart Contract

+

Parameters:

+

:param reference: +:param params:

+
+ +Expand source code + +
def restart_contract(self, reference, params):
+    """Restart Contract
+    
+    Parameters:
+
+    :param reference: 
+    :param params: 
+
+    """
+    return self.client.put("/hr/v2/contracts/{0}/restart".format(reference), params)
+
+
+
+def suspend_contract(self, reference, params) +
+
+

Suspend Contract

+

Parameters:

+

:param reference: +:param params:

+
+ +Expand source code + +
def suspend_contract(self, reference, params):
+    """Suspend Contract
+    
+    Parameters:
+
+    :param reference: 
+    :param params: 
+
+    """
+    return self.client.put("/hr/v2/contracts/{0}/suspend".format(reference), params)
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/hr/engagements.html b/routers/hr/engagements.html new file mode 100644 index 0000000..e9a015c --- /dev/null +++ b/routers/hr/engagements.html @@ -0,0 +1,200 @@ + + + + + + +upwork.routers.hr.engagements API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.hr.engagements

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_list(self, params):
+        """Get list of engagements
+        
+        Parameters:
+
+        :param params: 
+
+        """
+        return self.client.get("/hr/v2/engagements", params)
+
+    def get_specific(self, reference):
+        """Get specific engagement
+
+        :param reference: String
+
+        """
+        return self.client.get("/hr/v2/engagements/{0}".format(reference))
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_list(self, params):
+        """Get list of engagements
+        
+        Parameters:
+
+        :param params: 
+
+        """
+        return self.client.get("/hr/v2/engagements", params)
+
+    def get_specific(self, reference):
+        """Get specific engagement
+
+        :param reference: String
+
+        """
+        return self.client.get("/hr/v2/engagements/{0}".format(reference))
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def get_list(self, params) +
+
+

Get list of engagements

+

Parameters:

+

:param params:

+
+ +Expand source code + +
def get_list(self, params):
+    """Get list of engagements
+    
+    Parameters:
+
+    :param params: 
+
+    """
+    return self.client.get("/hr/v2/engagements", params)
+
+
+
+def get_specific(self, reference) +
+
+

Get specific engagement

+

:param reference: String

+
+ +Expand source code + +
def get_specific(self, reference):
+    """Get specific engagement
+
+    :param reference: String
+
+    """
+    return self.client.get("/hr/v2/engagements/{0}".format(reference))
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/hr/freelancers/applications.html b/routers/hr/freelancers/applications.html new file mode 100644 index 0000000..b46b48b --- /dev/null +++ b/routers/hr/freelancers/applications.html @@ -0,0 +1,201 @@ + + + + + + +upwork.routers.hr.freelancers.applications API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.hr.freelancers.applications

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_list(self, params={}):
+        """Get list of applications
+        
+        Parameters:
+
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get("/hr/v4/contractors/applications", params)
+
+    def get_specific(self, reference):
+        """Get specific application
+
+        :param reference: String
+
+        """
+        return self.client.get("/hr/v4/contractors/applications/{0}".format(reference))
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_list(self, params={}):
+        """Get list of applications
+        
+        Parameters:
+
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get("/hr/v4/contractors/applications", params)
+
+    def get_specific(self, reference):
+        """Get specific application
+
+        :param reference: String
+
+        """
+        return self.client.get("/hr/v4/contractors/applications/{0}".format(reference))
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def get_list(self, params={}) +
+
+

Get list of applications

+

Parameters:

+

:param params: +(Default value = {})

+
+ +Expand source code + +
def get_list(self, params={}):
+    """Get list of applications
+    
+    Parameters:
+
+    :param params:  (Default value = {})
+
+    """
+    return self.client.get("/hr/v4/contractors/applications", params)
+
+
+
+def get_specific(self, reference) +
+
+

Get specific application

+

:param reference: String

+
+ +Expand source code + +
def get_specific(self, reference):
+    """Get specific application
+
+    :param reference: String
+
+    """
+    return self.client.get("/hr/v4/contractors/applications/{0}".format(reference))
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/hr/freelancers/index.html b/routers/hr/freelancers/index.html new file mode 100644 index 0000000..168efea --- /dev/null +++ b/routers/hr/freelancers/index.html @@ -0,0 +1,80 @@ + + + + + + +upwork.routers.hr.freelancers API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.hr.freelancers

+
+
+

routers

+
+ +Expand source code + +
"""routers"""
+from . import applications, offers
+
+__all__ = ("applications", "offers")
+
+
+
+

Sub-modules

+
+
upwork.routers.hr.freelancers.applications
+
+
+
+
upwork.routers.hr.freelancers.offers
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/hr/freelancers/offers.html b/routers/hr/freelancers/offers.html new file mode 100644 index 0000000..bc1d8c6 --- /dev/null +++ b/routers/hr/freelancers/offers.html @@ -0,0 +1,254 @@ + + + + + + +upwork.routers.hr.freelancers.offers API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.hr.freelancers.offers

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_list(self, params={}):
+        """Get list of offers
+        
+        Parameters:
+
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get("/offers/v1/contractors/offers", params)
+
+    def get_specific(self, reference):
+        """Get specific offer
+
+        :param reference: String
+
+        """
+        return self.client.get("/offers/v1/contractors/offers/{0}".format(reference))
+
+    def actions(self, reference, params):
+        """Make an Offer
+        
+        Parameters:
+
+        :param reference: 
+        :param params: 
+
+        """
+        return self.client.post(
+            "/offers/v1/contractors/actions/{0}".format(reference), params
+        )
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_list(self, params={}):
+        """Get list of offers
+        
+        Parameters:
+
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get("/offers/v1/contractors/offers", params)
+
+    def get_specific(self, reference):
+        """Get specific offer
+
+        :param reference: String
+
+        """
+        return self.client.get("/offers/v1/contractors/offers/{0}".format(reference))
+
+    def actions(self, reference, params):
+        """Make an Offer
+        
+        Parameters:
+
+        :param reference: 
+        :param params: 
+
+        """
+        return self.client.post(
+            "/offers/v1/contractors/actions/{0}".format(reference), params
+        )
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def actions(self, reference, params) +
+
+

Make an Offer

+

Parameters:

+

:param reference: +:param params:

+
+ +Expand source code + +
def actions(self, reference, params):
+    """Make an Offer
+    
+    Parameters:
+
+    :param reference: 
+    :param params: 
+
+    """
+    return self.client.post(
+        "/offers/v1/contractors/actions/{0}".format(reference), params
+    )
+
+
+
+def get_list(self, params={}) +
+
+

Get list of offers

+

Parameters:

+

:param params: +(Default value = {})

+
+ +Expand source code + +
def get_list(self, params={}):
+    """Get list of offers
+    
+    Parameters:
+
+    :param params:  (Default value = {})
+
+    """
+    return self.client.get("/offers/v1/contractors/offers", params)
+
+
+
+def get_specific(self, reference) +
+
+

Get specific offer

+

:param reference: String

+
+ +Expand source code + +
def get_specific(self, reference):
+    """Get specific offer
+
+    :param reference: String
+
+    """
+    return self.client.get("/offers/v1/contractors/offers/{0}".format(reference))
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/hr/index.html b/routers/hr/index.html new file mode 100644 index 0000000..eb89976 --- /dev/null +++ b/routers/hr/index.html @@ -0,0 +1,126 @@ + + + + + + +upwork.routers.hr API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.hr

+
+
+

routers

+
+ +Expand source code + +
"""routers"""
+from . import clients, contracts, engagements, freelancers
+from . import interviews, jobs, milestones, roles, submissions
+
+__all__ = (
+    "clients",
+    "contracts",
+    "engagements",
+    "freelancers",
+    "interviews",
+    "jobs",
+    "milestones",
+    "roles",
+    "submissions"
+)
+
+
+
+

Sub-modules

+
+
upwork.routers.hr.clients
+
+

routers

+
+
upwork.routers.hr.contracts
+
+
+
+
upwork.routers.hr.engagements
+
+
+
+
upwork.routers.hr.freelancers
+
+

routers

+
+
upwork.routers.hr.interviews
+
+
+
+
upwork.routers.hr.jobs
+
+
+
+
upwork.routers.hr.milestones
+
+
+
+
upwork.routers.hr.roles
+
+
+
+
upwork.routers.hr.submissions
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/hr/interviews.html b/routers/hr/interviews.html new file mode 100644 index 0000000..64c19e7 --- /dev/null +++ b/routers/hr/interviews.html @@ -0,0 +1,168 @@ + + + + + + +upwork.routers.hr.interviews API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.hr.interviews

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def invite(self, job_key, params):
+        """Invite to Interview
+        
+        Parameters:
+
+        :param job_key: 
+        :param params: 
+
+        """
+        return self.client.post("/hr/v1/jobs/{0}/candidates".format(job_key), params)
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def invite(self, job_key, params):
+        """Invite to Interview
+        
+        Parameters:
+
+        :param job_key: 
+        :param params: 
+
+        """
+        return self.client.post("/hr/v1/jobs/{0}/candidates".format(job_key), params)
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def invite(self, job_key, params) +
+
+

Invite to Interview

+

Parameters:

+

:param job_key: +:param params:

+
+ +Expand source code + +
def invite(self, job_key, params):
+    """Invite to Interview
+    
+    Parameters:
+
+    :param job_key: 
+    :param params: 
+
+    """
+    return self.client.post("/hr/v1/jobs/{0}/candidates".format(job_key), params)
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/hr/jobs.html b/routers/hr/jobs.html new file mode 100644 index 0000000..74a6c20 --- /dev/null +++ b/routers/hr/jobs.html @@ -0,0 +1,337 @@ + + + + + + +upwork.routers.hr.jobs API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.hr.jobs

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_list(self, params):
+        """Get list of jobs
+        
+        Parameters:
+
+        :param params: 
+
+        """
+        return self.client.get("/hr/v2/jobs", params)
+
+    def get_specific(self, key):
+        """Get specific job by key
+
+        :param key: String
+
+        """
+        return self.client.get("/hr/v2/jobs/{0}".format(key))
+
+    def post_job(self, params):
+        """Post a new job
+        
+        Parameters:
+
+        :param params: 
+
+        """
+        return self.client.post("/hr/v2/jobs", params)
+
+    def edit_job(self, key, params):
+        """Edit existent job
+        
+        Parameters:
+
+        :param key: 
+        :param params: 
+
+        """
+        self.client.put("/hr/v2/jobs/{0}".format(key), params)
+
+    def delete_job(self, key, params):
+        """Delete existent job
+        
+        Parameters:
+
+        :param key: 
+        :param params: 
+
+        """
+        self.client.delete("/hr/v2/jobs/{0}".format(key), params)
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_list(self, params):
+        """Get list of jobs
+        
+        Parameters:
+
+        :param params: 
+
+        """
+        return self.client.get("/hr/v2/jobs", params)
+
+    def get_specific(self, key):
+        """Get specific job by key
+
+        :param key: String
+
+        """
+        return self.client.get("/hr/v2/jobs/{0}".format(key))
+
+    def post_job(self, params):
+        """Post a new job
+        
+        Parameters:
+
+        :param params: 
+
+        """
+        return self.client.post("/hr/v2/jobs", params)
+
+    def edit_job(self, key, params):
+        """Edit existent job
+        
+        Parameters:
+
+        :param key: 
+        :param params: 
+
+        """
+        self.client.put("/hr/v2/jobs/{0}".format(key), params)
+
+    def delete_job(self, key, params):
+        """Delete existent job
+        
+        Parameters:
+
+        :param key: 
+        :param params: 
+
+        """
+        self.client.delete("/hr/v2/jobs/{0}".format(key), params)
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def delete_job(self, key, params) +
+
+

Delete existent job

+

Parameters:

+

:param key: +:param params:

+
+ +Expand source code + +
def delete_job(self, key, params):
+    """Delete existent job
+    
+    Parameters:
+
+    :param key: 
+    :param params: 
+
+    """
+    self.client.delete("/hr/v2/jobs/{0}".format(key), params)
+
+
+
+def edit_job(self, key, params) +
+
+

Edit existent job

+

Parameters:

+

:param key: +:param params:

+
+ +Expand source code + +
def edit_job(self, key, params):
+    """Edit existent job
+    
+    Parameters:
+
+    :param key: 
+    :param params: 
+
+    """
+    self.client.put("/hr/v2/jobs/{0}".format(key), params)
+
+
+
+def get_list(self, params) +
+
+

Get list of jobs

+

Parameters:

+

:param params:

+
+ +Expand source code + +
def get_list(self, params):
+    """Get list of jobs
+    
+    Parameters:
+
+    :param params: 
+
+    """
+    return self.client.get("/hr/v2/jobs", params)
+
+
+
+def get_specific(self, key) +
+
+

Get specific job by key

+

:param key: String

+
+ +Expand source code + +
def get_specific(self, key):
+    """Get specific job by key
+
+    :param key: String
+
+    """
+    return self.client.get("/hr/v2/jobs/{0}".format(key))
+
+
+
+def post_job(self, params) +
+
+

Post a new job

+

Parameters:

+

:param params:

+
+ +Expand source code + +
def post_job(self, params):
+    """Post a new job
+    
+    Parameters:
+
+    :param params: 
+
+    """
+    return self.client.post("/hr/v2/jobs", params)
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/hr/milestones.html b/routers/hr/milestones.html new file mode 100644 index 0000000..7286d31 --- /dev/null +++ b/routers/hr/milestones.html @@ -0,0 +1,437 @@ + + + + + + +upwork.routers.hr.milestones API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.hr.milestones

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_active_milestone(self, contract_id):
+        """Get active Milestone for specific Contract
+
+        :param contract_id: String
+
+        """
+        return self.client.get(
+            "/hr/v3/fp/milestones/statuses/active/contracts/{0}".format(contract_id)
+        )
+
+    def get_submissions(self, milestone_id):
+        """Get active Milestone for specific Contract
+
+        :param milestone_id: String
+
+        """
+        return self.client.get(
+            "/hr/v3/fp/milestones/{0}/submissions".format(milestone_id)
+        )
+
+    def create(self, params):
+        """Create a new Milestone
+        
+        Parameters:
+
+        :param params: 
+
+        """
+        return self.client.post("/hr/v3/fp/milestones", params)
+
+    def edit(self, milestone_id, params):
+        """Edit an existing Milestone
+        
+        Parameters:
+
+        :param milestone_id: 
+        :param params: 
+
+        """
+        return self.client.put("/hr/v3/fp/milestones/{0}".format(milestone_id), params)
+
+    def activate(self, milestone_id, params):
+        """Activate an existing Milestone
+        
+        Parameters:
+
+        :param milestone_id: 
+        :param params: 
+
+        """
+        return self.client.put(
+            "/hr/v3/fp/milestones/{0}/activate".format(milestone_id), params
+        )
+
+    def approve(self, milestone_id, params):
+        """Approve an existing Milestone
+        
+        Parameters:
+
+        :param milestone_id: 
+        :param params: 
+
+        """
+        return self.client.put(
+            "/hr/v3/fp/milestones/{0}/approve".format(milestone_id), params
+        )
+
+    def delete(self, milestone_id):
+        """Delete an existing Milestone
+
+        :param milestone_id: String
+
+        """
+        return self.client.delete("/hr/v3/fp/milestones/{0}".format(milestone_id))
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_active_milestone(self, contract_id):
+        """Get active Milestone for specific Contract
+
+        :param contract_id: String
+
+        """
+        return self.client.get(
+            "/hr/v3/fp/milestones/statuses/active/contracts/{0}".format(contract_id)
+        )
+
+    def get_submissions(self, milestone_id):
+        """Get active Milestone for specific Contract
+
+        :param milestone_id: String
+
+        """
+        return self.client.get(
+            "/hr/v3/fp/milestones/{0}/submissions".format(milestone_id)
+        )
+
+    def create(self, params):
+        """Create a new Milestone
+        
+        Parameters:
+
+        :param params: 
+
+        """
+        return self.client.post("/hr/v3/fp/milestones", params)
+
+    def edit(self, milestone_id, params):
+        """Edit an existing Milestone
+        
+        Parameters:
+
+        :param milestone_id: 
+        :param params: 
+
+        """
+        return self.client.put("/hr/v3/fp/milestones/{0}".format(milestone_id), params)
+
+    def activate(self, milestone_id, params):
+        """Activate an existing Milestone
+        
+        Parameters:
+
+        :param milestone_id: 
+        :param params: 
+
+        """
+        return self.client.put(
+            "/hr/v3/fp/milestones/{0}/activate".format(milestone_id), params
+        )
+
+    def approve(self, milestone_id, params):
+        """Approve an existing Milestone
+        
+        Parameters:
+
+        :param milestone_id: 
+        :param params: 
+
+        """
+        return self.client.put(
+            "/hr/v3/fp/milestones/{0}/approve".format(milestone_id), params
+        )
+
+    def delete(self, milestone_id):
+        """Delete an existing Milestone
+
+        :param milestone_id: String
+
+        """
+        return self.client.delete("/hr/v3/fp/milestones/{0}".format(milestone_id))
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def activate(self, milestone_id, params) +
+
+

Activate an existing Milestone

+

Parameters:

+

:param milestone_id: +:param params:

+
+ +Expand source code + +
def activate(self, milestone_id, params):
+    """Activate an existing Milestone
+    
+    Parameters:
+
+    :param milestone_id: 
+    :param params: 
+
+    """
+    return self.client.put(
+        "/hr/v3/fp/milestones/{0}/activate".format(milestone_id), params
+    )
+
+
+
+def approve(self, milestone_id, params) +
+
+

Approve an existing Milestone

+

Parameters:

+

:param milestone_id: +:param params:

+
+ +Expand source code + +
def approve(self, milestone_id, params):
+    """Approve an existing Milestone
+    
+    Parameters:
+
+    :param milestone_id: 
+    :param params: 
+
+    """
+    return self.client.put(
+        "/hr/v3/fp/milestones/{0}/approve".format(milestone_id), params
+    )
+
+
+
+def create(self, params) +
+
+

Create a new Milestone

+

Parameters:

+

:param params:

+
+ +Expand source code + +
def create(self, params):
+    """Create a new Milestone
+    
+    Parameters:
+
+    :param params: 
+
+    """
+    return self.client.post("/hr/v3/fp/milestones", params)
+
+
+
+def delete(self, milestone_id) +
+
+

Delete an existing Milestone

+

:param milestone_id: String

+
+ +Expand source code + +
def delete(self, milestone_id):
+    """Delete an existing Milestone
+
+    :param milestone_id: String
+
+    """
+    return self.client.delete("/hr/v3/fp/milestones/{0}".format(milestone_id))
+
+
+
+def edit(self, milestone_id, params) +
+
+

Edit an existing Milestone

+

Parameters:

+

:param milestone_id: +:param params:

+
+ +Expand source code + +
def edit(self, milestone_id, params):
+    """Edit an existing Milestone
+    
+    Parameters:
+
+    :param milestone_id: 
+    :param params: 
+
+    """
+    return self.client.put("/hr/v3/fp/milestones/{0}".format(milestone_id), params)
+
+
+
+def get_active_milestone(self, contract_id) +
+
+

Get active Milestone for specific Contract

+

:param contract_id: String

+
+ +Expand source code + +
def get_active_milestone(self, contract_id):
+    """Get active Milestone for specific Contract
+
+    :param contract_id: String
+
+    """
+    return self.client.get(
+        "/hr/v3/fp/milestones/statuses/active/contracts/{0}".format(contract_id)
+    )
+
+
+
+def get_submissions(self, milestone_id) +
+
+

Get active Milestone for specific Contract

+

:param milestone_id: String

+
+ +Expand source code + +
def get_submissions(self, milestone_id):
+    """Get active Milestone for specific Contract
+
+    :param milestone_id: String
+
+    """
+    return self.client.get(
+        "/hr/v3/fp/milestones/{0}/submissions".format(milestone_id)
+    )
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/hr/roles.html b/routers/hr/roles.html new file mode 100644 index 0000000..c85d123 --- /dev/null +++ b/routers/hr/roles.html @@ -0,0 +1,184 @@ + + + + + + +upwork.routers.hr.roles API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.hr.roles

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_all(self):
+        """Get user roles"""
+        return self.client.get("/hr/v2/userroles")
+
+    def get_by_specific_user(self, user_reference):
+        """Get by specific user
+
+        :param reference: String
+        :param user_reference: 
+
+        """
+        return self.client.get("/hr/v2/userroles/{0}".format(user_reference))
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_all(self):
+        """Get user roles"""
+        return self.client.get("/hr/v2/userroles")
+
+    def get_by_specific_user(self, user_reference):
+        """Get by specific user
+
+        :param reference: String
+        :param user_reference: 
+
+        """
+        return self.client.get("/hr/v2/userroles/{0}".format(user_reference))
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def get_all(self) +
+
+

Get user roles

+
+ +Expand source code + +
def get_all(self):
+    """Get user roles"""
+    return self.client.get("/hr/v2/userroles")
+
+
+
+def get_by_specific_user(self, user_reference) +
+
+

Get by specific user

+

:param reference: String +:param user_reference:

+
+ +Expand source code + +
def get_by_specific_user(self, user_reference):
+    """Get by specific user
+
+    :param reference: String
+    :param user_reference: 
+
+    """
+    return self.client.get("/hr/v2/userroles/{0}".format(user_reference))
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/hr/submissions.html b/routers/hr/submissions.html new file mode 100644 index 0000000..b6b7f3d --- /dev/null +++ b/routers/hr/submissions.html @@ -0,0 +1,270 @@ + + + + + + +upwork.routers.hr.submissions API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.hr.submissions

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def request_approval(self, params):
+        """Freelancer submits work for the client to approve
+        
+        Parameters:
+
+        :param params: 
+
+        """
+        return self.client.post("/hr/v3/fp/submissions", params)
+
+    def approve(self, submission_id, params):
+        """Approve an existing Submission
+        
+        Parameters:
+
+        :param submission_id: 
+        :param params: 
+
+        """
+        return self.client.put(
+            "/hr/v3/fp/submissions/{0}/approve".format(submission_id), params
+        )
+
+    def reject(self, submission_id, params):
+        """Reject an existing Submission
+        
+        Parameters:
+
+        :param submission_id: 
+        :param params: 
+
+        """
+        return self.client.put(
+            "/hr/v3/fp/submissions/{0}/reject".format(submission_id), params
+        )
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def request_approval(self, params):
+        """Freelancer submits work for the client to approve
+        
+        Parameters:
+
+        :param params: 
+
+        """
+        return self.client.post("/hr/v3/fp/submissions", params)
+
+    def approve(self, submission_id, params):
+        """Approve an existing Submission
+        
+        Parameters:
+
+        :param submission_id: 
+        :param params: 
+
+        """
+        return self.client.put(
+            "/hr/v3/fp/submissions/{0}/approve".format(submission_id), params
+        )
+
+    def reject(self, submission_id, params):
+        """Reject an existing Submission
+        
+        Parameters:
+
+        :param submission_id: 
+        :param params: 
+
+        """
+        return self.client.put(
+            "/hr/v3/fp/submissions/{0}/reject".format(submission_id), params
+        )
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def approve(self, submission_id, params) +
+
+

Approve an existing Submission

+

Parameters:

+

:param submission_id: +:param params:

+
+ +Expand source code + +
def approve(self, submission_id, params):
+    """Approve an existing Submission
+    
+    Parameters:
+
+    :param submission_id: 
+    :param params: 
+
+    """
+    return self.client.put(
+        "/hr/v3/fp/submissions/{0}/approve".format(submission_id), params
+    )
+
+
+
+def reject(self, submission_id, params) +
+
+

Reject an existing Submission

+

Parameters:

+

:param submission_id: +:param params:

+
+ +Expand source code + +
def reject(self, submission_id, params):
+    """Reject an existing Submission
+    
+    Parameters:
+
+    :param submission_id: 
+    :param params: 
+
+    """
+    return self.client.put(
+        "/hr/v3/fp/submissions/{0}/reject".format(submission_id), params
+    )
+
+
+
+def request_approval(self, params) +
+
+

Freelancer submits work for the client to approve

+

Parameters:

+

:param params:

+
+ +Expand source code + +
def request_approval(self, params):
+    """Freelancer submits work for the client to approve
+    
+    Parameters:
+
+    :param params: 
+
+    """
+    return self.client.post("/hr/v3/fp/submissions", params)
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/index.html b/routers/index.html new file mode 100644 index 0000000..1678928 --- /dev/null +++ b/routers/index.html @@ -0,0 +1,156 @@ + + + + + + +upwork.routers API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers

+
+
+

routers

+
+ +Expand source code + +
"""routers"""
+from . import activities, auth, freelancers, hr, jobs
+from . import messages, metadata, organization, payments
+from . import reports, snapshots, workdays, workdiary
+
+__all__ = (
+    "activities",
+    "auth",
+    "freelancers",
+    "hr",
+    "jobs",
+    "messages",
+    "metadata",
+    "organization",
+    "payments",
+    "reports",
+    "snapshots",
+    "workdays",
+    "workdiary"
+)
+
+
+
+

Sub-modules

+
+
upwork.routers.activities
+
+

routers

+
+
upwork.routers.auth
+
+
+
+
upwork.routers.freelancers
+
+

routers

+
+
upwork.routers.graphql
+
+
+
+
upwork.routers.hr
+
+

routers

+
+
upwork.routers.jobs
+
+

routers

+
+
upwork.routers.messages
+
+
+
+
upwork.routers.metadata
+
+
+
+
upwork.routers.organization
+
+

routers

+
+
upwork.routers.payments
+
+
+
+
upwork.routers.reports
+
+

routers

+
+
upwork.routers.snapshots
+
+
+
+
upwork.routers.workdays
+
+
+
+
upwork.routers.workdiary
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/jobs/index.html b/routers/jobs/index.html new file mode 100644 index 0000000..bd5ca6e --- /dev/null +++ b/routers/jobs/index.html @@ -0,0 +1,80 @@ + + + + + + +upwork.routers.jobs API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.jobs

+
+
+

routers

+
+ +Expand source code + +
"""routers"""
+from . import profile, search
+
+__all__ = ("profile", "search")
+
+
+
+

Sub-modules

+
+
upwork.routers.jobs.profile
+
+
+
+
upwork.routers.jobs.search
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/jobs/profile.html b/routers/jobs/profile.html new file mode 100644 index 0000000..514c257 --- /dev/null +++ b/routers/jobs/profile.html @@ -0,0 +1,157 @@ + + + + + + +upwork.routers.jobs.profile API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.jobs.profile

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_specific(self, key):
+        """Get specific profile
+
+        :param key: String
+
+        """
+        return self.client.get("/profiles/v1/jobs/{0}".format(key))
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_specific(self, key):
+        """Get specific profile
+
+        :param key: String
+
+        """
+        return self.client.get("/profiles/v1/jobs/{0}".format(key))
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def get_specific(self, key) +
+
+

Get specific profile

+

:param key: String

+
+ +Expand source code + +
def get_specific(self, key):
+    """Get specific profile
+
+    :param key: String
+
+    """
+    return self.client.get("/profiles/v1/jobs/{0}".format(key))
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/jobs/search.html b/routers/jobs/search.html new file mode 100644 index 0000000..4831129 --- /dev/null +++ b/routers/jobs/search.html @@ -0,0 +1,164 @@ + + + + + + +upwork.routers.jobs.search API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.jobs.search

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def find(self, params):
+        """Search profiles
+        
+        Parameters:
+
+        :param params: 
+
+        """
+        return self.client.get("/profiles/v2/search/jobs", params)
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def find(self, params):
+        """Search profiles
+        
+        Parameters:
+
+        :param params: 
+
+        """
+        return self.client.get("/profiles/v2/search/jobs", params)
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def find(self, params) +
+
+

Search profiles

+

Parameters:

+

:param params:

+
+ +Expand source code + +
def find(self, params):
+    """Search profiles
+    
+    Parameters:
+
+    :param params: 
+
+    """
+    return self.client.get("/profiles/v2/search/jobs", params)
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/messages.html b/routers/messages.html new file mode 100644 index 0000000..5bd4025 --- /dev/null +++ b/routers/messages.html @@ -0,0 +1,712 @@ + + + + + + +upwork.routers.messages API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.messages

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_rooms(self, company, params={}):
+        """Retrieve rooms information
+        
+        Parameters:
+        :param company: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get("/messages/v3/{0}/rooms".format(company), params)
+
+    def get_room_details(self, company, room_id, params={}):
+        """Get a specific room information
+        
+        Parameters:
+        :param company: 
+        :param room_id: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get(
+            "/messages/v3/{0}/rooms/{1}".format(company, room_id), params
+        )
+
+    def get_room_messages(self, company, room_id, params={}):
+        """Get messages from a specific room
+        
+        Parameters:
+        :param company: 
+        :param room_id: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get(
+            "/messages/v3/{0}/rooms/{1}/stories".format(company, room_id), params
+        )
+
+    def get_room_by_offer(self, company, offer_id, params={}):
+        """Get a specific room by offer ID
+        
+        Parameters:
+        :param company: 
+        :param offer_id: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get(
+            "/messages/v3/{0}/rooms/offers/{1}".format(company, offer_id), params
+        )
+
+    def get_room_by_application(self, company, application_id, params={}):
+        """Get a specific room by application ID
+        
+        Parameters:
+        :param company: 
+        :param application_id: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get(
+            "/messages/v3/{0}/rooms/applications/{1}".format(company, application_id),
+            params,
+        )
+
+    def get_room_by_contract(self, company, contract_id, params={}):
+        """Get a specific room by contract ID
+        
+        Parameters:
+        :param company: 
+        :param contract_id: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get(
+            "/messages/v3/{0}/rooms/contracts/{1}".format(company, contract_id), params
+        )
+
+    def create_room(self, company, params={}):
+        """Create a new room
+        
+        Parameters:
+        :param company: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.post("/messages/v3/{0}/rooms".format(company), params)
+
+    def send_message_to_room(self, company, room_id, params={}):
+        """Send a message to a room
+
+        Parameters:
+        :param company:
+        :param room_id: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.post(
+            "/messages/v3/{0}/rooms/{1}/stories".format(company, room_id), params
+        )
+
+    def send_message_to_rooms(self, company, params={}):
+        """Send a message to a batch of rooms
+
+        Parameters:
+        :param company:
+        :param params:  (Default value = {})
+
+        """
+        return self.client.post(
+            "/messages/v3/{0}/stories/batch".format(company), params
+        )
+
+    def update_room_settings(self, company, room_id, username, params={}):
+        """Update a room settings
+        
+        Parameters:
+        :param company: 
+        :param room_id: 
+        :param username: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.put(
+            "/messages/v3/{0}/rooms/{1}/users/{2}".format(company, room_id, username),
+            params,
+        )
+
+    def update_room_metadata(self, company, room_id, params={}):
+        """Update the metadata of a room
+        
+        Parameters:
+        :param company: 
+        :param room_id: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.put(
+            "/messages/v3/{0}/rooms/{1}".format(company, room_id), params
+        )
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_rooms(self, company, params={}):
+        """Retrieve rooms information
+        
+        Parameters:
+        :param company: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get("/messages/v3/{0}/rooms".format(company), params)
+
+    def get_room_details(self, company, room_id, params={}):
+        """Get a specific room information
+        
+        Parameters:
+        :param company: 
+        :param room_id: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get(
+            "/messages/v3/{0}/rooms/{1}".format(company, room_id), params
+        )
+
+    def get_room_messages(self, company, room_id, params={}):
+        """Get messages from a specific room
+        
+        Parameters:
+        :param company: 
+        :param room_id: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get(
+            "/messages/v3/{0}/rooms/{1}/stories".format(company, room_id), params
+        )
+
+    def get_room_by_offer(self, company, offer_id, params={}):
+        """Get a specific room by offer ID
+        
+        Parameters:
+        :param company: 
+        :param offer_id: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get(
+            "/messages/v3/{0}/rooms/offers/{1}".format(company, offer_id), params
+        )
+
+    def get_room_by_application(self, company, application_id, params={}):
+        """Get a specific room by application ID
+        
+        Parameters:
+        :param company: 
+        :param application_id: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get(
+            "/messages/v3/{0}/rooms/applications/{1}".format(company, application_id),
+            params,
+        )
+
+    def get_room_by_contract(self, company, contract_id, params={}):
+        """Get a specific room by contract ID
+        
+        Parameters:
+        :param company: 
+        :param contract_id: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get(
+            "/messages/v3/{0}/rooms/contracts/{1}".format(company, contract_id), params
+        )
+
+    def create_room(self, company, params={}):
+        """Create a new room
+        
+        Parameters:
+        :param company: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.post("/messages/v3/{0}/rooms".format(company), params)
+
+    def send_message_to_room(self, company, room_id, params={}):
+        """Send a message to a room
+
+        Parameters:
+        :param company:
+        :param room_id: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.post(
+            "/messages/v3/{0}/rooms/{1}/stories".format(company, room_id), params
+        )
+
+    def send_message_to_rooms(self, company, params={}):
+        """Send a message to a batch of rooms
+
+        Parameters:
+        :param company:
+        :param params:  (Default value = {})
+
+        """
+        return self.client.post(
+            "/messages/v3/{0}/stories/batch".format(company), params
+        )
+
+    def update_room_settings(self, company, room_id, username, params={}):
+        """Update a room settings
+        
+        Parameters:
+        :param company: 
+        :param room_id: 
+        :param username: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.put(
+            "/messages/v3/{0}/rooms/{1}/users/{2}".format(company, room_id, username),
+            params,
+        )
+
+    def update_room_metadata(self, company, room_id, params={}):
+        """Update the metadata of a room
+        
+        Parameters:
+        :param company: 
+        :param room_id: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.put(
+            "/messages/v3/{0}/rooms/{1}".format(company, room_id), params
+        )
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def create_room(self, company, params={}) +
+
+

Create a new room

+

Parameters: +:param company: +:param params: +(Default value = {})

+
+ +Expand source code + +
def create_room(self, company, params={}):
+    """Create a new room
+    
+    Parameters:
+    :param company: 
+    :param params:  (Default value = {})
+
+    """
+    return self.client.post("/messages/v3/{0}/rooms".format(company), params)
+
+
+
+def get_room_by_application(self, company, application_id, params={}) +
+
+

Get a specific room by application ID

+

Parameters: +:param company: +:param application_id: +:param params: +(Default value = {})

+
+ +Expand source code + +
def get_room_by_application(self, company, application_id, params={}):
+    """Get a specific room by application ID
+    
+    Parameters:
+    :param company: 
+    :param application_id: 
+    :param params:  (Default value = {})
+
+    """
+    return self.client.get(
+        "/messages/v3/{0}/rooms/applications/{1}".format(company, application_id),
+        params,
+    )
+
+
+
+def get_room_by_contract(self, company, contract_id, params={}) +
+
+

Get a specific room by contract ID

+

Parameters: +:param company: +:param contract_id: +:param params: +(Default value = {})

+
+ +Expand source code + +
def get_room_by_contract(self, company, contract_id, params={}):
+    """Get a specific room by contract ID
+    
+    Parameters:
+    :param company: 
+    :param contract_id: 
+    :param params:  (Default value = {})
+
+    """
+    return self.client.get(
+        "/messages/v3/{0}/rooms/contracts/{1}".format(company, contract_id), params
+    )
+
+
+
+def get_room_by_offer(self, company, offer_id, params={}) +
+
+

Get a specific room by offer ID

+

Parameters: +:param company: +:param offer_id: +:param params: +(Default value = {})

+
+ +Expand source code + +
def get_room_by_offer(self, company, offer_id, params={}):
+    """Get a specific room by offer ID
+    
+    Parameters:
+    :param company: 
+    :param offer_id: 
+    :param params:  (Default value = {})
+
+    """
+    return self.client.get(
+        "/messages/v3/{0}/rooms/offers/{1}".format(company, offer_id), params
+    )
+
+
+
+def get_room_details(self, company, room_id, params={}) +
+
+

Get a specific room information

+

Parameters: +:param company: +:param room_id: +:param params: +(Default value = {})

+
+ +Expand source code + +
def get_room_details(self, company, room_id, params={}):
+    """Get a specific room information
+    
+    Parameters:
+    :param company: 
+    :param room_id: 
+    :param params:  (Default value = {})
+
+    """
+    return self.client.get(
+        "/messages/v3/{0}/rooms/{1}".format(company, room_id), params
+    )
+
+
+
+def get_room_messages(self, company, room_id, params={}) +
+
+

Get messages from a specific room

+

Parameters: +:param company: +:param room_id: +:param params: +(Default value = {})

+
+ +Expand source code + +
def get_room_messages(self, company, room_id, params={}):
+    """Get messages from a specific room
+    
+    Parameters:
+    :param company: 
+    :param room_id: 
+    :param params:  (Default value = {})
+
+    """
+    return self.client.get(
+        "/messages/v3/{0}/rooms/{1}/stories".format(company, room_id), params
+    )
+
+
+
+def get_rooms(self, company, params={}) +
+
+

Retrieve rooms information

+

Parameters: +:param company: +:param params: +(Default value = {})

+
+ +Expand source code + +
def get_rooms(self, company, params={}):
+    """Retrieve rooms information
+    
+    Parameters:
+    :param company: 
+    :param params:  (Default value = {})
+
+    """
+    return self.client.get("/messages/v3/{0}/rooms".format(company), params)
+
+
+
+def send_message_to_room(self, company, room_id, params={}) +
+
+

Send a message to a room

+

Parameters: +:param company: +:param room_id: +:param params: +(Default value = {})

+
+ +Expand source code + +
def send_message_to_room(self, company, room_id, params={}):
+    """Send a message to a room
+
+    Parameters:
+    :param company:
+    :param room_id: 
+    :param params:  (Default value = {})
+
+    """
+    return self.client.post(
+        "/messages/v3/{0}/rooms/{1}/stories".format(company, room_id), params
+    )
+
+
+
+def send_message_to_rooms(self, company, params={}) +
+
+

Send a message to a batch of rooms

+

Parameters: +:param company: +:param params: +(Default value = {})

+
+ +Expand source code + +
def send_message_to_rooms(self, company, params={}):
+    """Send a message to a batch of rooms
+
+    Parameters:
+    :param company:
+    :param params:  (Default value = {})
+
+    """
+    return self.client.post(
+        "/messages/v3/{0}/stories/batch".format(company), params
+    )
+
+
+
+def update_room_metadata(self, company, room_id, params={}) +
+
+

Update the metadata of a room

+

Parameters: +:param company: +:param room_id: +:param params: +(Default value = {})

+
+ +Expand source code + +
def update_room_metadata(self, company, room_id, params={}):
+    """Update the metadata of a room
+    
+    Parameters:
+    :param company: 
+    :param room_id: 
+    :param params:  (Default value = {})
+
+    """
+    return self.client.put(
+        "/messages/v3/{0}/rooms/{1}".format(company, room_id), params
+    )
+
+
+
+def update_room_settings(self, company, room_id, username, params={}) +
+
+

Update a room settings

+

Parameters: +:param company: +:param room_id: +:param username: +:param params: +(Default value = {})

+
+ +Expand source code + +
def update_room_settings(self, company, room_id, username, params={}):
+    """Update a room settings
+    
+    Parameters:
+    :param company: 
+    :param room_id: 
+    :param username: 
+    :param params:  (Default value = {})
+
+    """
+    return self.client.put(
+        "/messages/v3/{0}/rooms/{1}/users/{2}".format(company, room_id, username),
+        params,
+    )
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/metadata.html b/routers/metadata.html new file mode 100644 index 0000000..772227d --- /dev/null +++ b/routers/metadata.html @@ -0,0 +1,308 @@ + + + + + + +upwork.routers.metadata API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.metadata

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_categories_v2(self):
+        """Get categories (V2)"""
+        return self.client.get("/profiles/v2/metadata/categories")
+
+    def get_skills(self):
+        """Get skills"""
+        return self.client.get("/profiles/v1/metadata/skills")
+
+    def get_skills_v2(self, params):
+        """Get skills (V2)
+
+        :param params: 
+
+        """
+        return self.client.get("/profiles/v2/metadata/skills", params)
+
+    def get_specialties(self):
+        """Get specialties"""
+        return self.client.get("/profiles/v1/metadata/specialties")
+
+    def get_regions(self):
+        """Get regions"""
+        return self.client.get("/profiles/v1/metadata/regions")
+
+    def get_tests(self):
+        """Get tests"""
+        return self.client.get("/profiles/v1/metadata/tests")
+
+    def get_reasons(self, params):
+        """Get reasons
+
+        :param params: 
+
+        """
+        return self.client.get("/profiles/v1/metadata/reasons", params)
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_categories_v2(self):
+        """Get categories (V2)"""
+        return self.client.get("/profiles/v2/metadata/categories")
+
+    def get_skills(self):
+        """Get skills"""
+        return self.client.get("/profiles/v1/metadata/skills")
+
+    def get_skills_v2(self, params):
+        """Get skills (V2)
+
+        :param params: 
+
+        """
+        return self.client.get("/profiles/v2/metadata/skills", params)
+
+    def get_specialties(self):
+        """Get specialties"""
+        return self.client.get("/profiles/v1/metadata/specialties")
+
+    def get_regions(self):
+        """Get regions"""
+        return self.client.get("/profiles/v1/metadata/regions")
+
+    def get_tests(self):
+        """Get tests"""
+        return self.client.get("/profiles/v1/metadata/tests")
+
+    def get_reasons(self, params):
+        """Get reasons
+
+        :param params: 
+
+        """
+        return self.client.get("/profiles/v1/metadata/reasons", params)
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def get_categories_v2(self) +
+
+

Get categories (V2)

+
+ +Expand source code + +
def get_categories_v2(self):
+    """Get categories (V2)"""
+    return self.client.get("/profiles/v2/metadata/categories")
+
+
+
+def get_reasons(self, params) +
+
+

Get reasons

+

:param params:

+
+ +Expand source code + +
def get_reasons(self, params):
+    """Get reasons
+
+    :param params: 
+
+    """
+    return self.client.get("/profiles/v1/metadata/reasons", params)
+
+
+
+def get_regions(self) +
+
+

Get regions

+
+ +Expand source code + +
def get_regions(self):
+    """Get regions"""
+    return self.client.get("/profiles/v1/metadata/regions")
+
+
+
+def get_skills(self) +
+
+

Get skills

+
+ +Expand source code + +
def get_skills(self):
+    """Get skills"""
+    return self.client.get("/profiles/v1/metadata/skills")
+
+
+
+def get_skills_v2(self, params) +
+
+

Get skills (V2)

+

:param params:

+
+ +Expand source code + +
def get_skills_v2(self, params):
+    """Get skills (V2)
+
+    :param params: 
+
+    """
+    return self.client.get("/profiles/v2/metadata/skills", params)
+
+
+
+def get_specialties(self) +
+
+

Get specialties

+
+ +Expand source code + +
def get_specialties(self):
+    """Get specialties"""
+    return self.client.get("/profiles/v1/metadata/specialties")
+
+
+
+def get_tests(self) +
+
+

Get tests

+
+ +Expand source code + +
def get_tests(self):
+    """Get tests"""
+    return self.client.get("/profiles/v1/metadata/tests")
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/organization/companies.html b/routers/organization/companies.html new file mode 100644 index 0000000..27291b9 --- /dev/null +++ b/routers/organization/companies.html @@ -0,0 +1,252 @@ + + + + + + +upwork.routers.organization.companies API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.organization.companies

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_list(self):
+        """Get Companies Info"""
+        return self.client.get("/hr/v2/companies")
+
+    def get_specific(self, company_reference):
+        """Get Specific Company
+
+        :param company_reference: String
+
+        """
+        return self.client.get("/hr/v2/companies/{0}".format(company_reference))
+
+    def get_teams(self, company_reference):
+        """Get Teams in Company
+
+        :param company_reference: String
+
+        """
+        return self.client.get("/hr/v2/companies/{0}/teams".format(company_reference))
+
+    def get_users(self, company_reference):
+        """Get Users in Company
+
+        :param company_reference: String
+
+        """
+        return self.client.get("/hr/v2/companies/{0}/users".format(company_reference))
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_list(self):
+        """Get Companies Info"""
+        return self.client.get("/hr/v2/companies")
+
+    def get_specific(self, company_reference):
+        """Get Specific Company
+
+        :param company_reference: String
+
+        """
+        return self.client.get("/hr/v2/companies/{0}".format(company_reference))
+
+    def get_teams(self, company_reference):
+        """Get Teams in Company
+
+        :param company_reference: String
+
+        """
+        return self.client.get("/hr/v2/companies/{0}/teams".format(company_reference))
+
+    def get_users(self, company_reference):
+        """Get Users in Company
+
+        :param company_reference: String
+
+        """
+        return self.client.get("/hr/v2/companies/{0}/users".format(company_reference))
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def get_list(self) +
+
+

Get Companies Info

+
+ +Expand source code + +
def get_list(self):
+    """Get Companies Info"""
+    return self.client.get("/hr/v2/companies")
+
+
+
+def get_specific(self, company_reference) +
+
+

Get Specific Company

+

:param company_reference: String

+
+ +Expand source code + +
def get_specific(self, company_reference):
+    """Get Specific Company
+
+    :param company_reference: String
+
+    """
+    return self.client.get("/hr/v2/companies/{0}".format(company_reference))
+
+
+
+def get_teams(self, company_reference) +
+
+

Get Teams in Company

+

:param company_reference: String

+
+ +Expand source code + +
def get_teams(self, company_reference):
+    """Get Teams in Company
+
+    :param company_reference: String
+
+    """
+    return self.client.get("/hr/v2/companies/{0}/teams".format(company_reference))
+
+
+
+def get_users(self, company_reference) +
+
+

Get Users in Company

+

:param company_reference: String

+
+ +Expand source code + +
def get_users(self, company_reference):
+    """Get Users in Company
+
+    :param company_reference: String
+
+    """
+    return self.client.get("/hr/v2/companies/{0}/users".format(company_reference))
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/organization/index.html b/routers/organization/index.html new file mode 100644 index 0000000..712e79d --- /dev/null +++ b/routers/organization/index.html @@ -0,0 +1,85 @@ + + + + + + +upwork.routers.organization API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.organization

+
+
+

routers

+
+ +Expand source code + +
"""routers"""
+from . import companies, teams, users
+
+__all__ = ("companies", "teams", "users")
+
+
+
+

Sub-modules

+
+
upwork.routers.organization.companies
+
+
+
+
upwork.routers.organization.teams
+
+
+
+
upwork.routers.organization.users
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/organization/teams.html b/routers/organization/teams.html new file mode 100644 index 0000000..042a354 --- /dev/null +++ b/routers/organization/teams.html @@ -0,0 +1,180 @@ + + + + + + +upwork.routers.organization.teams API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.organization.teams

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_list(self):
+        """Get Teams"""
+        return self.client.get("/hr/v2/teams")
+
+    def get_users_in_team(self, team_reference):
+        """Get Users in Team
+
+        :param team_reference: String
+
+        """
+        return self.client.get("/hr/v2/teams/{0}/users".format(team_reference))
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_list(self):
+        """Get Teams"""
+        return self.client.get("/hr/v2/teams")
+
+    def get_users_in_team(self, team_reference):
+        """Get Users in Team
+
+        :param team_reference: String
+
+        """
+        return self.client.get("/hr/v2/teams/{0}/users".format(team_reference))
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def get_list(self) +
+
+

Get Teams

+
+ +Expand source code + +
def get_list(self):
+    """Get Teams"""
+    return self.client.get("/hr/v2/teams")
+
+
+
+def get_users_in_team(self, team_reference) +
+
+

Get Users in Team

+

:param team_reference: String

+
+ +Expand source code + +
def get_users_in_team(self, team_reference):
+    """Get Users in Team
+
+    :param team_reference: String
+
+    """
+    return self.client.get("/hr/v2/teams/{0}/users".format(team_reference))
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/organization/users.html b/routers/organization/users.html new file mode 100644 index 0000000..c78453f --- /dev/null +++ b/routers/organization/users.html @@ -0,0 +1,180 @@ + + + + + + +upwork.routers.organization.users API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.organization.users

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_my_info(self):
+        """Get Auth user info"""
+        return self.client.get("/hr/v2/users/me")
+
+    def get_specific(self, user_reference):
+        """Get Specific User Info
+
+        :param user_reference: String
+
+        """
+        return self.client.get("/hr/v2/users/{0}".format(user_reference))
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_my_info(self):
+        """Get Auth user info"""
+        return self.client.get("/hr/v2/users/me")
+
+    def get_specific(self, user_reference):
+        """Get Specific User Info
+
+        :param user_reference: String
+
+        """
+        return self.client.get("/hr/v2/users/{0}".format(user_reference))
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def get_my_info(self) +
+
+

Get Auth user info

+
+ +Expand source code + +
def get_my_info(self):
+    """Get Auth user info"""
+    return self.client.get("/hr/v2/users/me")
+
+
+
+def get_specific(self, user_reference) +
+
+

Get Specific User Info

+

:param user_reference: String

+
+ +Expand source code + +
def get_specific(self, user_reference):
+    """Get Specific User Info
+
+    :param user_reference: String
+
+    """
+    return self.client.get("/hr/v2/users/{0}".format(user_reference))
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/payments.html b/routers/payments.html new file mode 100644 index 0000000..59a9fa7 --- /dev/null +++ b/routers/payments.html @@ -0,0 +1,167 @@ + + + + + + +upwork.routers.payments API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.payments

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def submit_bonus(self, team_reference, params):
+        """Submit bonus
+
+        :param team_reference: String
+        :param params: 
+
+        """
+        return self.client.post(
+            "/hr/v2/teams/{0}/adjustments".format(team_reference), params
+        )
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def submit_bonus(self, team_reference, params):
+        """Submit bonus
+
+        :param team_reference: String
+        :param params: 
+
+        """
+        return self.client.post(
+            "/hr/v2/teams/{0}/adjustments".format(team_reference), params
+        )
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def submit_bonus(self, team_reference, params) +
+
+

Submit bonus

+

:param team_reference: String +:param params:

+
+ +Expand source code + +
def submit_bonus(self, team_reference, params):
+    """Submit bonus
+
+    :param team_reference: String
+    :param params: 
+
+    """
+    return self.client.post(
+        "/hr/v2/teams/{0}/adjustments".format(team_reference), params
+    )
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/reports/finance/accounts.html b/routers/reports/finance/accounts.html new file mode 100644 index 0000000..b65f249 --- /dev/null +++ b/routers/reports/finance/accounts.html @@ -0,0 +1,239 @@ + + + + + + +upwork.routers.reports.finance.accounts API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.reports.finance.accounts

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Gds:
+    """ """
+
+    client = None
+    entry_point = "gds"
+
+    def __init__(self, client):
+        self.client = client
+        self.client.epoint = self.entry_point
+
+    def get_owned(self, freelancer_reference, params):
+        """Generate Financial Reports for an owned Account
+        
+        Arguments:
+
+        :param freelancer_reference: param params:
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/financial_account_owner/{0}".format(freelancer_reference),
+            params,
+        )
+
+    def get_specific(self, entity_reference, params):
+        """Generate Financial Reports for a Specific Account
+        
+        Arguments:
+
+        :param entity_reference: param params:
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/financial_accounts/{0}".format(entity_reference), params
+        )
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Gds +(client) +
+
+
+
+ +Expand source code + +
class Gds:
+    """ """
+
+    client = None
+    entry_point = "gds"
+
+    def __init__(self, client):
+        self.client = client
+        self.client.epoint = self.entry_point
+
+    def get_owned(self, freelancer_reference, params):
+        """Generate Financial Reports for an owned Account
+        
+        Arguments:
+
+        :param freelancer_reference: param params:
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/financial_account_owner/{0}".format(freelancer_reference),
+            params,
+        )
+
+    def get_specific(self, entity_reference, params):
+        """Generate Financial Reports for a Specific Account
+        
+        Arguments:
+
+        :param entity_reference: param params:
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/financial_accounts/{0}".format(entity_reference), params
+        )
+
+

Class variables

+
+
var client
+
+
+
+
var entry_point
+
+
+
+
+

Methods

+
+
+def get_owned(self, freelancer_reference, params) +
+
+

Generate Financial Reports for an owned Account

+

Arguments:

+

:param freelancer_reference: param params: +:param params:

+
+ +Expand source code + +
def get_owned(self, freelancer_reference, params):
+    """Generate Financial Reports for an owned Account
+    
+    Arguments:
+
+    :param freelancer_reference: param params:
+    :param params: 
+
+    """
+    return self.client.get(
+        "/finreports/v2/financial_account_owner/{0}".format(freelancer_reference),
+        params,
+    )
+
+
+
+def get_specific(self, entity_reference, params) +
+
+

Generate Financial Reports for a Specific Account

+

Arguments:

+

:param entity_reference: param params: +:param params:

+
+ +Expand source code + +
def get_specific(self, entity_reference, params):
+    """Generate Financial Reports for a Specific Account
+    
+    Arguments:
+
+    :param entity_reference: param params:
+    :param params: 
+
+    """
+    return self.client.get(
+        "/finreports/v2/financial_accounts/{0}".format(entity_reference), params
+    )
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/reports/finance/billings.html b/routers/reports/finance/billings.html new file mode 100644 index 0000000..33efed7 --- /dev/null +++ b/routers/reports/finance/billings.html @@ -0,0 +1,425 @@ + + + + + + +upwork.routers.reports.finance.billings API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.reports.finance.billings

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Gds:
+    """ """
+
+    client = None
+    entry_point = "gds"
+
+    def __init__(self, client):
+        self.client = client
+        self.client.epoint = self.entry_point
+
+    def get_by_freelancer(self, freelancer_reference, params):
+        """Generate Billing Reports for a Specific Freelancer
+        
+        Parameters:
+
+        :param freelancer_reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/providers/{0}/billings".format(freelancer_reference), params
+        )
+
+    def get_by_freelancers_team(self, freelancer_team_reference, params):
+        """Generate Billing Reports for a Specific Freelancer's Team
+        
+        Parameters:
+
+        :param freelancer_team_reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/provider_teams/{0}/billings".format(
+                freelancer_team_reference
+            ),
+            params,
+        )
+
+    def get_by_freelancers_company(self, freelancer_company_reference, params):
+        """Generate Billing Reports for a Specific Freelancer's Company
+        
+        Parameters:
+
+        :param freelancer_company_reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/provider_companies/{0}/billings".format(
+                freelancer_company_reference
+            ),
+            params,
+        )
+
+    def get_by_buyers_team(self, buyer_team_reference, params):
+        """Generate Billing Reports for a Specific Buyer's Team
+        
+        Parameters:
+
+        :param buyer_team_reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/buyer_teams/{0}/billings".format(buyer_team_reference),
+            params,
+        )
+
+    def get_by_buyers_company(self, buyer_company_reference, params):
+        """Generate Billing Reports for a Specific Buyer's Company
+        
+        Parameters:
+
+        :param buyer_company_reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/buyer_companies/{0}/billings".format(
+                buyer_company_reference
+            ),
+            params,
+        )
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Gds +(client) +
+
+
+
+ +Expand source code + +
class Gds:
+    """ """
+
+    client = None
+    entry_point = "gds"
+
+    def __init__(self, client):
+        self.client = client
+        self.client.epoint = self.entry_point
+
+    def get_by_freelancer(self, freelancer_reference, params):
+        """Generate Billing Reports for a Specific Freelancer
+        
+        Parameters:
+
+        :param freelancer_reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/providers/{0}/billings".format(freelancer_reference), params
+        )
+
+    def get_by_freelancers_team(self, freelancer_team_reference, params):
+        """Generate Billing Reports for a Specific Freelancer's Team
+        
+        Parameters:
+
+        :param freelancer_team_reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/provider_teams/{0}/billings".format(
+                freelancer_team_reference
+            ),
+            params,
+        )
+
+    def get_by_freelancers_company(self, freelancer_company_reference, params):
+        """Generate Billing Reports for a Specific Freelancer's Company
+        
+        Parameters:
+
+        :param freelancer_company_reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/provider_companies/{0}/billings".format(
+                freelancer_company_reference
+            ),
+            params,
+        )
+
+    def get_by_buyers_team(self, buyer_team_reference, params):
+        """Generate Billing Reports for a Specific Buyer's Team
+        
+        Parameters:
+
+        :param buyer_team_reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/buyer_teams/{0}/billings".format(buyer_team_reference),
+            params,
+        )
+
+    def get_by_buyers_company(self, buyer_company_reference, params):
+        """Generate Billing Reports for a Specific Buyer's Company
+        
+        Parameters:
+
+        :param buyer_company_reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/buyer_companies/{0}/billings".format(
+                buyer_company_reference
+            ),
+            params,
+        )
+
+

Class variables

+
+
var client
+
+
+
+
var entry_point
+
+
+
+
+

Methods

+
+
+def get_by_buyers_company(self, buyer_company_reference, params) +
+
+

Generate Billing Reports for a Specific Buyer's Company

+

Parameters:

+

:param buyer_company_reference: +:param params:

+
+ +Expand source code + +
def get_by_buyers_company(self, buyer_company_reference, params):
+    """Generate Billing Reports for a Specific Buyer's Company
+    
+    Parameters:
+
+    :param buyer_company_reference: 
+    :param params: 
+
+    """
+    return self.client.get(
+        "/finreports/v2/buyer_companies/{0}/billings".format(
+            buyer_company_reference
+        ),
+        params,
+    )
+
+
+
+def get_by_buyers_team(self, buyer_team_reference, params) +
+
+

Generate Billing Reports for a Specific Buyer's Team

+

Parameters:

+

:param buyer_team_reference: +:param params:

+
+ +Expand source code + +
def get_by_buyers_team(self, buyer_team_reference, params):
+    """Generate Billing Reports for a Specific Buyer's Team
+    
+    Parameters:
+
+    :param buyer_team_reference: 
+    :param params: 
+
+    """
+    return self.client.get(
+        "/finreports/v2/buyer_teams/{0}/billings".format(buyer_team_reference),
+        params,
+    )
+
+
+
+def get_by_freelancer(self, freelancer_reference, params) +
+
+

Generate Billing Reports for a Specific Freelancer

+

Parameters:

+

:param freelancer_reference: +:param params:

+
+ +Expand source code + +
def get_by_freelancer(self, freelancer_reference, params):
+    """Generate Billing Reports for a Specific Freelancer
+    
+    Parameters:
+
+    :param freelancer_reference: 
+    :param params: 
+
+    """
+    return self.client.get(
+        "/finreports/v2/providers/{0}/billings".format(freelancer_reference), params
+    )
+
+
+
+def get_by_freelancers_company(self, freelancer_company_reference, params) +
+
+

Generate Billing Reports for a Specific Freelancer's Company

+

Parameters:

+

:param freelancer_company_reference: +:param params:

+
+ +Expand source code + +
def get_by_freelancers_company(self, freelancer_company_reference, params):
+    """Generate Billing Reports for a Specific Freelancer's Company
+    
+    Parameters:
+
+    :param freelancer_company_reference: 
+    :param params: 
+
+    """
+    return self.client.get(
+        "/finreports/v2/provider_companies/{0}/billings".format(
+            freelancer_company_reference
+        ),
+        params,
+    )
+
+
+
+def get_by_freelancers_team(self, freelancer_team_reference, params) +
+
+

Generate Billing Reports for a Specific Freelancer's Team

+

Parameters:

+

:param freelancer_team_reference: +:param params:

+
+ +Expand source code + +
def get_by_freelancers_team(self, freelancer_team_reference, params):
+    """Generate Billing Reports for a Specific Freelancer's Team
+    
+    Parameters:
+
+    :param freelancer_team_reference: 
+    :param params: 
+
+    """
+    return self.client.get(
+        "/finreports/v2/provider_teams/{0}/billings".format(
+            freelancer_team_reference
+        ),
+        params,
+    )
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/reports/finance/earnings.html b/routers/reports/finance/earnings.html new file mode 100644 index 0000000..8d888b2 --- /dev/null +++ b/routers/reports/finance/earnings.html @@ -0,0 +1,425 @@ + + + + + + +upwork.routers.reports.finance.earnings API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.reports.finance.earnings

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Gds:
+    """ """
+
+    client = None
+    entry_point = "gds"
+
+    def __init__(self, client):
+        self.client = client
+        self.client.epoint = self.entry_point
+
+    def get_by_freelancer(self, freelancer_reference, params):
+        """Generate Earning Reports for a Specific Freelancer
+        
+        Parameters:
+
+        :param freelancer_reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/providers/{0}/earnings".format(freelancer_reference), params
+        )
+
+    def get_by_freelancers_team(self, freelancer_team_reference, params):
+        """Generate Earning Reports for a Specific Freelancer's Team
+        
+        Parameters:
+
+        :param freelancer_team_reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/provider_teams/{0}/earnings".format(
+                freelancer_team_reference
+            ),
+            params,
+        )
+
+    def get_by_freelancers_company(self, freelancer_company_reference, params):
+        """Generate Earning Reports for a Specific Freelancer's Company
+        
+        Parameters:
+
+        :param freelancer_company_reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/provider_companies/{0}/earnings".format(
+                freelancer_company_reference
+            ),
+            params,
+        )
+
+    def get_by_buyers_team(self, buyer_team_reference, params):
+        """Generate Earning Reports for a Specific Buyer's Team
+        
+        Parameters:
+
+        :param buyer_team_reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/buyer_teams/{0}/earnings".format(buyer_team_reference),
+            params,
+        )
+
+    def get_by_buyers_company(self, buyer_company_reference, params):
+        """Generate Earning Reports for a Specific Buyer's Company
+        
+        Parameters:
+
+        :param buyer_company_reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/buyer_companies/{0}/earnings".format(
+                buyer_company_reference
+            ),
+            params,
+        )
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Gds +(client) +
+
+
+
+ +Expand source code + +
class Gds:
+    """ """
+
+    client = None
+    entry_point = "gds"
+
+    def __init__(self, client):
+        self.client = client
+        self.client.epoint = self.entry_point
+
+    def get_by_freelancer(self, freelancer_reference, params):
+        """Generate Earning Reports for a Specific Freelancer
+        
+        Parameters:
+
+        :param freelancer_reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/providers/{0}/earnings".format(freelancer_reference), params
+        )
+
+    def get_by_freelancers_team(self, freelancer_team_reference, params):
+        """Generate Earning Reports for a Specific Freelancer's Team
+        
+        Parameters:
+
+        :param freelancer_team_reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/provider_teams/{0}/earnings".format(
+                freelancer_team_reference
+            ),
+            params,
+        )
+
+    def get_by_freelancers_company(self, freelancer_company_reference, params):
+        """Generate Earning Reports for a Specific Freelancer's Company
+        
+        Parameters:
+
+        :param freelancer_company_reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/provider_companies/{0}/earnings".format(
+                freelancer_company_reference
+            ),
+            params,
+        )
+
+    def get_by_buyers_team(self, buyer_team_reference, params):
+        """Generate Earning Reports for a Specific Buyer's Team
+        
+        Parameters:
+
+        :param buyer_team_reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/buyer_teams/{0}/earnings".format(buyer_team_reference),
+            params,
+        )
+
+    def get_by_buyers_company(self, buyer_company_reference, params):
+        """Generate Earning Reports for a Specific Buyer's Company
+        
+        Parameters:
+
+        :param buyer_company_reference: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/finreports/v2/buyer_companies/{0}/earnings".format(
+                buyer_company_reference
+            ),
+            params,
+        )
+
+

Class variables

+
+
var client
+
+
+
+
var entry_point
+
+
+
+
+

Methods

+
+
+def get_by_buyers_company(self, buyer_company_reference, params) +
+
+

Generate Earning Reports for a Specific Buyer's Company

+

Parameters:

+

:param buyer_company_reference: +:param params:

+
+ +Expand source code + +
def get_by_buyers_company(self, buyer_company_reference, params):
+    """Generate Earning Reports for a Specific Buyer's Company
+    
+    Parameters:
+
+    :param buyer_company_reference: 
+    :param params: 
+
+    """
+    return self.client.get(
+        "/finreports/v2/buyer_companies/{0}/earnings".format(
+            buyer_company_reference
+        ),
+        params,
+    )
+
+
+
+def get_by_buyers_team(self, buyer_team_reference, params) +
+
+

Generate Earning Reports for a Specific Buyer's Team

+

Parameters:

+

:param buyer_team_reference: +:param params:

+
+ +Expand source code + +
def get_by_buyers_team(self, buyer_team_reference, params):
+    """Generate Earning Reports for a Specific Buyer's Team
+    
+    Parameters:
+
+    :param buyer_team_reference: 
+    :param params: 
+
+    """
+    return self.client.get(
+        "/finreports/v2/buyer_teams/{0}/earnings".format(buyer_team_reference),
+        params,
+    )
+
+
+
+def get_by_freelancer(self, freelancer_reference, params) +
+
+

Generate Earning Reports for a Specific Freelancer

+

Parameters:

+

:param freelancer_reference: +:param params:

+
+ +Expand source code + +
def get_by_freelancer(self, freelancer_reference, params):
+    """Generate Earning Reports for a Specific Freelancer
+    
+    Parameters:
+
+    :param freelancer_reference: 
+    :param params: 
+
+    """
+    return self.client.get(
+        "/finreports/v2/providers/{0}/earnings".format(freelancer_reference), params
+    )
+
+
+
+def get_by_freelancers_company(self, freelancer_company_reference, params) +
+
+

Generate Earning Reports for a Specific Freelancer's Company

+

Parameters:

+

:param freelancer_company_reference: +:param params:

+
+ +Expand source code + +
def get_by_freelancers_company(self, freelancer_company_reference, params):
+    """Generate Earning Reports for a Specific Freelancer's Company
+    
+    Parameters:
+
+    :param freelancer_company_reference: 
+    :param params: 
+
+    """
+    return self.client.get(
+        "/finreports/v2/provider_companies/{0}/earnings".format(
+            freelancer_company_reference
+        ),
+        params,
+    )
+
+
+
+def get_by_freelancers_team(self, freelancer_team_reference, params) +
+
+

Generate Earning Reports for a Specific Freelancer's Team

+

Parameters:

+

:param freelancer_team_reference: +:param params:

+
+ +Expand source code + +
def get_by_freelancers_team(self, freelancer_team_reference, params):
+    """Generate Earning Reports for a Specific Freelancer's Team
+    
+    Parameters:
+
+    :param freelancer_team_reference: 
+    :param params: 
+
+    """
+    return self.client.get(
+        "/finreports/v2/provider_teams/{0}/earnings".format(
+            freelancer_team_reference
+        ),
+        params,
+    )
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/reports/finance/index.html b/routers/reports/finance/index.html new file mode 100644 index 0000000..0258e21 --- /dev/null +++ b/routers/reports/finance/index.html @@ -0,0 +1,85 @@ + + + + + + +upwork.routers.reports.finance API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.reports.finance

+
+
+

routers

+
+ +Expand source code + +
"""routers"""
+from . import accounts, billings, earnings
+
+__all__ = ("accounts", "billings", "earnings")
+
+
+
+

Sub-modules

+
+
upwork.routers.reports.finance.accounts
+
+
+
+
upwork.routers.reports.finance.billings
+
+
+
+
upwork.routers.reports.finance.earnings
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/reports/index.html b/routers/reports/index.html new file mode 100644 index 0000000..078c04e --- /dev/null +++ b/routers/reports/index.html @@ -0,0 +1,80 @@ + + + + + + +upwork.routers.reports API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.reports

+
+
+

routers

+
+ +Expand source code + +
"""routers"""
+from . import finance, time
+
+__all__ = ("finance", "time")
+
+
+
+

Sub-modules

+
+
upwork.routers.reports.finance
+
+

routers

+
+
upwork.routers.reports.time
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/reports/time.html b/routers/reports/time.html new file mode 100644 index 0000000..73fd3bb --- /dev/null +++ b/routers/reports/time.html @@ -0,0 +1,462 @@ + + + + + + +upwork.routers.reports.time API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.reports.time

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Gds:
+    """ """
+
+    client = None
+    entry_point = "gds"
+
+    def __init__(self, client):
+        self.client = client
+        self.client.epoint = self.entry_point
+
+    def get_by_team_full(self, company, team, params):
+        """Generate Time Reports for a Specific Team (with financial info)
+        
+        Parameters:
+
+        :param company: 
+        :param team: 
+        :param params: 
+
+        """
+        return self.__get_by_type(company, team, None, params, False)
+
+    def get_by_team_limited(self, company, team, params):
+        """Generate Time Reports for a Specific Team (hide financial info)
+        
+        Parameters:
+
+        :param company: 
+        :param team: 
+        :param params: 
+
+        """
+        return self.__get_by_type(company, team, None, params, True)
+
+    def get_by_agency(self, company, agency, params):
+        """Generating Agency Specific Reports
+        
+        Parameters:
+
+        :param company: 
+        :param agency: 
+        :param params: 
+
+        """
+        return self.__get_by_type(company, None, agency, params, False)
+
+    def get_by_company(self, company, params):
+        """Generating Company Wide Reports
+        
+        Parameters:
+
+        :param company: 
+        :param params: 
+
+        """
+        return self.__get_by_type(company, None, None, params, False)
+
+    def get_by_freelancer_limited(self, freelancer_id, params):
+        """Generating Freelancer's Specific Reports (hide financial info)
+        
+        Parameters:
+
+        :param freelancer_id: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/timereports/v1/providers/{0}/hours".format(freelancer_id), params
+        )
+
+    def get_by_freelancer_full(self, freelancer_id, params):
+        """Generating Freelancer's Specific Reports (with financial info)
+        
+        Parameters:
+
+        :param freelancer_id: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/timereports/v1/providers/{0}".format(freelancer_id), params
+        )
+
+    def __get_by_type(self, company, team, agency, params, hide_fin_data):
+        url = ""
+        if team is not None:
+            url = "/teams/{0}".format(team)
+            if hide_fin_data:
+                url = url + "/hours"
+        elif agency is not None:
+            url = "/agencies/{0}".format(agency)
+
+        return self.client.get(
+            "/timereports/v1/companies/{0}{1}".format(company, url), params
+        )
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Gds +(client) +
+
+
+
+ +Expand source code + +
class Gds:
+    """ """
+
+    client = None
+    entry_point = "gds"
+
+    def __init__(self, client):
+        self.client = client
+        self.client.epoint = self.entry_point
+
+    def get_by_team_full(self, company, team, params):
+        """Generate Time Reports for a Specific Team (with financial info)
+        
+        Parameters:
+
+        :param company: 
+        :param team: 
+        :param params: 
+
+        """
+        return self.__get_by_type(company, team, None, params, False)
+
+    def get_by_team_limited(self, company, team, params):
+        """Generate Time Reports for a Specific Team (hide financial info)
+        
+        Parameters:
+
+        :param company: 
+        :param team: 
+        :param params: 
+
+        """
+        return self.__get_by_type(company, team, None, params, True)
+
+    def get_by_agency(self, company, agency, params):
+        """Generating Agency Specific Reports
+        
+        Parameters:
+
+        :param company: 
+        :param agency: 
+        :param params: 
+
+        """
+        return self.__get_by_type(company, None, agency, params, False)
+
+    def get_by_company(self, company, params):
+        """Generating Company Wide Reports
+        
+        Parameters:
+
+        :param company: 
+        :param params: 
+
+        """
+        return self.__get_by_type(company, None, None, params, False)
+
+    def get_by_freelancer_limited(self, freelancer_id, params):
+        """Generating Freelancer's Specific Reports (hide financial info)
+        
+        Parameters:
+
+        :param freelancer_id: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/timereports/v1/providers/{0}/hours".format(freelancer_id), params
+        )
+
+    def get_by_freelancer_full(self, freelancer_id, params):
+        """Generating Freelancer's Specific Reports (with financial info)
+        
+        Parameters:
+
+        :param freelancer_id: 
+        :param params: 
+
+        """
+        return self.client.get(
+            "/timereports/v1/providers/{0}".format(freelancer_id), params
+        )
+
+    def __get_by_type(self, company, team, agency, params, hide_fin_data):
+        url = ""
+        if team is not None:
+            url = "/teams/{0}".format(team)
+            if hide_fin_data:
+                url = url + "/hours"
+        elif agency is not None:
+            url = "/agencies/{0}".format(agency)
+
+        return self.client.get(
+            "/timereports/v1/companies/{0}{1}".format(company, url), params
+        )
+
+

Class variables

+
+
var client
+
+
+
+
var entry_point
+
+
+
+
+

Methods

+
+
+def get_by_agency(self, company, agency, params) +
+
+

Generating Agency Specific Reports

+

Parameters:

+

:param company: +:param agency: +:param params:

+
+ +Expand source code + +
def get_by_agency(self, company, agency, params):
+    """Generating Agency Specific Reports
+    
+    Parameters:
+
+    :param company: 
+    :param agency: 
+    :param params: 
+
+    """
+    return self.__get_by_type(company, None, agency, params, False)
+
+
+
+def get_by_company(self, company, params) +
+
+

Generating Company Wide Reports

+

Parameters:

+

:param company: +:param params:

+
+ +Expand source code + +
def get_by_company(self, company, params):
+    """Generating Company Wide Reports
+    
+    Parameters:
+
+    :param company: 
+    :param params: 
+
+    """
+    return self.__get_by_type(company, None, None, params, False)
+
+
+
+def get_by_freelancer_full(self, freelancer_id, params) +
+
+

Generating Freelancer's Specific Reports (with financial info)

+

Parameters:

+

:param freelancer_id: +:param params:

+
+ +Expand source code + +
def get_by_freelancer_full(self, freelancer_id, params):
+    """Generating Freelancer's Specific Reports (with financial info)
+    
+    Parameters:
+
+    :param freelancer_id: 
+    :param params: 
+
+    """
+    return self.client.get(
+        "/timereports/v1/providers/{0}".format(freelancer_id), params
+    )
+
+
+
+def get_by_freelancer_limited(self, freelancer_id, params) +
+
+

Generating Freelancer's Specific Reports (hide financial info)

+

Parameters:

+

:param freelancer_id: +:param params:

+
+ +Expand source code + +
def get_by_freelancer_limited(self, freelancer_id, params):
+    """Generating Freelancer's Specific Reports (hide financial info)
+    
+    Parameters:
+
+    :param freelancer_id: 
+    :param params: 
+
+    """
+    return self.client.get(
+        "/timereports/v1/providers/{0}/hours".format(freelancer_id), params
+    )
+
+
+
+def get_by_team_full(self, company, team, params) +
+
+

Generate Time Reports for a Specific Team (with financial info)

+

Parameters:

+

:param company: +:param team: +:param params:

+
+ +Expand source code + +
def get_by_team_full(self, company, team, params):
+    """Generate Time Reports for a Specific Team (with financial info)
+    
+    Parameters:
+
+    :param company: 
+    :param team: 
+    :param params: 
+
+    """
+    return self.__get_by_type(company, team, None, params, False)
+
+
+
+def get_by_team_limited(self, company, team, params) +
+
+

Generate Time Reports for a Specific Team (hide financial info)

+

Parameters:

+

:param company: +:param team: +:param params:

+
+ +Expand source code + +
def get_by_team_limited(self, company, team, params):
+    """Generate Time Reports for a Specific Team (hide financial info)
+    
+    Parameters:
+
+    :param company: 
+    :param team: 
+    :param params: 
+
+    """
+    return self.__get_by_type(company, team, None, params, True)
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/snapshots.html b/routers/snapshots.html new file mode 100644 index 0000000..80cb890 --- /dev/null +++ b/routers/snapshots.html @@ -0,0 +1,267 @@ + + + + + + +upwork.routers.snapshots API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.snapshots

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_by_contract(self, contract, ts):
+        """Get snapshot info by specific contract
+
+        :param contract: String
+        :param ts: String
+
+        """
+        return self.client.get(
+            "/team/v3/snapshots/contracts/{0}/{1}".format(contract, ts)
+        )
+
+    def update_by_contract(self, contract, ts, params):
+        """Update snapshot by specific contract
+        
+        Parameters:
+        :param contract: String
+        :param ts: String
+        :param params: 
+
+        """
+        return self.client.put(
+            "/team/v3/snapshots/contracts/{0}/{1}".format(contract, ts), params
+        )
+
+    def delete_by_contract(self, contract, ts):
+        """Delete snapshot by specific contract
+
+        :param contract: String
+        :param ts: String
+
+        """
+        return self.client.delete(
+            "/team/v3/snapshots/contracts/{0}/{1}".format(contract, ts)
+        )
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_by_contract(self, contract, ts):
+        """Get snapshot info by specific contract
+
+        :param contract: String
+        :param ts: String
+
+        """
+        return self.client.get(
+            "/team/v3/snapshots/contracts/{0}/{1}".format(contract, ts)
+        )
+
+    def update_by_contract(self, contract, ts, params):
+        """Update snapshot by specific contract
+        
+        Parameters:
+        :param contract: String
+        :param ts: String
+        :param params: 
+
+        """
+        return self.client.put(
+            "/team/v3/snapshots/contracts/{0}/{1}".format(contract, ts), params
+        )
+
+    def delete_by_contract(self, contract, ts):
+        """Delete snapshot by specific contract
+
+        :param contract: String
+        :param ts: String
+
+        """
+        return self.client.delete(
+            "/team/v3/snapshots/contracts/{0}/{1}".format(contract, ts)
+        )
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def delete_by_contract(self, contract, ts) +
+
+

Delete snapshot by specific contract

+

:param contract: String +:param ts: String

+
+ +Expand source code + +
def delete_by_contract(self, contract, ts):
+    """Delete snapshot by specific contract
+
+    :param contract: String
+    :param ts: String
+
+    """
+    return self.client.delete(
+        "/team/v3/snapshots/contracts/{0}/{1}".format(contract, ts)
+    )
+
+
+
+def get_by_contract(self, contract, ts) +
+
+

Get snapshot info by specific contract

+

:param contract: String +:param ts: String

+
+ +Expand source code + +
def get_by_contract(self, contract, ts):
+    """Get snapshot info by specific contract
+
+    :param contract: String
+    :param ts: String
+
+    """
+    return self.client.get(
+        "/team/v3/snapshots/contracts/{0}/{1}".format(contract, ts)
+    )
+
+
+
+def update_by_contract(self, contract, ts, params) +
+
+

Update snapshot by specific contract

+

Parameters: +:param contract: String +:param ts: String +:param params:

+
+ +Expand source code + +
def update_by_contract(self, contract, ts, params):
+    """Update snapshot by specific contract
+    
+    Parameters:
+    :param contract: String
+    :param ts: String
+    :param params: 
+
+    """
+    return self.client.put(
+        "/team/v3/snapshots/contracts/{0}/{1}".format(contract, ts), params
+    )
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/workdays.html b/routers/workdays.html new file mode 100644 index 0000000..34ce6ac --- /dev/null +++ b/routers/workdays.html @@ -0,0 +1,257 @@ + + + + + + +upwork.routers.workdays API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.workdays

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_by_company(self, company, from_date, till_date, params={}):
+        """Get Workdays by Company
+        
+        Parameters:
+        :param company: 
+        :param from_date: 
+        :param till_date: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get(
+            "/team/v3/workdays/companies/{0}/{1},{2}".format(
+                company, from_date, till_date
+            ),
+            params,
+        )
+
+    def get_by_contract(self, contract, from_date, till_date, params={}):
+        """Get Workdays by Contract
+        
+        Parameters:
+        :param contract: 
+        :param from_date: 
+        :param till_date: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get(
+            "/team/v3/workdays/contracts/{0}/{1},{2}".format(
+                contract, from_date, till_date
+            ),
+            params,
+        )
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_by_company(self, company, from_date, till_date, params={}):
+        """Get Workdays by Company
+        
+        Parameters:
+        :param company: 
+        :param from_date: 
+        :param till_date: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get(
+            "/team/v3/workdays/companies/{0}/{1},{2}".format(
+                company, from_date, till_date
+            ),
+            params,
+        )
+
+    def get_by_contract(self, contract, from_date, till_date, params={}):
+        """Get Workdays by Contract
+        
+        Parameters:
+        :param contract: 
+        :param from_date: 
+        :param till_date: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get(
+            "/team/v3/workdays/contracts/{0}/{1},{2}".format(
+                contract, from_date, till_date
+            ),
+            params,
+        )
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def get_by_company(self, company, from_date, till_date, params={}) +
+
+

Get Workdays by Company

+

Parameters: +:param company: +:param from_date: +:param till_date: +:param params: +(Default value = {})

+
+ +Expand source code + +
def get_by_company(self, company, from_date, till_date, params={}):
+    """Get Workdays by Company
+    
+    Parameters:
+    :param company: 
+    :param from_date: 
+    :param till_date: 
+    :param params:  (Default value = {})
+
+    """
+    return self.client.get(
+        "/team/v3/workdays/companies/{0}/{1},{2}".format(
+            company, from_date, till_date
+        ),
+        params,
+    )
+
+
+
+def get_by_contract(self, contract, from_date, till_date, params={}) +
+
+

Get Workdays by Contract

+

Parameters: +:param contract: +:param from_date: +:param till_date: +:param params: +(Default value = {})

+
+ +Expand source code + +
def get_by_contract(self, contract, from_date, till_date, params={}):
+    """Get Workdays by Contract
+    
+    Parameters:
+    :param contract: 
+    :param from_date: 
+    :param till_date: 
+    :param params:  (Default value = {})
+
+    """
+    return self.client.get(
+        "/team/v3/workdays/contracts/{0}/{1},{2}".format(
+            contract, from_date, till_date
+        ),
+        params,
+    )
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/routers/workdiary.html b/routers/workdiary.html new file mode 100644 index 0000000..03befba --- /dev/null +++ b/routers/workdiary.html @@ -0,0 +1,231 @@ + + + + + + +upwork.routers.workdiary API documentation + + + + + + + + + + + +
+
+
+

Module upwork.routers.workdiary

+
+
+
+ +Expand source code + +
# Licensed under the Upwork's API Terms of Use;
+# you may not use this file except in compliance with the Terms.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author::    Maksym Novozhylov (mnovozhilov@upwork.com)
+# Copyright:: Copyright 2020(c) Upwork.com
+# License::   See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
+
+
+class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_workdiary(self, company, date, params={}):
+        """Get Workdiary by Company
+        
+        Parameters:
+        :param company:
+        :param date:
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get(
+            "/team/v3/workdiaries/companies/{0}/{1}".format(company, date), params
+        )
+
+    def get_by_contract(self, contract, date, params={}):
+        """Get Work Diary by Contract
+        
+        Parameters:
+        :param contract: 
+        :param date: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get(
+            "/team/v3/workdiaries/contracts/{0}/{1}".format(contract, date), params
+        )
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class Api +(client) +
+
+
+
+ +Expand source code + +
class Api:
+    """ """
+
+    client = None
+
+    def __init__(self, client):
+        self.client = client
+
+    def get_workdiary(self, company, date, params={}):
+        """Get Workdiary by Company
+        
+        Parameters:
+        :param company:
+        :param date:
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get(
+            "/team/v3/workdiaries/companies/{0}/{1}".format(company, date), params
+        )
+
+    def get_by_contract(self, contract, date, params={}):
+        """Get Work Diary by Contract
+        
+        Parameters:
+        :param contract: 
+        :param date: 
+        :param params:  (Default value = {})
+
+        """
+        return self.client.get(
+            "/team/v3/workdiaries/contracts/{0}/{1}".format(contract, date), params
+        )
+
+

Class variables

+
+
var client
+
+
+
+
+

Methods

+
+
+def get_by_contract(self, contract, date, params={}) +
+
+

Get Work Diary by Contract

+

Parameters: +:param contract: +:param date: +:param params: +(Default value = {})

+
+ +Expand source code + +
def get_by_contract(self, contract, date, params={}):
+    """Get Work Diary by Contract
+    
+    Parameters:
+    :param contract: 
+    :param date: 
+    :param params:  (Default value = {})
+
+    """
+    return self.client.get(
+        "/team/v3/workdiaries/contracts/{0}/{1}".format(contract, date), params
+    )
+
+
+
+def get_workdiary(self, company, date, params={}) +
+
+

Get Workdiary by Company

+

Parameters: +:param company: +:param date: +:param params: +(Default value = {})

+
+ +Expand source code + +
def get_workdiary(self, company, date, params={}):
+    """Get Workdiary by Company
+    
+    Parameters:
+    :param company:
+    :param date:
+    :param params:  (Default value = {})
+
+    """
+    return self.client.get(
+        "/team/v3/workdiaries/companies/{0}/{1}".format(company, date), params
+    )
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index c68b0bb..0000000 --- a/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python - -from setuptools import setup, find_packages # type: ignore - -with open("README.md") as readme_file: - readme = readme_file.read() - -setup( - author="Maksym Novozhylov", - author_email="mnovozhilov@upwork.com", - python_requires=">=3.8", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Environment :: Web Environment", - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Natural Language :: English", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Topic :: Software Development :: Libraries :: Python Modules", - "Topic :: Utilities", - ], - description="Python bindings for Upwork API (OAuth2)", - install_requires=["requests_oauthlib==1.3.1"], - license="Apache Software License 2.0", - long_description=readme, - long_description_content_type="text/markdown", - include_package_data=True, - keywords="python-upwork-oauth2", - name="python-upwork-oauth2", - packages=find_packages(), - setup_requires=[], - url="https://github.com/upwork/python-upwork-oauth2", - version="3.2.0", - zip_safe=False, -) diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index 1e361ae..0000000 --- a/tests/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Unit test package for upwork.""" diff --git a/tests/routers/__init__.py b/tests/routers/__init__.py deleted file mode 100644 index 0838208..0000000 --- a/tests/routers/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Unit test package for upwork routers.""" diff --git a/tests/routers/test_graphql.py b/tests/routers/test_graphql.py deleted file mode 100644 index 434a0cd..0000000 --- a/tests/routers/test_graphql.py +++ /dev/null @@ -1,9 +0,0 @@ -import upwork -from upwork.routers import graphql -from unittest.mock import patch - - -@patch.object(upwork.Client, "post") -def test_execute(mocked_method): - graphql.Api(upwork.Client).execute({"query": "query{}"}) - mocked_method.assert_called_with("", {"query": "query{}"}) diff --git a/tests/test_client.py b/tests/test_client.py deleted file mode 100644 index 7d4e232..0000000 --- a/tests/test_client.py +++ /dev/null @@ -1,92 +0,0 @@ -import unittest -from upwork import config -from upwork import client -from unittest.mock import patch, Mock -from requests_oauthlib import OAuth2Session # type: ignore - - -class TestClient(unittest.TestCase): - def setUp(self): - cfg = config.Config( - { - "client_id": "clientid", - "client_secret": "secret", - "redirect_uri": "https://a.callback.url", - } - ) - self.base_client = client.Client(cfg) - - @patch.object( - OAuth2Session, - "fetch_token", - return_value={"access_token": "a", "expires_in": "86400", "refresh_token": "b"}, - ) - def test_get_access_token(self, mocked_post): - assert self.base_client.get_access_token( - "https://a.callback.url/?code=xxxxxxxxxx&state=xxxxx" - ) == {"access_token": "a", "expires_in": "86400", "refresh_token": "b"} - - def test_get_actual_config(self): - assert isinstance(self.base_client.get_actual_config(), config.Config) - assert self.base_client.get_actual_config().client_id == "clientid" - - @patch.object( - OAuth2Session, - "get", - return_value=Mock(status_code=200, json=lambda: {"a": "b"}), - ) - @patch.object( - OAuth2Session, - "post", - return_value=Mock(status_code=200, json=lambda: {"a": "b"}), - ) - @patch.object( - OAuth2Session, - "put", - return_value=Mock(status_code=200, json=lambda: {"a": "b"}), - ) - @patch.object( - OAuth2Session, - "delete", - return_value=Mock(status_code=200, json=lambda: {"a": "b"}), - ) - def test_send_request(self, mocked_get, mocked_post, mocked_put, mocked_delete): - cfg = config.Config( - { - "client_id": "keyxxxxxxxxxxxxxxxxxxxx", - "client_secret": "secretxxxxxxxxxx", - "token": { - "access_token": "token", - "refresh_token": "token", - "expires_in": "86400", - }, - } - ) - cl = client.Client(cfg) - assert cl.get("/test/uri", {}) == {"a": "b"} - assert cl.post("/test/uri", {}) == {"a": "b"} - assert cl.put("/test/uri", {}) == {"a": "b"} - assert cl.delete("/test/uri", {}) == {"a": "b"} - - with self.assertRaises(ValueError): - cl.send_request("/test/uri", "method", {}) - - def test_get_authorization_url(self): - assert ( - self.base_client.get_authorization_url()[0][:-30] - == "https://www.upwork.com/ab/account-security/oauth2/authorize?response_type=code&client_id=clientid&redirect_uri=https%3A%2F%2Fa.callback.url&state=" - ) - - def test_refresh_config_from_access_token(self): - self.base_client.refresh_config_from_access_token({"access_token": "a"}) - assert self.base_client.config.token == {"access_token": "a"} - - def test_full_url(self): - assert client.full_url("/test/uri") == "https://www.upwork.com/api/test/uri" - assert ( - client.full_url("/test/uri", "gds") == "https://www.upwork.com/gds/test/uri" - ) - - def test_get_uri_with_format(self): - assert client.get_uri_with_format("/test/uri", "api") == "/test/uri.json" - assert client.get_uri_with_format("/test/uri", "gds") == "/test/uri" diff --git a/tests/test_config.py b/tests/test_config.py deleted file mode 100644 index 0352f70..0000000 --- a/tests/test_config.py +++ /dev/null @@ -1,17 +0,0 @@ -from upwork import config - - -def test_config_initialization(): - cfg = config.Config( - { - "client_id": "keyxxxxxxxxxxxxxxxxxxxx", - "client_secret": "secretxxxxxxxxxx", - "redirect_uri": "https://a.callback.url", - "token": {"access_token": "a"}, - } - ) - - assert cfg.client_id == "keyxxxxxxxxxxxxxxxxxxxx" - assert cfg.client_secret == "secretxxxxxxxxxx" - assert cfg.redirect_uri == "https://a.callback.url" - assert cfg.token == {"access_token": "a"} diff --git a/tests/test_upwork.py b/tests/test_upwork.py deleted file mode 100644 index 7631189..0000000 --- a/tests/test_upwork.py +++ /dev/null @@ -1,5 +0,0 @@ -from upwork import upwork - - -def test_upwork(): - assert upwork is not None diff --git a/upwork.html b/upwork.html new file mode 100644 index 0000000..dcdaa9a --- /dev/null +++ b/upwork.html @@ -0,0 +1,64 @@ + + + + + + +upwork.upwork API documentation + + + + + + + + + + + +
+
+
+

Module upwork.upwork

+
+
+

Main module.

+
+ +Expand source code + +
"""Main module."""
+
+BASE_HOST = "https://www.upwork.com"
+GQL_EPOINT = "https://api.upwork.com/graphql"
+DEFAULT_EPOINT = "api"
+
+
+
+
+
+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/upwork/__init__.py b/upwork/__init__.py deleted file mode 100644 index da54e8b..0000000 --- a/upwork/__init__.py +++ /dev/null @@ -1,11 +0,0 @@ -"""Top-level package for python-upwork.""" - -from upwork.config import Config -from upwork.client import Client -from . import routers - -__author__ = """Maksym Novozhylov""" -__email__ = "mnovozhilov@upwork.com" -__version__ = "3.2.0" - -__all__ = ("Config", "Client", "routers") diff --git a/upwork/client.py b/upwork/client.py deleted file mode 100644 index 12708e6..0000000 --- a/upwork/client.py +++ /dev/null @@ -1,195 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - -from . import upwork -from oauthlib.oauth2 import BackendApplicationClient # type: ignore -from requests_oauthlib import OAuth2Session # type: ignore -from urllib.parse import parse_qsl, urlencode - - -class Client(object): - """API client for OAuth2 authorization - - *Parameters:* - :config: An instance of upwork.Config class, which contains the configuration keys and tokens - """ - - __data_format = "json" - __overload_var = "http_method" - - __uri_auth = "/ab/account-security/oauth2/authorize" - __uri_rtoken = "/v3/oauth2/token" - __uri_atoken = "/v3/oauth2/token" - - epoint = upwork.DEFAULT_EPOINT - - def __init__(self, config): - self.config = config - self.config.tenant_id = None - try: - # token is known, use it - self.__oauth = OAuth2Session( - self.config.client_id, - token=self.config.token, - auto_refresh_url=full_url(self.__uri_rtoken, upwork.DEFAULT_EPOINT), - auto_refresh_kwargs={ - "client_id": self.config.client_id, - "client_secret": self.config.client_secret, - }, - token_updater=self.refresh_config_from_access_token, - ) - except AttributeError as e: - if self.config.grant_type == "client_credentials": - client = BackendApplicationClient(client_id=self.config.client_id) - self.__oauth = OAuth2Session( - client=client - ) - else: - # start from authorization step - self.__oauth = OAuth2Session( - self.config.client_id, redirect_uri=self.config.redirect_uri - ) - - def get_authorization_url(self): - """Get authorization URL - - :param redirect_uri: (Default value = None) - - """ - return self.__oauth.authorization_url( - "{0}{1}".format(upwork.BASE_HOST, self.__uri_auth) - ) - - def get_access_token(self, authorization_response=None): - """Finish auth process and get access token - - :param authorization_response: - - """ - self.config.token = self.__oauth.fetch_token( - full_url(self.__uri_atoken, upwork.DEFAULT_EPOINT), - authorization_response=authorization_response, - client_secret=self.config.client_secret, - ) - return self.config.token - - def refresh_config_from_access_token(self, token): - """Callback from OAuth2 client which will refresh config with actual data""" - self.config.token = token - - def set_org_uid_header(self, tenant_id): - """Configure X-Upwork-API-TenantId header""" - self.config.tenant_id = tenant_id - - def get_actual_config(self): - """Get actual client config""" - return self.config - - def get(self, uri, params=None): - """Execute GET request - - :param uri: - :param params: (Default value = None) - - """ - return self.send_request(uri, "get", params) - - def post(self, uri, params=None): - """Execute POST request - - :param uri: - :param params: (Default value = None) - - """ - return self.send_request(uri, "post", params) - - def put(self, uri, params=None): - """Execute PUT request - - :param uri: - :param params: (Default value = None) - - """ - return self.send_request(uri, "put", params) - - def delete(self, uri, params=None): - """Execute DELETE request - - :param uri: - :param params: (Default value = None) - - """ - return self.send_request(uri, "delete", params) - - def send_request(self, uri, method="get", params={}): - """Send request - - :param uri: - :param method: (Default value = 'get') - :param params: (Default value = {}) - - """ - # delete does not support passing the parameters - if method == "delete": - params[self.__overload_var] = method - - url = full_url(get_uri_with_format(uri, self.epoint), self.epoint) - - if method == "get": - r = self.__oauth.get(url, params=params) - elif method == "put": - headers = {"Content-type": "application/json"} - r = self.__oauth.put(url, json=params, headers=headers) - elif method in {"post", "delete"}: - headers = {"Content-type": "application/json"} - if self.epoint == "graphql" and self.config.tenant_id: - headers["X-Upwork-API-TenantId"] = self.config.tenant_id - r = self.__oauth.post(url, json=params, headers=headers) - else: - raise ValueError( - 'Do not know how to handle http method "{0}"'.format(method) - ) - - return r.json() - - -""" - -""" - - -def full_url(uri, epoint=None): - """Get full URL - - :param uri: - :param epoint: (Default value = None) - - """ - if epoint == "graphql": - return upwork.GQL_EPOINT - - if not epoint: - epoint = upwork.DEFAULT_EPOINT - return "{0}/{1}{2}".format(upwork.BASE_HOST, epoint, uri) - - -def get_uri_with_format(uri, epoint): - """Get URI with format ending - - :param uri: - :param epoint: - - """ - if epoint == upwork.DEFAULT_EPOINT: - uri += ".json" - return uri diff --git a/upwork/config.py b/upwork/config.py deleted file mode 100644 index d57f816..0000000 --- a/upwork/config.py +++ /dev/null @@ -1,34 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Config: - """Configuration container""" - - def __init__(self, config): - self.client_id, self.client_secret = ( - config["client_id"], - config["client_secret"], - ) - - if "grant_type" in config: - self.grant_type = config["grant_type"] - else: - self.grant_type = None # Authorization Code Grant flow is used by default - - if "redirect_uri" in config: - self.redirect_uri = config["redirect_uri"] - - # access-, refresh token, and expires_in/at data - if "token" in config: - self.token = config["token"] diff --git a/upwork/routers/__init__.py b/upwork/routers/__init__.py deleted file mode 100644 index f3ade5c..0000000 --- a/upwork/routers/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -"""routers""" -from . import activities, auth, freelancers, hr, jobs -from . import messages, metadata, organization, payments -from . import reports, snapshots, workdays, workdiary - -__all__ = ( - "activities", - "auth", - "freelancers", - "hr", - "jobs", - "messages", - "metadata", - "organization", - "payments", - "reports", - "snapshots", - "workdays", - "workdiary" -) diff --git a/upwork/routers/activities/__init__.py b/upwork/routers/activities/__init__.py deleted file mode 100644 index fe31729..0000000 --- a/upwork/routers/activities/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""routers""" diff --git a/upwork/routers/activities/engagement.py b/upwork/routers/activities/engagement.py deleted file mode 100644 index dbb075d..0000000 --- a/upwork/routers/activities/engagement.py +++ /dev/null @@ -1,37 +0,0 @@ -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def get_specific(self, engagement_ref): - """List activities for specific engagement - - :param engagement_ref: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def assign(self, company, team, engagement, params): - """Assign engagements to the list of activities - - Parameters: - :param company: - :param team: - :param engagement: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def assign_to_engagement(self, engagement_ref, params): - """Assign to specific engagement the list of activities - - Parameters: - :param engagement_ref: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/activities/team.py b/upwork/routers/activities/team.py deleted file mode 100644 index 705e06a..0000000 --- a/upwork/routers/activities/team.py +++ /dev/null @@ -1,100 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def get_list(self, company, team): - """List all oTask/Activity records within a team - - :param company: String - :param team: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_specific_list(self, company, team, code): - """List all oTask/Activity records within a Company by specified code(s) - - :param company: String - :param team: String - :param code: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def add_activity(self, company, team, params): - """Create an oTask/Activity record within a team - - Parameters: - :param company: - :param team: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def update_activities(self, company, team, code, params): - """Update specific oTask/Activity record within a team - - Parameters: - :param company: - :param team: - :param code: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def archive_activities(self, company, team, code): - """Archive specific oTask/Activity record within a team - - :param company: String - :param team: String - :param code: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def unarchive_activities(self, company, team, code): - """Unarchive specific oTask/Activity record within a team - - :param company: String - :param team: String - :param code: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def update_batch(self, company, params): - """Update a group of oTask/Activity records within a company - - Parameters: - :param company: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def __get_by_type(self, company, team, code=None): - url = "" - if code is not None: - url = "/" + code - - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/auth.py b/upwork/routers/auth.py deleted file mode 100644 index bb935fb..0000000 --- a/upwork/routers/auth.py +++ /dev/null @@ -1,25 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def get_user_info(self): - """Get info of authenticated user""" - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/freelancers/__init__.py b/upwork/routers/freelancers/__init__.py deleted file mode 100644 index fac6e3c..0000000 --- a/upwork/routers/freelancers/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -"""routers""" -from . import profile, search - -__all__ = ("profile", "search") diff --git a/upwork/routers/freelancers/profile.py b/upwork/routers/freelancers/profile.py deleted file mode 100644 index 4e7e4a2..0000000 --- a/upwork/routers/freelancers/profile.py +++ /dev/null @@ -1,37 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def get_specific(self, key): - """Get specific profile - - :param key: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_specific_brief(self, key): - """Get brief info on specific profile - - :param key: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/freelancers/search.py b/upwork/routers/freelancers/search.py deleted file mode 100644 index 07ce9c4..0000000 --- a/upwork/routers/freelancers/search.py +++ /dev/null @@ -1,31 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def find(self, params): - """Search profiles - - Parameters: - - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/graphql.py b/upwork/routers/graphql.py deleted file mode 100644 index c32bb2d..0000000 --- a/upwork/routers/graphql.py +++ /dev/null @@ -1,27 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2021(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - entry_point = "graphql" - - def __init__(self, client): - self.client = client - self.client.epoint = self.entry_point - - def execute(self, params): - """Execute GraphQL request""" - return self.client.post("", params) diff --git a/upwork/routers/hr/__init__.py b/upwork/routers/hr/__init__.py deleted file mode 100644 index c7d6193..0000000 --- a/upwork/routers/hr/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -"""routers""" -from . import clients, contracts, engagements, freelancers -from . import interviews, jobs, milestones, roles, submissions - -__all__ = ( - "clients", - "contracts", - "engagements", - "freelancers", - "interviews", - "jobs", - "milestones", - "roles", - "submissions" -) diff --git a/upwork/routers/hr/clients/__init__.py b/upwork/routers/hr/clients/__init__.py deleted file mode 100644 index 5631897..0000000 --- a/upwork/routers/hr/clients/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -"""routers""" -from . import applications, offers - -__all__ = ("applications", "offers") diff --git a/upwork/routers/hr/clients/applications.py b/upwork/routers/hr/clients/applications.py deleted file mode 100644 index 0cf05fb..0000000 --- a/upwork/routers/hr/clients/applications.py +++ /dev/null @@ -1,42 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def get_list(self, params): - """Get list of applications - - Parameters: - - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_specific(self, reference, params): - """Get specific application - - Parameters: - - :param reference: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/hr/clients/offers.py b/upwork/routers/hr/clients/offers.py deleted file mode 100644 index f7f18df..0000000 --- a/upwork/routers/hr/clients/offers.py +++ /dev/null @@ -1,52 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def get_list(self, params): - """Get list of offers - - Parameters: - - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_specific(self, reference, params): - """Get specific offer - - Parameters: - - :param reference: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def make_offer(self, params): - """Make an Offer - - Parameters: - - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/hr/contracts.py b/upwork/routers/hr/contracts.py deleted file mode 100644 index bc11256..0000000 --- a/upwork/routers/hr/contracts.py +++ /dev/null @@ -1,54 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def suspend_contract(self, reference, params): - """Suspend Contract - - Parameters: - - :param reference: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def restart_contract(self, reference, params): - """Restart Contract - - Parameters: - - :param reference: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def end_contract(self, reference, params): - """End Contract - - Parameters: - - :param reference: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/hr/engagements.py b/upwork/routers/hr/engagements.py deleted file mode 100644 index c067a81..0000000 --- a/upwork/routers/hr/engagements.py +++ /dev/null @@ -1,39 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def get_list(self, params): - """Get list of engagements - - Parameters: - - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_specific(self, reference): - """Get specific engagement - - :param reference: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/hr/freelancers/__init__.py b/upwork/routers/hr/freelancers/__init__.py deleted file mode 100644 index 5631897..0000000 --- a/upwork/routers/hr/freelancers/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -"""routers""" -from . import applications, offers - -__all__ = ("applications", "offers") diff --git a/upwork/routers/hr/freelancers/applications.py b/upwork/routers/hr/freelancers/applications.py deleted file mode 100644 index e4aef19..0000000 --- a/upwork/routers/hr/freelancers/applications.py +++ /dev/null @@ -1,39 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def get_list(self, params={}): - """Get list of applications - - Parameters: - - :param params: (Default value = {}) - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_specific(self, reference): - """Get specific application - - :param reference: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/hr/freelancers/offers.py b/upwork/routers/hr/freelancers/offers.py deleted file mode 100644 index 16cae81..0000000 --- a/upwork/routers/hr/freelancers/offers.py +++ /dev/null @@ -1,50 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def get_list(self, params={}): - """Get list of offers - - Parameters: - - :param params: (Default value = {}) - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_specific(self, reference): - """Get specific offer - - :param reference: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def actions(self, reference, params): - """Make an Offer - - Parameters: - - :param reference: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/hr/interviews.py b/upwork/routers/hr/interviews.py deleted file mode 100644 index 003379b..0000000 --- a/upwork/routers/hr/interviews.py +++ /dev/null @@ -1,32 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def invite(self, job_key, params): - """Invite to Interview - - Parameters: - - :param job_key: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/hr/jobs.py b/upwork/routers/hr/jobs.py deleted file mode 100644 index 32a600f..0000000 --- a/upwork/routers/hr/jobs.py +++ /dev/null @@ -1,71 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def get_list(self, params): - """Get list of jobs - - Parameters: - - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_specific(self, key): - """Get specific job by key - - :param key: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def post_job(self, params): - """Post a new job - - Parameters: - - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def edit_job(self, key, params): - """Edit existent job - - Parameters: - - :param key: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def delete_job(self, key, params): - """Delete existent job - - Parameters: - - :param key: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/hr/milestones.py b/upwork/routers/hr/milestones.py deleted file mode 100644 index 35f173c..0000000 --- a/upwork/routers/hr/milestones.py +++ /dev/null @@ -1,88 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def get_active_milestone(self, contract_id): - """Get active Milestone for specific Contract - - :param contract_id: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_submissions(self, milestone_id): - """Get active Milestone for specific Contract - - :param milestone_id: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def create(self, params): - """Create a new Milestone - - Parameters: - - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def edit(self, milestone_id, params): - """Edit an existing Milestone - - Parameters: - - :param milestone_id: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def activate(self, milestone_id, params): - """Activate an existing Milestone - - Parameters: - - :param milestone_id: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def approve(self, milestone_id, params): - """Approve an existing Milestone - - Parameters: - - :param milestone_id: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def delete(self, milestone_id): - """Delete an existing Milestone - - :param milestone_id: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/hr/roles.py b/upwork/routers/hr/roles.py deleted file mode 100644 index 44a6a56..0000000 --- a/upwork/routers/hr/roles.py +++ /dev/null @@ -1,34 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def get_all(self): - """Get user roles""" - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_by_specific_user(self, user_reference): - """Get by specific user - - :param reference: String - :param user_reference: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/hr/submissions.py b/upwork/routers/hr/submissions.py deleted file mode 100644 index cedb4f3..0000000 --- a/upwork/routers/hr/submissions.py +++ /dev/null @@ -1,53 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def request_approval(self, params): - """Freelancer submits work for the client to approve - - Parameters: - - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def approve(self, submission_id, params): - """Approve an existing Submission - - Parameters: - - :param submission_id: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def reject(self, submission_id, params): - """Reject an existing Submission - - Parameters: - - :param submission_id: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/jobs/__init__.py b/upwork/routers/jobs/__init__.py deleted file mode 100644 index fac6e3c..0000000 --- a/upwork/routers/jobs/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -"""routers""" -from . import profile, search - -__all__ = ("profile", "search") diff --git a/upwork/routers/jobs/profile.py b/upwork/routers/jobs/profile.py deleted file mode 100644 index 982e02b..0000000 --- a/upwork/routers/jobs/profile.py +++ /dev/null @@ -1,29 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def get_specific(self, key): - """Get specific profile - - :param key: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/jobs/search.py b/upwork/routers/jobs/search.py deleted file mode 100644 index 07ce9c4..0000000 --- a/upwork/routers/jobs/search.py +++ /dev/null @@ -1,31 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def find(self, params): - """Search profiles - - Parameters: - - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/messages.py b/upwork/routers/messages.py deleted file mode 100644 index 083ef5d..0000000 --- a/upwork/routers/messages.py +++ /dev/null @@ -1,140 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def get_rooms(self, company, params={}): - """Retrieve rooms information - - Parameters: - :param company: - :param params: (Default value = {}) - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_room_details(self, company, room_id, params={}): - """Get a specific room information - - Parameters: - :param company: - :param room_id: - :param params: (Default value = {}) - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_room_messages(self, company, room_id, params={}): - """Get messages from a specific room - - Parameters: - :param company: - :param room_id: - :param params: (Default value = {}) - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_room_by_offer(self, company, offer_id, params={}): - """Get a specific room by offer ID - - Parameters: - :param company: - :param offer_id: - :param params: (Default value = {}) - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_room_by_application(self, company, application_id, params={}): - """Get a specific room by application ID - - Parameters: - :param company: - :param application_id: - :param params: (Default value = {}) - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_room_by_contract(self, company, contract_id, params={}): - """Get a specific room by contract ID - - Parameters: - :param company: - :param contract_id: - :param params: (Default value = {}) - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def create_room(self, company, params={}): - """Create a new room - - Parameters: - :param company: - :param params: (Default value = {}) - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def send_message_to_room(self, company, room_id, params={}): - """Send a message to a room - - Parameters: - :param company: - :param room_id: - :param params: (Default value = {}) - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def send_message_to_rooms(self, company, params={}): - """Send a message to a batch of rooms - - Parameters: - :param company: - :param params: (Default value = {}) - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def update_room_settings(self, company, room_id, username, params={}): - """Update a room settings - - Parameters: - :param company: - :param room_id: - :param username: - :param params: (Default value = {}) - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def update_room_metadata(self, company, room_id, params={}): - """Update the metadata of a room - - Parameters: - :param company: - :param room_id: - :param params: (Default value = {}) - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/metadata.py b/upwork/routers/metadata.py deleted file mode 100644 index 56fb2eb..0000000 --- a/upwork/routers/metadata.py +++ /dev/null @@ -1,57 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def get_categories_v2(self): - """Get categories (V2)""" - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_skills(self): - """Get skills""" - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_skills_v2(self, params): - """Get skills (V2) - - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_specialties(self): - """Get specialties""" - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_regions(self): - """Get regions""" - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_tests(self): - """Get tests""" - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_reasons(self, params): - """Get reasons - - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/organization/__init__.py b/upwork/routers/organization/__init__.py deleted file mode 100644 index 7afe2c1..0000000 --- a/upwork/routers/organization/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -"""routers""" -from . import companies, teams, users - -__all__ = ("companies", "teams", "users") diff --git a/upwork/routers/organization/companies.py b/upwork/routers/organization/companies.py deleted file mode 100644 index 6f4d07e..0000000 --- a/upwork/routers/organization/companies.py +++ /dev/null @@ -1,49 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def get_list(self): - """Get Companies Info""" - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_specific(self, company_reference): - """Get Specific Company - - :param company_reference: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_teams(self, company_reference): - """Get Teams in Company - - :param company_reference: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_users(self, company_reference): - """Get Users in Company - - :param company_reference: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/organization/teams.py b/upwork/routers/organization/teams.py deleted file mode 100644 index ebd5aa1..0000000 --- a/upwork/routers/organization/teams.py +++ /dev/null @@ -1,33 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def get_list(self): - """Get Teams""" - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_users_in_team(self, team_reference): - """Get Users in Team - - :param team_reference: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/organization/users.py b/upwork/routers/organization/users.py deleted file mode 100644 index 71abb69..0000000 --- a/upwork/routers/organization/users.py +++ /dev/null @@ -1,33 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def get_my_info(self): - """Get Auth user info""" - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_specific(self, user_reference): - """Get Specific User Info - - :param user_reference: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/payments.py b/upwork/routers/payments.py deleted file mode 100644 index 0980d1d..0000000 --- a/upwork/routers/payments.py +++ /dev/null @@ -1,30 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def submit_bonus(self, team_reference, params): - """Submit bonus - - :param team_reference: String - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/reports/__init__.py b/upwork/routers/reports/__init__.py deleted file mode 100644 index ea001d6..0000000 --- a/upwork/routers/reports/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -"""routers""" -from . import finance, time - -__all__ = ("finance", "time") diff --git a/upwork/routers/reports/finance/__init__.py b/upwork/routers/reports/finance/__init__.py deleted file mode 100644 index b3bcc21..0000000 --- a/upwork/routers/reports/finance/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -"""routers""" -from . import accounts, billings, earnings - -__all__ = ("accounts", "billings", "earnings") diff --git a/upwork/routers/reports/finance/accounts.py b/upwork/routers/reports/finance/accounts.py deleted file mode 100644 index a6eb485..0000000 --- a/upwork/routers/reports/finance/accounts.py +++ /dev/null @@ -1,45 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Gds: - """ """ - - client = None - entry_point = "gds" - - def __init__(self, client): - self.client = client - self.client.epoint = self.entry_point - - def get_owned(self, freelancer_reference, params): - """Generate Financial Reports for an owned Account - - Arguments: - - :param freelancer_reference: param params: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_specific(self, entity_reference, params): - """Generate Financial Reports for a Specific Account - - Arguments: - - :param entity_reference: param params: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/reports/finance/billings.py b/upwork/routers/reports/finance/billings.py deleted file mode 100644 index 5b833b8..0000000 --- a/upwork/routers/reports/finance/billings.py +++ /dev/null @@ -1,78 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Gds: - """ """ - - client = None - entry_point = "gds" - - def __init__(self, client): - self.client = client - self.client.epoint = self.entry_point - - def get_by_freelancer(self, freelancer_reference, params): - """Generate Billing Reports for a Specific Freelancer - - Parameters: - - :param freelancer_reference: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_by_freelancers_team(self, freelancer_team_reference, params): - """Generate Billing Reports for a Specific Freelancer's Team - - Parameters: - - :param freelancer_team_reference: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_by_freelancers_company(self, freelancer_company_reference, params): - """Generate Billing Reports for a Specific Freelancer's Company - - Parameters: - - :param freelancer_company_reference: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_by_buyers_team(self, buyer_team_reference, params): - """Generate Billing Reports for a Specific Buyer's Team - - Parameters: - - :param buyer_team_reference: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_by_buyers_company(self, buyer_company_reference, params): - """Generate Billing Reports for a Specific Buyer's Company - - Parameters: - - :param buyer_company_reference: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/reports/finance/earnings.py b/upwork/routers/reports/finance/earnings.py deleted file mode 100644 index 219c1a8..0000000 --- a/upwork/routers/reports/finance/earnings.py +++ /dev/null @@ -1,78 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Gds: - """ """ - - client = None - entry_point = "gds" - - def __init__(self, client): - self.client = client - self.client.epoint = self.entry_point - - def get_by_freelancer(self, freelancer_reference, params): - """Generate Earning Reports for a Specific Freelancer - - Parameters: - - :param freelancer_reference: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_by_freelancers_team(self, freelancer_team_reference, params): - """Generate Earning Reports for a Specific Freelancer's Team - - Parameters: - - :param freelancer_team_reference: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_by_freelancers_company(self, freelancer_company_reference, params): - """Generate Earning Reports for a Specific Freelancer's Company - - Parameters: - - :param freelancer_company_reference: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_by_buyers_team(self, buyer_team_reference, params): - """Generate Earning Reports for a Specific Buyer's Team - - Parameters: - - :param buyer_team_reference: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_by_buyers_company(self, buyer_company_reference, params): - """Generate Earning Reports for a Specific Buyer's Company - - Parameters: - - :param buyer_company_reference: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/reports/time.py b/upwork/routers/reports/time.py deleted file mode 100644 index 01897dc..0000000 --- a/upwork/routers/reports/time.py +++ /dev/null @@ -1,103 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Gds: - """ """ - - client = None - entry_point = "gds" - - def __init__(self, client): - self.client = client - self.client.epoint = self.entry_point - - def get_by_team_full(self, company, team, params): - """Generate Time Reports for a Specific Team (with financial info) - - Parameters: - - :param company: - :param team: - :param params: - - """ - return self.__get_by_type(company, team, None, params, False) - - def get_by_team_limited(self, company, team, params): - """Generate Time Reports for a Specific Team (hide financial info) - - Parameters: - - :param company: - :param team: - :param params: - - """ - return self.__get_by_type(company, team, None, params, True) - - def get_by_agency(self, company, agency, params): - """Generating Agency Specific Reports - - Parameters: - - :param company: - :param agency: - :param params: - - """ - return self.__get_by_type(company, None, agency, params, False) - - def get_by_company(self, company, params): - """Generating Company Wide Reports - - Parameters: - - :param company: - :param params: - - """ - return self.__get_by_type(company, None, None, params, False) - - def get_by_freelancer_limited(self, freelancer_id, params): - """Generating Freelancer's Specific Reports (hide financial info) - - Parameters: - - :param freelancer_id: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_by_freelancer_full(self, freelancer_id, params): - """Generating Freelancer's Specific Reports (with financial info) - - Parameters: - - :param freelancer_id: - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def __get_by_type(self, company, team, agency, params, hide_fin_data): - url = "" - if team is not None: - url = "/teams/{0}".format(team) - if hide_fin_data: - url = url + "/hours" - elif agency is not None: - url = "/agencies/{0}".format(agency) - - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/snapshots.py b/upwork/routers/snapshots.py deleted file mode 100644 index 6126c6d..0000000 --- a/upwork/routers/snapshots.py +++ /dev/null @@ -1,50 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def get_by_contract(self, contract, ts): - """Get snapshot info by specific contract - - :param contract: String - :param ts: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def update_by_contract(self, contract, ts, params): - """Update snapshot by specific contract - - Parameters: - :param contract: String - :param ts: String - :param params: - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def delete_by_contract(self, contract, ts): - """Delete snapshot by specific contract - - :param contract: String - :param ts: String - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/workdays.py b/upwork/routers/workdays.py deleted file mode 100644 index a9bd0e4..0000000 --- a/upwork/routers/workdays.py +++ /dev/null @@ -1,45 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def get_by_company(self, company, from_date, till_date, params={}): - """Get Workdays by Company - - Parameters: - :param company: - :param from_date: - :param till_date: - :param params: (Default value = {}) - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_by_contract(self, contract, from_date, till_date, params={}): - """Get Workdays by Contract - - Parameters: - :param contract: - :param from_date: - :param till_date: - :param params: (Default value = {}) - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/routers/workdiary.py b/upwork/routers/workdiary.py deleted file mode 100644 index bf4474a..0000000 --- a/upwork/routers/workdiary.py +++ /dev/null @@ -1,43 +0,0 @@ -# Licensed under the Upwork's API Terms of Use; -# you may not use this file except in compliance with the Terms. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) -# Copyright:: Copyright 2020(c) Upwork.com -# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html - - -class Api: - """ """ - - client = None - - def __init__(self, client): - self.client = client - - def get_workdiary(self, company, date, params={}): - """Get Workdiary by Company - - Parameters: - :param company: - :param date: - :param params: (Default value = {}) - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") - - def get_by_contract(self, contract, date, params={}): - """Get Work Diary by Contract - - Parameters: - :param contract: - :param date: - :param params: (Default value = {}) - - """ - raise Exception("The legacy API was deprecated. Please, use GraphQL call - see example in this library.") diff --git a/upwork/upwork.py b/upwork/upwork.py deleted file mode 100644 index 0afc9fa..0000000 --- a/upwork/upwork.py +++ /dev/null @@ -1,5 +0,0 @@ -"""Main module.""" - -BASE_HOST = "https://www.upwork.com" -GQL_EPOINT = "https://api.upwork.com/graphql" -DEFAULT_EPOINT = "api"