From 1656a31f312d6ad07ddcc8db41e4ab406d86960b Mon Sep 17 00:00:00 2001 From: pnadolny13 Date: Fri, 8 Sep 2023 14:01:22 -0400 Subject: [PATCH] implement sdk via migration from other repo --- .circleci/config.yml | 22 - .env.template | 7 + .gitattributes | 2 + .github/dependabot.yml | 26 + .github/workflows/ci_workflow.yml | 57 + .github/workflows/constraints.txt | 5 + .github/workflows/project_add.yml | 25 - .github/workflows/release.yaml | 51 + .gitignore | 69 +- .pre-commit-config.yaml | 32 + .secrets/.gitignore | 10 + Blacklisting.md | 119 - CHANGELOG.md | 149 - LICENSE | 659 +- README.md | 187 +- meltano.yml | 35 + mypy.ini | 6 + output/.gitignore | 4 + poetry.lock | 1372 ++++ pyproject.toml | 58 + setup.py | 33 - tap_salesforce/__init__.py | 558 +- tap_salesforce/__main__.py | 4 - tap_salesforce/client.py | 94 + tap_salesforce/salesforce/__init__.py | 389 -- tap_salesforce/salesforce/bulk.py | 338 - tap_salesforce/salesforce/credentials.py | 120 - tap_salesforce/salesforce/exceptions.py | 8 - tap_salesforce/salesforce/rest.py | 105 - tap_salesforce/streams.py | 8034 ++++++++++++++++++++++ tap_salesforce/sync.py | 197 - tap_salesforce/tap.py | 167 + tests/__init__.py | 1 + tests/conftest.py | 3 + tests/test_core.py | 24 + tox.ini | 53 + 36 files changed, 10291 insertions(+), 2732 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .env.template create mode 100644 .gitattributes create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci_workflow.yml create mode 100644 .github/workflows/constraints.txt delete mode 100644 .github/workflows/project_add.yml create mode 100644 .github/workflows/release.yaml create mode 100644 .pre-commit-config.yaml create mode 100644 .secrets/.gitignore delete mode 100644 Blacklisting.md delete mode 100644 CHANGELOG.md create mode 100644 meltano.yml create mode 100644 mypy.ini create mode 100644 output/.gitignore create mode 100644 poetry.lock create mode 100644 pyproject.toml delete mode 100644 setup.py delete mode 100644 tap_salesforce/__main__.py create mode 100644 tap_salesforce/client.py delete mode 100644 tap_salesforce/salesforce/__init__.py delete mode 100644 tap_salesforce/salesforce/bulk.py delete mode 100644 tap_salesforce/salesforce/credentials.py delete mode 100644 tap_salesforce/salesforce/exceptions.py delete mode 100644 tap_salesforce/salesforce/rest.py create mode 100644 tap_salesforce/streams.py delete mode 100644 tap_salesforce/sync.py create mode 100644 tap_salesforce/tap.py create mode 100644 tests/__init__.py create mode 100644 tests/conftest.py create mode 100644 tests/test_core.py create mode 100644 tox.ini diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index df0bc42..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: 2 -jobs: - build: - docker: - - image: 218546966473.dkr.ecr.us-east-1.amazonaws.com/circle-ci:tap-tester - steps: - - checkout - - run: - name: 'Setup virtual env' - command: | - virtualenv -p python3 /usr/local/share/virtualenvs/tap-salesforce - source /usr/local/share/virtualenvs/tap-salesforce/bin/activate - pip install . - pip install pylint - pylint tap_salesforce -d missing-docstring,invalid-name,line-too-long,too-many-locals,too-few-public-methods,fixme,stop-iteration-return,no-else-return,chained-comparison,broad-except,no-else-raise - - run: - name: 'Unit Tests' - command: | - source /usr/local/share/virtualenvs/tap-salesforce/bin/activate - pip install nose - nosetests - - add_ssh_keys diff --git a/.env.template b/.env.template new file mode 100644 index 0000000..47d1440 --- /dev/null +++ b/.env.template @@ -0,0 +1,7 @@ +TAP_SALESFORCE_CLIENT_ID = '' +TAP_SALESFORCE_CLIENT_SECRET = '' +TAP_SALESFORCE_USERNAME = '' +TAP_SALESFORCE_PASSWORD = '' +TAP_SALESFORCE_DOMAIN = '' +TAP_SALESFORCE_ACCESS_TOKEN = '' + diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..933e6b1 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,26 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: pip + directory: "/" + schedule: + interval: "daily" + commit-message: + prefix: "chore(deps): " + prefix-development: "chore(deps-dev): " + - package-ecosystem: pip + directory: "/.github/workflows" + schedule: + interval: daily + commit-message: + prefix: "ci: " + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: "ci: " diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml new file mode 100644 index 0000000..d3b214f --- /dev/null +++ b/.github/workflows/ci_workflow.yml @@ -0,0 +1,57 @@ +### A CI workflow template that runs linting and python testing + +name: Test tap-salesforce + +on: [push] + +jobs: + linting: + runs-on: ubuntu-latest + strategy: + matrix: + # Only lint using the primary version used for dev + python-version: ["3.9"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install pipx and Poetry + run: | + pip install pipx poetry + - name: Run lint command from tox.ini + run: | + pipx run tox -e lint + + pytest: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + strategy: + matrix: + python-version: ["3.9"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install Poetry + run: | + pip install poetry + - name: Install dependencies + run: | + poetry install + - name: Test with pytest + id: test_pytest + continue-on-error: false + env: + TAP_SALESFORCE_CLIENT_ID: ${{ secrets.client_id }} + TAP_SALESFORCE_CLIENT_SECRET: ${{ secrets.client_secret }} + TAP_SALESFORCE_AUTH_USERNAME: ${{ secrets.username }} + TAP_SALESFORCE_AUTH_PASSWORD: ${{ secrets.password }} + TAP_SALESFORCE_AUTH_FLOW: ${{ secrets.domain }} + TAP_SALESFORCE_DOMAIN: ${{ secrets.domain }} + run: | + poetry run pytest --capture=no diff --git a/.github/workflows/constraints.txt b/.github/workflows/constraints.txt new file mode 100644 index 0000000..3f6e297 --- /dev/null +++ b/.github/workflows/constraints.txt @@ -0,0 +1,5 @@ +nox==2023.4.22 +nox-poetry==1.0.3 +pip==23.2.1 +poetry==1.6.1 +poetry-dynamic-versioning==1.0.1 diff --git a/.github/workflows/project_add.yml b/.github/workflows/project_add.yml deleted file mode 100644 index 5f9276b..0000000 --- a/.github/workflows/project_add.yml +++ /dev/null @@ -1,25 +0,0 @@ -# Managed by Pulumi. Any edits to this file will be overwritten. - -name: Add issues and PRs to MeltanoLabs Overview Project - -on: - issues: - types: - - opened - - reopened - - transferred - pull_request: - types: - - opened - - reopened - -jobs: - add-to-project: - name: Add issue to project - runs-on: ubuntu-latest - if: ${{ github.actor != 'dependabot[bot]' }} - steps: - - uses: actions/add-to-project@v0.5.0 - with: - project-url: https://github.com/orgs/MeltanoLabs/projects/3 - github-token: ${{ secrets.MELTYBOT_PROJECT_ADD_PAT }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..c4c4ff0 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,51 @@ +name: Publish with Dynamic Versioning + +on: + release: + types: [published] + +permissions: + contents: write + id-token: write + +jobs: + publish: + name: Publish to PyPI + runs-on: ubuntu-latest + environment: publishing + env: + PIP_CONSTRAINT: .github/workflows/constraints.txt + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v4.6.0 + with: + python-version: "3.10" + + - name: Upgrade pip + run: | + pip install pip + pip --version + - name: Install Poetry + run: | + pipx install poetry + pipx inject poetry poetry-dynamic-versioning[plugin] + poetry --version + poetry self show plugins + - name: Build + run: poetry build + + - name: Upload wheel to release + uses: svenstaro/upload-release-action@v2 + with: + file: dist/*.whl + tag: ${{ github.ref }} + overwrite: true + file_glob: true + + - name: Publish + uses: pypa/gh-action-pypi-publish@v1.8.10 diff --git a/.gitignore b/.gitignore index 4ca50f7..5fb0959 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,10 @@ +# Secrets and internal config files +**/.secrets/* + +# Ignore meltano internal cache and sqlite systemdb + +.meltano/ + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] @@ -8,7 +15,6 @@ __pycache__/ # Distribution / packaging .Python -env/ build/ develop-eggs/ dist/ @@ -20,9 +26,14 @@ lib64/ parts/ sdist/ var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ *.egg-info/ .installed.cfg *.egg +MANIFEST +.idea # PyInstaller # Usually these files are written by a python script from a template @@ -37,13 +48,16 @@ pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ +.nox/ .coverage .coverage.* .cache nosetests.xml coverage.xml -*,cover +*.cover +*.py,cover .hypothesis/ +.pytest_cache/ # Translations *.mo @@ -52,6 +66,8 @@ coverage.xml # Django stuff: *.log local_settings.py +db.sqlite3 +db.sqlite3-journal # Flask stuff: instance/ @@ -66,36 +82,57 @@ docs/_build/ # PyBuilder target/ -# IPython Notebook +# Jupyter Notebook .ipynb_checkpoints +# IPython +profile_default/ +ipython_config.py + # pyenv .python-version -# celery beat schedule file +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff celerybeat-schedule +celerybeat.pid -# dotenv -.env +# SageMath parsed files +*.sage.py -# virtualenv -.venv/ +# Environments +.env +.venv +env/ venv/ ENV/ +env.bak/ +venv.bak/ # Spyder project settings .spyderproject +.spyproject # Rope project settings .ropeproject -# Mac -._* -.DS_Store +# mkdocs documentation +/site -# Custom stuff -env.sh -config.json -.autoenv.zsh +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json -*~ \ No newline at end of file +# Pyre type checker +.pyre/ +.DS_Store diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..0cf423a --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,32 @@ +ci: + autofix_prs: true + autoupdate_schedule: weekly + autoupdate_commit_msg: 'chore: pre-commit autoupdate' + +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-json + - id: check-toml + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + +- repo: https://github.com/charliermarsh/ruff-pre-commit + rev: v0.0.263 + hooks: + - id: ruff + args: [--fix, --exit-non-zero-on-fix] + +- repo: https://github.com/psf/black + rev: 23.3.0 + hooks: + - id: black + +- repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.2.0 + hooks: + - id: mypy + additional_dependencies: + - types-requests diff --git a/.secrets/.gitignore b/.secrets/.gitignore new file mode 100644 index 0000000..33c6acd --- /dev/null +++ b/.secrets/.gitignore @@ -0,0 +1,10 @@ +# IMPORTANT! This folder is hidden from git - if you need to store config files or other secrets, +# make sure those are never staged for commit into your git repo. You can store them here or another +# secure location. +# +# Note: This may be redundant with the global .gitignore for, and is provided +# for redundancy. If the `.secrets` folder is not needed, you may delete it +# from the project. + +* +!.gitignore diff --git a/Blacklisting.md b/Blacklisting.md deleted file mode 100644 index c6b54fd..0000000 --- a/Blacklisting.md +++ /dev/null @@ -1,119 +0,0 @@ -# Blacklisted Objects Explanation - -Some objects or fields may not be queryable for a variety of reasons, and these reasons are not always apparent. This document exists to provide some visibility to the research that prompted these fields and objects to be excluded from the tap's discovery or sync mode. - -- [Overall](#overall) -- [Bulk API](#bulk-api) -- [Location in Code](#location-in-code) - -* The Rest API has no unique restrictions - -Each section has two parts. -1. A short explanation of what the category means. -2. Example(s) of messages returned by Salesforce when these situations are encountered. - -## Overall - -These restrictions apply to both the Bulk and REST API endpoints. - -### Blacklisted Fields - -#### attributes -This field is returned in JSON responses from Salesforce, but is not included in the `describe` endpoint's view of objects and their fields, so it will be removed from `RECORD`s before emitting. - -### Query Restricted Objects - -These are objects which the Salesforce API endpoint has reported a specific way of querying that requires a special `WHERE` clause, which may be incompatible for replication. - -#### Types of Salesforce Errors associated with this category: - -``` -MALFORMED_QUERY: ________: a filter on a reified column is required [UserId,DurableId] -``` - -``` -MALFORMED_QUERY: Implementation restriction: ________ requires a filter by a single Id, ChildRecordId or ParentContentFolderId using the equals operator -``` - -``` -Implementation restriction: When querying the Vote object, you must filter using the following syntax: ParentId = [single ID], Parent.Type = [single Type], Id = [single ID], or Id IN [list of ID\'s]. -``` - -``` -EXTERNAL_OBJECT_UNSUPPORTED_EXCEPTION: Where clauses should contain ________ -``` - -### Query Incompatible Objects - -These are objects which the Salesforce API endpoint has reported issues with the `queryAll` method, or the concept of *query* in general. - -#### Types of Salesforce Errors associated with this category: - -``` -INVALID_TYPE_FOR_OPERATION: entity type ________ does not support query -``` - -``` -EXTERNAL_OBJECT_UNSUPPORTED_EXCEPTION: This query is not supported on the OutgoingEmail object. (OutgoingEmailRelation) -``` - -``` -EXTERNAL_OBJECT_UNSUPPORTED_EXCEPTION: Getting all ________ is unsupported -``` - -### Datacloud Objects -Some objects associated with Data.com (e.g., DatacloudAddress, DatacloudContact, DatacloudPurchaseUsage) are returned from the Salesforce API's `describe` endpoint. These objects may throw errors on request, depending on the licensing and permissions of the account being used. Because of this, the tap will emit `SCHEMA` records for them, but they may not be queryable. - -#### Types of Salesforce Errors associated with this category: -The error messages for this type, when failed, are not very descriptive. - -``` -An unexpected error occurred. Please include this ErrorId if you contact support: ##########-##### (##########) -``` - -## Bulk API - -### Unsupported Fields - -This refers to fields that are unsupported by the Bulk API for any reason, such as not being CSV serializable (which is required to process records in a streaming manner). - -#### Types of Salesforce Errors associated with this category: - -``` -FeatureNotEnabled : Cannot serialize value for '________' in CSV format -``` - -### Unsupported Objects - -These objects are explicitly not supported by the Salesforce Bulk API, as reported by the API itself. - -#### Types of Salesforce Errors associated with this category: - -``` -Entity '________' is not supported by the Bulk API. -``` - -## Tags Referencing Custom Settings ## - -During testing, it was discovered that `__Tag` objects associated with Custom Settings objects are reported as being not supported by the Bulk API. Because of this, affected `__Tag` objects will be removed from those found in discovery mode before emitting `SCHEMA` records. - -In practice, this refers to `__Tag` objects that are described by Salesforce with an `Item` relationship field that has a `referenceTo` property for another object that is marked as `customSetting: true`. - -#### Types of Salesforce Errors associated with this category: - -``` -Entity '01AA00000010AAA.Tag' is not supported by the Bulk API. -``` -* When querying a `__Tag` field. - -## Location in Code - -### Discovery -The `do_discover()` method of `tap_salesforce/__init__.py` calls `get_blacklisted_objects` from `tap_salesforce/salesforce/__init__.py` to retrieve the list of unsupported objects for the current API endpoint and either skip or remove fields from discovered schemas according to the rules above as it iterates over the objects returned by Salesforce's `describe` endpoint. - -### Sync -Since the `attributes` field is returned during sync mode, it will get filtered out during the transform step in the `do_sync()` method of `tap_salesforce/__init__.py` via the `pre_hook` passed to the `Transformer` object. - ---- - -Copyright © 2017 Stitch diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 4ff5eff..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,149 +0,0 @@ -# Changelog - -## meltano.1.5.0 - - * [#14](https://gitlab.com/meltano/tap-salesforce/-/issues/14) Apply schema filtering per property selection rules. - -## meltano.1.4.27 - - * [#11](https://gitlab.com/meltano/tap-salesforce/-/issues/11) Don't run indefinitely when using OAuth and job runs for more than 15 minutes - -## meltano.1.4.26 - - * [#11](https://gitlab.com/meltano/tap-salesforce/-/issues/11) Don't run indefinitely when using OAuth - -## meltano.1.4.25 - - * [#10](https://gitlab.com/meltano/tap-salesforce/-/issues/10) Fix broken `is_sandbox` setting - -## 1.4.24 - * Mark json fields as `unsupported` instead of throwing exception. If, in the future, we find streams with json fields that have records, we can consider supporting the json field type. [commit](https://github.com/singer-io/tap-salesforce/commit/85e3811b9cb5673e23cab8e7b011d2a3d3064d0f) - -## 1.4.23 - * Protect against empty strings for quota config fields [commit](https://github.com/singer-io/tap-salesforce/commit/1133726e20af434d82af8761ba3ad006f49f0b42) - -## 1.4.22 - * Filter out *ChangeEvent tables from discovery as neither REST nor BULK can sync them [#62](https://github.com/singer-io/tap-salesforce/pull/62) - -## 1.4.21 - * Move the transformer outside of the record write-loop to quiet logging [#61](https://github.com/singer-io/tap-salesforce/pull/61) - -## 1.4.20 - * (Bulk Rest API) Sync the second half of the date range After a timeout occurs and the date window is halved [#60](https://github.com/singer-io/tap-salesforce/pull/60) - -## 1.4.19 - * (Bulk API) Removes failed jobs that don't exists in Salesforce from state when encountered [#57](https://github.com/singer-io/tap-salesforce/pull/57) - * (All APIs) Makes `BackgroundOperationResult` sync full table, since it cannot be sorted by `CreatedDate` [#58](https://github.com/singer-io/tap-salesforce/pull/58) - * Update version of `requests` to `2.20.0` in response to CVE 2018-18074 [#59](https://github.com/singer-io/tap-salesforce/pull/59) - -## 1.4.18 - * Increases the `field_size_limit` on the CSV reader to enable larger fields coming through without error [#53](https://github.com/singer-io/tap-salesforce/pull/53) - -## 1.4.17 - * Adds the suffix "FieldHistory" to those checked for when finding the parent object to fix the `OpportunityFieldHistory` stream [#52](https://github.com/singer-io/tap-salesforce/pull/52) - -## 1.4.16 - * Fixes a few bugs with PK chunking including allowing a custom table to be chunked by its parent table [#51](https://github.com/singer-io/tap-salesforce/pull/51) - -## 1.4.15 - * Added a correct else condition to fix an error being raised during the PK Chunking query [#50](https://github.com/singer-io/tap-salesforce/pull/50) - -## 1.4.14 - * Updated the usage of singer-python's Transformer to reduce its scope [#48](https://github.com/singer-io/tap-salesforce/pull/48) - -## 1.4.13 - * Updated the JSON schema generated for Salesforce Date types to use `anyOf` so when a bad date comes through we use the String instead [#47](https://github.com/singer-io/tap-salesforce/pull/47) - -## 1.4.12 - * Bug fix for metadata when resuming bulk sync jobs. - -## 1.4.11 - * Moved ContentFolderItem to query restricted objects list since the REST API requires specific IDs to query this object. - -## 1.4.10 - * Read replication-method, replication-key from metadata instead of Catalog. Publish key-properties as table-key-properties metadata instead of including on the Catalog. - -## 1.4.9 - * Fixes logging output when an HTTP error occurs - -## 1.4.8 - * Bumps singer-python dependency to help with formatting dates < 1000 - -## 1.4.7 - * Fixes a bug with datetime conversion during the generation of the SF query string [#40](https://github.com/singer-io/tap-salesforce/pull/40) - -## 1.4.6 - * Fixes more bugs with exception handling where the REST API was not capturing the correct error [#39](https://github.com/singer-io/tap-salesforce/pull/39) - -## 1.4.5 - * Fixes a schema issue with 'location' fields that come back as JSON objects [#36](https://github.com/singer-io/tap-salesforce/pull/36) - * Fixes a bug where a `"version"` in the state would not be preserved due to truthiness [#37](https://github.com/singer-io/tap-salesforce/pull/37) - * Fixes a bug in exception handling where rendering an exception as a string would cause an additional exception [#38](https://github.com/singer-io/tap-salesforce/pull/38) - -## 1.4.4 - * Fixes automatic property selection when select-fields-by-default is true [#35](https://github.com/singer-io/tap-salesforce/pull/35) - -## 1.4.3 - * Adds the `AttachedContentNote` and `QuoteTemplateRichTextData` objects to the list of query-incompatible Salesforce objects so they are excluded from discovery / catalogs [#34](https://github.com/singer-io/tap-salesforce/pull/34) - -## 1.4.2 - * Adds backoff for the `_make_request` function to prevent failures in certain cases [#33](https://github.com/singer-io/tap-salesforce/pull/33) - -## 1.4.1 - * Adds detection for certain SF Objects whose parents can be used as the parent during PK Chunking [#32](https://github.com/singer-io/tap-salesforce/pull/32) - -## 1.4.0 - * Fixes a logic bug in the build_state function - * Improves upon streaming bulk results by first writing the file to a tempfile and then consuming it [#31](https://github.com/singer-io/tap-salesforce/pull/31) - -## 1.3.9 - * Updates the retrieval of a bulk result set to be downloaded entirely instead of streaming [#30](https://github.com/singer-io/tap-salesforce/pull/30) - -## 1.3.8 - * Removes `multipleOf` JSON Schema parameters for latitude / longitude fields that are part of an Address object - -## 1.3.7 - * Adds a check to make sure the start_date has time information associated with it - * Adds more robust parsing for select_fields_by_default - -## 1.3.6 - * Fixes a bug with running the tap when provided a Catalog containing streams without a replication key [#27](https://github.com/singer-io/tap-salesforce/pull/27) - -## 1.3.5 - * Bumps the dependency singer-python's version to 5.0.4 - -## 1.3.4 - * Fixes a bug where bookmark state would not get set after resuming a PK Chunked Bulk Sync [#24](https://github.com/singer-io/tap-salesforce/pull/24) - -## 1.3.3 - * Adds additional logging and state management during a PK Chunked Bulk Sync - -## 1.3.2 - * Fixes a bad variable name - -## 1.3.1 - * Uses the correct datetime to string function for chunked bookmarks - -## 1.3.0 - * Adds a feature for resuming a PK-Chunked Bulk API job [#22](https://github.com/singer-io/tap-salesforce/pull/22) - * Fixes an issue where a Salesforce's field data containing NULL bytes would cause an error reading the CSV response [#21](https://github.com/singer-io/tap-salesforce/pull/21) - * Fixes an issue where the timed `login()` thread could die and never call a new login [#20](https://github.com/singer-io/tap-salesforce/pull/20) - -## 1.2.2 - * Fixes a bug with with yield records when the Bulk job is successful [#19](https://github.com/singer-io/tap-salesforce/pull/19) - -## 1.2.1 - * Fixes a bug with a missing pk_chunking attribute - -## 1.2.0 - * Adds support for Bulk API jobs which time out to be retried with Salesforce's PK Chunking feature enabled - -## 1.1.1 - * Allows compound fields to be supported with the exception of "address" types - * Adds additional unsupported Bulk API Objects - -## 1.1.0 - * Support for time_extracted property on Singer messages - -## 1.0.0 - * Initial release diff --git a/LICENSE b/LICENSE index 627c3e9..809108b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,620 +1,93 @@ - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 +Elastic License 2.0 - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. +URL: https://www.elastic.co/licensing/elastic-license - Preamble +## Acceptance - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. +By using the software, you agree to all of the terms and conditions below. - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. +## Copyright License - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. +The licensor grants you a non-exclusive, royalty-free, worldwide, +non-sublicensable, non-transferable license to use, copy, distribute, make +available, and prepare derivative works of the software, in each case subject to +the limitations and conditions below. - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. +## Limitations - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. +You may not provide the software to third parties as a hosted or managed +service, where the service provides users with access to any substantial set of +the features or functionality of the software. - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. +You may not move, change, disable, or circumvent the license key functionality +in the software, and you may not remove or obscure any functionality in the +software that is protected by the license key. - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. +You may not alter, remove, or obscure any licensing, copyright, or other notices +of the licensor in the software. Any use of the licensor’s trademarks is subject +to applicable law. - The precise terms and conditions for copying, distribution and -modification follow. +## Patents - TERMS AND CONDITIONS +The licensor grants you a license, under any patent claims the licensor can +license, or becomes able to license, to make, have made, use, sell, offer for +sale, import and have imported the software, in each case subject to the +limitations and conditions in this license. This license does not cover any +patent claims that you cause to be infringed by modifications or additions to +the software. If you or your company make any written claim that the software +infringes or contributes to infringement of any patent, your patent license for +the software granted under these terms ends immediately. If your company makes +such a claim, your patent license ends immediately for work on behalf of your +company. - 0. Definitions. +## Notices - "This License" refers to version 3 of the GNU Affero General Public License. +You must ensure that anyone who gets a copy of any part of the software from you +also gets a copy of these terms. - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. +If you modify the software, you must include in any modified copies of the +software prominent notices stating that you have modified the software. - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. +## No Other Rights - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. +These terms do not imply any licenses other than those expressly granted in +these terms. - A "covered work" means either the unmodified Program or a work based -on the Program. +## Termination - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. +If you use the software in violation of these terms, such use is not licensed, +and your licenses will automatically terminate. If the licensor provides you +with a notice of your violation, and you cease all violation of this license no +later than 30 days after you receive that notice, your licenses will be +reinstated retroactively. However, if you violate these terms after such +reinstatement, any additional violation of these terms will cause your licenses +to terminate automatically and permanently. - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. +## No Liability - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. +*As far as the law allows, the software comes as is, without any warranty or +condition, and the licensor will not be liable to you for any damages arising +out of these terms or the use or nature of the software, under any kind of +legal claim.* - 1. Source Code. +## Definitions - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. +The **licensor** is the entity offering these terms, and the **software** is the +software the licensor makes available under these terms, including any portion +of it. - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. +**you** refers to the individual or entity agreeing to these terms. - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. +**your company** is any legal entity, sole proprietorship, or other kind of +organization that you work for, plus all organizations that have control over, +are under the control of, or are under common control with that +organization. **control** means ownership of substantially all the assets of an +entity, or the power to direct its management and policies by vote, contract, or +otherwise. Control can be direct or indirect. - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. +**your licenses** are all the licenses granted to you for the software under +these terms. - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. +**use** means anything you do with the software requiring one of your licenses. - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - \ No newline at end of file +**trademark** means trademarks, service marks, and similar rights. diff --git a/README.md b/README.md index 5ab9361..c2904a7 100644 --- a/README.md +++ b/README.md @@ -1,96 +1,169 @@ # tap-salesforce -[![CircleCI Build Status](https://circleci.com/gh/singer-io/tap-salesforce.png)](https://circleci.com/gh/singer-io/tap-salesforce.png) +`tap-salesforce` is a Singer tap for tap-salesforce. +Built with the [Meltano Tap SDK](https://sdk.meltano.com) for Singer Taps. -[Singer](https://www.singer.io/) tap that extracts data from a [Salesforce](https://www.salesforce.com/) Account and produces JSON-formatted data following the [Singer spec](https://github.com/singer-io/getting-started/blob/master/SPEC.md). +## Capabilities -This is a forked version of [tap-salesforce (v1.4.24)](https://github.com/singer-io/tap-salesforce) that maintained by the Meltano team. +* `catalog` +* `state` +* `discover` +* `about` +* `stream-maps` +* `schema-flattening` -Main differences from the original version: +## Configuration -- Support for `username/password/security_token` authentication -- Support for concurrent execution (8 threads by default) when accessing different API endpoints to speed up the extraction process -- Support for much faster discovery +### Accepted Config Options -# Quickstart +| Setting | Required | Default | Description | +|:---------------------|:--------:|:-------:|:--------------------------------------------------------------------------------------------------------------------------------------------| +| client_id | True | None | Client id, used for getting access token if access token is not available | +| client_secret | True | None | Client secret, used for getting access token if access token is not available | +| start_date | False | None | Earliest record date to sync | +| end_date | False | None | Latest record date to sync | +| domain | True | None | Website domain for site url, ie., https://{domain}.salesforce.com/services/data/ | +| auth | True | None | Auth type for Salesforce API requires either access_token or username/password | +| bulk_load | True | False | Toggle for using BULK API method | | +| stream_maps | False | None | Config object for stream maps capability. For more information check out [Stream Maps](https://sdk.meltano.com/en/latest/stream_maps.html). +| stream_map_config | False | None | User-defined config values to be used within map expressions. | +| flattening_enabled | False | None | 'True' to enable schema flattening and automatically expand nested properties. | +| flattening_max_depth | False | None | The max depth to flatten schemas. | -## Install the tap +The auth setting works either with access token or username/password, set by the following configs: -This version of `tap-salesforce` is not available on PyPi, so you have to fetch it directly from the Meltano maintained project: +Auth with access token: +```bash +TAP_SALESFORCE_AUTH_FLOW = 'oauth' +TAP_SALESFORCE_AUTH_TOKEN = '' +``` +Auth with username/password: ```bash -python3 -m venv venv -source venv/bin/activate -pip install git+https://github.com/MeltanoLabs/tap-salesforce.git +TAP_SALESFORCE_AUTH_FLOW = 'password' +TAP_SALESFORCE_AUTH_USERNAME = '' +TAP_SALESFORCE_AUTH_PASSWORD = '' ``` -## Create a Config file +A full list of supported settings and capabilities for this tap is available by running: -**Required** +```bash +tap-salesforce --about ``` -{ - "api_type": "BULK", - "select_fields_by_default": true, -} + +## Elastic License 2.0 + +The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software. + +## Installation + +```bash +pipx install git+https://github.com/ryan-miranda-partners/tap-salesforce.git ``` -**Required for OAuth based authentication** +### Configure using environment variables + +This Singer tap will automatically import any environment variables within the working directory's +`.env` if the `--config=ENV` is provided, such that config values will be considered if a matching +environment variable is set either in the terminal context or in the `.env` file. + +### Source Authentication and Authorization + +A salesforce access token is required to make API requests. (See [salesforce API](https://developers.salesforce.com/docs/api/working-with-oauth) docs for more info) + +## Usage + +You can easily run `tap-salesforce` by itself or in a pipeline using [Meltano](https://meltano.com/). + +## Stream Inheritance + +This project uses parent-child streams. Learn more about them [here](https://gitlab.com/meltano/sdk/-/blob/main/docs/parent_streams.md). + +### Executing the Tap Directly + +```bash +tap-salesforce --version +tap-salesforce --help +tap-salesforce --config CONFIG --discover > ./catalog.json ``` -{ - "client_id": "secret_client_id", - "client_secret": "secret_client_secret", - "refresh_token": "abc123", -} + +## Developer Resources + +Follow these instructions to contribute to this project. + +### Initialize your Development Environment + +```bash +pipx install poetry +poetry install ``` -**Required for username/password based authentication** +### Create and Run Tests + +Create tests within the `tests` subfolder and + then run: + +```bash +poetry run pytest ``` -{ - "username": "Account Email", - "password": "Account Password", - "security_token": "Security Token", -} + +You can also test the `tap-salesforce` CLI interface directly using `poetry run`: + +```bash +poetry run tap-salesforce --help ``` -**Optional** +### Testing with [Meltano](https://www.meltano.com) + +_**Note:** This tap will work in any Singer environment and does not require Meltano. +Examples here are for convenience and to streamline end-to-end orchestration scenarios._ + +Your project comes with a custom `meltano.yml` project file already created. Open the `meltano.yml` and follow any "TODO" items listed in +the file. + +Next, install Meltano (if you haven't already) and any needed plugins: + +```bash +# Install meltano +pipx install meltano +# Initialize meltano within this directory +cd tap-salesforce +meltano install ``` -{ - "start_date": "2017-11-02T00:00:00Z", - "state_message_threshold": 1000, - "max_workers": 8, - "streams_to_discover": ["Lead", "LeadHistory"] -} + +Now you can test and orchestrate using Meltano: + +```bash +# Test invocation: +meltano invoke tap-salesforce --version +# OR run a test `elt` pipeline: +meltano elt tap-salesforce target-jsonl ``` -The `client_id` and `client_secret` keys are your OAuth Salesforce App secrets. The `refresh_token` is a secret created during the OAuth flow. For more info on the Salesforce OAuth flow, visit the [Salesforce documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_understanding_web_server_oauth_flow.htm). +### SDK Dev Guide -The `start_date` is used by the tap as a bound on SOQL queries when searching for records. This should be an [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) formatted date-time, like "2018-01-08T00:00:00Z". For more details, see the [Singer best practices for dates](https://github.com/singer-io/getting-started/blob/master/BEST_PRACTICES.md#dates). +See the [dev guide](https://sdk.meltano.com/en/latest/dev_guide.html) for more instructions on how to use the SDK to +develop your own taps and targets. -The `api_type` is used to switch the behavior of the tap between using Salesforce's "REST" and "BULK" APIs. When new fields are discovered in Salesforce objects, the `select_fields_by_default` key describes whether or not the tap will select those fields by default. +## BULK API vs REST API -The `state_message_threshold` is used to throttle how often STATE messages are generated when the tap is using the "REST" API. This is a balance between not slowing down execution due to too many STATE messages produced and how many records must be fetched again if a tap fails unexpectedly. Defaults to 1000 (generate a STATE message every 1000 records). +The `bulk_load` config toggles the use of the BULK API for pulling data. The REST and BULK APIs have a few key differences. -The `max_workers` value is used to set the maximum number of threads used in order to concurrently extract data for streams. Defaults to 8 (extract data for 8 streams in paralel). +### Data Volume and Batch Processing -The `streams_to_discover` value may contain a list of Salesforce streams (each ending up in a target table) for which the discovery is handled. -By default, discovery is handled for all existing streams, which can take several minutes. With just several entities which users typically need it is running few seconds. -The disadvantage is that you have to keep this list in sync with the `select` section, where you specify all properties(each ending up in a table column). +**Bulk API** : This API is designed for processing large volumes of data. The connector submits a batch of data for processing, and receives a job ID in response. It then uses that job ID in a query to retrieve the batched data. -## Run Discovery +**REST API** : The REST API in Salesforce is more suitable for working with individual records or smaller datasets. -To run discovery mode, execute the tap with the config file. +### Request and Response Format -``` -tap-salesforce --config config.json --discover > properties.json -``` +**Bulk API** : The Bulk API 2.0 uses a simplified format using CSV files for easier data loading and manipulation. The connector modifies the response CSV into a JSON object. -## Sync Data +**REST API** : The REST API primarily uses JSON for requests and responses -To sync data, select fields in the `properties.json` output and run the tap. +### Use Cases -``` -tap-salesforce --config config.json --properties properties.json [--state state.json] -``` +**Bulk API** : It is best suited for scenarios where you need to process large amounts of data, such as data migration, data warehousing, or mass updates to existing records. It's particularly useful when dealing with thousands to millions of records. -Copyright © 2017 Stitch +**REST API** : The REST API is more suitable for real-time interactions, user interfaces, and integrations that involve smaller data volumes. \ No newline at end of file diff --git a/meltano.yml b/meltano.yml new file mode 100644 index 0000000..181d0eb --- /dev/null +++ b/meltano.yml @@ -0,0 +1,35 @@ +version: 1 +send_anonymous_usage_stats: true +project_id: tap-salesforce +default_environment: dev +plugins: + extractors: + - name: tap-salesforce + namespace: tap_salesforce + pip_url: -e . + capabilities: + - state + - catalog + - discover + - about + - stream-maps + settings: + - name: start_date + - name: end_date + - name: domain + - name: client_id + kind: password + - name: client_secret + kind: password + - name: auth.flow + - name: auth.access_token + kind: password + - name: auth.username + - name: auth.password + kind: password + - name: bulk_load + kind: boolean + value: false +environments: +- name: dev + diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 0000000..ba621de --- /dev/null +++ b/mypy.ini @@ -0,0 +1,6 @@ +[mypy] +python_version = 3.9 +warn_unused_configs = True + +[mypy-backoff.*] +ignore_missing_imports = True diff --git a/output/.gitignore b/output/.gitignore new file mode 100644 index 0000000..80ff9d2 --- /dev/null +++ b/output/.gitignore @@ -0,0 +1,4 @@ +# This directory is used as a target by target-jsonl, so ignore all files + +* +!.gitignore diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..93b53f6 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,1372 @@ +# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. + +[[package]] +name = "appdirs" +version = "1.4.4" +description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +optional = false +python-versions = "*" +files = [ + {file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"}, + {file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"}, +] + +[[package]] +name = "attrs" +version = "23.1.0" +description = "Classes Without Boilerplate" +optional = false +python-versions = ">=3.7" +files = [ + {file = "attrs-23.1.0-py3-none-any.whl", hash = "sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04"}, + {file = "attrs-23.1.0.tar.gz", hash = "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015"}, +] + +[package.extras] +cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] +dev = ["attrs[docs,tests]", "pre-commit"] +docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope-interface"] +tests = ["attrs[tests-no-zope]", "zope-interface"] +tests-no-zope = ["cloudpickle", "hypothesis", "mypy (>=1.1.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] + +[[package]] +name = "backoff" +version = "2.2.1" +description = "Function decoration for backoff and retry" +optional = false +python-versions = ">=3.7,<4.0" +files = [ + {file = "backoff-2.2.1-py3-none-any.whl", hash = "sha256:63579f9a0628e06278f7e47b7d7d5b6ce20dc65c5e96a6f3ca99a6adca0396e8"}, + {file = "backoff-2.2.1.tar.gz", hash = "sha256:03f829f5bb1923180821643f8753b0502c3b682293992485b0eef2807afa5cba"}, +] + +[[package]] +name = "black" +version = "23.7.0" +description = "The uncompromising code formatter." +optional = false +python-versions = ">=3.8" +files = [ + {file = "black-23.7.0-cp310-cp310-macosx_10_16_arm64.whl", hash = "sha256:5c4bc552ab52f6c1c506ccae05681fab58c3f72d59ae6e6639e8885e94fe2587"}, + {file = "black-23.7.0-cp310-cp310-macosx_10_16_universal2.whl", hash = "sha256:552513d5cd5694590d7ef6f46e1767a4df9af168d449ff767b13b084c020e63f"}, + {file = "black-23.7.0-cp310-cp310-macosx_10_16_x86_64.whl", hash = "sha256:86cee259349b4448adb4ef9b204bb4467aae74a386bce85d56ba4f5dc0da27be"}, + {file = "black-23.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:501387a9edcb75d7ae8a4412bb8749900386eaef258f1aefab18adddea1936bc"}, + {file = "black-23.7.0-cp310-cp310-win_amd64.whl", hash = "sha256:fb074d8b213749fa1d077d630db0d5f8cc3b2ae63587ad4116e8a436e9bbe995"}, + {file = "black-23.7.0-cp311-cp311-macosx_10_16_arm64.whl", hash = "sha256:b5b0ee6d96b345a8b420100b7d71ebfdd19fab5e8301aff48ec270042cd40ac2"}, + {file = "black-23.7.0-cp311-cp311-macosx_10_16_universal2.whl", hash = "sha256:893695a76b140881531062d48476ebe4a48f5d1e9388177e175d76234ca247cd"}, + {file = "black-23.7.0-cp311-cp311-macosx_10_16_x86_64.whl", hash = "sha256:c333286dc3ddca6fdff74670b911cccedacb4ef0a60b34e491b8a67c833b343a"}, + {file = "black-23.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:831d8f54c3a8c8cf55f64d0422ee875eecac26f5f649fb6c1df65316b67c8926"}, + {file = "black-23.7.0-cp311-cp311-win_amd64.whl", hash = "sha256:7f3bf2dec7d541b4619b8ce526bda74a6b0bffc480a163fed32eb8b3c9aed8ad"}, + {file = "black-23.7.0-cp38-cp38-macosx_10_16_arm64.whl", hash = "sha256:f9062af71c59c004cd519e2fb8f5d25d39e46d3af011b41ab43b9c74e27e236f"}, + {file = "black-23.7.0-cp38-cp38-macosx_10_16_universal2.whl", hash = "sha256:01ede61aac8c154b55f35301fac3e730baf0c9cf8120f65a9cd61a81cfb4a0c3"}, + {file = "black-23.7.0-cp38-cp38-macosx_10_16_x86_64.whl", hash = "sha256:327a8c2550ddc573b51e2c352adb88143464bb9d92c10416feb86b0f5aee5ff6"}, + {file = "black-23.7.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d1c6022b86f83b632d06f2b02774134def5d4d4f1dac8bef16d90cda18ba28a"}, + {file = "black-23.7.0-cp38-cp38-win_amd64.whl", hash = "sha256:27eb7a0c71604d5de083757fbdb245b1a4fae60e9596514c6ec497eb63f95320"}, + {file = "black-23.7.0-cp39-cp39-macosx_10_16_arm64.whl", hash = "sha256:8417dbd2f57b5701492cd46edcecc4f9208dc75529bcf76c514864e48da867d9"}, + {file = "black-23.7.0-cp39-cp39-macosx_10_16_universal2.whl", hash = "sha256:47e56d83aad53ca140da0af87678fb38e44fd6bc0af71eebab2d1f59b1acf1d3"}, + {file = "black-23.7.0-cp39-cp39-macosx_10_16_x86_64.whl", hash = "sha256:25cc308838fe71f7065df53aedd20327969d05671bac95b38fdf37ebe70ac087"}, + {file = "black-23.7.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:642496b675095d423f9b8448243336f8ec71c9d4d57ec17bf795b67f08132a91"}, + {file = "black-23.7.0-cp39-cp39-win_amd64.whl", hash = "sha256:ad0014efc7acf0bd745792bd0d8857413652979200ab924fbf239062adc12491"}, + {file = "black-23.7.0-py3-none-any.whl", hash = "sha256:9fd59d418c60c0348505f2ddf9609c1e1de8e7493eab96198fc89d9f865e7a96"}, + {file = "black-23.7.0.tar.gz", hash = "sha256:022a582720b0d9480ed82576c920a8c1dde97cc38ff11d8d8859b3bd6ca9eedb"}, +] + +[package.dependencies] +click = ">=8.0.0" +mypy-extensions = ">=0.4.3" +packaging = ">=22.0" +pathspec = ">=0.9.0" +platformdirs = ">=2" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} + +[package.extras] +colorama = ["colorama (>=0.4.3)"] +d = ["aiohttp (>=3.7.4)"] +jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] +uvloop = ["uvloop (>=0.15.2)"] + +[[package]] +name = "boto3" +version = "1.28.18" +description = "The AWS SDK for Python" +optional = true +python-versions = ">= 3.7" +files = [ + {file = "boto3-1.28.18-py3-none-any.whl", hash = "sha256:f2ec3e6f173fe8d141d512ea7d90138db5a58af130773e26ce8e72bdbfd2cddc"}, + {file = "boto3-1.28.18.tar.gz", hash = "sha256:87ecac82d2a68430c0292b7946512c8b1f01ea6971b43dc5832582fcb176c0dd"}, +] + +[package.dependencies] +botocore = ">=1.31.18,<1.32.0" +jmespath = ">=0.7.1,<2.0.0" +s3transfer = ">=0.6.0,<0.7.0" + +[package.extras] +crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] + +[[package]] +name = "botocore" +version = "1.31.18" +description = "Low-level, data-driven core of boto 3." +optional = true +python-versions = ">= 3.7" +files = [ + {file = "botocore-1.31.18-py3-none-any.whl", hash = "sha256:909db57f5d6ca765fc9dc9dcae962a87566d0123da1d2bd5be32432493d5785e"}, + {file = "botocore-1.31.18.tar.gz", hash = "sha256:c4c01fae2ba32c242ce62175cad719aa49415618560d6e215ed76dab91991dc5"}, +] + +[package.dependencies] +jmespath = ">=0.7.1,<2.0.0" +python-dateutil = ">=2.1,<3.0.0" +urllib3 = ">=1.25.4,<1.27" + +[package.extras] +crt = ["awscrt (==0.16.26)"] + +[[package]] +name = "certifi" +version = "2023.7.22" +description = "Python package for providing Mozilla's CA Bundle." +optional = false +python-versions = ">=3.6" +files = [ + {file = "certifi-2023.7.22-py3-none-any.whl", hash = "sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9"}, + {file = "certifi-2023.7.22.tar.gz", hash = "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082"}, +] + +[[package]] +name = "cffi" +version = "1.15.1" +description = "Foreign Function Interface for Python calling C code." +optional = false +python-versions = "*" +files = [ + {file = "cffi-1.15.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2"}, + {file = "cffi-1.15.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2"}, + {file = "cffi-1.15.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914"}, + {file = "cffi-1.15.1-cp27-cp27m-win32.whl", hash = "sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3"}, + {file = "cffi-1.15.1-cp27-cp27m-win_amd64.whl", hash = "sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e"}, + {file = "cffi-1.15.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162"}, + {file = "cffi-1.15.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b"}, + {file = "cffi-1.15.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21"}, + {file = "cffi-1.15.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185"}, + {file = "cffi-1.15.1-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd"}, + {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc"}, + {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f"}, + {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e"}, + {file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4"}, + {file = "cffi-1.15.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01"}, + {file = "cffi-1.15.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e"}, + {file = "cffi-1.15.1-cp310-cp310-win32.whl", hash = "sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2"}, + {file = "cffi-1.15.1-cp310-cp310-win_amd64.whl", hash = "sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d"}, + {file = "cffi-1.15.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac"}, + {file = "cffi-1.15.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83"}, + {file = "cffi-1.15.1-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9"}, + {file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c"}, + {file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325"}, + {file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c"}, + {file = "cffi-1.15.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef"}, + {file = "cffi-1.15.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8"}, + {file = "cffi-1.15.1-cp311-cp311-win32.whl", hash = "sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d"}, + {file = "cffi-1.15.1-cp311-cp311-win_amd64.whl", hash = "sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104"}, + {file = "cffi-1.15.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7"}, + {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6"}, + {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d"}, + {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a"}, + {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405"}, + {file = "cffi-1.15.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e"}, + {file = "cffi-1.15.1-cp36-cp36m-win32.whl", hash = "sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf"}, + {file = "cffi-1.15.1-cp36-cp36m-win_amd64.whl", hash = "sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497"}, + {file = "cffi-1.15.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375"}, + {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e"}, + {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82"}, + {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b"}, + {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c"}, + {file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426"}, + {file = "cffi-1.15.1-cp37-cp37m-win32.whl", hash = "sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9"}, + {file = "cffi-1.15.1-cp37-cp37m-win_amd64.whl", hash = "sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045"}, + {file = "cffi-1.15.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3"}, + {file = "cffi-1.15.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a"}, + {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5"}, + {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca"}, + {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02"}, + {file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192"}, + {file = "cffi-1.15.1-cp38-cp38-win32.whl", hash = "sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314"}, + {file = "cffi-1.15.1-cp38-cp38-win_amd64.whl", hash = "sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5"}, + {file = "cffi-1.15.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585"}, + {file = "cffi-1.15.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0"}, + {file = "cffi-1.15.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415"}, + {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d"}, + {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984"}, + {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35"}, + {file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27"}, + {file = "cffi-1.15.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76"}, + {file = "cffi-1.15.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3"}, + {file = "cffi-1.15.1-cp39-cp39-win32.whl", hash = "sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee"}, + {file = "cffi-1.15.1-cp39-cp39-win_amd64.whl", hash = "sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c"}, + {file = "cffi-1.15.1.tar.gz", hash = "sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9"}, +] + +[package.dependencies] +pycparser = "*" + +[[package]] +name = "charset-normalizer" +version = "3.2.0" +description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +optional = false +python-versions = ">=3.7.0" +files = [ + {file = "charset-normalizer-3.2.0.tar.gz", hash = "sha256:3bb3d25a8e6c0aedd251753a79ae98a093c7e7b471faa3aa9a93a81431987ace"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:0b87549028f680ca955556e3bd57013ab47474c3124dc069faa0b6545b6c9710"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7c70087bfee18a42b4040bb9ec1ca15a08242cf5867c58726530bdf3945672ed"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a103b3a7069b62f5d4890ae1b8f0597618f628b286b03d4bc9195230b154bfa9"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:94aea8eff76ee6d1cdacb07dd2123a68283cb5569e0250feab1240058f53b623"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:db901e2ac34c931d73054d9797383d0f8009991e723dab15109740a63e7f902a"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b0dac0ff919ba34d4df1b6131f59ce95b08b9065233446be7e459f95554c0dc8"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:193cbc708ea3aca45e7221ae58f0fd63f933753a9bfb498a3b474878f12caaad"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:09393e1b2a9461950b1c9a45d5fd251dc7c6f228acab64da1c9c0165d9c7765c"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:baacc6aee0b2ef6f3d308e197b5d7a81c0e70b06beae1f1fcacffdbd124fe0e3"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:bf420121d4c8dce6b889f0e8e4ec0ca34b7f40186203f06a946fa0276ba54029"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:c04a46716adde8d927adb9457bbe39cf473e1e2c2f5d0a16ceb837e5d841ad4f"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:aaf63899c94de41fe3cf934601b0f7ccb6b428c6e4eeb80da72c58eab077b19a"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d62e51710986674142526ab9f78663ca2b0726066ae26b78b22e0f5e571238dd"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-win32.whl", hash = "sha256:04e57ab9fbf9607b77f7d057974694b4f6b142da9ed4a199859d9d4d5c63fe96"}, + {file = "charset_normalizer-3.2.0-cp310-cp310-win_amd64.whl", hash = "sha256:48021783bdf96e3d6de03a6e39a1171ed5bd7e8bb93fc84cc649d11490f87cea"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:4957669ef390f0e6719db3613ab3a7631e68424604a7b448f079bee145da6e09"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:46fb8c61d794b78ec7134a715a3e564aafc8f6b5e338417cb19fe9f57a5a9bf2"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f779d3ad205f108d14e99bb3859aa7dd8e9c68874617c72354d7ecaec2a054ac"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f25c229a6ba38a35ae6e25ca1264621cc25d4d38dca2942a7fce0b67a4efe918"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2efb1bd13885392adfda4614c33d3b68dee4921fd0ac1d3988f8cbb7d589e72a"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1f30b48dd7fa1474554b0b0f3fdfdd4c13b5c737a3c6284d3cdc424ec0ffff3a"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:246de67b99b6851627d945db38147d1b209a899311b1305dd84916f2b88526c6"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9bd9b3b31adcb054116447ea22caa61a285d92e94d710aa5ec97992ff5eb7cf3"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:8c2f5e83493748286002f9369f3e6607c565a6a90425a3a1fef5ae32a36d749d"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:3170c9399da12c9dc66366e9d14da8bf7147e1e9d9ea566067bbce7bb74bd9c2"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:7a4826ad2bd6b07ca615c74ab91f32f6c96d08f6fcc3902ceeedaec8cdc3bcd6"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:3b1613dd5aee995ec6d4c69f00378bbd07614702a315a2cf6c1d21461fe17c23"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9e608aafdb55eb9f255034709e20d5a83b6d60c054df0802fa9c9883d0a937aa"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-win32.whl", hash = "sha256:f2a1d0fd4242bd8643ce6f98927cf9c04540af6efa92323e9d3124f57727bfc1"}, + {file = "charset_normalizer-3.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:681eb3d7e02e3c3655d1b16059fbfb605ac464c834a0c629048a30fad2b27489"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c57921cda3a80d0f2b8aec7e25c8aa14479ea92b5b51b6876d975d925a2ea346"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:41b25eaa7d15909cf3ac4c96088c1f266a9a93ec44f87f1d13d4a0e86c81b982"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f058f6963fd82eb143c692cecdc89e075fa0828db2e5b291070485390b2f1c9c"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a7647ebdfb9682b7bb97e2a5e7cb6ae735b1c25008a70b906aecca294ee96cf4"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eef9df1eefada2c09a5e7a40991b9fc6ac6ef20b1372abd48d2794a316dc0449"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e03b8895a6990c9ab2cdcd0f2fe44088ca1c65ae592b8f795c3294af00a461c3"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:ee4006268ed33370957f55bf2e6f4d263eaf4dc3cfc473d1d90baff6ed36ce4a"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c4983bf937209c57240cff65906b18bb35e64ae872da6a0db937d7b4af845dd7"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:3bb7fda7260735efe66d5107fb7e6af6a7c04c7fce9b2514e04b7a74b06bf5dd"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:72814c01533f51d68702802d74f77ea026b5ec52793c791e2da806a3844a46c3"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:70c610f6cbe4b9fce272c407dd9d07e33e6bf7b4aa1b7ffb6f6ded8e634e3592"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-win32.whl", hash = "sha256:a401b4598e5d3f4a9a811f3daf42ee2291790c7f9d74b18d75d6e21dda98a1a1"}, + {file = "charset_normalizer-3.2.0-cp37-cp37m-win_amd64.whl", hash = "sha256:c0b21078a4b56965e2b12f247467b234734491897e99c1d51cee628da9786959"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:95eb302ff792e12aba9a8b8f8474ab229a83c103d74a750ec0bd1c1eea32e669"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1a100c6d595a7f316f1b6f01d20815d916e75ff98c27a01ae817439ea7726329"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:6339d047dab2780cc6220f46306628e04d9750f02f983ddb37439ca47ced7149"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e4b749b9cc6ee664a3300bb3a273c1ca8068c46be705b6c31cf5d276f8628a94"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a38856a971c602f98472050165cea2cdc97709240373041b69030be15047691f"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f87f746ee241d30d6ed93969de31e5ffd09a2961a051e60ae6bddde9ec3583aa"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:89f1b185a01fe560bc8ae5f619e924407efca2191b56ce749ec84982fc59a32a"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e1c8a2f4c69e08e89632defbfabec2feb8a8d99edc9f89ce33c4b9e36ab63037"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:2f4ac36d8e2b4cc1aa71df3dd84ff8efbe3bfb97ac41242fbcfc053c67434f46"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a386ebe437176aab38c041de1260cd3ea459c6ce5263594399880bbc398225b2"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:ccd16eb18a849fd8dcb23e23380e2f0a354e8daa0c984b8a732d9cfaba3a776d"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:e6a5bf2cba5ae1bb80b154ed68a3cfa2fa00fde979a7f50d6598d3e17d9ac20c"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:45de3f87179c1823e6d9e32156fb14c1927fcc9aba21433f088fdfb555b77c10"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-win32.whl", hash = "sha256:1000fba1057b92a65daec275aec30586c3de2401ccdcd41f8a5c1e2c87078706"}, + {file = "charset_normalizer-3.2.0-cp38-cp38-win_amd64.whl", hash = "sha256:8b2c760cfc7042b27ebdb4a43a4453bd829a5742503599144d54a032c5dc7e9e"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:855eafa5d5a2034b4621c74925d89c5efef61418570e5ef9b37717d9c796419c"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:203f0c8871d5a7987be20c72442488a0b8cfd0f43b7973771640fc593f56321f"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e857a2232ba53ae940d3456f7533ce6ca98b81917d47adc3c7fd55dad8fab858"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5e86d77b090dbddbe78867a0275cb4df08ea195e660f1f7f13435a4649e954e5"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c4fb39a81950ec280984b3a44f5bd12819953dc5fa3a7e6fa7a80db5ee853952"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2dee8e57f052ef5353cf608e0b4c871aee320dd1b87d351c28764fc0ca55f9f4"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8700f06d0ce6f128de3ccdbc1acaea1ee264d2caa9ca05daaf492fde7c2a7200"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1920d4ff15ce893210c1f0c0e9d19bfbecb7983c76b33f046c13a8ffbd570252"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:c1c76a1743432b4b60ab3358c937a3fe1341c828ae6194108a94c69028247f22"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:f7560358a6811e52e9c4d142d497f1a6e10103d3a6881f18d04dbce3729c0e2c"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:c8063cf17b19661471ecbdb3df1c84f24ad2e389e326ccaf89e3fb2484d8dd7e"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:cd6dbe0238f7743d0efe563ab46294f54f9bc8f4b9bcf57c3c666cc5bc9d1299"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:1249cbbf3d3b04902ff081ffbb33ce3377fa6e4c7356f759f3cd076cc138d020"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-win32.whl", hash = "sha256:6c409c0deba34f147f77efaa67b8e4bb83d2f11c8806405f76397ae5b8c0d1c9"}, + {file = "charset_normalizer-3.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:7095f6fbfaa55defb6b733cfeb14efaae7a29f0b59d8cf213be4e7ca0b857b80"}, + {file = "charset_normalizer-3.2.0-py3-none-any.whl", hash = "sha256:8e098148dd37b4ce3baca71fb394c81dc5d9c7728c95df695d2dca218edf40e6"}, +] + +[[package]] +name = "click" +version = "8.1.6" +description = "Composable command line interface toolkit" +optional = false +python-versions = ">=3.7" +files = [ + {file = "click-8.1.6-py3-none-any.whl", hash = "sha256:fa244bb30b3b5ee2cae3da8f55c9e5e0c0e86093306301fb418eb9dc40fbded5"}, + {file = "click-8.1.6.tar.gz", hash = "sha256:48ee849951919527a045bfe3bf7baa8a959c423134e1a5b98c05c20ba75a1cbd"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "platform_system == \"Windows\""} + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "cryptography" +version = "41.0.3" +description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." +optional = false +python-versions = ">=3.7" +files = [ + {file = "cryptography-41.0.3-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:652627a055cb52a84f8c448185922241dd5217443ca194d5739b44612c5e6507"}, + {file = "cryptography-41.0.3-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:8f09daa483aedea50d249ef98ed500569841d6498aa9c9f4b0531b9964658922"}, + {file = "cryptography-41.0.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4fd871184321100fb400d759ad0cddddf284c4b696568204d281c902fc7b0d81"}, + {file = "cryptography-41.0.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:84537453d57f55a50a5b6835622ee405816999a7113267739a1b4581f83535bd"}, + {file = "cryptography-41.0.3-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:3fb248989b6363906827284cd20cca63bb1a757e0a2864d4c1682a985e3dca47"}, + {file = "cryptography-41.0.3-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:42cb413e01a5d36da9929baa9d70ca90d90b969269e5a12d39c1e0d475010116"}, + {file = "cryptography-41.0.3-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:aeb57c421b34af8f9fe830e1955bf493a86a7996cc1338fe41b30047d16e962c"}, + {file = "cryptography-41.0.3-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:6af1c6387c531cd364b72c28daa29232162010d952ceb7e5ca8e2827526aceae"}, + {file = "cryptography-41.0.3-cp37-abi3-win32.whl", hash = "sha256:0d09fb5356f975974dbcb595ad2d178305e5050656affb7890a1583f5e02a306"}, + {file = "cryptography-41.0.3-cp37-abi3-win_amd64.whl", hash = "sha256:a983e441a00a9d57a4d7c91b3116a37ae602907a7618b882c8013b5762e80574"}, + {file = "cryptography-41.0.3-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5259cb659aa43005eb55a0e4ff2c825ca111a0da1814202c64d28a985d33b087"}, + {file = "cryptography-41.0.3-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:67e120e9a577c64fe1f611e53b30b3e69744e5910ff3b6e97e935aeb96005858"}, + {file = "cryptography-41.0.3-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:7efe8041897fe7a50863e51b77789b657a133c75c3b094e51b5e4b5cec7bf906"}, + {file = "cryptography-41.0.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:ce785cf81a7bdade534297ef9e490ddff800d956625020ab2ec2780a556c313e"}, + {file = "cryptography-41.0.3-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:57a51b89f954f216a81c9d057bf1a24e2f36e764a1ca9a501a6964eb4a6800dd"}, + {file = "cryptography-41.0.3-pp38-pypy38_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:4c2f0d35703d61002a2bbdcf15548ebb701cfdd83cdc12471d2bae80878a4207"}, + {file = "cryptography-41.0.3-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:23c2d778cf829f7d0ae180600b17e9fceea3c2ef8b31a99e3c694cbbf3a24b84"}, + {file = "cryptography-41.0.3-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:95dd7f261bb76948b52a5330ba5202b91a26fbac13ad0e9fc8a3ac04752058c7"}, + {file = "cryptography-41.0.3-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:41d7aa7cdfded09b3d73a47f429c298e80796c8e825ddfadc84c8a7f12df212d"}, + {file = "cryptography-41.0.3-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:d0d651aa754ef58d75cec6edfbd21259d93810b73f6ec246436a21b7841908de"}, + {file = "cryptography-41.0.3-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:ab8de0d091acbf778f74286f4989cf3d1528336af1b59f3e5d2ebca8b5fe49e1"}, + {file = "cryptography-41.0.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:a74fbcdb2a0d46fe00504f571a2a540532f4c188e6ccf26f1f178480117b33c4"}, + {file = "cryptography-41.0.3.tar.gz", hash = "sha256:6d192741113ef5e30d89dcb5b956ef4e1578f304708701b8b73d38e3e1461f34"}, +] + +[package.dependencies] +cffi = ">=1.12" + +[package.extras] +docs = ["sphinx (>=5.3.0)", "sphinx-rtd-theme (>=1.1.1)"] +docstest = ["pyenchant (>=1.6.11)", "sphinxcontrib-spelling (>=4.0.1)", "twine (>=1.12.0)"] +nox = ["nox"] +pep8test = ["black", "check-sdist", "mypy", "ruff"] +sdist = ["build"] +ssh = ["bcrypt (>=3.1.5)"] +test = ["pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] +test-randomorder = ["pytest-randomly"] + +[[package]] +name = "decorator" +version = "5.1.1" +description = "Decorators for Humans" +optional = false +python-versions = ">=3.5" +files = [ + {file = "decorator-5.1.1-py3-none-any.whl", hash = "sha256:b8c3f85900b9dc423225913c5aace94729fe1fa9763b38939a95226f02d37186"}, + {file = "decorator-5.1.1.tar.gz", hash = "sha256:637996211036b6385ef91435e4fae22989472f9d571faba8927ba8253acbc330"}, +] + +[[package]] +name = "exceptiongroup" +version = "1.1.2" +description = "Backport of PEP 654 (exception groups)" +optional = false +python-versions = ">=3.7" +files = [ + {file = "exceptiongroup-1.1.2-py3-none-any.whl", hash = "sha256:e346e69d186172ca7cf029c8c1d16235aa0e04035e5750b4b95039e65204328f"}, + {file = "exceptiongroup-1.1.2.tar.gz", hash = "sha256:12c3e887d6485d16943a309616de20ae5582633e0a2eda17f4e10fd61c1e8af5"}, +] + +[package.extras] +test = ["pytest (>=6)"] + +[[package]] +name = "fs" +version = "2.4.16" +description = "Python's filesystem abstraction layer" +optional = false +python-versions = "*" +files = [ + {file = "fs-2.4.16-py2.py3-none-any.whl", hash = "sha256:660064febbccda264ae0b6bace80a8d1be9e089e0a5eb2427b7d517f9a91545c"}, + {file = "fs-2.4.16.tar.gz", hash = "sha256:ae97c7d51213f4b70b6a958292530289090de3a7e15841e108fbe144f069d313"}, +] + +[package.dependencies] +appdirs = ">=1.4.3,<1.5.0" +setuptools = "*" +six = ">=1.10,<2.0" + +[package.extras] +scandir = ["scandir (>=1.5,<2.0)"] + +[[package]] +name = "fs-s3fs" +version = "1.1.1" +description = "Amazon S3 filesystem for PyFilesystem2" +optional = true +python-versions = "*" +files = [ + {file = "fs-s3fs-1.1.1.tar.gz", hash = "sha256:b57f8c7664460ff7b451b4b44ca2ea9623a374d74e1284c2d5e6df499dc7976c"}, + {file = "fs_s3fs-1.1.1-py2.py3-none-any.whl", hash = "sha256:9ba160eaa93390cc5992a857675666cb2fbb3721b872474dfdc659a715c39280"}, +] + +[package.dependencies] +boto3 = ">=1.9,<2.0" +fs = ">=2.4,<3.0" +six = ">=1.10,<2.0" + +[[package]] +name = "greenlet" +version = "2.0.2" +description = "Lightweight in-process concurrent programming" +optional = false +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*" +files = [ + {file = "greenlet-2.0.2-cp27-cp27m-macosx_10_14_x86_64.whl", hash = "sha256:bdfea8c661e80d3c1c99ad7c3ff74e6e87184895bbaca6ee8cc61209f8b9b85d"}, + {file = "greenlet-2.0.2-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:9d14b83fab60d5e8abe587d51c75b252bcc21683f24699ada8fb275d7712f5a9"}, + {file = "greenlet-2.0.2-cp27-cp27m-win32.whl", hash = "sha256:6c3acb79b0bfd4fe733dff8bc62695283b57949ebcca05ae5c129eb606ff2d74"}, + {file = "greenlet-2.0.2-cp27-cp27m-win_amd64.whl", hash = "sha256:283737e0da3f08bd637b5ad058507e578dd462db259f7f6e4c5c365ba4ee9343"}, + {file = "greenlet-2.0.2-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:d27ec7509b9c18b6d73f2f5ede2622441de812e7b1a80bbd446cb0633bd3d5ae"}, + {file = "greenlet-2.0.2-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:30bcf80dda7f15ac77ba5af2b961bdd9dbc77fd4ac6105cee85b0d0a5fcf74df"}, + {file = "greenlet-2.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:26fbfce90728d82bc9e6c38ea4d038cba20b7faf8a0ca53a9c07b67318d46088"}, + {file = "greenlet-2.0.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9190f09060ea4debddd24665d6804b995a9c122ef5917ab26e1566dcc712ceeb"}, + {file = "greenlet-2.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d75209eed723105f9596807495d58d10b3470fa6732dd6756595e89925ce2470"}, + {file = "greenlet-2.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:3a51c9751078733d88e013587b108f1b7a1fb106d402fb390740f002b6f6551a"}, + {file = "greenlet-2.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:76ae285c8104046b3a7f06b42f29c7b73f77683df18c49ab5af7983994c2dd91"}, + {file = "greenlet-2.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:2d4686f195e32d36b4d7cf2d166857dbd0ee9f3d20ae349b6bf8afc8485b3645"}, + {file = "greenlet-2.0.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:c4302695ad8027363e96311df24ee28978162cdcdd2006476c43970b384a244c"}, + {file = "greenlet-2.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c48f54ef8e05f04d6eff74b8233f6063cb1ed960243eacc474ee73a2ea8573ca"}, + {file = "greenlet-2.0.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a1846f1b999e78e13837c93c778dcfc3365902cfb8d1bdb7dd73ead37059f0d0"}, + {file = "greenlet-2.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a06ad5312349fec0ab944664b01d26f8d1f05009566339ac6f63f56589bc1a2"}, + {file = "greenlet-2.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:eff4eb9b7eb3e4d0cae3d28c283dc16d9bed6b193c2e1ace3ed86ce48ea8df19"}, + {file = "greenlet-2.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5454276c07d27a740c5892f4907c86327b632127dd9abec42ee62e12427ff7e3"}, + {file = "greenlet-2.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:7cafd1208fdbe93b67c7086876f061f660cfddc44f404279c1585bbf3cdc64c5"}, + {file = "greenlet-2.0.2-cp35-cp35m-macosx_10_14_x86_64.whl", hash = "sha256:910841381caba4f744a44bf81bfd573c94e10b3045ee00de0cbf436fe50673a6"}, + {file = "greenlet-2.0.2-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:18a7f18b82b52ee85322d7a7874e676f34ab319b9f8cce5de06067384aa8ff43"}, + {file = "greenlet-2.0.2-cp35-cp35m-win32.whl", hash = "sha256:03a8f4f3430c3b3ff8d10a2a86028c660355ab637cee9333d63d66b56f09d52a"}, + {file = "greenlet-2.0.2-cp35-cp35m-win_amd64.whl", hash = "sha256:4b58adb399c4d61d912c4c331984d60eb66565175cdf4a34792cd9600f21b394"}, + {file = "greenlet-2.0.2-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:703f18f3fda276b9a916f0934d2fb6d989bf0b4fb5a64825260eb9bfd52d78f0"}, + {file = "greenlet-2.0.2-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:32e5b64b148966d9cccc2c8d35a671409e45f195864560829f395a54226408d3"}, + {file = "greenlet-2.0.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2dd11f291565a81d71dab10b7033395b7a3a5456e637cf997a6f33ebdf06f8db"}, + {file = "greenlet-2.0.2-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e0f72c9ddb8cd28532185f54cc1453f2c16fb417a08b53a855c4e6a418edd099"}, + {file = "greenlet-2.0.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cd021c754b162c0fb55ad5d6b9d960db667faad0fa2ff25bb6e1301b0b6e6a75"}, + {file = "greenlet-2.0.2-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:3c9b12575734155d0c09d6c3e10dbd81665d5c18e1a7c6597df72fd05990c8cf"}, + {file = "greenlet-2.0.2-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:b9ec052b06a0524f0e35bd8790686a1da006bd911dd1ef7d50b77bfbad74e292"}, + {file = "greenlet-2.0.2-cp36-cp36m-win32.whl", hash = "sha256:dbfcfc0218093a19c252ca8eb9aee3d29cfdcb586df21049b9d777fd32c14fd9"}, + {file = "greenlet-2.0.2-cp36-cp36m-win_amd64.whl", hash = "sha256:9f35ec95538f50292f6d8f2c9c9f8a3c6540bbfec21c9e5b4b751e0a7c20864f"}, + {file = "greenlet-2.0.2-cp37-cp37m-macosx_10_15_x86_64.whl", hash = "sha256:d5508f0b173e6aa47273bdc0a0b5ba055b59662ba7c7ee5119528f466585526b"}, + {file = "greenlet-2.0.2-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:f82d4d717d8ef19188687aa32b8363e96062911e63ba22a0cff7802a8e58e5f1"}, + {file = "greenlet-2.0.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c9c59a2120b55788e800d82dfa99b9e156ff8f2227f07c5e3012a45a399620b7"}, + {file = "greenlet-2.0.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2780572ec463d44c1d3ae850239508dbeb9fed38e294c68d19a24d925d9223ca"}, + {file = "greenlet-2.0.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:937e9020b514ceedb9c830c55d5c9872abc90f4b5862f89c0887033ae33c6f73"}, + {file = "greenlet-2.0.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:36abbf031e1c0f79dd5d596bfaf8e921c41df2bdf54ee1eed921ce1f52999a86"}, + {file = "greenlet-2.0.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:18e98fb3de7dba1c0a852731c3070cf022d14f0d68b4c87a19cc1016f3bb8b33"}, + {file = "greenlet-2.0.2-cp37-cp37m-win32.whl", hash = "sha256:3f6ea9bd35eb450837a3d80e77b517ea5bc56b4647f5502cd28de13675ee12f7"}, + {file = "greenlet-2.0.2-cp37-cp37m-win_amd64.whl", hash = "sha256:7492e2b7bd7c9b9916388d9df23fa49d9b88ac0640db0a5b4ecc2b653bf451e3"}, + {file = "greenlet-2.0.2-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:b864ba53912b6c3ab6bcb2beb19f19edd01a6bfcbdfe1f37ddd1778abfe75a30"}, + {file = "greenlet-2.0.2-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:ba2956617f1c42598a308a84c6cf021a90ff3862eddafd20c3333d50f0edb45b"}, + {file = "greenlet-2.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fc3a569657468b6f3fb60587e48356fe512c1754ca05a564f11366ac9e306526"}, + {file = "greenlet-2.0.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8eab883b3b2a38cc1e050819ef06a7e6344d4a990d24d45bc6f2cf959045a45b"}, + {file = "greenlet-2.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:acd2162a36d3de67ee896c43effcd5ee3de247eb00354db411feb025aa319857"}, + {file = "greenlet-2.0.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:0bf60faf0bc2468089bdc5edd10555bab6e85152191df713e2ab1fcc86382b5a"}, + {file = "greenlet-2.0.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b0ef99cdbe2b682b9ccbb964743a6aca37905fda5e0452e5ee239b1654d37f2a"}, + {file = "greenlet-2.0.2-cp38-cp38-win32.whl", hash = "sha256:b80f600eddddce72320dbbc8e3784d16bd3fb7b517e82476d8da921f27d4b249"}, + {file = "greenlet-2.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:4d2e11331fc0c02b6e84b0d28ece3a36e0548ee1a1ce9ddde03752d9b79bba40"}, + {file = "greenlet-2.0.2-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:88d9ab96491d38a5ab7c56dd7a3cc37d83336ecc564e4e8816dbed12e5aaefc8"}, + {file = "greenlet-2.0.2-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:561091a7be172ab497a3527602d467e2b3fbe75f9e783d8b8ce403fa414f71a6"}, + {file = "greenlet-2.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:971ce5e14dc5e73715755d0ca2975ac88cfdaefcaab078a284fea6cfabf866df"}, + {file = "greenlet-2.0.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:be4ed120b52ae4d974aa40215fcdfde9194d63541c7ded40ee12eb4dda57b76b"}, + {file = "greenlet-2.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94c817e84245513926588caf1152e3b559ff794d505555211ca041f032abbb6b"}, + {file = "greenlet-2.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:1a819eef4b0e0b96bb0d98d797bef17dc1b4a10e8d7446be32d1da33e095dbb8"}, + {file = "greenlet-2.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:7efde645ca1cc441d6dc4b48c0f7101e8d86b54c8530141b09fd31cef5149ec9"}, + {file = "greenlet-2.0.2-cp39-cp39-win32.whl", hash = "sha256:ea9872c80c132f4663822dd2a08d404073a5a9b5ba6155bea72fb2a79d1093b5"}, + {file = "greenlet-2.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:db1a39669102a1d8d12b57de2bb7e2ec9066a6f2b3da35ae511ff93b01b5d564"}, + {file = "greenlet-2.0.2.tar.gz", hash = "sha256:e7c8dc13af7db097bed64a051d2dd49e9f0af495c26995c00a9ee842690d34c0"}, +] + +[package.extras] +docs = ["Sphinx", "docutils (<0.18)"] +test = ["objgraph", "psutil"] + +[[package]] +name = "idna" +version = "3.4" +description = "Internationalized Domain Names in Applications (IDNA)" +optional = false +python-versions = ">=3.5" +files = [ + {file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"}, + {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, +] + +[[package]] +name = "importlib-resources" +version = "5.12.0" +description = "Read resources from Python packages" +optional = false +python-versions = ">=3.7" +files = [ + {file = "importlib_resources-5.12.0-py3-none-any.whl", hash = "sha256:7b1deeebbf351c7578e09bf2f63fa2ce8b5ffec296e0d349139d43cca061a81a"}, + {file = "importlib_resources-5.12.0.tar.gz", hash = "sha256:4be82589bf5c1d7999aedf2a45159d10cb3ca4f19b2271f8792bc8e6da7b22f6"}, +] + +[package.dependencies] +zipp = {version = ">=3.1.0", markers = "python_version < \"3.10\""} + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +testing = ["flake8 (<5)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] + +[[package]] +name = "inflection" +version = "0.5.1" +description = "A port of Ruby on Rails inflector to Python" +optional = false +python-versions = ">=3.5" +files = [ + {file = "inflection-0.5.1-py2.py3-none-any.whl", hash = "sha256:f38b2b640938a4f35ade69ac3d053042959b62a0f1076a5bbaa1b9526605a8a2"}, + {file = "inflection-0.5.1.tar.gz", hash = "sha256:1a29730d366e996aaacffb2f1f1cb9593dc38e2ddd30c91250c6dde09ea9b417"}, +] + +[[package]] +name = "iniconfig" +version = "2.0.0" +description = "brain-dead simple config-ini parsing" +optional = false +python-versions = ">=3.7" +files = [ + {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, + {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, +] + +[[package]] +name = "jmespath" +version = "1.0.1" +description = "JSON Matching Expressions" +optional = true +python-versions = ">=3.7" +files = [ + {file = "jmespath-1.0.1-py3-none-any.whl", hash = "sha256:02e2e4cc71b5bcab88332eebf907519190dd9e6e82107fa7f83b1003a6252980"}, + {file = "jmespath-1.0.1.tar.gz", hash = "sha256:90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe"}, +] + +[[package]] +name = "joblib" +version = "1.3.1" +description = "Lightweight pipelining with Python functions" +optional = false +python-versions = ">=3.7" +files = [ + {file = "joblib-1.3.1-py3-none-any.whl", hash = "sha256:89cf0529520e01b3de7ac7b74a8102c90d16d54c64b5dd98cafcd14307fdf915"}, + {file = "joblib-1.3.1.tar.gz", hash = "sha256:1f937906df65329ba98013dc9692fe22a4c5e4a648112de500508b18a21b41e3"}, +] + +[[package]] +name = "jsonpath-ng" +version = "1.5.3" +description = "A final implementation of JSONPath for Python that aims to be standard compliant, including arithmetic and binary comparison operators and providing clear AST for metaprogramming." +optional = false +python-versions = "*" +files = [ + {file = "jsonpath-ng-1.5.3.tar.gz", hash = "sha256:a273b182a82c1256daab86a313b937059261b5c5f8c4fa3fc38b882b344dd567"}, + {file = "jsonpath_ng-1.5.3-py2-none-any.whl", hash = "sha256:f75b95dbecb8a0f3b86fd2ead21c2b022c3f5770957492b9b6196ecccfeb10aa"}, + {file = "jsonpath_ng-1.5.3-py3-none-any.whl", hash = "sha256:292a93569d74029ba75ac2dc3d3630fc0e17b2df26119a165fa1d498ca47bf65"}, +] + +[package.dependencies] +decorator = "*" +ply = "*" +six = "*" + +[[package]] +name = "jsonschema" +version = "4.18.6" +description = "An implementation of JSON Schema validation for Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "jsonschema-4.18.6-py3-none-any.whl", hash = "sha256:dc274409c36175aad949c68e5ead0853aaffbe8e88c830ae66bb3c7a1728ad2d"}, + {file = "jsonschema-4.18.6.tar.gz", hash = "sha256:ce71d2f8c7983ef75a756e568317bf54bc531dc3ad7e66a128eae0d51623d8a3"}, +] + +[package.dependencies] +attrs = ">=22.2.0" +importlib-resources = {version = ">=1.4.0", markers = "python_version < \"3.9\""} +jsonschema-specifications = ">=2023.03.6" +pkgutil-resolve-name = {version = ">=1.3.10", markers = "python_version < \"3.9\""} +referencing = ">=0.28.4" +rpds-py = ">=0.7.1" + +[package.extras] +format = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3987", "uri-template", "webcolors (>=1.11)"] +format-nongpl = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3986-validator (>0.1.0)", "uri-template", "webcolors (>=1.11)"] + +[[package]] +name = "jsonschema-specifications" +version = "2023.7.1" +description = "The JSON Schema meta-schemas and vocabularies, exposed as a Registry" +optional = false +python-versions = ">=3.8" +files = [ + {file = "jsonschema_specifications-2023.7.1-py3-none-any.whl", hash = "sha256:05adf340b659828a004220a9613be00fa3f223f2b82002e273dee62fd50524b1"}, + {file = "jsonschema_specifications-2023.7.1.tar.gz", hash = "sha256:c91a50404e88a1f6ba40636778e2ee08f6e24c5613fe4c53ac24578a5a7f72bb"}, +] + +[package.dependencies] +importlib-resources = {version = ">=1.4.0", markers = "python_version < \"3.9\""} +referencing = ">=0.28.0" + +[[package]] +name = "memoization" +version = "0.4.0" +description = "A powerful caching library for Python, with TTL support and multiple algorithm options. (https://github.com/lonelyenvoy/python-memoization)" +optional = false +python-versions = ">=3, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4" +files = [ + {file = "memoization-0.4.0.tar.gz", hash = "sha256:fde5e7cd060ef45b135e0310cfec17b2029dc472ccb5bbbbb42a503d4538a135"}, +] + +[[package]] +name = "mypy-extensions" +version = "1.0.0" +description = "Type system extensions for programs checked with the mypy type checker." +optional = false +python-versions = ">=3.5" +files = [ + {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, + {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, +] + +[[package]] +name = "packaging" +version = "23.1" +description = "Core utilities for Python packages" +optional = false +python-versions = ">=3.7" +files = [ + {file = "packaging-23.1-py3-none-any.whl", hash = "sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61"}, + {file = "packaging-23.1.tar.gz", hash = "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f"}, +] + +[[package]] +name = "pathspec" +version = "0.11.2" +description = "Utility library for gitignore style pattern matching of file paths." +optional = false +python-versions = ">=3.7" +files = [ + {file = "pathspec-0.11.2-py3-none-any.whl", hash = "sha256:1d6ed233af05e679efb96b1851550ea95bbb64b7c490b0f5aa52996c11e92a20"}, + {file = "pathspec-0.11.2.tar.gz", hash = "sha256:e0d8d0ac2f12da61956eb2306b69f9469b42f4deb0f3cb6ed47b9cce9996ced3"}, +] + +[[package]] +name = "pendulum" +version = "2.1.2" +description = "Python datetimes made easy" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +files = [ + {file = "pendulum-2.1.2-cp27-cp27m-macosx_10_15_x86_64.whl", hash = "sha256:b6c352f4bd32dff1ea7066bd31ad0f71f8d8100b9ff709fb343f3b86cee43efe"}, + {file = "pendulum-2.1.2-cp27-cp27m-win_amd64.whl", hash = "sha256:318f72f62e8e23cd6660dbafe1e346950281a9aed144b5c596b2ddabc1d19739"}, + {file = "pendulum-2.1.2-cp35-cp35m-macosx_10_15_x86_64.whl", hash = "sha256:0731f0c661a3cb779d398803655494893c9f581f6488048b3fb629c2342b5394"}, + {file = "pendulum-2.1.2-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:3481fad1dc3f6f6738bd575a951d3c15d4b4ce7c82dce37cf8ac1483fde6e8b0"}, + {file = "pendulum-2.1.2-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:9702069c694306297ed362ce7e3c1ef8404ac8ede39f9b28b7c1a7ad8c3959e3"}, + {file = "pendulum-2.1.2-cp35-cp35m-win_amd64.whl", hash = "sha256:fb53ffa0085002ddd43b6ca61a7b34f2d4d7c3ed66f931fe599e1a531b42af9b"}, + {file = "pendulum-2.1.2-cp36-cp36m-macosx_10_15_x86_64.whl", hash = "sha256:c501749fdd3d6f9e726086bf0cd4437281ed47e7bca132ddb522f86a1645d360"}, + {file = "pendulum-2.1.2-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:c807a578a532eeb226150d5006f156632df2cc8c5693d778324b43ff8c515dd0"}, + {file = "pendulum-2.1.2-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:2d1619a721df661e506eff8db8614016f0720ac171fe80dda1333ee44e684087"}, + {file = "pendulum-2.1.2-cp36-cp36m-win_amd64.whl", hash = "sha256:f888f2d2909a414680a29ae74d0592758f2b9fcdee3549887779cd4055e975db"}, + {file = "pendulum-2.1.2-cp37-cp37m-macosx_10_15_x86_64.whl", hash = "sha256:e95d329384717c7bf627bf27e204bc3b15c8238fa8d9d9781d93712776c14002"}, + {file = "pendulum-2.1.2-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:4c9c689747f39d0d02a9f94fcee737b34a5773803a64a5fdb046ee9cac7442c5"}, + {file = "pendulum-2.1.2-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:1245cd0075a3c6d889f581f6325dd8404aca5884dea7223a5566c38aab94642b"}, + {file = "pendulum-2.1.2-cp37-cp37m-win_amd64.whl", hash = "sha256:db0a40d8bcd27b4fb46676e8eb3c732c67a5a5e6bfab8927028224fbced0b40b"}, + {file = "pendulum-2.1.2-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:f5e236e7730cab1644e1b87aca3d2ff3e375a608542e90fe25685dae46310116"}, + {file = "pendulum-2.1.2-cp38-cp38-manylinux1_i686.whl", hash = "sha256:de42ea3e2943171a9e95141f2eecf972480636e8e484ccffaf1e833929e9e052"}, + {file = "pendulum-2.1.2-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:7c5ec650cb4bec4c63a89a0242cc8c3cebcec92fcfe937c417ba18277d8560be"}, + {file = "pendulum-2.1.2-cp38-cp38-win_amd64.whl", hash = "sha256:33fb61601083f3eb1d15edeb45274f73c63b3c44a8524703dc143f4212bf3269"}, + {file = "pendulum-2.1.2-cp39-cp39-manylinux1_i686.whl", hash = "sha256:29c40a6f2942376185728c9a0347d7c0f07905638c83007e1d262781f1e6953a"}, + {file = "pendulum-2.1.2-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:94b1fc947bfe38579b28e1cccb36f7e28a15e841f30384b5ad6c5e31055c85d7"}, + {file = "pendulum-2.1.2.tar.gz", hash = "sha256:b06a0ca1bfe41c990bbf0c029f0b6501a7f2ec4e38bfec730712015e8860f207"}, +] + +[package.dependencies] +python-dateutil = ">=2.6,<3.0" +pytzdata = ">=2020.1" + +[[package]] +name = "pkgutil-resolve-name" +version = "1.3.10" +description = "Resolve a name to an object." +optional = false +python-versions = ">=3.6" +files = [ + {file = "pkgutil_resolve_name-1.3.10-py3-none-any.whl", hash = "sha256:ca27cc078d25c5ad71a9de0a7a330146c4e014c2462d9af19c6b828280649c5e"}, + {file = "pkgutil_resolve_name-1.3.10.tar.gz", hash = "sha256:357d6c9e6a755653cfd78893817c0853af365dd51ec97f3d358a819373bbd174"}, +] + +[[package]] +name = "platformdirs" +version = "3.10.0" +description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +optional = false +python-versions = ">=3.7" +files = [ + {file = "platformdirs-3.10.0-py3-none-any.whl", hash = "sha256:d7c24979f292f916dc9cbf8648319032f551ea8c49a4c9bf2fb556a02070ec1d"}, + {file = "platformdirs-3.10.0.tar.gz", hash = "sha256:b45696dab2d7cc691a3226759c0d3b00c47c8b6e293d96f6436f733303f77f6d"}, +] + +[package.extras] +docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.1)", "sphinx-autodoc-typehints (>=1.24)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-cov (>=4.1)", "pytest-mock (>=3.11.1)"] + +[[package]] +name = "pluggy" +version = "1.2.0" +description = "plugin and hook calling mechanisms for python" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pluggy-1.2.0-py3-none-any.whl", hash = "sha256:c2fd55a7d7a3863cba1a013e4e2414658b1d07b6bc57b3919e0c63c9abb99849"}, + {file = "pluggy-1.2.0.tar.gz", hash = "sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3"}, +] + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["pytest", "pytest-benchmark"] + +[[package]] +name = "ply" +version = "3.11" +description = "Python Lex & Yacc" +optional = false +python-versions = "*" +files = [ + {file = "ply-3.11-py2.py3-none-any.whl", hash = "sha256:096f9b8350b65ebd2fd1346b12452efe5b9607f7482813ffca50c22722a807ce"}, + {file = "ply-3.11.tar.gz", hash = "sha256:00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3"}, +] + +[[package]] +name = "pycparser" +version = "2.21" +description = "C parser in Python" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "pycparser-2.21-py2.py3-none-any.whl", hash = "sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9"}, + {file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"}, +] + +[[package]] +name = "pyjwt" +version = "2.8.0" +description = "JSON Web Token implementation in Python" +optional = false +python-versions = ">=3.7" +files = [ + {file = "PyJWT-2.8.0-py3-none-any.whl", hash = "sha256:59127c392cc44c2da5bb3192169a91f429924e17aff6534d70fdc02ab3e04320"}, + {file = "PyJWT-2.8.0.tar.gz", hash = "sha256:57e28d156e3d5c10088e0c68abb90bfac3df82b40a71bd0daa20c65ccd5c23de"}, +] + +[package.extras] +crypto = ["cryptography (>=3.4.0)"] +dev = ["coverage[toml] (==5.0.4)", "cryptography (>=3.4.0)", "pre-commit", "pytest (>=6.0.0,<7.0.0)", "sphinx (>=4.5.0,<5.0.0)", "sphinx-rtd-theme", "zope.interface"] +docs = ["sphinx (>=4.5.0,<5.0.0)", "sphinx-rtd-theme", "zope.interface"] +tests = ["coverage[toml] (==5.0.4)", "pytest (>=6.0.0,<7.0.0)"] + +[[package]] +name = "pytest" +version = "7.4.0" +description = "pytest: simple powerful testing with Python" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pytest-7.4.0-py3-none-any.whl", hash = "sha256:78bf16451a2eb8c7a2ea98e32dc119fd2aa758f1d5d66dbf0a59d69a3969df32"}, + {file = "pytest-7.4.0.tar.gz", hash = "sha256:b4bf8c45bd59934ed84001ad51e11b4ee40d40a1229d2c79f9c592b0a3f6bd8a"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "sys_platform == \"win32\""} +exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=0.12,<2.0" +tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} + +[package.extras] +testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] + +[[package]] +name = "pytest-durations" +version = "1.2.0" +description = "Pytest plugin reporting fixtures and test functions execution time." +optional = false +python-versions = ">=3.6.2" +files = [ + {file = "pytest-durations-1.2.0.tar.gz", hash = "sha256:75793f7c2c393a947de4a92cc205e8dcb3d7fcde492628926cca97eb8e87077d"}, + {file = "pytest_durations-1.2.0-py3-none-any.whl", hash = "sha256:210c649d989fdf8e864b7f614966ca2c8be5b58a5224d60089a43618c146d7fb"}, +] + +[package.dependencies] +pytest = ">=4.6" + +[[package]] +name = "python-dateutil" +version = "2.8.2" +description = "Extensions to the standard Python datetime module" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +files = [ + {file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"}, + {file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"}, +] + +[package.dependencies] +six = ">=1.5" + +[[package]] +name = "python-dotenv" +version = "0.21.1" +description = "Read key-value pairs from a .env file and set them as environment variables" +optional = false +python-versions = ">=3.7" +files = [ + {file = "python-dotenv-0.21.1.tar.gz", hash = "sha256:1c93de8f636cde3ce377292818d0e440b6e45a82f215c3744979151fa8151c49"}, + {file = "python_dotenv-0.21.1-py3-none-any.whl", hash = "sha256:41e12e0318bebc859fcc4d97d4db8d20ad21721a6aa5047dd59f090391cb549a"}, +] + +[package.extras] +cli = ["click (>=5.0)"] + +[[package]] +name = "pytz" +version = "2023.3" +description = "World timezone definitions, modern and historical" +optional = false +python-versions = "*" +files = [ + {file = "pytz-2023.3-py2.py3-none-any.whl", hash = "sha256:a151b3abb88eda1d4e34a9814df37de2a80e301e68ba0fd856fb9b46bfbbbffb"}, + {file = "pytz-2023.3.tar.gz", hash = "sha256:1d8ce29db189191fb55338ee6d0387d82ab59f3d00eac103412d64e0ebd0c588"}, +] + +[[package]] +name = "pytzdata" +version = "2020.1" +description = "The Olson timezone database for Python." +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "pytzdata-2020.1-py2.py3-none-any.whl", hash = "sha256:e1e14750bcf95016381e4d472bad004eef710f2d6417240904070b3d6654485f"}, + {file = "pytzdata-2020.1.tar.gz", hash = "sha256:3efa13b335a00a8de1d345ae41ec78dd11c9f8807f522d39850f2dd828681540"}, +] + +[[package]] +name = "pyyaml" +version = "6.0.1" +description = "YAML parser and emitter for Python" +optional = false +python-versions = ">=3.6" +files = [ + {file = "PyYAML-6.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a"}, + {file = "PyYAML-6.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"}, + {file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"}, + {file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"}, + {file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"}, + {file = "PyYAML-6.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"}, + {file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"}, + {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, + {file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd"}, + {file = "PyYAML-6.0.1-cp36-cp36m-win32.whl", hash = "sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585"}, + {file = "PyYAML-6.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa"}, + {file = "PyYAML-6.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c"}, + {file = "PyYAML-6.0.1-cp37-cp37m-win32.whl", hash = "sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba"}, + {file = "PyYAML-6.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867"}, + {file = "PyYAML-6.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"}, + {file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"}, + {file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"}, + {file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"}, + {file = "PyYAML-6.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"}, + {file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"}, + {file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"}, + {file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"}, +] + +[[package]] +name = "referencing" +version = "0.30.0" +description = "JSON Referencing + Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "referencing-0.30.0-py3-none-any.whl", hash = "sha256:c257b08a399b6c2f5a3510a50d28ab5dbc7bbde049bcaf954d43c446f83ab548"}, + {file = "referencing-0.30.0.tar.gz", hash = "sha256:47237742e990457f7512c7d27486394a9aadaf876cbfaa4be65b27b4f4d47c6b"}, +] + +[package.dependencies] +attrs = ">=22.2.0" +rpds-py = ">=0.7.0" + +[[package]] +name = "requests" +version = "2.31.0" +description = "Python HTTP for Humans." +optional = false +python-versions = ">=3.7" +files = [ + {file = "requests-2.31.0-py3-none-any.whl", hash = "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f"}, + {file = "requests-2.31.0.tar.gz", hash = "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1"}, +] + +[package.dependencies] +certifi = ">=2017.4.17" +charset-normalizer = ">=2,<4" +idna = ">=2.5,<4" +urllib3 = ">=1.21.1,<3" + +[package.extras] +socks = ["PySocks (>=1.5.6,!=1.5.7)"] +use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] + +[[package]] +name = "rpds-py" +version = "0.9.2" +description = "Python bindings to Rust's persistent data structures (rpds)" +optional = false +python-versions = ">=3.8" +files = [ + {file = "rpds_py-0.9.2-cp310-cp310-macosx_10_7_x86_64.whl", hash = "sha256:ab6919a09c055c9b092798ce18c6c4adf49d24d4d9e43a92b257e3f2548231e7"}, + {file = "rpds_py-0.9.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d55777a80f78dd09410bd84ff8c95ee05519f41113b2df90a69622f5540c4f8b"}, + {file = "rpds_py-0.9.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a216b26e5af0a8e265d4efd65d3bcec5fba6b26909014effe20cd302fd1138fa"}, + {file = "rpds_py-0.9.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:29cd8bfb2d716366a035913ced99188a79b623a3512292963d84d3e06e63b496"}, + {file = "rpds_py-0.9.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:44659b1f326214950a8204a248ca6199535e73a694be8d3e0e869f820767f12f"}, + {file = "rpds_py-0.9.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:745f5a43fdd7d6d25a53ab1a99979e7f8ea419dfefebcab0a5a1e9095490ee5e"}, + {file = "rpds_py-0.9.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a987578ac5214f18b99d1f2a3851cba5b09f4a689818a106c23dbad0dfeb760f"}, + {file = "rpds_py-0.9.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:bf4151acb541b6e895354f6ff9ac06995ad9e4175cbc6d30aaed08856558201f"}, + {file = "rpds_py-0.9.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:03421628f0dc10a4119d714a17f646e2837126a25ac7a256bdf7c3943400f67f"}, + {file = "rpds_py-0.9.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:13b602dc3e8dff3063734f02dcf05111e887f301fdda74151a93dbbc249930fe"}, + {file = "rpds_py-0.9.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:fae5cb554b604b3f9e2c608241b5d8d303e410d7dfb6d397c335f983495ce7f6"}, + {file = "rpds_py-0.9.2-cp310-none-win32.whl", hash = "sha256:47c5f58a8e0c2c920cc7783113df2fc4ff12bf3a411d985012f145e9242a2764"}, + {file = "rpds_py-0.9.2-cp310-none-win_amd64.whl", hash = "sha256:4ea6b73c22d8182dff91155af018b11aac9ff7eca085750455c5990cb1cfae6e"}, + {file = "rpds_py-0.9.2-cp311-cp311-macosx_10_7_x86_64.whl", hash = "sha256:e564d2238512c5ef5e9d79338ab77f1cbbda6c2d541ad41b2af445fb200385e3"}, + {file = "rpds_py-0.9.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f411330a6376fb50e5b7a3e66894e4a39e60ca2e17dce258d53768fea06a37bd"}, + {file = "rpds_py-0.9.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0e7521f5af0233e89939ad626b15278c71b69dc1dfccaa7b97bd4cdf96536bb7"}, + {file = "rpds_py-0.9.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8d3335c03100a073883857e91db9f2e0ef8a1cf42dc0369cbb9151c149dbbc1b"}, + {file = "rpds_py-0.9.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d25b1c1096ef0447355f7293fbe9ad740f7c47ae032c2884113f8e87660d8f6e"}, + {file = "rpds_py-0.9.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6a5d3fbd02efd9cf6a8ffc2f17b53a33542f6b154e88dd7b42ef4a4c0700fdad"}, + {file = "rpds_py-0.9.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c5934e2833afeaf36bd1eadb57256239785f5af0220ed8d21c2896ec4d3a765f"}, + {file = "rpds_py-0.9.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:095b460e117685867d45548fbd8598a8d9999227e9061ee7f012d9d264e6048d"}, + {file = "rpds_py-0.9.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:91378d9f4151adc223d584489591dbb79f78814c0734a7c3bfa9c9e09978121c"}, + {file = "rpds_py-0.9.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:24a81c177379300220e907e9b864107614b144f6c2a15ed5c3450e19cf536fae"}, + {file = "rpds_py-0.9.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:de0b6eceb46141984671802d412568d22c6bacc9b230174f9e55fc72ef4f57de"}, + {file = "rpds_py-0.9.2-cp311-none-win32.whl", hash = "sha256:700375326ed641f3d9d32060a91513ad668bcb7e2cffb18415c399acb25de2ab"}, + {file = "rpds_py-0.9.2-cp311-none-win_amd64.whl", hash = "sha256:0766babfcf941db8607bdaf82569ec38107dbb03c7f0b72604a0b346b6eb3298"}, + {file = "rpds_py-0.9.2-cp312-cp312-macosx_10_7_x86_64.whl", hash = "sha256:b1440c291db3f98a914e1afd9d6541e8fc60b4c3aab1a9008d03da4651e67386"}, + {file = "rpds_py-0.9.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0f2996fbac8e0b77fd67102becb9229986396e051f33dbceada3debaacc7033f"}, + {file = "rpds_py-0.9.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9f30d205755566a25f2ae0382944fcae2f350500ae4df4e795efa9e850821d82"}, + {file = "rpds_py-0.9.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:159fba751a1e6b1c69244e23ba6c28f879a8758a3e992ed056d86d74a194a0f3"}, + {file = "rpds_py-0.9.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a1f044792e1adcea82468a72310c66a7f08728d72a244730d14880cd1dabe36b"}, + {file = "rpds_py-0.9.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9251eb8aa82e6cf88510530b29eef4fac825a2b709baf5b94a6094894f252387"}, + {file = "rpds_py-0.9.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:01899794b654e616c8625b194ddd1e5b51ef5b60ed61baa7a2d9c2ad7b2a4238"}, + {file = "rpds_py-0.9.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b0c43f8ae8f6be1d605b0465671124aa8d6a0e40f1fb81dcea28b7e3d87ca1e1"}, + {file = "rpds_py-0.9.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:207f57c402d1f8712618f737356e4b6f35253b6d20a324d9a47cb9f38ee43a6b"}, + {file = "rpds_py-0.9.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:b52e7c5ae35b00566d244ffefba0f46bb6bec749a50412acf42b1c3f402e2c90"}, + {file = "rpds_py-0.9.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:978fa96dbb005d599ec4fd9ed301b1cc45f1a8f7982d4793faf20b404b56677d"}, + {file = "rpds_py-0.9.2-cp38-cp38-macosx_10_7_x86_64.whl", hash = "sha256:6aa8326a4a608e1c28da191edd7c924dff445251b94653988efb059b16577a4d"}, + {file = "rpds_py-0.9.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:aad51239bee6bff6823bbbdc8ad85136c6125542bbc609e035ab98ca1e32a192"}, + {file = "rpds_py-0.9.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4bd4dc3602370679c2dfb818d9c97b1137d4dd412230cfecd3c66a1bf388a196"}, + {file = "rpds_py-0.9.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:dd9da77c6ec1f258387957b754f0df60766ac23ed698b61941ba9acccd3284d1"}, + {file = "rpds_py-0.9.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:190ca6f55042ea4649ed19c9093a9be9d63cd8a97880106747d7147f88a49d18"}, + {file = "rpds_py-0.9.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:876bf9ed62323bc7dcfc261dbc5572c996ef26fe6406b0ff985cbcf460fc8a4c"}, + {file = "rpds_py-0.9.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fa2818759aba55df50592ecbc95ebcdc99917fa7b55cc6796235b04193eb3c55"}, + {file = "rpds_py-0.9.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9ea4d00850ef1e917815e59b078ecb338f6a8efda23369677c54a5825dbebb55"}, + {file = "rpds_py-0.9.2-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:5855c85eb8b8a968a74dc7fb014c9166a05e7e7a8377fb91d78512900aadd13d"}, + {file = "rpds_py-0.9.2-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:14c408e9d1a80dcb45c05a5149e5961aadb912fff42ca1dd9b68c0044904eb32"}, + {file = "rpds_py-0.9.2-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:65a0583c43d9f22cb2130c7b110e695fff834fd5e832a776a107197e59a1898e"}, + {file = "rpds_py-0.9.2-cp38-none-win32.whl", hash = "sha256:71f2f7715935a61fa3e4ae91d91b67e571aeb5cb5d10331ab681256bda2ad920"}, + {file = "rpds_py-0.9.2-cp38-none-win_amd64.whl", hash = "sha256:674c704605092e3ebbbd13687b09c9f78c362a4bc710343efe37a91457123044"}, + {file = "rpds_py-0.9.2-cp39-cp39-macosx_10_7_x86_64.whl", hash = "sha256:07e2c54bef6838fa44c48dfbc8234e8e2466d851124b551fc4e07a1cfeb37260"}, + {file = "rpds_py-0.9.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f7fdf55283ad38c33e35e2855565361f4bf0abd02470b8ab28d499c663bc5d7c"}, + {file = "rpds_py-0.9.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:890ba852c16ace6ed9f90e8670f2c1c178d96510a21b06d2fa12d8783a905193"}, + {file = "rpds_py-0.9.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:50025635ba8b629a86d9d5474e650da304cb46bbb4d18690532dd79341467846"}, + {file = "rpds_py-0.9.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:517cbf6e67ae3623c5127206489d69eb2bdb27239a3c3cc559350ef52a3bbf0b"}, + {file = "rpds_py-0.9.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0836d71ca19071090d524739420a61580f3f894618d10b666cf3d9a1688355b1"}, + {file = "rpds_py-0.9.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c439fd54b2b9053717cca3de9583be6584b384d88d045f97d409f0ca867d80f"}, + {file = "rpds_py-0.9.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f68996a3b3dc9335037f82754f9cdbe3a95db42bde571d8c3be26cc6245f2324"}, + {file = "rpds_py-0.9.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:7d68dc8acded354c972116f59b5eb2e5864432948e098c19fe6994926d8e15c3"}, + {file = "rpds_py-0.9.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:f963c6b1218b96db85fc37a9f0851eaf8b9040aa46dec112611697a7023da535"}, + {file = "rpds_py-0.9.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:5a46859d7f947061b4010e554ccd1791467d1b1759f2dc2ec9055fa239f1bc26"}, + {file = "rpds_py-0.9.2-cp39-none-win32.whl", hash = "sha256:e07e5dbf8a83c66783a9fe2d4566968ea8c161199680e8ad38d53e075df5f0d0"}, + {file = "rpds_py-0.9.2-cp39-none-win_amd64.whl", hash = "sha256:682726178138ea45a0766907957b60f3a1bf3acdf212436be9733f28b6c5af3c"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-macosx_10_7_x86_64.whl", hash = "sha256:196cb208825a8b9c8fc360dc0f87993b8b260038615230242bf18ec84447c08d"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:c7671d45530fcb6d5e22fd40c97e1e1e01965fc298cbda523bb640f3d923b387"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:83b32f0940adec65099f3b1c215ef7f1d025d13ff947975a055989cb7fd019a4"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7f67da97f5b9eac838b6980fc6da268622e91f8960e083a34533ca710bec8611"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:03975db5f103997904c37e804e5f340c8fdabbb5883f26ee50a255d664eed58c"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:987b06d1cdb28f88a42e4fb8a87f094e43f3c435ed8e486533aea0bf2e53d931"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c861a7e4aef15ff91233751619ce3a3d2b9e5877e0fcd76f9ea4f6847183aa16"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:02938432352359805b6da099c9c95c8a0547fe4b274ce8f1a91677401bb9a45f"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:ef1f08f2a924837e112cba2953e15aacfccbbfcd773b4b9b4723f8f2ddded08e"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-musllinux_1_2_i686.whl", hash = "sha256:35da5cc5cb37c04c4ee03128ad59b8c3941a1e5cd398d78c37f716f32a9b7f67"}, + {file = "rpds_py-0.9.2-pp310-pypy310_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:141acb9d4ccc04e704e5992d35472f78c35af047fa0cfae2923835d153f091be"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-macosx_10_7_x86_64.whl", hash = "sha256:79f594919d2c1a0cc17d1988a6adaf9a2f000d2e1048f71f298b056b1018e872"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:a06418fe1155e72e16dddc68bb3780ae44cebb2912fbd8bb6ff9161de56e1798"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8b2eb034c94b0b96d5eddb290b7b5198460e2d5d0c421751713953a9c4e47d10"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8b08605d248b974eb02f40bdcd1a35d3924c83a2a5e8f5d0fa5af852c4d960af"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a0805911caedfe2736935250be5008b261f10a729a303f676d3d5fea6900c96a"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ab2299e3f92aa5417d5e16bb45bb4586171c1327568f638e8453c9f8d9e0f020"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c8d7594e38cf98d8a7df25b440f684b510cf4627fe038c297a87496d10a174f"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8b9ec12ad5f0a4625db34db7e0005be2632c1013b253a4a60e8302ad4d462afd"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:1fcdee18fea97238ed17ab6478c66b2095e4ae7177e35fb71fbe561a27adf620"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-musllinux_1_2_i686.whl", hash = "sha256:933a7d5cd4b84f959aedeb84f2030f0a01d63ae6cf256629af3081cf3e3426e8"}, + {file = "rpds_py-0.9.2-pp38-pypy38_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:686ba516e02db6d6f8c279d1641f7067ebb5dc58b1d0536c4aaebb7bf01cdc5d"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-macosx_10_7_x86_64.whl", hash = "sha256:0173c0444bec0a3d7d848eaeca2d8bd32a1b43f3d3fde6617aac3731fa4be05f"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:d576c3ef8c7b2d560e301eb33891d1944d965a4d7a2eacb6332eee8a71827db6"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ed89861ee8c8c47d6beb742a602f912b1bb64f598b1e2f3d758948721d44d468"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1054a08e818f8e18910f1bee731583fe8f899b0a0a5044c6e680ceea34f93876"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:99e7c4bb27ff1aab90dcc3e9d37ee5af0231ed98d99cb6f5250de28889a3d502"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c545d9d14d47be716495076b659db179206e3fd997769bc01e2d550eeb685596"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9039a11bca3c41be5a58282ed81ae422fa680409022b996032a43badef2a3752"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fb39aca7a64ad0c9490adfa719dbeeb87d13be137ca189d2564e596f8ba32c07"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:2d8b3b3a2ce0eaa00c5bbbb60b6713e94e7e0becab7b3db6c5c77f979e8ed1f1"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-musllinux_1_2_i686.whl", hash = "sha256:99b1c16f732b3a9971406fbfe18468592c5a3529585a45a35adbc1389a529a03"}, + {file = "rpds_py-0.9.2-pp39-pypy39_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:c27ee01a6c3223025f4badd533bea5e87c988cb0ba2811b690395dfe16088cfe"}, + {file = "rpds_py-0.9.2.tar.gz", hash = "sha256:8d70e8f14900f2657c249ea4def963bed86a29b81f81f5b76b5a9215680de945"}, +] + +[[package]] +name = "s3transfer" +version = "0.6.1" +description = "An Amazon S3 Transfer Manager" +optional = true +python-versions = ">= 3.7" +files = [ + {file = "s3transfer-0.6.1-py3-none-any.whl", hash = "sha256:3c0da2d074bf35d6870ef157158641178a4204a6e689e82546083e31e0311346"}, + {file = "s3transfer-0.6.1.tar.gz", hash = "sha256:640bb492711f4c0c0905e1f62b6aaeb771881935ad27884852411f8e9cacbca9"}, +] + +[package.dependencies] +botocore = ">=1.12.36,<2.0a.0" + +[package.extras] +crt = ["botocore[crt] (>=1.20.29,<2.0a.0)"] + +[[package]] +name = "setuptools" +version = "68.0.0" +description = "Easily download, build, install, upgrade, and uninstall Python packages" +optional = false +python-versions = ">=3.7" +files = [ + {file = "setuptools-68.0.0-py3-none-any.whl", hash = "sha256:11e52c67415a381d10d6b462ced9cfb97066179f0e871399e006c4ab101fc85f"}, + {file = "setuptools-68.0.0.tar.gz", hash = "sha256:baf1fdb41c6da4cd2eae722e135500da913332ab3f2f5c7d33af9b492acb5235"}, +] + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (==0.8.3)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pip-run (>=8.8)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] + +[[package]] +name = "simplejson" +version = "3.19.1" +description = "Simple, fast, extensible JSON encoder/decoder for Python" +optional = false +python-versions = ">=2.5, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "simplejson-3.19.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:412e58997a30c5deb8cab5858b8e2e5b40ca007079f7010ee74565cc13d19665"}, + {file = "simplejson-3.19.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:e765b1f47293dedf77946f0427e03ee45def2862edacd8868c6cf9ab97c8afbd"}, + {file = "simplejson-3.19.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:3231100edee292da78948fa0a77dee4e5a94a0a60bcba9ed7a9dc77f4d4bb11e"}, + {file = "simplejson-3.19.1-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:081ea6305b3b5e84ae7417e7f45956db5ea3872ec497a584ec86c3260cda049e"}, + {file = "simplejson-3.19.1-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:f253edf694ce836631b350d758d00a8c4011243d58318fbfbe0dd54a6a839ab4"}, + {file = "simplejson-3.19.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:5db86bb82034e055257c8e45228ca3dbce85e38d7bfa84fa7b2838e032a3219c"}, + {file = "simplejson-3.19.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:69a8b10a4f81548bc1e06ded0c4a6c9042c0be0d947c53c1ed89703f7e613950"}, + {file = "simplejson-3.19.1-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:58ee5e24d6863b22194020eb62673cf8cc69945fcad6b283919490f6e359f7c5"}, + {file = "simplejson-3.19.1-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:73d0904c2471f317386d4ae5c665b16b5c50ab4f3ee7fd3d3b7651e564ad74b1"}, + {file = "simplejson-3.19.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:66d780047c31ff316ee305c3f7550f352d87257c756413632303fc59fef19eac"}, + {file = "simplejson-3.19.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:cd4d50a27b065447c9c399f0bf0a993bd0e6308db8bbbfbc3ea03b41c145775a"}, + {file = "simplejson-3.19.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0c16ec6a67a5f66ab004190829eeede01c633936375edcad7cbf06d3241e5865"}, + {file = "simplejson-3.19.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:17a963e8dd4d81061cc05b627677c1f6a12e81345111fbdc5708c9f088d752c9"}, + {file = "simplejson-3.19.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7e78d79b10aa92f40f54178ada2b635c960d24fc6141856b926d82f67e56d169"}, + {file = "simplejson-3.19.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ad071cd84a636195f35fa71de2186d717db775f94f985232775794d09f8d9061"}, + {file = "simplejson-3.19.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e7c70f19405e5f99168077b785fe15fcb5f9b3c0b70b0b5c2757ce294922c8c"}, + {file = "simplejson-3.19.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:54fca2b26bcd1c403146fd9461d1da76199442297160721b1d63def2a1b17799"}, + {file = "simplejson-3.19.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:48600a6e0032bed17c20319d91775f1797d39953ccfd68c27f83c8d7fc3b32cb"}, + {file = "simplejson-3.19.1-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:93f5ac30607157a0b2579af59a065bcfaa7fadeb4875bf927a8f8b6739c8d910"}, + {file = "simplejson-3.19.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:6b79642a599740603ca86cf9df54f57a2013c47e1dd4dd2ae4769af0a6816900"}, + {file = "simplejson-3.19.1-cp310-cp310-win32.whl", hash = "sha256:d9f2c27f18a0b94107d57294aab3d06d6046ea843ed4a45cae8bd45756749f3a"}, + {file = "simplejson-3.19.1-cp310-cp310-win_amd64.whl", hash = "sha256:5673d27806085d2a413b3be5f85fad6fca4b7ffd31cfe510bbe65eea52fff571"}, + {file = "simplejson-3.19.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:79c748aa61fd8098d0472e776743de20fae2686edb80a24f0f6593a77f74fe86"}, + {file = "simplejson-3.19.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:390f4a8ca61d90bcf806c3ad644e05fa5890f5b9a72abdd4ca8430cdc1e386fa"}, + {file = "simplejson-3.19.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d61482b5d18181e6bb4810b4a6a24c63a490c3a20e9fbd7876639653e2b30a1a"}, + {file = "simplejson-3.19.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2541fdb7467ef9bfad1f55b6c52e8ea52b3ce4a0027d37aff094190a955daa9d"}, + {file = "simplejson-3.19.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:46133bc7dd45c9953e6ee4852e3de3d5a9a4a03b068bd238935a5c72f0a1ce34"}, + {file = "simplejson-3.19.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f96def94576f857abf58e031ce881b5a3fc25cbec64b2bc4824824a8a4367af9"}, + {file = "simplejson-3.19.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9f14ecca970d825df0d29d5c6736ff27999ee7bdf5510e807f7ad8845f7760ce"}, + {file = "simplejson-3.19.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:66389b6b6ee46a94a493a933a26008a1bae0cfadeca176933e7ff6556c0ce998"}, + {file = "simplejson-3.19.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:22b867205cd258050c2625325fdd9a65f917a5aff22a23387e245ecae4098e78"}, + {file = "simplejson-3.19.1-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:c39fa911e4302eb79c804b221ddec775c3da08833c0a9120041dd322789824de"}, + {file = "simplejson-3.19.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:65dafe413b15e8895ad42e49210b74a955c9ae65564952b0243a18fb35b986cc"}, + {file = "simplejson-3.19.1-cp311-cp311-win32.whl", hash = "sha256:f05d05d99fce5537d8f7a0af6417a9afa9af3a6c4bb1ba7359c53b6257625fcb"}, + {file = "simplejson-3.19.1-cp311-cp311-win_amd64.whl", hash = "sha256:b46aaf0332a8a9c965310058cf3487d705bf672641d2c43a835625b326689cf4"}, + {file = "simplejson-3.19.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:b438e5eaa474365f4faaeeef1ec3e8d5b4e7030706e3e3d6b5bee6049732e0e6"}, + {file = "simplejson-3.19.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aa9d614a612ad02492f704fbac636f666fa89295a5d22b4facf2d665fc3b5ea9"}, + {file = "simplejson-3.19.1-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:46e89f58e4bed107626edce1cf098da3664a336d01fc78fddcfb1f397f553d44"}, + {file = "simplejson-3.19.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:96ade243fb6f3b57e7bd3b71e90c190cd0f93ec5dce6bf38734a73a2e5fa274f"}, + {file = "simplejson-3.19.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ed18728b90758d171f0c66c475c24a443ede815cf3f1a91e907b0db0ebc6e508"}, + {file = "simplejson-3.19.1-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:6a561320485017ddfc21bd2ed5de2d70184f754f1c9b1947c55f8e2b0163a268"}, + {file = "simplejson-3.19.1-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:2098811cd241429c08b7fc5c9e41fcc3f59f27c2e8d1da2ccdcf6c8e340ab507"}, + {file = "simplejson-3.19.1-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:8f8d179393e6f0cf6c7c950576892ea6acbcea0a320838c61968ac7046f59228"}, + {file = "simplejson-3.19.1-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:eff87c68058374e45225089e4538c26329a13499bc0104b52b77f8428eed36b2"}, + {file = "simplejson-3.19.1-cp36-cp36m-win32.whl", hash = "sha256:d300773b93eed82f6da138fd1d081dc96fbe53d96000a85e41460fe07c8d8b33"}, + {file = "simplejson-3.19.1-cp36-cp36m-win_amd64.whl", hash = "sha256:37724c634f93e5caaca04458f267836eb9505d897ab3947b52f33b191bf344f3"}, + {file = "simplejson-3.19.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:74bf802debe68627227ddb665c067eb8c73aa68b2476369237adf55c1161b728"}, + {file = "simplejson-3.19.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:70128fb92932524c89f373e17221cf9535d7d0c63794955cc3cd5868e19f5d38"}, + {file = "simplejson-3.19.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8090e75653ea7db75bc21fa5f7bcf5f7bdf64ea258cbbac45c7065f6324f1b50"}, + {file = "simplejson-3.19.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a755f7bfc8adcb94887710dc70cc12a69a454120c6adcc6f251c3f7b46ee6aac"}, + {file = "simplejson-3.19.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ccb2c1877bc9b25bc4f4687169caa925ffda605d7569c40e8e95186e9a5e58b"}, + {file = "simplejson-3.19.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:919bc5aa4d8094cf8f1371ea9119e5d952f741dc4162810ab714aec948a23fe5"}, + {file = "simplejson-3.19.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:e333c5b62e93949f5ac27e6758ba53ef6ee4f93e36cc977fe2e3df85c02f6dc4"}, + {file = "simplejson-3.19.1-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:3a4480e348000d89cf501b5606415f4d328484bbb431146c2971123d49fd8430"}, + {file = "simplejson-3.19.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:cb502cde018e93e75dc8fc7bb2d93477ce4f3ac10369f48866c61b5e031db1fd"}, + {file = "simplejson-3.19.1-cp37-cp37m-win32.whl", hash = "sha256:f41915a4e1f059dfad614b187bc06021fefb5fc5255bfe63abf8247d2f7a646a"}, + {file = "simplejson-3.19.1-cp37-cp37m-win_amd64.whl", hash = "sha256:3844305bc33d52c4975da07f75b480e17af3558c0d13085eaa6cc2f32882ccf7"}, + {file = "simplejson-3.19.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:1cb19eacb77adc5a9720244d8d0b5507421d117c7ed4f2f9461424a1829e0ceb"}, + {file = "simplejson-3.19.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:926957b278de22797bfc2f004b15297013843b595b3cd7ecd9e37ccb5fad0b72"}, + {file = "simplejson-3.19.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b0e9a5e66969f7a47dc500e3dba8edc3b45d4eb31efb855c8647700a3493dd8a"}, + {file = "simplejson-3.19.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:79d46e7e33c3a4ef853a1307b2032cfb7220e1a079d0c65488fbd7118f44935a"}, + {file = "simplejson-3.19.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:344a5093b71c1b370968d0fbd14d55c9413cb6f0355fdefeb4a322d602d21776"}, + {file = "simplejson-3.19.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:23fbb7b46d44ed7cbcda689295862851105c7594ae5875dce2a70eeaa498ff86"}, + {file = "simplejson-3.19.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4d3025e7e9ddb48813aec2974e1a7e68e63eac911dd5e0a9568775de107ac79a"}, + {file = "simplejson-3.19.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:87b190e6ceec286219bd6b6f13547ca433f977d4600b4e81739e9ac23b5b9ba9"}, + {file = "simplejson-3.19.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:dc935d8322ba9bc7b84f99f40f111809b0473df167bf5b93b89fb719d2c4892b"}, + {file = "simplejson-3.19.1-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:3b652579c21af73879d99c8072c31476788c8c26b5565687fd9db154070d852a"}, + {file = "simplejson-3.19.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6aa7ca03f25b23b01629b1c7f78e1cd826a66bfb8809f8977a3635be2ec48f1a"}, + {file = "simplejson-3.19.1-cp38-cp38-win32.whl", hash = "sha256:08be5a241fdf67a8e05ac7edbd49b07b638ebe4846b560673e196b2a25c94b92"}, + {file = "simplejson-3.19.1-cp38-cp38-win_amd64.whl", hash = "sha256:ca56a6c8c8236d6fe19abb67ef08d76f3c3f46712c49a3b6a5352b6e43e8855f"}, + {file = "simplejson-3.19.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:6424d8229ba62e5dbbc377908cfee9b2edf25abd63b855c21f12ac596cd18e41"}, + {file = "simplejson-3.19.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:547ea86ca408a6735335c881a2e6208851027f5bfd678d8f2c92a0f02c7e7330"}, + {file = "simplejson-3.19.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:889328873c35cb0b2b4c83cbb83ec52efee5a05e75002e2c0c46c4e42790e83c"}, + {file = "simplejson-3.19.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:44cdb4e544134f305b033ad79ae5c6b9a32e7c58b46d9f55a64e2a883fbbba01"}, + {file = "simplejson-3.19.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dc2b3f06430cbd4fac0dae5b2974d2bf14f71b415fb6de017f498950da8159b1"}, + {file = "simplejson-3.19.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d125e754d26c0298715bdc3f8a03a0658ecbe72330be247f4b328d229d8cf67f"}, + {file = "simplejson-3.19.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:476c8033abed7b1fd8db62a7600bf18501ce701c1a71179e4ce04ac92c1c5c3c"}, + {file = "simplejson-3.19.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:199a0bcd792811c252d71e3eabb3d4a132b3e85e43ebd93bfd053d5b59a7e78b"}, + {file = "simplejson-3.19.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:a79b439a6a77649bb8e2f2644e6c9cc0adb720fc55bed63546edea86e1d5c6c8"}, + {file = "simplejson-3.19.1-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:203412745fed916fc04566ecef3f2b6c872b52f1e7fb3a6a84451b800fb508c1"}, + {file = "simplejson-3.19.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5ca922c61d87b4c38f37aa706520328ffe22d7ac1553ef1cadc73f053a673553"}, + {file = "simplejson-3.19.1-cp39-cp39-win32.whl", hash = "sha256:3e0902c278243d6f7223ba3e6c5738614c971fd9a887fff8feaa8dcf7249c8d4"}, + {file = "simplejson-3.19.1-cp39-cp39-win_amd64.whl", hash = "sha256:d396b610e77b0c438846607cd56418bfc194973b9886550a98fd6724e8c6cfec"}, + {file = "simplejson-3.19.1-py3-none-any.whl", hash = "sha256:4710806eb75e87919b858af0cba4ffedc01b463edc3982ded7b55143f39e41e1"}, + {file = "simplejson-3.19.1.tar.gz", hash = "sha256:6277f60848a7d8319d27d2be767a7546bc965535b28070e310b3a9af90604a4c"}, +] + +[[package]] +name = "singer-sdk" +version = "0.30.0" +description = "A framework for building Singer taps" +optional = false +python-versions = ">=3.7.1,<3.12" +files = [ + {file = "singer_sdk-0.30.0-py3-none-any.whl", hash = "sha256:ca8e002ab6fce56c4e6f3312655c7b68896d1d07f88a9efeb373e74c58ceb9b8"}, + {file = "singer_sdk-0.30.0.tar.gz", hash = "sha256:73300d1c1bcb048b49a7f28c71ae26c9d309fdf3375e65940747b05c8a6551b5"}, +] + +[package.dependencies] +backoff = ">=2.0.0,<3.0" +click = ">=8.0,<9.0" +cryptography = ">=3.4.6,<42.0.0" +fs = ">=2.4.16,<3.0.0" +importlib-resources = {version = "5.12.0", markers = "python_version < \"3.9\""} +inflection = ">=0.5.1,<0.6.0" +joblib = ">=1.0.1,<2.0.0" +jsonpath-ng = ">=1.5.3,<2.0.0" +jsonschema = ">=4.16.0,<5.0.0" +memoization = ">=0.3.2,<0.5.0" +packaging = ">=23.1" +pendulum = ">=2.1.0,<3.0.0" +PyJWT = ">=2.4,<3.0" +pytest = {version = ">=7.2.1,<8.0.0", optional = true, markers = "extra == \"testing\""} +pytest-durations = {version = ">=1.2.0,<2.0.0", optional = true, markers = "extra == \"testing\""} +python-dotenv = ">=0.20,<0.22" +pytz = ">=2022.2.1,<2024.0.0" +PyYAML = ">=6.0,<7.0" +requests = ">=2.25.1,<3.0.0" +simplejson = ">=3.17.6,<4.0.0" +sqlalchemy = ">=1.4,<2.0" +typing-extensions = ">=4.2.0,<5.0.0" +urllib3 = ">=1.26,<2" + +[package.extras] +docs = ["furo (>=2022.12.7,<2024.0.0)", "myst-parser (>=0.17.2,<1.1.0)", "sphinx (>=4.5,<6.0)", "sphinx-autobuild (>=2021.3.14,<2022.0.0)", "sphinx-copybutton (>=0.3.1,<0.6.0)", "sphinx-inline-tabs (>=2023.4.21)", "sphinx-reredirects (>=0.1.1,<0.2.0)"] +s3 = ["fs-s3fs (>=1.1.1,<2.0.0)"] +testing = ["pytest (>=7.2.1,<8.0.0)", "pytest-durations (>=1.2.0,<2.0.0)"] + +[[package]] +name = "six" +version = "1.16.0" +description = "Python 2 and 3 compatibility utilities" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, + {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, +] + +[[package]] +name = "sqlalchemy" +version = "1.4.49" +description = "Database Abstraction Library" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" +files = [ + {file = "SQLAlchemy-1.4.49-cp27-cp27m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:2e126cf98b7fd38f1e33c64484406b78e937b1a280e078ef558b95bf5b6895f6"}, + {file = "SQLAlchemy-1.4.49-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:03db81b89fe7ef3857b4a00b63dedd632d6183d4ea5a31c5d8a92e000a41fc71"}, + {file = "SQLAlchemy-1.4.49-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:95b9df9afd680b7a3b13b38adf6e3a38995da5e162cc7524ef08e3be4e5ed3e1"}, + {file = "SQLAlchemy-1.4.49-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a63e43bf3f668c11bb0444ce6e809c1227b8f067ca1068898f3008a273f52b09"}, + {file = "SQLAlchemy-1.4.49-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f835c050ebaa4e48b18403bed2c0fda986525896efd76c245bdd4db995e51a4c"}, + {file = "SQLAlchemy-1.4.49-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c21b172dfb22e0db303ff6419451f0cac891d2e911bb9fbf8003d717f1bcf91"}, + {file = "SQLAlchemy-1.4.49-cp310-cp310-win32.whl", hash = "sha256:5fb1ebdfc8373b5a291485757bd6431de8d7ed42c27439f543c81f6c8febd729"}, + {file = "SQLAlchemy-1.4.49-cp310-cp310-win_amd64.whl", hash = "sha256:f8a65990c9c490f4651b5c02abccc9f113a7f56fa482031ac8cb88b70bc8ccaa"}, + {file = "SQLAlchemy-1.4.49-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:8923dfdf24d5aa8a3adb59723f54118dd4fe62cf59ed0d0d65d940579c1170a4"}, + {file = "SQLAlchemy-1.4.49-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a9ab2c507a7a439f13ca4499db6d3f50423d1d65dc9b5ed897e70941d9e135b0"}, + {file = "SQLAlchemy-1.4.49-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5debe7d49b8acf1f3035317e63d9ec8d5e4d904c6e75a2a9246a119f5f2fdf3d"}, + {file = "SQLAlchemy-1.4.49-cp311-cp311-win32.whl", hash = "sha256:82b08e82da3756765c2e75f327b9bf6b0f043c9c3925fb95fb51e1567fa4ee87"}, + {file = "SQLAlchemy-1.4.49-cp311-cp311-win_amd64.whl", hash = "sha256:171e04eeb5d1c0d96a544caf982621a1711d078dbc5c96f11d6469169bd003f1"}, + {file = "SQLAlchemy-1.4.49-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:36e58f8c4fe43984384e3fbe6341ac99b6b4e083de2fe838f0fdb91cebe9e9cb"}, + {file = "SQLAlchemy-1.4.49-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b31e67ff419013f99ad6f8fc73ee19ea31585e1e9fe773744c0f3ce58c039c30"}, + {file = "SQLAlchemy-1.4.49-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c14b29d9e1529f99efd550cd04dbb6db6ba5d690abb96d52de2bff4ed518bc95"}, + {file = "SQLAlchemy-1.4.49-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c40f3470e084d31247aea228aa1c39bbc0904c2b9ccbf5d3cfa2ea2dac06f26d"}, + {file = "SQLAlchemy-1.4.49-cp36-cp36m-win32.whl", hash = "sha256:706bfa02157b97c136547c406f263e4c6274a7b061b3eb9742915dd774bbc264"}, + {file = "SQLAlchemy-1.4.49-cp36-cp36m-win_amd64.whl", hash = "sha256:a7f7b5c07ae5c0cfd24c2db86071fb2a3d947da7bd487e359cc91e67ac1c6d2e"}, + {file = "SQLAlchemy-1.4.49-cp37-cp37m-macosx_11_0_x86_64.whl", hash = "sha256:4afbbf5ef41ac18e02c8dc1f86c04b22b7a2125f2a030e25bbb4aff31abb224b"}, + {file = "SQLAlchemy-1.4.49-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:24e300c0c2147484a002b175f4e1361f102e82c345bf263242f0449672a4bccf"}, + {file = "SQLAlchemy-1.4.49-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:201de072b818f8ad55c80d18d1a788729cccf9be6d9dc3b9d8613b053cd4836d"}, + {file = "SQLAlchemy-1.4.49-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7653ed6817c710d0c95558232aba799307d14ae084cc9b1f4c389157ec50df5c"}, + {file = "SQLAlchemy-1.4.49-cp37-cp37m-win32.whl", hash = "sha256:647e0b309cb4512b1f1b78471fdaf72921b6fa6e750b9f891e09c6e2f0e5326f"}, + {file = "SQLAlchemy-1.4.49-cp37-cp37m-win_amd64.whl", hash = "sha256:ab73ed1a05ff539afc4a7f8cf371764cdf79768ecb7d2ec691e3ff89abbc541e"}, + {file = "SQLAlchemy-1.4.49-cp38-cp38-macosx_11_0_x86_64.whl", hash = "sha256:37ce517c011560d68f1ffb28af65d7e06f873f191eb3a73af5671e9c3fada08a"}, + {file = "SQLAlchemy-1.4.49-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a1878ce508edea4a879015ab5215546c444233881301e97ca16fe251e89f1c55"}, + {file = "SQLAlchemy-1.4.49-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:0e8e608983e6f85d0852ca61f97e521b62e67969e6e640fe6c6b575d4db68557"}, + {file = "SQLAlchemy-1.4.49-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ccf956da45290df6e809ea12c54c02ace7f8ff4d765d6d3dfb3655ee876ce58d"}, + {file = "SQLAlchemy-1.4.49-cp38-cp38-win32.whl", hash = "sha256:f167c8175ab908ce48bd6550679cc6ea20ae169379e73c7720a28f89e53aa532"}, + {file = "SQLAlchemy-1.4.49-cp38-cp38-win_amd64.whl", hash = "sha256:45806315aae81a0c202752558f0df52b42d11dd7ba0097bf71e253b4215f34f4"}, + {file = "SQLAlchemy-1.4.49-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:b6d0c4b15d65087738a6e22e0ff461b407533ff65a73b818089efc8eb2b3e1de"}, + {file = "SQLAlchemy-1.4.49-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a843e34abfd4c797018fd8d00ffffa99fd5184c421f190b6ca99def4087689bd"}, + {file = "SQLAlchemy-1.4.49-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:1c890421651b45a681181301b3497e4d57c0d01dc001e10438a40e9a9c25ee77"}, + {file = "SQLAlchemy-1.4.49-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d26f280b8f0a8f497bc10573849ad6dc62e671d2468826e5c748d04ed9e670d5"}, + {file = "SQLAlchemy-1.4.49-cp39-cp39-win32.whl", hash = "sha256:ec2268de67f73b43320383947e74700e95c6770d0c68c4e615e9897e46296294"}, + {file = "SQLAlchemy-1.4.49-cp39-cp39-win_amd64.whl", hash = "sha256:bbdf16372859b8ed3f4d05f925a984771cd2abd18bd187042f24be4886c2a15f"}, + {file = "SQLAlchemy-1.4.49.tar.gz", hash = "sha256:06ff25cbae30c396c4b7737464f2a7fc37a67b7da409993b182b024cec80aed9"}, +] + +[package.dependencies] +greenlet = {version = "!=0.4.17", markers = "python_version >= \"3\" and (platform_machine == \"win32\" or platform_machine == \"WIN32\" or platform_machine == \"AMD64\" or platform_machine == \"amd64\" or platform_machine == \"x86_64\" or platform_machine == \"ppc64le\" or platform_machine == \"aarch64\")"} + +[package.extras] +aiomysql = ["aiomysql", "greenlet (!=0.4.17)"] +aiosqlite = ["aiosqlite", "greenlet (!=0.4.17)", "typing-extensions (!=3.10.0.1)"] +asyncio = ["greenlet (!=0.4.17)"] +asyncmy = ["asyncmy (>=0.2.3,!=0.2.4)", "greenlet (!=0.4.17)"] +mariadb-connector = ["mariadb (>=1.0.1,!=1.1.2)"] +mssql = ["pyodbc"] +mssql-pymssql = ["pymssql"] +mssql-pyodbc = ["pyodbc"] +mypy = ["mypy (>=0.910)", "sqlalchemy2-stubs"] +mysql = ["mysqlclient (>=1.4.0)", "mysqlclient (>=1.4.0,<2)"] +mysql-connector = ["mysql-connector-python"] +oracle = ["cx-oracle (>=7)", "cx-oracle (>=7,<8)"] +postgresql = ["psycopg2 (>=2.7)"] +postgresql-asyncpg = ["asyncpg", "greenlet (!=0.4.17)"] +postgresql-pg8000 = ["pg8000 (>=1.16.6,!=1.29.0)"] +postgresql-psycopg2binary = ["psycopg2-binary"] +postgresql-psycopg2cffi = ["psycopg2cffi"] +pymysql = ["pymysql", "pymysql (<1)"] +sqlcipher = ["sqlcipher3-binary"] + +[[package]] +name = "tomli" +version = "2.0.1" +description = "A lil' TOML parser" +optional = false +python-versions = ">=3.7" +files = [ + {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, + {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, +] + +[[package]] +name = "typing-extensions" +version = "4.7.1" +description = "Backported and Experimental Type Hints for Python 3.7+" +optional = false +python-versions = ">=3.7" +files = [ + {file = "typing_extensions-4.7.1-py3-none-any.whl", hash = "sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36"}, + {file = "typing_extensions-4.7.1.tar.gz", hash = "sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2"}, +] + +[[package]] +name = "urllib3" +version = "1.26.16" +description = "HTTP library with thread-safe connection pooling, file post, and more." +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" +files = [ + {file = "urllib3-1.26.16-py2.py3-none-any.whl", hash = "sha256:8d36afa7616d8ab714608411b4a3b13e58f463aee519024578e062e141dce20f"}, + {file = "urllib3-1.26.16.tar.gz", hash = "sha256:8f135f6502756bde6b2a9b28989df5fbe87c9970cecaa69041edcce7f0589b14"}, +] + +[package.extras] +brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] +secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"] +socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] + +[[package]] +name = "zipp" +version = "3.16.2" +description = "Backport of pathlib-compatible object wrapper for zip files" +optional = false +python-versions = ">=3.8" +files = [ + {file = "zipp-3.16.2-py3-none-any.whl", hash = "sha256:679e51dd4403591b2d6838a48de3d283f3d188412a9782faadf845f298736ba0"}, + {file = "zipp-3.16.2.tar.gz", hash = "sha256:ebc15946aa78bd63458992fc81ec3b6f7b1e92d51c35e6de1c3804e73b799147"}, +] + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy (>=0.9.1)", "pytest-ruff"] + +[extras] +s3 = ["fs-s3fs"] + +[metadata] +lock-version = "2.0" +python-versions = "<3.12,>=3.8" +content-hash = "3ee2b93868247473152935f964ba3adec66d859caa7b89d3f093498e3799f882" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..5bde9e2 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,58 @@ +[tool.poetry] +name = "tap-salesforce" +version = "0.0.1" +description = "`tap-salesforce` is a Singer tap for salesforce, built with the Meltano Singer SDK." +readme = "README.md" +authors = ["Ethan Stein"] +keywords = [ + "ELT", + "salesforce", +] +license = "Elastic-2.0" + +[tool.poetry.dependencies] +python = "<3.12,>=3.8" +singer-sdk = "^0.30.0" +fs-s3fs = { version = "^1.1.1", optional = true } +requests = "^2.28.2" + + +[tool.poetry.group.dev.dependencies] +pytest = "^7.2.1" +pendulum = "^2.1.2" +black = "^23.3.0" +singer-sdk = { version="*", extras = ["testing"] } + +[tool.poetry.extras] +s3 = ["fs-s3fs"] + +[tool.mypy] +python_version = "3.9" +warn_unused_configs = true + +[tool.ruff] +ignore = [ + "ANN101", # missing-type-self + "ANN102", # missing-type-cls +] +select = ["ALL"] +src = ["tap_salesforce"] +target-version = "py37" + + +[tool.ruff.flake8-annotations] +allow-star-arg-any = true + +[tool.ruff.isort] +known-first-party = ["tap_salesforce"] + +[tool.ruff.pydocstyle] +convention = "google" + +[build-system] +requires = ["poetry-core>=1.0.8"] +build-backend = "poetry.core.masonry.api" + +[tool.poetry.scripts] +# CLI declaration +tap-salesforce = 'tap_salesforce.tap:TapSalesforce.cli' diff --git a/setup.py b/setup.py deleted file mode 100644 index 050d9d8..0000000 --- a/setup.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python - -from setuptools import setup - -setup(name='tap-salesforce', - version='1.5.1', - description='Singer.io tap for extracting data from the Salesforce API', - author='Stitch', - url='https://singer.io', - classifiers=['Programming Language :: Python :: 3 :: Only'], - py_modules=['tap_salesforce'], - install_requires=[ - 'requests==2.31.0', - 'singer-python==5.3.1', - 'xmltodict==0.11.0', - 'simple-salesforce<1.0', # v1.0 requires `requests==2.22.0` - # fix version conflicts, see https://gitlab.com/meltano/meltano/issues/193 - 'idna==2.7', - 'cryptography', - 'pyOpenSSL', - ], - entry_points=''' - [console_scripts] - tap-salesforce=tap_salesforce:main - ''', - packages=['tap_salesforce', 'tap_salesforce.salesforce'], - package_data = { - 'tap_salesforce/schemas': [ - # add schema.json filenames here - ] - }, - include_package_data=True, -) diff --git a/tap_salesforce/__init__.py b/tap_salesforce/__init__.py index c6c8fb1..e94d9f1 100644 --- a/tap_salesforce/__init__.py +++ b/tap_salesforce/__init__.py @@ -1,557 +1 @@ -#!/usr/bin/env python3 -from __future__ import annotations -import asyncio -import concurrent.futures -import json -import sys -from copy import deepcopy - -import singer -import singer.utils as singer_utils -from singer import metadata, metrics - -import tap_salesforce.salesforce -from tap_salesforce.sync import (sync_stream, resume_syncing_bulk_query, get_stream_version) -from tap_salesforce.salesforce import Salesforce -from tap_salesforce.salesforce.exceptions import ( - TapSalesforceException, TapSalesforceQuotaExceededException) -from tap_salesforce.salesforce.credentials import ( - OAuthCredentials, - PasswordCredentials, - parse_credentials -) - -LOGGER = singer.get_logger() - -# the tap requires these keys -REQUIRED_CONFIG_KEYS = ['api_type', - 'select_fields_by_default'] - -# and either one of these credentials - -# OAuth: -# - client_id -# - client_secret -# - refresh_token -OAUTH_CONFIG_KEYS = OAuthCredentials._fields - -# Password: -# - username -# - password -# - security_token -PASSWORD_CONFIG_KEYS = PasswordCredentials._fields - -CONFIG = { - 'refresh_token': None, - 'client_id': None, - 'client_secret': None, - 'start_date': None -} - -FORCED_FULL_TABLE = { - 'BackgroundOperationResult' # Does not support ordering by CreatedDate -} - -def get_replication_key(sobject_name, fields): - if sobject_name in FORCED_FULL_TABLE: - return None - - fields_list = [f['name'] for f in fields] - - if 'SystemModstamp' in fields_list: - return 'SystemModstamp' - elif 'LastModifiedDate' in fields_list: - return 'LastModifiedDate' - elif 'CreatedDate' in fields_list: - return 'CreatedDate' - elif 'LoginTime' in fields_list and sobject_name == 'LoginHistory': - return 'LoginTime' - return None - -def stream_is_selected(mdata): - return mdata.get((), {}).get('selected', False) - -def build_state(raw_state, catalog): - state = {} - - for catalog_entry in catalog['streams']: - tap_stream_id = catalog_entry['tap_stream_id'] - catalog_metadata = metadata.to_map(catalog_entry['metadata']) - replication_method = catalog_metadata.get((), {}).get('replication-method') - - version = singer.get_bookmark(raw_state, - tap_stream_id, - 'version') - - # Preserve state that deals with resuming an incomplete bulk job - if singer.get_bookmark(raw_state, tap_stream_id, 'JobID'): - job_id = singer.get_bookmark(raw_state, tap_stream_id, 'JobID') - batches = singer.get_bookmark(raw_state, tap_stream_id, 'BatchIDs') - current_bookmark = singer.get_bookmark(raw_state, tap_stream_id, 'JobHighestBookmarkSeen') - state = singer.write_bookmark(state, tap_stream_id, 'JobID', job_id) - state = singer.write_bookmark(state, tap_stream_id, 'BatchIDs', batches) - state = singer.write_bookmark(state, tap_stream_id, 'JobHighestBookmarkSeen', current_bookmark) - - if replication_method == 'INCREMENTAL': - replication_key = catalog_metadata.get((), {}).get('replication-key') - replication_key_value = singer.get_bookmark(raw_state, - tap_stream_id, - replication_key) - if version is not None: - state = singer.write_bookmark( - state, tap_stream_id, 'version', version) - if replication_key_value is not None: - state = singer.write_bookmark( - state, tap_stream_id, replication_key, replication_key_value) - elif replication_method == 'FULL_TABLE' and version is None: - state = singer.write_bookmark(state, tap_stream_id, 'version', version) - - return state - -# pylint: disable=undefined-variable -def create_property_schema(field, mdata): - field_name = field['name'] - - if field_name == "Id": - mdata = metadata.write( - mdata, ('properties', field_name), 'inclusion', 'automatic') - else: - mdata = metadata.write( - mdata, ('properties', field_name), 'inclusion', 'available') - - property_schema, mdata = salesforce.field_to_property_schema(field, mdata) - - return (property_schema, mdata) - - -# pylint: disable=too-many-branches,too-many-statements -def do_discover(sf: Salesforce, streams: list[str]): - if not streams: - """Describes a Salesforce instance's objects and generates a JSON schema for each field.""" - LOGGER.info(f"Start discovery for all streams") - global_description = sf.describe() - objects_to_discover = {o['name'] for o in global_description['sobjects']} - else: - LOGGER.info(f"Start discovery: {streams=}") - objects_to_discover = streams - - key_properties = ['Id'] - - sf_custom_setting_objects = [] - object_to_tag_references = {} - - # For each SF Object describe it, loop its fields and build a schema - entries = [] - for sobject_name in objects_to_discover: - - # Skip blacklisted SF objects depending on the api_type in use - # ChangeEvent objects are not queryable via Bulk or REST (undocumented) - if sobject_name in sf.get_blacklisted_objects() \ - or sobject_name.endswith("ChangeEvent"): - continue - - sobject_description = sf.describe(sobject_name) - - # Cache customSetting and Tag objects to check for blacklisting after - # all objects have been described - if sobject_description.get("customSetting"): - sf_custom_setting_objects.append(sobject_name) - elif sobject_name.endswith("__Tag"): - relationship_field = next( - (f for f in sobject_description["fields"] if f.get("relationshipName") == "Item"), - None) - if relationship_field: - # Map {"Object":"Object__Tag"} - object_to_tag_references[relationship_field["referenceTo"] - [0]] = sobject_name - - fields = sobject_description['fields'] - replication_key = get_replication_key(sobject_name, fields) - - unsupported_fields = set() - properties = {} - mdata = metadata.new() - - found_id_field = False - - # Loop over the object's fields - for f in fields: - field_name = f['name'] - field_type = f['type'] - - if field_name == "Id": - found_id_field = True - - property_schema, mdata = create_property_schema( - f, mdata) - - # Compound Address fields cannot be queried by the Bulk API - if f['type'] == "address" and sf.api_type == tap_salesforce.salesforce.BULK_API_TYPE: - unsupported_fields.add( - (field_name, 'cannot query compound address fields with bulk API')) - - # we haven't been able to observe any records with a json field, so we - # are marking it as unavailable until we have an example to work with - if f['type'] == "json": - unsupported_fields.add( - (field_name, 'do not currently support json fields - please contact support')) - - # Blacklisted fields are dependent on the api_type being used - field_pair = (sobject_name, field_name) - if field_pair in sf.get_blacklisted_fields(): - unsupported_fields.add( - (field_name, sf.get_blacklisted_fields()[field_pair])) - - inclusion = metadata.get( - mdata, ('properties', field_name), 'inclusion') - - if sf.select_fields_by_default and inclusion != 'unsupported': - mdata = metadata.write( - mdata, ('properties', field_name), 'selected-by-default', True) - - properties[field_name] = property_schema - - if replication_key: - mdata = metadata.write( - mdata, ('properties', replication_key), 'inclusion', 'automatic') - - # There are cases where compound fields are referenced by the associated - # subfields but are not actually present in the field list - field_name_set = {f['name'] for f in fields} - filtered_unsupported_fields = [f for f in unsupported_fields if f[0] in field_name_set] - missing_unsupported_field_names = [f[0] for f in unsupported_fields if f[0] not in field_name_set] - - if missing_unsupported_field_names: - LOGGER.info("Ignoring the following unsupported fields for object %s as they are missing from the field list: %s", - sobject_name, - ', '.join(sorted(missing_unsupported_field_names))) - - if filtered_unsupported_fields: - LOGGER.info("Not syncing the following unsupported fields for object %s: %s", - sobject_name, - ', '.join(sorted([k for k, _ in filtered_unsupported_fields]))) - - # Salesforce Objects are skipped when they do not have an Id field - if not found_id_field: - LOGGER.info( - "Skipping Salesforce Object %s, as it has no Id field", - sobject_name) - continue - - # Any property added to unsupported_fields has metadata generated and - # removed - for prop, description in filtered_unsupported_fields: - if metadata.get(mdata, ('properties', prop), - 'selected-by-default'): - metadata.delete( - mdata, ('properties', prop), 'selected-by-default') - - mdata = metadata.write( - mdata, ('properties', prop), 'unsupported-description', description) - mdata = metadata.write( - mdata, ('properties', prop), 'inclusion', 'unsupported') - - if replication_key: - mdata = metadata.write( - mdata, (), 'valid-replication-keys', [replication_key]) - mdata = metadata.write( - mdata, (), 'replication-key', replication_key - ) - mdata = metadata.write( - mdata, (), 'replication-method', "INCREMENTAL" - ) - else: - mdata = metadata.write( - mdata, - (), - 'forced-replication-method', - { - 'replication-method': 'FULL_TABLE', - 'reason': 'No replication keys found from the Salesforce API'}) - - mdata = metadata.write(mdata, (), 'table-key-properties', key_properties) - - schema = { - 'type': 'object', - 'additionalProperties': False, - 'properties': properties - } - - entry = { - 'stream': sobject_name, - 'tap_stream_id': sobject_name, - 'schema': schema, - 'metadata': metadata.to_list(mdata) - } - - entries.append(entry) - - # For each custom setting field, remove its associated tag from entries - # See Blacklisting.md for more information - unsupported_tag_objects = [object_to_tag_references[f] - for f in sf_custom_setting_objects if f in object_to_tag_references] - if unsupported_tag_objects: - LOGGER.info( #pylint:disable=logging-not-lazy - "Skipping the following Tag objects, Tags on Custom Settings Salesforce objects " + - "are not supported by the Bulk API:") - LOGGER.info(unsupported_tag_objects) - entries = [e for e in entries if e['stream'] - not in unsupported_tag_objects] - - result = {'streams': entries} - json.dump(result, sys.stdout, indent=4) - - -def is_object_type(property_schema): - """ - Return true if the JSON Schema type is an object or None if detection fails. - This code is based on the Meltano SDK: - https://github.com/meltano/sdk/blob/c9c0967b0caca51fe7c87082f9e7c5dd54fa5dfa/singer_sdk/helpers/_typing.py#L50 - """ - if "anyOf" not in property_schema and "type" not in property_schema: - return None # Could not detect data type - for property_type in property_schema.get("anyOf", [property_schema.get("type")]): - if "object" in property_type or property_type == "object": - return True - return False - - -def is_property_selected( # noqa: C901 # ignore 'too complex' - stream_name, - metadata_map, - breadcrumb -) -> bool: - """ - Return True if the property is selected for extract. - Breadcrumb of `[]` or `None` indicates the stream itself. Otherwise, the - breadcrumb is the path to a property within the stream. - - The code is based on the Meltano SDK: - https://github.com/meltano/sdk/blob/c9c0967b0caca51fe7c87082f9e7c5dd54fa5dfa/singer_sdk/helpers/_catalog.py#L63 - """ - breadcrumb = breadcrumb or () - if isinstance(breadcrumb, str): - breadcrumb = tuple([breadcrumb]) - - if not metadata: - # Default to true if no metadata to say otherwise - return True - - md_entry = metadata_map.get(breadcrumb, {}) - parent_value = None - if len(breadcrumb) > 0: - parent_breadcrumb = tuple(list(breadcrumb)[:-2]) - parent_value = is_property_selected( - stream_name, metadata_map, parent_breadcrumb - ) - if parent_value is False: - return parent_value - - selected = md_entry.get("selected") - selected_by_default = md_entry.get("selected-by-default") - inclusion = md_entry.get("inclusion") - - if inclusion == "unsupported": - if selected is True: - LOGGER.debug( - "Property '%s' was selected but is not supported. " - "Ignoring selected==True input.", - ":".join(breadcrumb), - ) - return False - - if inclusion == "automatic": - if selected is False: - LOGGER.debug( - "Property '%s' was deselected while also set " - "for automatic inclusion. Ignoring selected==False input.", - ":".join(breadcrumb), - ) - return True - - if selected is not None: - return selected - - if selected_by_default is not None: - return selected_by_default - - LOGGER.debug( - "Selection metadata omitted for '%s':'%s'. " - "Using parent value of selected=%s.", - stream_name, - breadcrumb, - parent_value, - ) - return parent_value or False - - -def pop_deselected_schema( - schema, - stream_name, - breadcrumb, - metadata_map -): - """Remove anything from schema that is not selected. - Walk through schema, starting at the index in breadcrumb, recursively updating in - place. - This code is based on https://github.com/meltano/sdk/blob/c9c0967b0caca51fe7c87082f9e7c5dd54fa5dfa/singer_sdk/helpers/_catalog.py#L146 - """ - for property_name, val in list(schema.get("properties", {}).items()): - property_breadcrumb = tuple( - list(breadcrumb) + ["properties", property_name] - ) - selected = is_property_selected( - stream_name, metadata_map, property_breadcrumb - ) - LOGGER.info(stream_name + '.' + property_name + ' - ' + str(selected)) - if not selected: - schema["properties"].pop(property_name) - continue - - if is_object_type(val): - # call recursively in case any subproperties are deselected. - pop_deselected_schema( - val, stream_name, property_breadcrumb, metadata_map - ) - - -async def sync_catalog_entry(sf, catalog_entry, state): - stream_version = get_stream_version(catalog_entry, state) - stream = catalog_entry['stream'] - stream_alias = catalog_entry.get('stream_alias') - stream_name = catalog_entry["tap_stream_id"] - activate_version_message = singer.ActivateVersionMessage( - stream=(stream_alias or stream), version=stream_version) - - catalog_metadata = metadata.to_map(catalog_entry['metadata']) - replication_key = catalog_metadata.get((), {}).get('replication-key') - - mdata = metadata.to_map(catalog_entry['metadata']) - - if not stream_is_selected(mdata): - LOGGER.debug("%s: Skipping - not selected", stream_name) - return - - LOGGER.info("%s: Starting", stream_name) - - singer.write_state(state) - key_properties = metadata.to_map(catalog_entry['metadata']).get((), {}).get('table-key-properties') - - # Filter the schema for selected fields - schema = deepcopy(catalog_entry['schema']) - pop_deselected_schema(schema, stream_name, (), mdata) - - singer.write_schema( - stream, - schema, - key_properties, - replication_key, - stream_alias) - loop = asyncio.get_event_loop() - - job_id = singer.get_bookmark(state, catalog_entry['tap_stream_id'], 'JobID') - if job_id: - with metrics.record_counter(stream) as counter: - LOGGER.info("Found JobID from previous Bulk Query. Resuming sync for job: %s", job_id) - # Resuming a sync should clear out the remaining state once finished - await loop.run_in_executor(None, resume_syncing_bulk_query, sf, catalog_entry, job_id, state, counter) - LOGGER.info("Completed sync for %s", stream_name) - state.get('bookmarks', {}).get(catalog_entry['tap_stream_id'], {}).pop('JobID', None) - state.get('bookmarks', {}).get(catalog_entry['tap_stream_id'], {}).pop('BatchIDs', None) - bookmark = state.get('bookmarks', {}).get(catalog_entry['tap_stream_id'], {}).pop('JobHighestBookmarkSeen', None) - state = singer.write_bookmark( - state, - catalog_entry['tap_stream_id'], - replication_key, - bookmark) - singer.write_state(state) - else: - state_msg_threshold = CONFIG.get('state_message_threshold', 1000) - - # Tables with a replication_key or an empty bookmark will emit an - # activate_version at the beginning of their sync - bookmark_is_empty = state.get('bookmarks', {}).get( - catalog_entry['tap_stream_id']) is None - - if replication_key or bookmark_is_empty: - singer.write_message(activate_version_message) - state = singer.write_bookmark(state, - catalog_entry['tap_stream_id'], - 'version', - stream_version) - await loop.run_in_executor(None, sync_stream, sf, catalog_entry, state, state_msg_threshold) - LOGGER.info("Completed sync for %s", stream_name) - -def do_sync(sf, catalog, state): - LOGGER.info("Starting sync") - - max_workers = CONFIG.get('max_workers', 8) - executor = concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) - loop = asyncio.get_event_loop() - loop.set_default_executor(executor) - - try: - streams_to_sync = catalog["streams"] - - # Schedule one task for each catalog entry to be extracted - # and run them concurrently. - sync_tasks = (sync_catalog_entry(sf, catalog_entry, state) - for catalog_entry in streams_to_sync) - tasks = asyncio.gather(*sync_tasks) - loop.run_until_complete(tasks) - finally: - loop.run_until_complete(loop.shutdown_asyncgens()) - loop.close() - - singer.write_state(state) - LOGGER.info("Finished sync") - -def main_impl(): - args = singer_utils.parse_args(REQUIRED_CONFIG_KEYS) - CONFIG.update(args.config) - - credentials = parse_credentials(CONFIG) - sf = None - try: - sf = Salesforce( - credentials=credentials, - quota_percent_total=CONFIG.get('quota_percent_total'), - quota_percent_per_run=CONFIG.get('quota_percent_per_run'), - is_sandbox=CONFIG.get('is_sandbox'), - select_fields_by_default=CONFIG.get('select_fields_by_default'), - default_start_date=CONFIG.get('start_date'), - api_type=CONFIG.get('api_type')) - sf.login() - - if args.discover: - do_discover(sf, CONFIG.get("streams_to_discover", [])) - elif args.properties or args.catalog: - catalog = args.properties or args.catalog.to_dict() - state = build_state(args.state, catalog) - do_sync(sf, catalog, state) - finally: - if sf: - if sf.rest_requests_attempted > 0: - LOGGER.debug( - "This job used %s REST requests towards the Salesforce quota.", - sf.rest_requests_attempted) - if sf.jobs_completed > 0: - LOGGER.debug( - "Replication used %s Bulk API jobs towards the Salesforce quota.", - sf.jobs_completed) - if sf.auth.login_timer: - sf.auth.login_timer.cancel() - - -def main(): - try: - main_impl() - except TapSalesforceQuotaExceededException as e: - LOGGER.critical(e) - sys.exit(2) - except TapSalesforceException as e: - LOGGER.critical(e) - sys.exit(1) - except Exception as e: - LOGGER.critical(e) - raise e +"""Tap for salesforce.""" diff --git a/tap_salesforce/__main__.py b/tap_salesforce/__main__.py deleted file mode 100644 index f98a75c..0000000 --- a/tap_salesforce/__main__.py +++ /dev/null @@ -1,4 +0,0 @@ -import tap_salesforce - -if __name__ == "__main__": - tap_salesforce.main() diff --git a/tap_salesforce/client.py b/tap_salesforce/client.py new file mode 100644 index 0000000..a9044e9 --- /dev/null +++ b/tap_salesforce/client.py @@ -0,0 +1,94 @@ +"""REST client handling, including SalesforceStream base class.""" + +from __future__ import annotations + +from typing import Any, Callable + +import requests + +from singer_sdk.authenticators import BearerTokenAuthenticator +from singer_sdk.streams import RESTStream + +_Auth = Callable[[requests.PreparedRequest], requests.PreparedRequest] + +class SalesforceStream(RESTStream): + """salesforce stream class.""" + version = "v58.0" + records_jsonpath = "$[*]" # Or override `parse_response`. + + # Set this value or override `get_new_paginator`. + next_page_token_jsonpath = "$.next_page" # noqa: S105 + + @property + def url_base(self): + domain = self.config["domain"] + return f"https://{domain}.salesforce.com/services/data/{self.version}" + + @property + def authenticator(self) -> _Auth: + """Return a new authenticator object. + + Returns: + An authenticator instance. + """ + + auth_type = self.config["auth"]["flow"] + + if auth_type == "oauth": + access_token = self.config["auth"]["access_token"] + else: + grant_type = "password" + client_id = self.config["client_id"] + client_secret = self.config["client_secret"] + username = self.config["auth"]["username"] + password = self.config["auth"]["password"] + url = "https://login.salesforce.com/services/oauth2/token" + login_response = requests.post( + url, + params={ + "grant_type": grant_type, + "client_id": client_id, + "client_secret": client_secret, + "username": username, + "password": password, + }, + ) + access_token = login_response.json().get("access_token") + return BearerTokenAuthenticator.create_for_stream( + self, + token=access_token, + ) + + @property + def http_headers(self) -> dict: + """Return the http headers needed. + + Returns: + A dictionary of HTTP headers. + """ + headers = {} + if "user_agent" in self.config: + headers["User-Agent"] = self.config.get("user_agent") + return headers + + def get_url_params( + self, + context: dict | None, + next_page_token: Any | None, + ) -> dict[str, Any]: + """Return a dictionary of values to be used in URL parameterization. + + Args: + context: The stream context. + next_page_token: The next page index or value. + + Returns: + A dictionary of URL query parameters. + """ + params: dict = {} + if next_page_token: + params["page"] = next_page_token + if self.replication_key: + params["sort"] = "asc" + params["order_by"] = self.replication_key + return params diff --git a/tap_salesforce/salesforce/__init__.py b/tap_salesforce/salesforce/__init__.py deleted file mode 100644 index f3bc7e0..0000000 --- a/tap_salesforce/salesforce/__init__.py +++ /dev/null @@ -1,389 +0,0 @@ -import re -import time -import backoff -import requests -from requests.exceptions import RequestException -import singer -import singer.utils as singer_utils -from singer import metadata, metrics - -from tap_salesforce.salesforce.bulk import Bulk -from tap_salesforce.salesforce.rest import Rest -from tap_salesforce.salesforce.exceptions import ( - TapSalesforceException, - TapSalesforceQuotaExceededException) -from tap_salesforce.salesforce.credentials import SalesforceAuth - - -LOGGER = singer.get_logger() - -BULK_API_TYPE = "BULK" -REST_API_TYPE = "REST" - -STRING_TYPES = set([ - 'id', - 'string', - 'picklist', - 'textarea', - 'phone', - 'url', - 'reference', - 'multipicklist', - 'combobox', - 'encryptedstring', - 'email', - 'complexvalue', # TODO: Unverified - 'masterrecord', - 'datacategorygroupreference', - 'base64' -]) - -NUMBER_TYPES = set([ - 'double', - 'currency', - 'percent' -]) - -DATE_TYPES = set([ - 'datetime', - 'date' -]) - -BINARY_TYPES = set([ - 'byte' -]) - -LOOSE_TYPES = set([ - 'anyType', - - # A calculated field's type can be any of the supported - # formula data types (see https://developer.salesforce.com/docs/#i1435527) - 'calculated' -]) - - -# The following objects are not supported by the bulk API. -UNSUPPORTED_BULK_API_SALESFORCE_OBJECTS = set(['AssetTokenEvent', - 'AttachedContentNote', - 'EventWhoRelation', - 'QuoteTemplateRichTextData', - 'TaskWhoRelation', - 'SolutionStatus', - 'ContractStatus', - 'RecentlyViewed', - 'DeclinedEventRelation', - 'AcceptedEventRelation', - 'TaskStatus', - 'PartnerRole', - 'TaskPriority', - 'CaseStatus', - 'UndecidedEventRelation', - 'OrderStatus']) - -# The following objects have certain WHERE clause restrictions so we exclude them. -QUERY_RESTRICTED_SALESFORCE_OBJECTS = set(['Announcement', - 'ContentDocumentLink', - 'CollaborationGroupRecord', - 'Vote', - 'IdeaComment', - 'FieldDefinition', - 'PlatformAction', - 'UserEntityAccess', - 'RelationshipInfo', - 'ContentFolderMember', - 'ContentFolderItem', - 'SearchLayout', - 'SiteDetail', - 'EntityParticle', - 'OwnerChangeOptionInfo', - 'DataStatistics', - 'UserFieldAccess', - 'PicklistValueInfo', - 'RelationshipDomain', - 'FlexQueueItem', - 'NetworkUserHistoryRecent', - 'FieldHistoryArchive', - 'RecordActionHistory', - 'FlowVersionView', - 'FlowVariableView', - 'AppTabMember', - 'ColorDefinition', - 'IconDefinition',]) - -# The following objects are not supported by the query method being used. -QUERY_INCOMPATIBLE_SALESFORCE_OBJECTS = set(['DataType', - 'ListViewChartInstance', - 'FeedLike', - 'OutgoingEmail', - 'OutgoingEmailRelation', - 'FeedSignal', - 'ActivityHistory', - 'EmailStatus', - 'UserRecordAccess', - 'Name', - 'AggregateResult', - 'OpenActivity', - 'ProcessInstanceHistory', - 'OwnedContentDocument', - 'FolderedContentDocument', - 'FeedTrackedChange', - 'CombinedAttachment', - 'AttachedContentDocument', - 'ContentBody', - 'NoteAndAttachment', - 'LookedUpFromActivity', - 'AttachedContentNote', - 'QuoteTemplateRichTextData']) - -def log_backoff_attempt(details): - LOGGER.info("ConnectionError detected, triggering backoff: %d try", details.get("tries")) - - -def field_to_property_schema(field, mdata): - property_schema = {} - - field_name = field['name'] - sf_type = field['type'] - - if sf_type in STRING_TYPES: - property_schema['type'] = "string" - elif sf_type in DATE_TYPES: - date_type = {"type": "string", "format": "date-time"} - string_type = {"type": ["string", "null"]} - property_schema["anyOf"] = [date_type, string_type] - elif sf_type == "boolean": - property_schema['type'] = "boolean" - elif sf_type in NUMBER_TYPES: - property_schema['type'] = "number" - elif sf_type == "address": - property_schema['type'] = "object" - property_schema['properties'] = { - "street": {"type": ["null", "string"]}, - "state": {"type": ["null", "string"]}, - "postalCode": {"type": ["null", "string"]}, - "city": {"type": ["null", "string"]}, - "country": {"type": ["null", "string"]}, - "longitude": {"type": ["null", "number"]}, - "latitude": {"type": ["null", "number"]}, - "geocodeAccuracy": {"type": ["null", "string"]} - } - elif sf_type in ("int", "long"): - property_schema['type'] = "integer" - elif sf_type == "time": - property_schema['type'] = "string" - elif sf_type in LOOSE_TYPES: - return property_schema, mdata # No type = all types - elif sf_type in BINARY_TYPES: - mdata = metadata.write(mdata, ('properties', field_name), "inclusion", "unsupported") - mdata = metadata.write(mdata, ('properties', field_name), - "unsupported-description", "binary data") - return property_schema, mdata - elif sf_type == 'location': - # geo coordinates are numbers or objects divided into two fields for lat/long - property_schema['type'] = ["number", "object", "null"] - property_schema['properties'] = { - "longitude": {"type": ["null", "number"]}, - "latitude": {"type": ["null", "number"]} - } - elif sf_type == 'json': - property_schema['type'] = "string" - else: - raise TapSalesforceException("Found unsupported type: {}".format(sf_type)) - - # The nillable field cannot be trusted - if field_name != 'Id' and sf_type != 'location' and sf_type not in DATE_TYPES: - property_schema['type'] = ["null", property_schema['type']] - - return property_schema, mdata - -class Salesforce(): - # pylint: disable=too-many-instance-attributes,too-many-arguments - def __init__(self, - credentials=None, - token=None, - quota_percent_per_run=None, - quota_percent_total=None, - is_sandbox=None, - select_fields_by_default=None, - default_start_date=None, - api_type=None): - self.api_type = api_type.upper() if api_type else None - self.session = requests.Session() - if isinstance(quota_percent_per_run, str) and quota_percent_per_run.strip() == '': - quota_percent_per_run = None - if isinstance(quota_percent_total, str) and quota_percent_total.strip() == '': - quota_percent_total = None - - self.quota_percent_per_run = float(quota_percent_per_run) if quota_percent_per_run is not None else 25 - self.quota_percent_total = float(quota_percent_total) if quota_percent_total is not None else 80 - self.is_sandbox = is_sandbox is True or (isinstance(is_sandbox, str) and is_sandbox.lower() == 'true') - self.select_fields_by_default = select_fields_by_default is True or (isinstance(select_fields_by_default, str) and select_fields_by_default.lower() == 'true') - self.default_start_date = default_start_date - self.rest_requests_attempted = 0 - self.jobs_completed = 0 - self.data_url = "{}/services/data/v53.0/{}" - self.pk_chunking = False - - self.auth = SalesforceAuth.from_credentials(credentials, is_sandbox=self.is_sandbox) - - # validate start_date - singer_utils.strptime(default_start_date) - - # pylint: disable=anomalous-backslash-in-string,line-too-long - def check_rest_quota_usage(self, headers): - match = re.search('^api-usage=(\d+)/(\d+)$', headers.get('Sforce-Limit-Info')) - - if match is None: - return - - remaining, allotted = map(int, match.groups()) - - LOGGER.info("Used %s of %s daily REST API quota", remaining, allotted) - - percent_used_from_total = (remaining / allotted) * 100 - max_requests_for_run = int((self.quota_percent_per_run * allotted) / 100) - - if percent_used_from_total > self.quota_percent_total: - total_message = ("Salesforce has reported {}/{} ({:3.2f}%) total REST quota " + - "used across all Salesforce Applications. Terminating " + - "replication to not continue past configured percentage " + - "of {}% total quota.").format(remaining, - allotted, - percent_used_from_total, - self.quota_percent_total) - raise TapSalesforceQuotaExceededException(total_message) - elif self.rest_requests_attempted > max_requests_for_run: - partial_message = ("This replication job has made {} REST requests ({:3.2f}% of " + - "total quota). Terminating replication due to allotted " + - "quota of {}% per replication.").format(self.rest_requests_attempted, - (self.rest_requests_attempted / allotted) * 100, - self.quota_percent_per_run) - raise TapSalesforceQuotaExceededException(partial_message) - - def login(self): - self.auth.login() - - @property - def instance_url(self): - return self.auth.instance_url - - # pylint: disable=too-many-arguments - @backoff.on_exception(backoff.expo, - requests.exceptions.ConnectionError, - max_tries=10, - factor=2, - on_backoff=log_backoff_attempt) - def _make_request(self, http_method, url, headers=None, body=None, stream=False, params=None): - if http_method == "GET": - LOGGER.info("Making %s request to %s with params: %s", http_method, url, params) - resp = self.session.get(url, headers=headers, stream=stream, params=params) - elif http_method == "POST": - LOGGER.info("Making %s request to %s with body %s", http_method, url, body) - resp = self.session.post(url, headers=headers, data=body) - else: - raise TapSalesforceException("Unsupported HTTP method") - - resp.raise_for_status() - - if resp.headers.get('Sforce-Limit-Info') is not None: - self.rest_requests_attempted += 1 - self.check_rest_quota_usage(resp.headers) - - return resp - - def describe(self, sobject=None): - """Describes all objects or a specific object""" - headers = self.auth.rest_headers - instance_url = self.auth.instance_url - if sobject is None: - endpoint = "sobjects" - endpoint_tag = "sobjects" - url = self.data_url.format(instance_url, endpoint) - else: - endpoint = "sobjects/{}/describe".format(sobject) - endpoint_tag = sobject - url = self.data_url.format(instance_url, endpoint) - - with metrics.http_request_timer("describe") as timer: - timer.tags['endpoint'] = endpoint_tag - resp = self._make_request('GET', url, headers=headers) - - return resp.json() - - # pylint: disable=no-self-use - def _get_selected_properties(self, catalog_entry): - mdata = metadata.to_map(catalog_entry['metadata']) - properties = catalog_entry['schema'].get('properties', {}) - - return [k for k in properties.keys() - if singer.should_sync_field(metadata.get(mdata, ('properties', k), 'inclusion'), - metadata.get(mdata, ('properties', k), 'selected'), - self.select_fields_by_default)] - - - def get_start_date(self, state, catalog_entry): - catalog_metadata = metadata.to_map(catalog_entry['metadata']) - replication_key = catalog_metadata.get((), {}).get('replication-key') - - return (singer.get_bookmark(state, - catalog_entry['tap_stream_id'], - replication_key) or self.default_start_date) - - def _build_query_string(self, catalog_entry, start_date, end_date=None, order_by_clause=True): - selected_properties = self._get_selected_properties(catalog_entry) - - query = "SELECT {} FROM {}".format(",".join(selected_properties), catalog_entry['stream']) - - catalog_metadata = metadata.to_map(catalog_entry['metadata']) - replication_key = catalog_metadata.get((), {}).get('replication-key') - - if replication_key: - where_clause = " WHERE {} >= {} ".format( - replication_key, - start_date) - if end_date: - end_date_clause = " AND {} < {}".format(replication_key, end_date) - else: - end_date_clause = "" - - order_by = " ORDER BY {} ASC".format(replication_key) - if order_by_clause: - return query + where_clause + end_date_clause + order_by - - return query + where_clause + end_date_clause - else: - return query - - def query(self, catalog_entry, state): - if self.api_type == BULK_API_TYPE: - bulk = Bulk(self) - return bulk.query(catalog_entry, state) - elif self.api_type == REST_API_TYPE: - rest = Rest(self) - return rest.query(catalog_entry, state) - else: - raise TapSalesforceException( - "api_type should be REST or BULK was: {}".format( - self.api_type)) - - def get_blacklisted_objects(self): - if self.api_type == BULK_API_TYPE: - return UNSUPPORTED_BULK_API_SALESFORCE_OBJECTS.union( - QUERY_RESTRICTED_SALESFORCE_OBJECTS).union(QUERY_INCOMPATIBLE_SALESFORCE_OBJECTS) - elif self.api_type == REST_API_TYPE: - return QUERY_RESTRICTED_SALESFORCE_OBJECTS.union(QUERY_INCOMPATIBLE_SALESFORCE_OBJECTS) - else: - raise TapSalesforceException( - "api_type should be REST or BULK was: {}".format( - self.api_type)) - - # pylint: disable=line-too-long - def get_blacklisted_fields(self): - if self.api_type == BULK_API_TYPE: - return {('EntityDefinition', 'RecordTypesSupported'): "this field is unsupported by the Bulk API."} - elif self.api_type == REST_API_TYPE: - return {} - else: - raise TapSalesforceException( - "api_type should be REST or BULK was: {}".format( - self.api_type)) diff --git a/tap_salesforce/salesforce/bulk.py b/tap_salesforce/salesforce/bulk.py deleted file mode 100644 index 13f2b69..0000000 --- a/tap_salesforce/salesforce/bulk.py +++ /dev/null @@ -1,338 +0,0 @@ -# pylint: disable=protected-access -import csv -import json -import sys -import time -import tempfile -import singer -from singer import metrics -from requests.exceptions import RequestException - -import xmltodict - -from tap_salesforce.salesforce.exceptions import ( - TapSalesforceException, TapSalesforceQuotaExceededException) - -BATCH_STATUS_POLLING_SLEEP = 20 -PK_CHUNKED_BATCH_STATUS_POLLING_SLEEP = 60 -ITER_CHUNK_SIZE = 1024 -DEFAULT_CHUNK_SIZE = 50000 - -LOGGER = singer.get_logger() - -# pylint: disable=inconsistent-return-statements -def find_parent(stream): - parent_stream = stream - if stream.endswith("CleanInfo"): - parent_stream = stream[:stream.find("CleanInfo")] - elif stream.endswith("FieldHistory"): - parent_stream = stream[:stream.find("FieldHistory")] - elif stream.endswith("History"): - parent_stream = stream[:stream.find("History")] - - # If the stripped stream ends with "__" we can assume the parent is a custom table - if parent_stream.endswith("__"): - parent_stream += 'c' - - return parent_stream - - -class Bulk(): - - bulk_url = "{}/services/async/53.0/{}" - - def __init__(self, sf): - # Set csv max reading size to the platform's max size available. - csv.field_size_limit(sys.maxsize) - self.sf = sf - - def query(self, catalog_entry, state): - self.check_bulk_quota_usage() - - for record in self._bulk_query(catalog_entry, state): - yield record - - self.sf.jobs_completed += 1 - - # pylint: disable=line-too-long - def check_bulk_quota_usage(self): - endpoint = "limits" - url = self.sf.data_url.format(self.sf.instance_url, endpoint) - - with metrics.http_request_timer(endpoint): - resp = self.sf._make_request('GET', url, headers=self.sf.auth.rest_headers).json() - - quota_max = resp['DailyBulkApiBatches']['Max'] - max_requests_for_run = int((self.sf.quota_percent_per_run * quota_max) / 100) - - quota_remaining = resp['DailyBulkApiBatches']['Remaining'] - percent_used = (1 - (quota_remaining / quota_max)) * 100 - - if percent_used > self.sf.quota_percent_total: - total_message = ("Salesforce has reported {}/{} ({:3.2f}%) total Bulk API quota " + - "used across all Salesforce Applications. Terminating " + - "replication to not continue past configured percentage " + - "of {}% total quota.").format(quota_max - quota_remaining, - quota_max, - percent_used, - self.sf.quota_percent_total) - raise TapSalesforceQuotaExceededException(total_message) - elif self.sf.jobs_completed > max_requests_for_run: - partial_message = ("This replication job has completed {} Bulk API jobs ({:3.2f}% of " + - "total quota). Terminating replication due to allotted " + - "quota of {}% per replication.").format(self.sf.jobs_completed, - (self.sf.jobs_completed / quota_max) * 100, - self.sf.quota_percent_per_run) - raise TapSalesforceQuotaExceededException(partial_message) - - def _get_bulk_headers(self): - return {**self.sf.auth.bulk_headers, "Content-Type": "application/json"} - - def _bulk_query(self, catalog_entry, state): - job_id = self._create_job(catalog_entry) - start_date = self.sf.get_start_date(state, catalog_entry) - - batch_id = self._add_batch(catalog_entry, job_id, start_date) - - self._close_job(job_id) - - batch_status = self._poll_on_batch_status(job_id, batch_id) - - if batch_status['state'] == 'Failed': - if "QUERY_TIMEOUT" in batch_status['stateMessage']: - batch_status = self._bulk_query_with_pk_chunking(catalog_entry, start_date) - job_id = batch_status['job_id'] - - # Set pk_chunking to True to indicate that we should write a bookmark differently - self.sf.pk_chunking = True - - # Add the bulk Job ID and its batches to the state so it can be resumed if necessary - tap_stream_id = catalog_entry['tap_stream_id'] - state = singer.write_bookmark(state, tap_stream_id, 'JobID', job_id) - state = singer.write_bookmark(state, tap_stream_id, 'BatchIDs', batch_status['completed'][:]) - - for completed_batch_id in batch_status['completed']: - for result in self.get_batch_results(job_id, completed_batch_id, catalog_entry): - yield result - # Remove the completed batch ID and write state - state['bookmarks'][catalog_entry['tap_stream_id']]["BatchIDs"].remove(completed_batch_id) - LOGGER.info("Finished syncing batch %s. Removing batch from state.", completed_batch_id) - LOGGER.info("Batches to go: %d", len(state['bookmarks'][catalog_entry['tap_stream_id']]["BatchIDs"])) - singer.write_state(state) - else: - raise TapSalesforceException(batch_status['stateMessage']) - else: - for result in self.get_batch_results(job_id, batch_id, catalog_entry): - yield result - - def _bulk_query_with_pk_chunking(self, catalog_entry, start_date): - LOGGER.info("Retrying Bulk Query with PK Chunking") - - # Create a new job - job_id = self._create_job(catalog_entry, True) - - self._add_batch(catalog_entry, job_id, start_date, False) - - batch_status = self._poll_on_pk_chunked_batch_status(job_id) - batch_status['job_id'] = job_id - - if batch_status['failed']: - raise TapSalesforceException("One or more batches failed during PK chunked job") - - # Close the job after all the batches are complete - self._close_job(job_id) - - return batch_status - - def _create_job(self, catalog_entry, pk_chunking=False): - url = self.bulk_url.format(self.sf.instance_url, "job") - body = {"operation": "queryAll", "object": catalog_entry['stream'], "contentType": "CSV"} - - headers = self._get_bulk_headers() - headers['Sforce-Disable-Batch-Retry'] = "true" - - if pk_chunking: - LOGGER.info("ADDING PK CHUNKING HEADER") - - headers['Sforce-Enable-PKChunking'] = "true; chunkSize={}".format(DEFAULT_CHUNK_SIZE) - - # If the stream ends with 'CleanInfo' or 'History', we can PK Chunk on the object's parent - if any(catalog_entry['stream'].endswith(suffix) for suffix in ["CleanInfo", "History"]): - parent = find_parent(catalog_entry['stream']) - headers['Sforce-Enable-PKChunking'] = headers['Sforce-Enable-PKChunking'] + "; parent={}".format(parent) - - with metrics.http_request_timer("create_job") as timer: - timer.tags['sobject'] = catalog_entry['stream'] - resp = self.sf._make_request( - 'POST', - url, - headers=headers, - body=json.dumps(body)) - - job = resp.json() - - return job['id'] - - def _add_batch(self, catalog_entry, job_id, start_date, order_by_clause=True): - endpoint = "job/{}/batch".format(job_id) - url = self.bulk_url.format(self.sf.instance_url, endpoint) - - body = self.sf._build_query_string(catalog_entry, start_date, order_by_clause=order_by_clause) - - headers = self._get_bulk_headers() - headers['Content-Type'] = 'text/csv' - - with metrics.http_request_timer("add_batch") as timer: - timer.tags['sobject'] = catalog_entry['stream'] - resp = self.sf._make_request('POST', url, headers=headers, body=body) - - batch = xmltodict.parse(resp.text) - - return batch['batchInfo']['id'] - - def _poll_on_pk_chunked_batch_status(self, job_id): - batches = self._get_batches(job_id) - - while True: - queued_batches = [b['id'] for b in batches if b['state'] == "Queued"] - in_progress_batches = [b['id'] for b in batches if b['state'] == "InProgress"] - - if not queued_batches and not in_progress_batches: - completed_batches = [b['id'] for b in batches if b['state'] == "Completed"] - failed_batches = [b['id'] for b in batches if b['state'] == "Failed"] - return {'completed': completed_batches, 'failed': failed_batches} - else: - time.sleep(PK_CHUNKED_BATCH_STATUS_POLLING_SLEEP) - batches = self._get_batches(job_id) - - def _poll_on_batch_status(self, job_id, batch_id): - batch_status = self._get_batch(job_id=job_id, - batch_id=batch_id) - - while batch_status['state'] not in ['Completed', 'Failed', 'Not Processed']: - time.sleep(BATCH_STATUS_POLLING_SLEEP) - batch_status = self._get_batch(job_id=job_id, - batch_id=batch_id) - - return batch_status - - def job_exists(self, job_id): - try: - endpoint = "job/{}".format(job_id) - url = self.bulk_url.format(self.sf.instance_url, endpoint) - headers = self._get_bulk_headers() - - with metrics.http_request_timer("get_job"): - self.sf._make_request('GET', url, headers=headers) - - return True # requests will raise for a 400 InvalidJob - - except RequestException as ex: - if ex.response.headers["Content-Type"] == 'application/json': - exception_code = ex.response.json()['exceptionCode'] - if exception_code == 'InvalidJob': - return False - raise - - def _get_batches(self, job_id): - endpoint = "job/{}/batch".format(job_id) - url = self.bulk_url.format(self.sf.instance_url, endpoint) - headers = self._get_bulk_headers() - - with metrics.http_request_timer("get_batches"): - resp = self.sf._make_request('GET', url, headers=headers) - - batches = xmltodict.parse(resp.text, - xml_attribs=False, - force_list=('batchInfo',))['batchInfoList']['batchInfo'] - - return batches - - def _get_batch(self, job_id, batch_id): - endpoint = "job/{}/batch/{}".format(job_id, batch_id) - url = self.bulk_url.format(self.sf.instance_url, endpoint) - headers = self._get_bulk_headers() - - with metrics.http_request_timer("get_batch"): - resp = self.sf._make_request('GET', url, headers=headers) - - batch = xmltodict.parse(resp.text) - - return batch['batchInfo'] - - def get_batch_results(self, job_id, batch_id, catalog_entry): - """Given a job_id and batch_id, queries the batches results and reads - CSV lines yielding each line as a record.""" - headers = self._get_bulk_headers() - endpoint = "job/{}/batch/{}/result".format(job_id, batch_id) - url = self.bulk_url.format(self.sf.instance_url, endpoint) - - with metrics.http_request_timer("batch_result_list") as timer: - timer.tags['sobject'] = catalog_entry['stream'] - batch_result_resp = self.sf._make_request('GET', url, headers=headers) - - # Returns a Dict where input: - # 12 - # will return: {'result', ['1', '2']} - batch_result_list = xmltodict.parse(batch_result_resp.text, - xml_attribs=False, - force_list={'result'})['result-list'] - - for result in batch_result_list['result']: - endpoint = "job/{}/batch/{}/result/{}".format(job_id, batch_id, result) - url = self.bulk_url.format(self.sf.instance_url, endpoint) - headers['Content-Type'] = 'text/csv' - - with tempfile.NamedTemporaryFile(mode="w+", encoding="utf8") as csv_file: - resp = self.sf._make_request('GET', url, headers=headers, stream=True) - for chunk in resp.iter_content(chunk_size=ITER_CHUNK_SIZE, decode_unicode=True): - if chunk: - # Replace any NULL bytes in the chunk so it can be safely given to the CSV reader - csv_file.write(chunk.replace('\0', '')) - - csv_file.seek(0) - csv_reader = csv.reader(csv_file, - delimiter=',', - quotechar='"') - - column_name_list = next(csv_reader) - - for line in csv_reader: - rec = dict(zip(column_name_list, line)) - yield rec - - def _close_job(self, job_id): - endpoint = "job/{}".format(job_id) - url = self.bulk_url.format(self.sf.instance_url, endpoint) - body = {"state": "Closed"} - - with metrics.http_request_timer("close_job"): - self.sf._make_request( - 'POST', - url, - headers=self._get_bulk_headers(), - body=json.dumps(body)) - - # pylint: disable=no-self-use - def _iter_lines(self, response): - """Clone of the iter_lines function from the requests library with the change - to pass keepends=True in order to ensure that we do not strip the line breaks - from within a quoted value from the CSV stream.""" - pending = None - - for chunk in response.iter_content(decode_unicode=True, chunk_size=ITER_CHUNK_SIZE): - if pending is not None: - chunk = pending + chunk - - lines = chunk.splitlines(keepends=True) - - if lines and lines[-1] and chunk and lines[-1][-1] == chunk[-1]: - pending = lines.pop() - else: - pending = None - - for line in lines: - yield line - - if pending is not None: - yield pending diff --git a/tap_salesforce/salesforce/credentials.py b/tap_salesforce/salesforce/credentials.py deleted file mode 100644 index dd80344..0000000 --- a/tap_salesforce/salesforce/credentials.py +++ /dev/null @@ -1,120 +0,0 @@ -import threading -import logging -import requests -from collections import namedtuple -from simple_salesforce import SalesforceLogin - - -LOGGER = logging.getLogger(__name__) - - -OAuthCredentials = namedtuple('OAuthCredentials', ( - "client_id", - "client_secret", - "refresh_token" -)) - -PasswordCredentials = namedtuple('PasswordCredentials', ( - "username", - "password", - "security_token" -)) - - -def parse_credentials(config): - for cls in reversed((OAuthCredentials, PasswordCredentials)): - creds = cls(*(config.get(key) for key in cls._fields)) - if all(creds): - return creds - - raise Exception("Cannot create credentials from config.") - - -class SalesforceAuth(): - def __init__(self, credentials, is_sandbox=False): - self.is_sandbox = is_sandbox - self._credentials = credentials - self._access_token = None - self._instance_url = None - self._auth_header = None - self.login_timer = None - - def login(self): - """Attempt to login and set the `instance_url` and `access_token` on success.""" - pass - - @property - def rest_headers(self): - return {"Authorization": "Bearer {}".format(self._access_token)} - - @property - def bulk_headers(self): - return {"X-SFDC-Session": self._access_token, - "Content-Type": "application/json"} - - @property - def instance_url(self): - return self._instance_url - - @classmethod - def from_credentials(cls, credentials, **kwargs): - if isinstance(credentials, OAuthCredentials): - return SalesforceAuthOAuth(credentials, **kwargs) - - if isinstance(credentials, PasswordCredentials): - return SalesforceAuthPassword(credentials, **kwargs) - - raise Exception("Invalid credentials") - - -class SalesforceAuthOAuth(SalesforceAuth): - # The minimum expiration setting for SF Refresh Tokens is 15 minutes - REFRESH_TOKEN_EXPIRATION_PERIOD = 900 - - @property - def _login_body(self): - return {'grant_type': 'refresh_token', **self._credentials._asdict()} - - @property - def _login_url(self): - login_url = 'https://login.salesforce.com/services/oauth2/token' - - if self.is_sandbox: - login_url = 'https://test.salesforce.com/services/oauth2/token' - - return login_url - - def login(self): - try: - LOGGER.info("Attempting login via OAuth2") - - resp = requests.post(self._login_url, - data=self._login_body, - headers={"Content-Type": "application/x-www-form-urlencoded"}) - - resp.raise_for_status() - auth = resp.json() - - LOGGER.info("OAuth2 login successful") - self._access_token = auth['access_token'] - self._instance_url = auth['instance_url'] - except Exception as e: - error_message = str(e) - if resp: - error_message = error_message + ", Response from Salesforce: {}".format(resp.text) - raise Exception(error_message) from e - finally: - LOGGER.info("Starting new login timer") - self.login_timer = threading.Timer(self.REFRESH_TOKEN_EXPIRATION_PERIOD, self.login) - self.login_timer.start() - - -class SalesforceAuthPassword(SalesforceAuth): - def login(self): - login = SalesforceLogin( - sandbox=self.is_sandbox, - **self._credentials._asdict() - ) - - self._access_token, host = login - self._instance_url = "https://" + host diff --git a/tap_salesforce/salesforce/exceptions.py b/tap_salesforce/salesforce/exceptions.py deleted file mode 100644 index ff18c01..0000000 --- a/tap_salesforce/salesforce/exceptions.py +++ /dev/null @@ -1,8 +0,0 @@ -# pylint: disable=super-init-not-called - -class TapSalesforceException(Exception): - pass - - -class TapSalesforceQuotaExceededException(TapSalesforceException): - pass diff --git a/tap_salesforce/salesforce/rest.py b/tap_salesforce/salesforce/rest.py deleted file mode 100644 index 03b2388..0000000 --- a/tap_salesforce/salesforce/rest.py +++ /dev/null @@ -1,105 +0,0 @@ -# pylint: disable=protected-access -import singer -import singer.utils as singer_utils -from requests.exceptions import HTTPError -from tap_salesforce.salesforce.exceptions import TapSalesforceException - -LOGGER = singer.get_logger() - -MAX_RETRIES = 4 - -class Rest(): - - def __init__(self, sf): - self.sf = sf - - def query(self, catalog_entry, state): - start_date = self.sf.get_start_date(state, catalog_entry) - query = self.sf._build_query_string(catalog_entry, start_date) - - return self._query_recur(query, catalog_entry, start_date) - - # pylint: disable=too-many-arguments - def _query_recur( - self, - query, - catalog_entry, - start_date_str, - end_date=None, - retries=MAX_RETRIES): - params = {"q": query} - url = "{}/services/data/v53.0/queryAll".format(self.sf.instance_url) - headers = self.sf.auth.rest_headers - - sync_start = singer_utils.now() - if end_date is None: - end_date = sync_start - - if retries == 0: - raise TapSalesforceException( - "Ran out of retries attempting to query Salesforce Object {}".format( - catalog_entry['stream'])) - - retryable = False - try: - for rec in self._sync_records(url, headers, params): - yield rec - - # If the date range was chunked (an end_date was passed), sync - # from the end_date -> now - if end_date < sync_start: - next_start_date_str = singer_utils.strftime(end_date) - query = self.sf._build_query_string(catalog_entry, next_start_date_str) - for record in self._query_recur( - query, - catalog_entry, - next_start_date_str, - retries=retries): - yield record - - except HTTPError as ex: - response = ex.response.json() - if isinstance(response, list) and response[0].get("errorCode") == "QUERY_TIMEOUT": - start_date = singer_utils.strptime_with_tz(start_date_str) - day_range = (end_date - start_date).days - LOGGER.info( - "Salesforce returned QUERY_TIMEOUT querying %d days of %s", - day_range, - catalog_entry['stream']) - retryable = True - else: - raise ex - - if retryable: - start_date = singer_utils.strptime_with_tz(start_date_str) - half_day_range = (end_date - start_date) // 2 - end_date = end_date - half_day_range - - if half_day_range.days == 0: - raise TapSalesforceException( - "Attempting to query by 0 day range, this would cause infinite looping.") - - query = self.sf._build_query_string(catalog_entry, singer_utils.strftime(start_date), - singer_utils.strftime(end_date)) - for record in self._query_recur( - query, - catalog_entry, - start_date_str, - end_date, - retries - 1): - yield record - - def _sync_records(self, url, headers, params): - while True: - resp = self.sf._make_request('GET', url, headers=headers, params=params) - resp_json = resp.json() - - for rec in resp_json.get('records'): - yield rec - - next_records_url = resp_json.get('nextRecordsUrl') - - if next_records_url is None: - break - else: - url = "{}{}".format(self.sf.instance_url, next_records_url) diff --git a/tap_salesforce/streams.py b/tap_salesforce/streams.py new file mode 100644 index 0000000..81082a4 --- /dev/null +++ b/tap_salesforce/streams.py @@ -0,0 +1,8034 @@ +"""Stream type classes for tap-salesforce.""" + +from __future__ import annotations + +import csv +import json +import time +import typing as t +from io import StringIO + +import requests +from singer_sdk import typing as th + +from tap_salesforce.client import SalesforceStream + +PropertiesList = th.PropertiesList +Property = th.Property +ObjectType = th.ObjectType +DateTimeType = th.DateTimeType +StringType = th.StringType +ArrayType = th.ArrayType +BooleanType = th.BooleanType +IntegerType = th.IntegerType +NumberType = th.NumberType + +def get_headers(access_token): + headers = { + "Content-Type": "application/json", + "Authorization": f"Bearer {access_token}", + "grant_type": "password", + "client_id": "", + "Cookie": "BrowserId=1yJQczWaEe6vlgHTIKdd1A; CookieConsentPolicy=0:1; LSKey-c$CookieConsentPolicy=0:1", + } + return headers + + +class AccountStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_account.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,YearStarted,AccountNumber,AccountSource,AnnualRevenue,BillingAddress,BillingCity,BillingCountry, + BillingLatitude,BillingLongitude,BillingPostalCode,BillingState,BillingStreet,BillingGeocodeAccuracy, + CleanStatus,Description,DunsNumber,Fax,Industry,Jigsaw,LastActivityDate,LastReferencedDate,LastViewedDate, + MasterRecordId,NaicsCode,NaicsDesc,NumberOfEmployees,OperatingHoursId,OwnerId,Ownership,ParentId,Phone, + PhotoUrl,Rating,ShippingAddress,ShippingCity,ShippingCountry,ShippingGeocodeAccuracy,ShippingLatitude, + ShippingLongitude,ShippingPostalCode,ShippingState,ShippingStreet,Sic,SicDesc,Site,TickerSymbol,Tradestyle,Type, + Website,CreatedById,CreatedDate,DandbCompanyId,IsDeleted,JigsawCompanyId, + LastModifiedById,LastModifiedDate,SystemModstamp + """ + + entity = "Account" + name = "accounts" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("YearStarted", StringType), + Property("AccountNumber", StringType), + Property("AccountSource", StringType), + Property("AnnualRevenue", NumberType), + Property( + "BillingAddress", + ObjectType( + Property("city", StringType), + Property("country", StringType), + Property("geocodeAccuracy", StringType), + Property("latitude", StringType), + Property("longitude", StringType), + Property("postalCode", StringType), + Property("state", StringType), + Property("street", StringType), + ), + ), + Property("BillingCity", StringType), + Property("BillingCountry", StringType), + Property("BillingLatitude", StringType), + Property("BillingLongitude", StringType), + Property("BillingPostalCode", StringType), + Property("BillingState", StringType), + Property("BillingStreet", StringType), + Property("BillingGeocodeAccuracy", StringType), + Property("CleanStatus", StringType), + Property("Description", StringType), + Property("DunsNumber", StringType), + Property("Fax", StringType), + Property("Industry", StringType), + Property("Jigsaw", StringType), + Property("LastActivityDate", StringType), + Property("LastReferencedDate", StringType), + Property("LastViewedDate", StringType), + Property("MasterRecordId", StringType), + Property("NaicsCode", StringType), + Property("NaicsDesc", StringType), + Property("NumberOfEmployees", IntegerType), + Property("OperatingHoursId", StringType), + Property("OwnerId", StringType), + Property("Ownership", StringType), + Property("ParentId", StringType), + Property("Phone", StringType), + Property("PhotoUrl", StringType), + Property("Rating", StringType), + Property( + "ShippingAddress", + ObjectType( + Property("city", StringType), + Property("country", StringType), + Property("geocodeAccuracy", StringType), + Property("latitude", StringType), + Property("longitude", StringType), + Property("postalCode", StringType), + Property("state", StringType), + Property("street", StringType), + ), + ), + Property("ShippingCity", StringType), + Property("ShippingCountry", StringType), + Property("ShippingGeocodeAccuracy", StringType), + Property("ShippingLatitude", StringType), + Property("ShippingLongitude", StringType), + Property("ShippingPostalCode", StringType), + Property("ShippingState", StringType), + Property("ShippingStreet", StringType), + Property("Sic", StringType), + Property("SicDesc", StringType), + Property("Site", StringType), + Property("TickerSymbol", StringType), + Property("Tradestyle", StringType), + Property("Type", StringType), + Property("Website", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("DandbCompanyId", StringType), + Property("IsDeleted", BooleanType), + Property("JigsawCompanyId", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class ContactStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_contact.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,AccountId,AssistantName,AssistantPhone,Birthdate,CleanStatus,CreatedById,CreatedDate,Department, + Description,Email,EmailBouncedDate,EmailBouncedReason,Fax,FirstName,LastName,HomePhone,IndividualId,IsDeleted, + IsEmailBounced,Jigsaw,JigsawContactId,LastActivityDate,LastReferencedDate,LastViewedDate,LastCURequestDate, + LastCUUpdateDate,LastModifiedById,LastModifiedDate,LeadSource,MailingAddress,MailingCity,MailingCountry, + MailingGeocodeAccuracy,MailingLatitude,MailingLongitude,MailingPostalCode,MailingState,MailingStreet,MasterRecordId, + MobilePhone,OtherAddress,OtherCity,OtherCountry,OtherGeocodeAccuracy,OtherLatitude,OtherLongitude,OtherPhone,OtherPostalCode, + OtherState,OtherStreet,OwnerId,Phone,PhotoUrl,ReportsToId,Salutation,SystemModstamp,Title + """ + + entity = "Contact" + name = "contacts" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("AccountId", StringType), + Property("AssistantName", StringType), + Property("AssistantPhone", StringType), + Property("Birthdate", StringType), + Property("CleanStatus", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("Department", StringType), + Property("Description", StringType), + Property("Email", StringType), + Property("EmailBouncedDate", StringType), + Property("EmailBouncedReason", StringType), + Property("Fax", StringType), + Property("FirstName", StringType), + Property("LastName", StringType), + Property("HomePhone", StringType), + Property("IndividualId", StringType), + Property("IsDeleted", BooleanType), + Property("IsEmailBounced", BooleanType), + Property("Jigsaw", StringType), + Property("JigsawContactId", StringType), + Property("LastActivityDate", StringType), + Property("LastReferencedDate", StringType), + Property("LastViewedDate", StringType), + Property("LastCURequestDate", StringType), + Property("LastCUUpdateDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("LeadSource", StringType), + Property( + "MailingAddress", + ObjectType( + Property("city", StringType), + Property("country", StringType), + Property("geocodeAccuracy", StringType), + Property("latitude", StringType), + Property("longitude", StringType), + Property("postalCode", StringType), + Property("state", StringType), + Property("street", StringType), + ), + ), + Property("MailingCity", StringType), + Property("MailingCountry", StringType), + Property("MailingGeocodeAccuracy", StringType), + Property("MailingLatitude", StringType), + Property("MailingLongitude", StringType), + Property("MailingPostalCode", StringType), + Property("MailingState", StringType), + Property("MailingStreet", StringType), + Property("MasterRecordId", StringType), + Property("MobilePhone", StringType), + Property( + "OtherAddress", + ObjectType( + Property("city", StringType), + Property("country", StringType), + Property("geocodeAccuracy", StringType), + Property("latitude", StringType), + Property("longitude", StringType), + Property("postalCode", StringType), + Property("state", StringType), + Property("street", StringType), + ), + ), + Property("OtherCity", StringType), + Property("OtherCountry", StringType), + Property("OtherGeocodeAccuracy", StringType), + Property("OtherLatitude", StringType), + Property("OtherLongitude", StringType), + Property("OtherPhone", StringType), + Property("OtherPostalCode", StringType), + Property("OtherState", StringType), + Property("OtherStreet", StringType), + Property("OwnerId", StringType), + Property("Phone", StringType), + Property("PhotoUrl", StringType), + Property("ReportsToId", BooleanType), + Property("Salutation", StringType), + Property("SystemModstamp", StringType), + Property("Title", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class CampaignStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_campaign.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,ActualCost,AmountAllOpportunities,AmountWonOpportunities,BudgetedCost,CampaignMemberRecordTypeId, + CreatedById,CreatedDate,Description,EndDate,ExpectedResponse,ExpectedRevenue,IsActive,IsDeleted,LastActivityDate, + LastReferencedDate,LastViewedDate,LastModifiedById,LastModifiedDate,NumberOfContacts,NumberOfConvertedLeads, + NumberOfLeads,NumberOfOpportunities,NumberOfResponses,NumberOfWonOpportunities,NumberSent,OwnerId,ParentId, + StartDate,Status,Type,SystemModstamp + """ + + entity = "Campaign" + name = "campaigns" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("ActualCost", NumberType), + Property("AmountAllOpportunities", NumberType), + Property("AmountWonOpportunities", NumberType), + Property("BudgetedCost", NumberType), + Property("CampaignMemberRecordTypeId", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("Description", StringType), + Property("EndDate", StringType), + Property("ExpectedResponse", NumberType), + Property("ExpectedRevenue", NumberType), + Property("IsActive", BooleanType), + Property("IsDeleted", BooleanType), + Property("LastActivityDate", StringType), + Property("LastReferencedDate", StringType), + Property("LastViewedDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", BooleanType), + Property("NumberOfContacts", IntegerType), + Property("NumberOfConvertedLeads", IntegerType), + Property("NumberOfLeads", IntegerType), + Property("NumberOfOpportunities", IntegerType), + Property("NumberOfResponses", IntegerType), + Property("NumberOfWonOpportunities", IntegerType), + Property("NumberSent", NumberType), + Property("OwnerId", StringType), + Property("ParentId", StringType), + Property("StartDate", StringType), + Property("Status", StringType), + Property("Type", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class EntitlementStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_entitlement.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,AccountId,AssetId,BusinessHoursId,CasesPerEntitlement,ContractLineItemId,CreatedById,CreatedDate,EndDate,IsDeleted, + IsPerIncident,LastReferencedDate,LastViewedDate,LastModifiedById,LastModifiedDate,LocationId,SvcApptBookingWindowsId, + RemainingCases,RemainingWorkOrders,ServiceContractId,SlaProcessId,StartDate,Status,Type,WorkOrdersPerEntitlement,SystemModstamp + """ + + entity = "Entitlement" + name = "entitlements" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("AccountId", StringType), + Property("AssetId", StringType), + Property("BusinessHoursId", StringType), + Property("CasesPerEntitlement", IntegerType), + Property("ContractLineItemId", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("EndDate", StringType), + Property("IsDeleted", BooleanType), + Property("IsPerIncident", BooleanType), + Property("LastReferencedDate", StringType), + Property("LastViewedDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("LocationId", StringType), + Property("SvcApptBookingWindowsId", StringType), + Property("RemainingCases", IntegerType), + Property("RemainingWorkOrders", IntegerType), + Property("ServiceContractId", StringType), + Property("SlaProcessId", StringType), + Property("StartDate", StringType), + Property("Status", StringType), + Property("Type", StringType), + Property("WorkOrdersPerEntitlement", IntegerType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class CaseStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_case.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,AccountId,AssetId,Comments,CaseNumber,ClosedDate,ContactEmail,ContactFax,ContactId,ContactMobile,ContactPhone,CreatedById, + CreatedDate,Description,IsClosed,IsDeleted,IsEscalated,LastReferencedDate,LastViewedDate,LastModifiedById, + LastModifiedDate,MasterRecordId,Origin,OwnerId,ParentId,Priority,Reason, + SourceId,Status,Subject,SuppliedCompany,SuppliedEmail,SuppliedName,SuppliedPhone,Type,SystemModstamp + """ + + entity = "Case" + name = "cases" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("AccountId", StringType), + Property("AssetId", StringType), + Property("Comments", StringType), + Property("CaseNumber", StringType), + Property("ClosedDate", StringType), + Property("ContactEmail", StringType), + Property("ContactFax", StringType), + Property("ContactId", StringType), + Property("ContactMobile", StringType), + Property("ContactPhone", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("Description", StringType), + Property("IsClosed", BooleanType), + Property("IsDeleted", BooleanType), + Property("IsEscalated", BooleanType), + Property("LastReferencedDate", StringType), + Property("LastViewedDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("MasterRecordId", StringType), + Property("Origin", StringType), + Property("OwnerId", StringType), + Property("ParentId", StringType), + Property("Priority", StringType), + Property("Reason", StringType), + Property("SourceId", StringType), + Property("Status", StringType), + Property("Subject", StringType), + Property("SuppliedCompany", StringType), + Property("SuppliedEmail", StringType), + Property("SuppliedName", StringType), + Property("SuppliedPhone", StringType), + Property("Type", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class EmailTemplateStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_emailtemplate.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,ApiVersion,Body,BrandTemplateId,CreatedById,CreatedDate,Description,DeveloperName,Encoding,EnhancedLetterheadId, + FolderId,FolderName,HtmlValue,IsActive,IsBuilderContent,LastUsedDate,LastModifiedById,LastModifiedDate,Markup, + NamespacePrefix,OwnerId,RelatedEntityType,Subject,TemplateStyle,TemplateType,TimesUsed,UIType,SystemModstamp + """ + + entity = "EmailTemplate" + name = "email_templates" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("ApiVersion", NumberType), + Property("Body", StringType), + Property("BrandTemplateId", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("Description", StringType), + Property("DeveloperName", StringType), + Property("Encoding", StringType), + Property("EnhancedLetterheadId", StringType), + Property("FolderId", StringType), + Property("FolderName", StringType), + Property("HtmlValue", StringType), + Property("IsActive", BooleanType), + Property("IsBuilderContent", BooleanType), + Property("LastUsedDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("Markup", StringType), + Property("NamespacePrefix", StringType), + Property("OwnerId", StringType), + Property("RelatedEntityType", StringType), + Property("Subject", StringType), + Property("TemplateStyle", StringType), + Property("TemplateType", StringType), + Property("TimesUsed", IntegerType), + Property("UiType", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class FolderStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_folder.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,AccessType,CreatedById,CreatedDate,DeveloperName,IsReadonly,LastModifiedById, + LastModifiedDate,NamespacePrefix,ParentId,Type,SystemModstamp + """ + + entity = "Folder" + name = "folders" + path = "/query?q=SELECT+{}+from+Folder".format(columns) + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("AccessType", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("DeveloperName", StringType), + Property("IsReadonly", BooleanType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("NamespacePrefix", StringType), + Property("ParentId", StringType), + Property("Type", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class GroupStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_group.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,CreatedById,CreatedDate,DeveloperName,DoesIncludeBosses,DoesSendEmailToMembers, + Email,LastModifiedById,LastModifiedDate,OwnerId,Type,RelatedId,SystemModstamp + """ + + entity = "Group" + name = "groups" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("DeveloperName", StringType), + Property("DoesIncludeBosses", BooleanType), + Property("DoesSendEmailToMembers", BooleanType), + Property("Email", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("OwnerId", StringType), + Property("Type", StringType), + Property("RelatedId", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class LeadStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_lead.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,Address,AnnualRevenue,City,CleanStatus,Company,CompanyDunsNumber,ConvertedAccountId,ConvertedContactId, + ConvertedDate,ConvertedOpportunityId,Country,CreatedById,CreatedDate,DandbCompanyId,Description, + Email,EmailBouncedDate,EmailBouncedReason,Fax,FirstName,GeocodeAccuracy,IndividualId,Industry,IsConverted, + IsDeleted,IsUnreadByOwner,Jigsaw,JigsawContactId,LastActivityDate,LastName,LastReferencedDate,LastViewedDate, + LastModifiedById,LastModifiedDate,Latitude,Longitude,LeadSource,MasterRecordId,MobilePhone, + NumberOfEmployees,OwnerId,Phone,PhotoUrl,PostalCode,Rating,Salutation, + State,Status,Street,Title,Website,SystemModstamp + """ + + entity = "Lead" + name = "leads" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property( + "Address", + ObjectType( + Property("city", StringType), + Property("country", StringType), + Property("geocodeAccuracy", StringType), + Property("latitude", StringType), + Property("longitude", StringType), + Property("postalCode", StringType), + Property("state", StringType), + Property("street", StringType), + ), + ), + Property("AnnualRevenue", NumberType), + Property("City", StringType), + Property("CleanStatus", StringType), + Property("Company", StringType), + Property("CompanyDunsNumber", StringType), + Property("ConvertedAccountId", StringType), + Property("ConvertedContactId", StringType), + Property("ConvertedDate", StringType), + Property("ConvertedOpportunityId", StringType), + Property("Country", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("DandbCompanyId", StringType), + Property("Description", StringType), + Property("Email", StringType), + Property("EmailBouncedDate", StringType), + Property("EmailBouncedReason", StringType), + Property("Fax", StringType), + Property("FirstName", StringType), + Property("GeocodeAccuracy", StringType), + Property("IndividualId", StringType), + Property("Industry", StringType), + Property("IsConverted", BooleanType), + Property("IsDeleted", BooleanType), + Property("IsUnreadByOwner", BooleanType), + Property("Jigsaw", StringType), + Property("JigsawContactId", StringType), + Property("LastActivityDate", StringType), + Property("LastName", StringType), + Property("LastReferencedDate", StringType), + Property("LastViewedDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("Latitude", StringType), + Property("Longitude", StringType), + Property("LeadSource", StringType), + Property("MasterRecordId", StringType), + Property("MobilePhone", StringType), + Property("NumberOfEmployees", IntegerType), + Property("OwnerId", StringType), + Property("Phone", StringType), + Property("PhotoUrl", StringType), + Property("PostalCode", StringType), + Property("Rating", StringType), + Property("Salutation", StringType), + Property("State", StringType), + Property("Status", StringType), + Property("Street", StringType), + Property("Title", StringType), + Property("Website", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class PeriodStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_period.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,EndDate,FiscalYearSettingsId,FullyQualifiedLabel,IsForecastPeriod, + Number,PeriodLabel,QuarterLabel,StartDate,Type,SystemModstamp + """ + + entity = "Period" + name = "periods" + path = "/query" + primary_keys = ["Id"] + replication_key = "StartDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("EndDate", StringType), + Property("FiscalYearSettingsId", StringType), + Property("FullyQualifiedLabel", StringType), + Property("IsForecastPeriod", BooleanType), + Property("Number", IntegerType), + Property("PeriodLabel", StringType), + Property("QuarterLabel", StringType), + Property("StartDate", StringType), + Property("Type", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class SolutionStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_solution.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,CreatedById,CreatedDate,IsDeleted,IsHtml,IsPublished,IsPublishedInPublicKb,IsReviewed, + LastReferencedDate,LastViewedDate,LastModifiedById,LastModifiedDate,OwnerId,SolutionName, + SolutionNote,SolutionNumber,Status,TimesUsed,SystemModstamp + """ + + entity = "Solution" + name = "solutions" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("IsDeleted", BooleanType), + Property("IsHtml", BooleanType), + Property("IsPublished", BooleanType), + Property("IsPublishedInPublicKb", BooleanType), + Property("IsReviewed", BooleanType), + Property("LastReferencedDate", StringType), + Property("LastViewedDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("OwnerId", StringType), + Property("SolutionName", StringType), + Property("SolutionNote", StringType), + Property("SolutionNumber", StringType), + Property("Status", StringType), + Property("TimesUsed", IntegerType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class StaticResourceStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_staticresource.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,Body,BodyLength,CacheControl,ContentType,CreatedById,CreatedDate,Description, + LastModifiedById,LastModifiedDate,NamespacePrefix,SystemModstamp + """ + + entity = "StaticResource" + name = "static_resources" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("Body", StringType), + Property("BodyLength", IntegerType), + Property("CacheControl", StringType), + Property("ContentType", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("Description", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("NamespacePrefix", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class WebLinkStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_weblink.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,CreatedById,CreatedDate,Description,DisplayType,EncodingKey,HasMenubar,HasScrollbars,HasToolbar, + Height,IsProtected,IsResizable,LinkType,LastModifiedById,LastModifiedDate,MasterLabel,NamespacePrefix,OpenType, + PageOrSobjectType,Position,RequireRowSelection,ScontrolId,ShowsLocation,ShowsStatus,Url,Width,SystemModstamp + """ + + entity = "WebLink" + name = "web_links" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("Body", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("Description", StringType), + Property("DisplayType", StringType), + Property("EncodingKey", StringType), + Property("HasMenubar", BooleanType), + Property("HasScrollbars", BooleanType), + Property("HasToolbar", BooleanType), + Property("Height", IntegerType), + Property("IsProtected", BooleanType), + Property("IsResizable", BooleanType), + Property("LinkType", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("MasterLabel", StringType), + Property("NamespacePrefix", StringType), + Property("OpenType", StringType), + Property("PageOrSobjectType", StringType), + Property("Position", StringType), + Property("RequireRowSelection", BooleanType), + Property("ScontrolId", StringType), + Property("ShowsLocation", BooleanType), + Property("ShowsStatus", BooleanType), + Property("Url", StringType), + Property("Width", IntegerType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class Pricebook2Stream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_pricebook2.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,CreatedById,CreatedDate,Description,IsActive,IsArchived,IsDeleted,IsStandard, + LastReferencedDate,LastViewedDate,LastModifiedById,LastModifiedDate,SystemModstamp + """ + + entity = "Pricebook2" + name = "pricebooks_2" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("Description", StringType), + Property("IsActive", BooleanType), + Property("IsArchived", BooleanType), + Property("IsDeleted", BooleanType), + Property("IsStandard", BooleanType), + Property("LastReferencedDate", StringType), + Property("LastViewedDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class Product2Stream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_product2.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,CreatedById,CreatedDate,Description,DisplayUrl,ExternalDataSourceId,ExternalId,Family,IsActive,IsArchived, + IsDeleted,LastReferencedDate,LastViewedDate,LastModifiedById,LastModifiedDate,ProductClass,ProductCode, + QuantityUnitOfMeasure,StockKeepingUnit,Type,SystemModstamp + """ + + entity = "Product2" + name = "products_2" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("Description", StringType), + Property("DisplayUrl", StringType), + Property("ExternalDataSourceId", StringType), + Property("ExternalId", StringType), + Property("Family", StringType), + Property("IsActive", BooleanType), + Property("IsArchived", BooleanType), + Property("IsDeleted", BooleanType), + Property("LastReferencedDate", StringType), + Property("LastViewedDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("ProductClass", StringType), + Property("ProductCode", StringType), + Property("QuantityUnitOfMeasure", StringType), + Property("StockKeepingUnit", StringType), + Property("Type", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class PricebookEntryStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_pricebookentry.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,CreatedById,CreatedDate,IsActive,IsArchived,IsDeleted,LastModifiedById,LastModifiedDate,Pricebook2Id, + Product2Id,ProductCode,UnitPrice,UseStandardPrice,SystemModstamp + """ + + entity = "PricebookEntry" + name = "pricebook_entries" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("IsActive", BooleanType), + Property("IsArchived", BooleanType), + Property("IsDeleted", BooleanType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("Pricebook2Id", StringType), + Property("Product2Id", StringType), + Property("ProductCode", StringType), + Property("UnitPrice", NumberType), + Property("UseStandardPrice", BooleanType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class UserAppInfoStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_userappinfo.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,AppDefinitionId,CreatedById,CreatedDate,FormFactor,IsDeleted,LastModifiedById,LastModifiedDate,UserId,SystemModstamp + """ + + entity = "UserAppInfo" + name = "user_app_info" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("AppDefinitionId", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("FormFactor", StringType), + Property("IsDeleted", BooleanType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("UserId", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class UserRoleStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_role.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,CaseAccessForAccountOwner,ContactAccessForAccountOwner,DeveloperName,ForecastUserId,LastModifiedById,LastModifiedDate,MayForecastManagerShare, + OpportunityAccessForAccountOwner,ParentRoleId,PortalAccountId,PortalAccountOwnerId,PortalType,RollupDescription,SystemModstamp + """ + + entity = "UserRole" + name = "user_roles" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("CaseAccessForAccountOwner", StringType), + Property("ContactAccessForAccountOwner", StringType), + Property("DeveloperName", StringType), + Property("ForecastUserId", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("MayForecastManagerShare", BooleanType), + Property("OpportunityAccessForAccountOwner", StringType), + Property("ParentRoleId", StringType), + Property("PortalAccountId", StringType), + Property("PortalAccountOwnerId", StringType), + Property("PortalType", StringType), + Property("RollupDescription", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class ApexClassStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_apexclass.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,ApiVersion,Body,BodyCrc,CreatedById,CreatedDate,IsValid,LengthWithoutComments,LastModifiedById,LastModifiedDate, + NamespacePrefix,Status,SystemModstamp + """ + + entity = "ApexClass" + name = "apex_classes" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("ApiVersion", NumberType), + Property("Body", StringType), + Property("BodyCrc", IntegerType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("IsValid", BooleanType), + Property("LengthWithoutComments", NumberType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("NamespacePrefix", StringType), + Property("Status", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class ApexPageStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_apexpage.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,ApiVersion,ControllerKey,ControllerType,CreatedById,CreatedDate,Description,IsAvailableInTouch, + IsConfirmationTokenRequired,LastModifiedById,LastModifiedDate,Markup,MasterLabel,NamespacePrefix,SystemModstamp + """ + + entity = "ApexPage" + name = "apex_pages" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("ApiVersion", NumberType), + Property("ControllerKey", StringType), + Property("ControllerType", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("Description", StringType), + Property("IsAvailableInTouch", BooleanType), + Property("IsConfirmationTokenRequired", BooleanType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("Markup", StringType), + Property("MasterLabel", StringType), + Property("NamespacePrefix", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class ApexTriggerStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_apextrigger.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,ApiVersion,Body,BodyCrc,CreatedById,CreatedDate,IsValid,LengthWithoutComments,LastModifiedById,LastModifiedDate,NamespacePrefix, + Status,TableEnumOrId,UsageAfterDelete,UsageAfterInsert,UsageAfterUndelete,UsageAfterUpdate,UsageBeforeDelete,UsageBeforeInsert, + UsageBeforeUpdate,UsageIsBulk,SystemModstamp + """ + + entity = "ApexTrigger" + name = "apex_triggers" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("ApiVersion", NumberType), + Property("Body", StringType), + Property("BodyCrc", IntegerType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("IsValid", BooleanType), + Property("LengthWithoutComments", NumberType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("NamespacePrefix", StringType), + Property("Status", StringType), + Property("TableEnumOrId", StringType), + Property("UsageAfterDelete", BooleanType), + Property("UsageAfterInsert", BooleanType), + Property("UsageAfterUndelete", BooleanType), + Property("UsageAfterUpdate", BooleanType), + Property("UsageBeforeDelete", BooleanType), + Property("UsageBeforeInsert", BooleanType), + Property("UsageBeforeUpdate", BooleanType), + Property("UsageIsBulk", BooleanType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class CampaignMemberStatusStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_campaignmemberstatus.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,CampaignId,CreatedById,CreatedDate,HasResponded,IsDefault,IsDeleted,Label,LastModifiedById,LastModifiedDate,SortOrder,SystemModstamp + """ + + entity = "CampaignMemberStatus" + name = "campaign_member_statuses" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("CampaignId", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("HasResponded", BooleanType), + Property("IsDefault", BooleanType), + Property("IsDeleted", BooleanType), + Property("Label", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("SortOrder", NumberType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class FiscalYearSettingsStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_fiscalyearsettings.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,Description,EndDate,IsStandardYear,PeriodId,PeriodLabelScheme,PeriodPrefix,QuarterLabelScheme, + QuarterPrefix,StartDate,WeekLabelScheme,WeekStartDay,YearType,SystemModstamp + """ + + entity = "FiscalYearSettings" + name = "fiscal_year_settings" + path = "/query" + primary_keys = ["Id"] + replication_key = "StartDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("Description", StringType), + Property("EndDate", StringType), + Property("IsStandardYear", BooleanType), + Property("PeriodId", StringType), + Property("PeriodLabelScheme", StringType), + Property("PeriodPrefix", StringType), + Property("QuarterLabelScheme", StringType), + Property("QuarterPrefix", StringType), + Property("StartDate", StringType), + Property("WeekLabelScheme", StringType), + Property("WeekStartDay", StringType), + Property("YearType", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class OpportunityStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_opportunity.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,AccountId,Amount,CampaignId,CloseDate,ContactId,CreatedById,CreatedDate, + Description,ExpectedRevenue,Fiscal,FiscalQuarter,FiscalYear,ForecastCategory,ForecastCategoryName,HasOpenActivity, + HasOpportunityLineItem,HasOverdueTask,IsClosed,IsDeleted,IsPrivate,IsWon,LastActivityDate,LastAmountChangedHistoryId, + LastCloseDateChangedHistoryId,LastReferencedDate,LastStageChangeDate,LastViewedDate,LastModifiedById,LastModifiedDate,LeadSource, + NextStep,OwnerId,Pricebook2Id,Probability,PushCount,StageName,TotalOpportunityQuantity,Type,SystemModstamp + """ + + entity = "Opportunity" + name = "opportunities" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("AccountId", StringType), + Property("Amount", NumberType), + Property("CampaignId", StringType), + Property("CloseDate", StringType), + Property("ContactId", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("Description", StringType), + Property("ExpectedRevenue", NumberType), + Property("Fiscal", StringType), + Property("FiscalQuarter", IntegerType), + Property("FiscalYear", IntegerType), + Property("ForecastCategory", StringType), + Property("ForecastCategoryName", StringType), + Property("HasOpenActivity", BooleanType), + Property("HasOpportunityLineItem", BooleanType), + Property("HasOverdueTask", BooleanType), + Property("IsClosed", BooleanType), + Property("IsDeleted", BooleanType), + Property("IsPrivate", BooleanType), + Property("IsWon", BooleanType), + Property("LastActivityDate", StringType), + Property("LastAmountChangedHistoryId", StringType), + Property("LastCloseDateChangedHistoryId", StringType), + Property("LastReferencedDate", StringType), + Property("LastStageChangeDate", StringType), + Property("LastViewedDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("LeadSource", StringType), + Property("NextStep", StringType), + Property("OwnerId", StringType), + Property("Pricebook2Id", StringType), + Property("Probability", NumberType), + Property("PushCount", IntegerType), + Property("StageName", StringType), + Property("TotalOpportunityQuantity", StringType), + Property("Type", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class OrganizationStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_organization.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,Division,Street,City,State,PostalCode,Country,Latitude,Longitude,GeocodeAccuracy,Phone,Fax, + PrimaryContact,DefaultLocaleSidKey,TimeZoneSidKey,LanguageLocaleKey,ReceivesInfoEmails, + ReceivesAdminInfoEmails,PreferencesRequireOpportunityProducts,PreferencesConsentManagementEnabled, + PreferencesAutoSelectIndividualOnMerge,PreferencesLightningLoginEnabled,PreferencesOnlyLLPermUserAllowed, + FiscalYearStartMonth,UsesStartDateAsFiscalYearName,DefaultAccountAccess,DefaultContactAccess, + DefaultOpportunityAccess,DefaultLeadAccess,DefaultCaseAccess,DefaultCalendarAccess,DefaultPricebookAccess, + DefaultCampaignAccess,SystemModstamp,ComplianceBccEmail,UiSkin,SignupCountryIsoCode,TrialExpirationDate, + NumKnowledgeService,OrganizationType,NamespacePrefix,InstanceName,IsSandbox,WebToCaseDefaultOrigin, + MonthlyPageViewsUsed,MonthlyPageViewsEntitlement,IsReadOnly,CreatedDate,CreatedById,LastModifiedDate, + PreferencesTransactionSecurityPolicy,LastModifiedById + """ + columns_remaining = "PreferencesTerminateOldestSession" + + entity = "Organization" + name = "organizations" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("Division", StringType), + Property("Street", StringType), + Property("City", StringType), + Property("State", StringType), + Property("PostalCode", StringType), + Property("Country", StringType), + Property("Latitude", StringType), + Property("Longitude", StringType), + Property("GeocodeAccuracy", StringType), + Property("Phone", StringType), + Property("Fax", StringType), + Property("PrimaryContact", StringType), + Property("DefaultLocaleSidKey", StringType), + Property("TimeZoneSidKey", StringType), + Property("LanguageLocaleKey", StringType), + Property("ReceivesInfoEmails", BooleanType), + Property("ReceivesAdminInfoEmails", BooleanType), + Property("PreferencesRequireOpportunityProducts", BooleanType), + Property("PreferencesConsentManagementEnabled", BooleanType), + Property("PreferencesAutoSelectIndividualOnMerge", BooleanType), + Property("PreferencesLightningLoginEnabled", BooleanType), + Property("PreferencesOnlyLLPermUserAllowed", BooleanType), + Property("FiscalYearStartMonth", IntegerType), + Property("UsesStartDateAsFiscalYearName", BooleanType), + Property("DefaultAccountAccess", StringType), + Property("DefaultContactAccess", StringType), + Property("DefaultOpportunityAccess", StringType), + Property("DefaultLeadAccess", StringType), + Property("DefaultCaseAccess", StringType), + Property("DefaultCalendarAccess", StringType), + Property("DefaultPricebookAccess", StringType), + Property("DefaultCampaignAccess", StringType), + Property("SystemModstamp", StringType), + Property("ComplianceBccEmail", StringType), + Property("UiSkin", StringType), + Property("SignupCountryIsoCode", StringType), + Property("TrialExpirationDate", StringType), + Property("NumKnowledgeService", IntegerType), + Property("OrganizationType", StringType), + Property("NamespacePrefix", StringType), + Property("InstanceName", StringType), + Property("IsSandbox", BooleanType), + Property("WebToCaseDefaultOrigin", StringType), + Property("MonthlyPageViewsUsed", IntegerType), + Property("MonthlyPageViewsEntitlement", IntegerType), + Property("IsReadOnly", BooleanType), + Property("CreatedDate", StringType), + Property("CreatedById", StringType), + Property("LastModifiedDate", StringType), + Property("LastModifiedById", StringType), + Property("PreferencesTransactionSecurityPolicy", BooleanType), + Property("PreferencesTerminateOldestSession", BooleanType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class ServiceSetupProvisioningStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_servicesetupprovisioning.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,CreatedById,CreatedDate,IsDeleted,JobName,LastModifiedById,LastModifiedDate,Status,TaskContext,TaskName,SystemModstamp + """ + + entity = "ServiceSetupProvisioning" + name = "service_setup_provisionings" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("IsDeleted", BooleanType), + Property("JobName", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("Status", StringType), + Property("TaskContext", StringType), + Property("TaskName", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class BusinessHoursStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_businesshours.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,CreatedById,CreatedDate,FridayEndTime,FridayStartTime,IsActive,IsDefault,LastViewedDate,LastModifiedById,LastModifiedDate,MondayEndTime, + MondayStartTime,SaturdayEndTime,SaturdayStartTime,SundayEndTime,SundayStartTime,ThursdayEndTime,ThursdayStartTime,TimeZoneSidKey,TuesdayEndTime, + TuesdayStartTime,WednesdayEndTime,WednesdayStartTime,SystemModstamp + """ + + entity = "BusinessHours" + name = "business_hours" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("FridayEndTime", StringType), + Property("FridayStartTime", StringType), + Property("IsActive", BooleanType), + Property("IsDefault", BooleanType), + Property("LastViewedDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("MondayEndTime", StringType), + Property("MondayStartTime", StringType), + Property("SaturdayEndTime", StringType), + Property("SaturdayStartTime", StringType), + Property("SundayEndTime", StringType), + Property("SundayStartTime", StringType), + Property("ThursdayEndTime", StringType), + Property("ThursdayStartTime", StringType), + Property("TimeZoneSidKey", StringType), + Property("TuesdayEndTime", StringType), + Property("TuesdayStartTime", StringType), + Property("WednesdayEndTime", StringType), + Property("WednesdayStartTime", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class UserStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_user.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Name,AboutMe,AccountId,Address,Alias,BadgeText,BannerPhotoUrl,CallCenterId,City,CommunityNickname,CompanyName, + ContactId,Country,CreatedById,CreatedDate,DefaultGroupNotificationFrequency,DelegatedApproverId,Department,DigestFrequency, + Division,Email,EmailEncodingKey,EmailPreferencesAutoBcc,EmailPreferencesAutoBccStayInTouch,EmailPreferencesStayInTouchReminder, + EmployeeNumber,Extension,Fax,FederationIdentifier,FirstName,ForecastEnabled,FullPhotoUrl,GeocodeAccuracy,IndividualId,IsActive,IsProfilePhotoActive, + IsExtIndicatorVisible,JigsawImportLimitOverride,LanguageLocaleKey,LastLoginDate,LastName,LastReferencedDate,LastViewedDate,Latitude,LocaleSidKey, + Longitude,LastPasswordChangeDate,LastModifiedById,LastModifiedDate,ManagerId,MediumBannerPhotoUrl,MediumPhotoUrl,MobilePhone,NumberOfFailedLogins, + OfflinePdaTrialExpirationDate,OfflineTrialExpirationDate,OutOfOfficeMessage,Phone,PostalCode,ProfileId,ReceivesAdminInfoEmails,ReceivesInfoEmails, + SenderEmail,SenderName,Signature,SmallBannerPhotoUrl,SmallPhotoUrl,State,StayInTouchNote,StayInTouchSignature,StayInTouchSubject,Street,TimeZoneSidKey, + Title,Username,UserPermissionsCallCenterAutoLogin,UserPermissionsInteractionUser,UserPermissionsJigsawProspectingUser,UserPermissionsKnowledgeUser, + UserPermissionsMarketingUser,UserPermissionsOfflineUser,UserPermissionsSFContentUser,UserPermissionsSiteforceContributorUser, + UserPermissionsSiteforcePublisherUser,UserPermissionsSupportUser,UserPermissionsWorkDotComUserFeature,UserPreferencesActivityRemindersPopup, + UserPreferencesApexPagesDeveloperMode,UserPreferencesCacheDiagnostics,UserPreferencesContentEmailAsAndWhen,UserPreferencesContentNoEmail, + UserPreferencesCreateLEXAppsWTShown,UserPreferencesEnableAutoSubForFeeds,UserPreferencesDisableAllFeedsEmail,UserPreferencesDisableBookmarkEmail, + UserPreferencesDisableChangeCommentEmail,UserPreferencesDisableEndorsementEmail,UserPreferencesDisableFileShareNotificationsForApi, + UserPreferencesDisableFollowersEmail,UserPreferencesDisableLaterCommentEmail,UserPreferencesDisableLikeEmail,UserPreferencesDisableMentionsPostEmail, + UserPreferencesDisableProfilePostEmail,UserPreferencesDisableSharePostEmail,UserPreferencesDisCommentAfterLikeEmail,UserPreferencesDisMentionsCommentEmail, + UserPreferencesDisableMessageEmail,UserPreferencesDisProfPostCommentEmail,UserPreferencesEventRemindersCheckboxDefault,UserPreferencesExcludeMailAppAttachments, + UserPreferencesFavoritesShowTopFavorites,UserPreferencesFavoritesWTShown,UserPreferencesGlobalNavBarWTShown,UserPreferencesGlobalNavGridMenuWTShown, + UserPreferencesHasCelebrationBadge,UserPreferencesHasSentWarningEmail,UserPreferencesHasSentWarningEmail238,UserPreferencesHasSentWarningEmail240, + UserPreferencesHideBiggerPhotoCallout,UserPreferencesHideChatterOnboardingSplash,UserPreferencesHideCSNDesktopTask,UserPreferencesHideCSNGetChatterMobileTask, + UserPreferencesHideEndUserOnboardingAssistantModal,UserPreferencesHideLightningMigrationModal, + UserPreferencesHideSecondChatterOnboardingSplash,UserPreferencesHideS1BrowserUI,UserPreferencesHideSfxWelcomeMat,UserPreferencesJigsawListUser, + UserPreferencesLightningExperiencePreferred,UserPreferencesNativeEmailClient,UserPreferencesNewLightningReportRunPageEnabled,UserPreferencesPathAssistantCollapsed, + UserPreferencesReceiveNoNotificationsAsApprover,UserPreferencesPreviewCustomTheme,UserPreferencesPreviewLightning,UserPreferencesRecordHomeReservedWTShown, + UserPreferencesRecordHomeSectionCollapseWTShown,UserPreferencesReverseOpenActivitiesView,UserPreferencesReceiveNotificationsAsDelegatedApprover, + UserPreferencesReminderSoundOff,UserPreferencesShowCityToExternalUsers,UserPreferencesShowCityToGuestUsers,UserPreferencesShowCountryToExternalUsers, + UserPreferencesShowCountryToGuestUsers,UserPreferencesShowEmailToExternalUsers,UserPreferencesShowEmailToGuestUsers,UserPreferencesShowFaxToExternalUsers, + UserPreferencesShowFaxToGuestUsers,UserPreferencesShowForecastingChangeSignals,UserPreferencesShowManagerToExternalUsers,UserPreferencesShowManagerToGuestUsers, + UserPreferencesShowMobilePhoneToExternalUsers,UserPreferencesShowMobilePhoneToGuestUsers,UserPreferencesShowPostalCodeToExternalUsers, + UserPreferencesShowPostalCodeToGuestUsers,UserPreferencesShowProfilePicToGuestUsers,UserPreferencesShowStateToExternalUsers, + UserPreferencesShowStateToGuestUsers,UserPreferencesShowStreetAddressToExternalUsers,UserPreferencesShowStreetAddressToGuestUsers, + UserPreferencesShowTitleToExternalUsers,UserPreferencesShowTitleToGuestUsers,UserPreferencesShowTerritoryTimeZoneShifts, + UserPreferencesShowWorkPhoneToExternalUsers,UserPreferencesShowWorkPhoneToGuestUsers,UserPreferencesSortFeedByComment,UserPreferencesSRHOverrideActivities, + UserPreferencesSuppressEventSFXReminders,UserPreferencesSuppressTaskSFXReminders,UserPreferencesTaskRemindersCheckboxDefault, + UserPreferencesUserDebugModePref,UserRoleId,UserType,SystemModstamp + """ + + entity = "User" + name = "users" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("AboutMe", StringType), + Property("AccountId", StringType), + Property( + "Address", + ObjectType( + Property("city", StringType), + Property("country", StringType), + Property("geocodeAccuracy", StringType), + Property("latitude", StringType), + Property("longitude", StringType), + Property("postalCode", StringType), + Property("state", StringType), + Property("street", StringType), + ), + ), + Property("Alias", StringType), + Property("BadgeText", StringType), + Property("BannerPhotoUrl", StringType), + Property("CallCenterId", StringType), + Property("City", StringType), + Property("CommunityNickname", StringType), + Property("CompanyName", StringType), + Property("ContactId", StringType), + Property("Country", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("DefaultGroupNotificationFrequency", StringType), + Property("DelegatedApproverId", StringType), + Property("Department", StringType), + Property("DigestFrequency", StringType), + Property("Division", StringType), + Property("Email", StringType), + Property("EmailEncodingKey", StringType), + Property("EmailPreferencesAutoBcc", BooleanType), + Property("EmailPreferencesAutoBccStayInTouch", BooleanType), + Property("EmailPreferencesStayInTouchReminder", BooleanType), + Property("EmployeeNumber", StringType), + Property("Extension", StringType), + Property("Fax", StringType), + Property("FederationIdentifier", StringType), + Property("FirstName", StringType), + Property("ForecastEnabled", BooleanType), + Property("FullPhotoUrl", StringType), + Property("GeocodeAccuracy", StringType), + Property("IndividualId", StringType), + Property("IsActive", BooleanType), + Property("IsProfilePhotoActive", BooleanType), + Property("IsExtIndicatorVisible", BooleanType), + Property("JigsawImportLimitOverride", IntegerType), + Property("LanguageLocaleKey", StringType), + Property("LastLoginDate", StringType), + Property("LastName", StringType), + Property("LastReferencedDate", StringType), + Property("LastViewedDate", StringType), + Property("Latitude", StringType), + Property("LocaleSidKey", StringType), + Property("Longitude", StringType), + Property("LastPasswordChangeDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("ManagerId", StringType), + Property("MediumBannerPhotoUrl", StringType), + Property("MediumPhotoUrl", StringType), + Property("MobilePhone", StringType), + Property("NumberOfFailedLogins", IntegerType), + Property("OfflinePdaTrialExpirationDate", StringType), + Property("OfflineTrialExpirationDate", StringType), + Property("OutOfOfficeMessage", StringType), + Property("Phone", StringType), + Property("PostalCode", StringType), + Property("ProfileId", StringType), + Property("ReceivesAdminInfoEmails", BooleanType), + Property("ReceivesInfoEmails", BooleanType), + Property("SenderEmail", StringType), + Property("SenderName", StringType), + Property("Signature", StringType), + Property("SmallBannerPhotoUrl", StringType), + Property("SmallPhotoUrl", StringType), + Property("State", StringType), + Property("StayInTouchNote", StringType), + Property("StayInTouchSignature", StringType), + Property("StayInTouchSubject", StringType), + Property("Street", StringType), + Property("TimeZoneSidKey", StringType), + Property("Title", StringType), + Property("Username", StringType), + Property("UserPermissionsCallCenterAutoLogin", BooleanType), + Property("UserPermissionsInteractionUser", BooleanType), + Property("UserPermissionsJigsawProspectingUser", BooleanType), + Property("UserPermissionsKnowledgeUser", BooleanType), + Property("UserPermissionsMarketingUser", BooleanType), + Property("UserPermissionsOfflineUser", BooleanType), + Property("UserPermissionsSFContentUser", BooleanType), + Property("UserPermissionsSiteforceContributorUser", BooleanType), + Property("UserPermissionsSiteforcePublisherUser", BooleanType), + Property("UserPermissionsSupportUser", BooleanType), + Property("UserPermissionsWorkDotComUserFeature", BooleanType), + Property("UserPreferencesActivityRemindersPopup", BooleanType), + Property("UserPreferencesApexPagesDeveloperMode", BooleanType), + Property("UserPreferencesCacheDiagnostics", BooleanType), + Property("UserPreferencesContentEmailAsAndWhen", BooleanType), + Property("UserPreferencesContentNoEmail", BooleanType), + Property("UserPreferencesCreateLEXAppsWTShown", BooleanType), + Property("UserPreferencesEnableAutoSubForFeeds", BooleanType), + Property("UserPreferencesDisableAllFeedsEmail", BooleanType), + Property("UserPreferencesDisableBookmarkEmail", BooleanType), + Property("UserPreferencesDisableChangeCommentEmail", BooleanType), + Property("UserPreferencesDisableEndorsementEmail", BooleanType), + Property("UserPreferencesDisableFileShareNotificationsForApi", BooleanType), + Property("UserPreferencesDisableFollowersEmail", BooleanType), + Property("UserPreferencesDisableLaterCommentEmail", BooleanType), + Property("UserPreferencesDisableLikeEmail", BooleanType), + Property("UserPreferencesDisableMentionsPostEmail", BooleanType), + Property("UserPreferencesDisableProfilePostEmail", BooleanType), + Property("UserPreferencesDisableSharePostEmail", BooleanType), + Property("UserPreferencesDisCommentAfterLikeEmail", BooleanType), + Property("UserPreferencesDisMentionsCommentEmail", BooleanType), + Property("UserPreferencesDisableMessageEmail", BooleanType), + Property("UserPreferencesDisProfPostCommentEmail", BooleanType), + Property("UserPreferencesEventRemindersCheckboxDefault", BooleanType), + Property("UserPreferencesExcludeMailAppAttachments", BooleanType), + Property("UserPreferencesFavoritesShowTopFavorites", BooleanType), + Property("UserPreferencesFavoritesWTShown", BooleanType), + Property("UserPreferencesGlobalNavBarWTShown", BooleanType), + Property("UserPreferencesGlobalNavGridMenuWTShown", BooleanType), + Property("UserPreferencesHasCelebrationBadge", BooleanType), + Property("UserPreferencesHasSentWarningEmail", BooleanType), + Property("UserPreferencesHasSentWarningEmail238", BooleanType), + Property("UserPreferencesHasSentWarningEmail240", BooleanType), + Property("UserPreferencesHideBiggerPhotoCallout", BooleanType), + Property("UserPreferencesHideChatterOnboardingSplash", BooleanType), + Property("UserPreferencesHideCSNDesktopTask", BooleanType), + Property("UserPreferencesHideCSNGetChatterMobileTask", BooleanType), + Property("UserPreferencesHideEndUserOnboardingAssistantModal", BooleanType), + Property("UserPreferencesHideLightningMigrationModal", BooleanType), + Property("UserPreferencesHideSecondChatterOnboardingSplash", BooleanType), + Property("UserPreferencesHideS1BrowserUI", BooleanType), + Property("UserPreferencesHideSfxWelcomeMat", BooleanType), + Property("UserPreferencesJigsawListUser", BooleanType), + Property("UserPreferencesLightningExperiencePreferred", BooleanType), + Property("UserPreferencesNativeEmailClient", BooleanType), + Property("UserPreferencesNewLightningReportRunPageEnabled", BooleanType), + Property("UserPreferencesPathAssistantCollapsed", BooleanType), + Property("UserPreferencesPreviewCustomTheme", BooleanType), + Property("UserPreferencesPreviewLightning", BooleanType), + Property("UserPreferencesRecordHomeReservedWTShown", BooleanType), + Property("UserPreferencesRecordHomeSectionCollapseWTShown", BooleanType), + Property("UserPreferencesReceiveNoNotificationsAsApprover", BooleanType), + Property("UserPreferencesReceiveNotificationsAsDelegatedApprover", BooleanType), + Property("UserPreferencesReminderSoundOff", BooleanType), + Property("UserPreferencesReverseOpenActivitiesView", BooleanType), + Property("UserPreferencesShowCityToExternalUsers", BooleanType), + Property("UserPreferencesShowCityToGuestUsers", BooleanType), + Property("UserPreferencesShowCountryToExternalUsers", BooleanType), + Property("UserPreferencesShowCountryToGuestUsers", BooleanType), + Property("UserPreferencesShowEmailToExternalUsers", BooleanType), + Property("UserPreferencesShowEmailToGuestUsers", BooleanType), + Property("UserPreferencesShowFaxToExternalUsers", BooleanType), + Property("UserPreferencesShowFaxToGuestUsers", BooleanType), + Property("UserPreferencesShowForecastingChangeSignals", BooleanType), + Property("UserPreferencesShowManagerToExternalUsers", BooleanType), + Property("UserPreferencesShowManagerToGuestUsers", BooleanType), + Property("UserPreferencesShowMobilePhoneToExternalUsers", BooleanType), + Property("UserPreferencesShowMobilePhoneToGuestUsers", BooleanType), + Property("UserPreferencesShowPostalCodeToExternalUsers", BooleanType), + Property("UserPreferencesShowPostalCodeToGuestUsers", BooleanType), + Property("UserPreferencesShowProfilePicToGuestUsers", BooleanType), + Property("UserPreferencesShowStateToExternalUsers", BooleanType), + Property("UserPreferencesShowStateToGuestUsers", BooleanType), + Property("UserPreferencesShowStreetAddressToExternalUsers", BooleanType), + Property("UserPreferencesShowStreetAddressToGuestUsers", BooleanType), + Property("UserPreferencesShowTitleToExternalUsers", BooleanType), + Property("UserPreferencesShowTitleToGuestUsers", BooleanType), + Property("UserPreferencesShowTerritoryTimeZoneShifts", BooleanType), + Property("UserPreferencesShowWorkPhoneToExternalUsers", BooleanType), + Property("UserPreferencesShowWorkPhoneToGuestUsers", BooleanType), + Property("UserPreferencesSortFeedByComment", BooleanType), + Property("UserPreferencesSRHOverrideActivities", BooleanType), + Property("UserPreferencesSuppressEventSFXReminders", BooleanType), + Property("UserPreferencesSuppressTaskSFXReminders", BooleanType), + Property("UserPreferencesTaskRemindersCheckboxDefault", BooleanType), + Property("UserPreferencesUserDebugModePref", BooleanType), + Property("UserRoleId", StringType), + Property("UserType", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class ProfileStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_businesshours.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id,Description,LastReferencedDate,PermissionsEmailSingle,PermissionsEmailMass,PermissionsEditTask,PermissionsEditEvent, + PermissionsExportReport,PermissionsImportPersonal,PermissionsDataExport,PermissionsManageUsers,PermissionsEditPublicFilters, + PermissionsEditPublicTemplates,PermissionsModifyAllData,PermissionsEditBillingInfo,PermissionsManageCases, + PermissionsMassInlineEdit,PermissionsEditKnowledge,PermissionsManageKnowledge,PermissionsManageSolutions, + PermissionsCustomizeApplication,PermissionsEditReadonlyFields,PermissionsRunReports,PermissionsViewSetup, + PermissionsTransferAnyEntity,PermissionsNewReportBuilder,PermissionsActivateContract,PermissionsActivateOrder, + PermissionsImportLeads,PermissionsManageLeads,PermissionsTransferAnyLead,PermissionsViewAllData,PermissionsEditPublicDocuments, + PermissionsViewEncryptedData,PermissionsEditBrandTemplates,PermissionsEditHtmlTemplates,PermissionsChatterInternalUser, + PermissionsManageEncryptionKeys,PermissionsDeleteActivatedContract,PermissionsChatterInviteExternalUsers, + PermissionsSendSitRequests,PermissionsApiUserOnly,PermissionsManageRemoteAccess,PermissionsCanUseNewDashboardBuilder, + PermissionsManageCategories,PermissionsConvertLeads,PermissionsPasswordNeverExpires,PermissionsUseTeamReassignWizards, + PermissionsEditActivatedOrders,PermissionsInstallMultiforce,PermissionsPublishMultiforce,PermissionsChatterOwnGroups, + PermissionsEditOppLineItemUnitPrice,PermissionsCreateMultiforce,PermissionsBulkApiHardDelete,PermissionsSolutionImport, + PermissionsManageCallCenters,PermissionsManageSynonyms,PermissionsViewContent,PermissionsManageEmailClientConfig, + PermissionsEnableNotifications,PermissionsManageDataIntegrations,PermissionsDistributeFromPersWksp,PermissionsViewDataCategories, + PermissionsManageDataCategories,PermissionsAuthorApex,PermissionsManageMobile,PermissionsApiEnabled,PermissionsManageCustomReportTypes, + PermissionsEditCaseComments,PermissionsTransferAnyCase,PermissionsContentAdministrator,PermissionsCreateWorkspaces, + PermissionsManageContentPermissions,PermissionsManageContentProperties,PermissionsManageContentTypes,PermissionsManageExchangeConfig, + PermissionsManageAnalyticSnapshots,PermissionsScheduleReports,PermissionsManageBusinessHourHolidays,PermissionsManageEntitlements, + PermissionsManageDynamicDashboards,PermissionsCustomSidebarOnAllPages,PermissionsManageInteraction,PermissionsViewMyTeamsDashboards, + PermissionsModerateChatter,PermissionsResetPasswords,PermissionsFlowUFLRequired,PermissionsCanInsertFeedSystemFields, + PermissionsActivitiesAccess,PermissionsManageKnowledgeImportExport,PermissionsEmailTemplateManagement,PermissionsEmailAdministration, + PermissionsManageChatterMessages,PermissionsAllowEmailIC,PermissionsChatterFileLink,PermissionsForceTwoFactor, + PermissionsViewEventLogFiles,PermissionsManageNetworks,PermissionsManageAuthProviders,PermissionsRunFlow, + PermissionsCreateCustomizeDashboards,PermissionsCreateDashboardFolders,PermissionsViewPublicDashboards, + PermissionsManageDashbdsInPubFolders,PermissionsCreateCustomizeReports,PermissionsCreateReportFolders,PermissionsViewPublicReports, + PermissionsManageReportsInPubFolders,PermissionsEditMyDashboards,PermissionsEditMyReports,PermissionsViewAllUsers, + PermissionsAllowUniversalSearch,PermissionsConnectOrgToEnvironmentHub,PermissionsWorkCalibrationUser,PermissionsCreateCustomizeFilters, + PermissionsWorkDotComUserPerm,PermissionsContentHubUser,PermissionsGovernNetworks,PermissionsSalesConsole, + PermissionsTwoFactorApi,PermissionsDeleteTopics,PermissionsEditTopics,PermissionsCreateTopics,PermissionsAssignTopics, + PermissionsIdentityEnabled,PermissionsIdentityConnect,PermissionsAllowViewKnowledge,PermissionsContentWorkspaces, + PermissionsManageSearchPromotionRules,PermissionsCustomMobileAppsAccess,PermissionsViewHelpLink,PermissionsManageProfilesPermissionsets, + PermissionsAssignPermissionSets,PermissionsManageRoles,PermissionsManageIpAddresses,PermissionsManageSharing, + PermissionsManageInternalUsers,PermissionsManagePasswordPolicies,PermissionsManageLoginAccessPolicies,PermissionsViewPlatformEvents, + PermissionsManageCustomPermissions,PermissionsCanVerifyComment,PermissionsManageUnlistedGroups,PermissionsStdAutomaticActivityCapture, + PermissionsInsightsAppDashboardEditor,PermissionsManageTwoFactor,PermissionsInsightsAppUser,PermissionsInsightsAppAdmin, + PermissionsInsightsAppEltEditor,PermissionsInsightsAppUploadUser,PermissionsInsightsCreateApplication,PermissionsLightningExperienceUser, + PermissionsViewDataLeakageEvents,PermissionsConfigCustomRecs,PermissionsSubmitMacrosAllowed,PermissionsBulkMacrosAllowed, + PermissionsShareInternalArticles,PermissionsManageSessionPermissionSets,PermissionsManageTemplatedApp,PermissionsUseTemplatedApp, + PermissionsSendAnnouncementEmails,PermissionsChatterEditOwnPost,PermissionsChatterEditOwnRecordPost,PermissionsWaveTabularDownload, + PermissionsAutomaticActivityCapture,PermissionsImportCustomObjects,PermissionsDelegatedTwoFactor,PermissionsChatterComposeUiCodesnippet, + PermissionsSelectFilesFromSalesforce,PermissionsModerateNetworkUsers,PermissionsMergeTopics,PermissionsSubscribeToLightningReports, + PermissionsManagePvtRptsAndDashbds,PermissionsAllowLightningLogin,PermissionsCampaignInfluence2,PermissionsViewDataAssessment, + PermissionsRemoveDirectMessageMembers,PermissionsCanApproveFeedPost,PermissionsAddDirectMessageMembers,PermissionsAllowViewEditConvertedLeads, + PermissionsShowCompanyNameAsUserBadge,PermissionsAccessCMC,PermissionsViewHealthCheck,PermissionsManageHealthCheck, + PermissionsPackaging2,PermissionsManageCertificates,PermissionsCreateReportInLightning,PermissionsPreventClassicExperience, + PermissionsHideReadByList,PermissionsListEmailSend,PermissionsFeedPinning,PermissionsChangeDashboardColors, + PermissionsManageRecommendationStrategies,PermissionsManagePropositions,PermissionsCloseConversations,PermissionsSubscribeReportRolesGrps, + PermissionsSubscribeDashboardRolesGrps,PermissionsUseWebLink,PermissionsHasUnlimitedNBAExecutions,PermissionsViewOnlyEmbeddedAppUser, + PermissionsViewAllActivities,PermissionsSubscribeReportToOtherUsers,PermissionsLightningConsoleAllowedForUser, + PermissionsSubscribeReportsRunAsUser,PermissionsSubscribeToLightningDashboards,PermissionsSubscribeDashboardToOtherUsers, + PermissionsCreateLtngTempInPub,PermissionsAppointmentBookingUserAccess,PermissionsTransactionalEmailSend, + PermissionsViewPrivateStaticResources,PermissionsCreateLtngTempFolder,PermissionsApexRestServices,PermissionsConfigureLiveMessage, + PermissionsLiveMessageAgent,PermissionsEnableCommunityAppLauncher,PermissionsGiveRecognitionBadge,PermissionsLightningSchedulerUserAccess, + PermissionsUseMySearch,PermissionsLtngPromoReserved01UserPerm,PermissionsManageSubscriptions,PermissionsWaveManagePrivateAssetsUser, + PermissionsCanEditDataPrepRecipe,PermissionsAddAnalyticsRemoteConnections,PermissionsManageSurveys,PermissionsUseAssistantDialog, + PermissionsUseQuerySuggestions,PermissionsPackaging2PromoteVersion,PermissionsRecordVisibilityAPI,PermissionsViewRoles, + PermissionsCanManageMaps,PermissionsLMOutboundMessagingUserPerm,PermissionsModifyDataClassification,PermissionsPrivacyDataAccess, + PermissionsQueryAllFiles,PermissionsModifyMetadata,PermissionsManageCMS,PermissionsSandboxTestingInCommunityApp, + PermissionsCanEditPrompts,PermissionsViewUserPII,PermissionsManageHubConnections,PermissionsB2BMarketingAnalyticsUser, + PermissionsTraceXdsQueries,PermissionsViewSecurityCommandCenter,PermissionsManageSecurityCommandCenter,PermissionsViewAllCustomSettings, + PermissionsViewAllForeignKeyNames,PermissionsAddWaveNotificationRecipients,PermissionsHeadlessCMSAccess,PermissionsLMEndMessagingSessionUserPerm, + PermissionsConsentApiUpdate,PermissionsPaymentsAPIUser,PermissionsAccessContentBuilder,PermissionsAccountSwitcherUser, + PermissionsViewAnomalyEvents,PermissionsManageC360AConnections,PermissionsIsContactCenterAdmin,PermissionsIsContactCenterAgent, + PermissionsManageReleaseUpdates,PermissionsViewAllProfiles,PermissionsSkipIdentityConfirmation,PermissionsCanToggleCallRecordings, + PermissionsLearningManager,PermissionsSendCustomNotifications,PermissionsPackaging2Delete,PermissionsUseOmnichannelInventoryAPIs, + PermissionsViewRestrictionAndScopingRules,PermissionsFSCComprehensiveUserAccess,PermissionsBotManageBots, + PermissionsBotManageBotsTrainingData,PermissionsSchedulingLineAmbassador,PermissionsSchedulingFacilityManager, + PermissionsOmnichannelInventorySync,PermissionsManageLearningReporting,PermissionsIsContactCenterSupervisor, + PermissionsIsotopeCToCUser,PermissionsCanAccessCE,PermissionsUseAddOrderItemSummaryAPIs,PermissionsIsotopeAccess, + PermissionsIsotopeLEX,PermissionsQuipMetricsAccess,PermissionsQuipUserEngagementMetrics,PermissionsRemoteMediaVirtualDesktop, + PermissionsTransactionSecurityExempt,PermissionsManageStores,PermissionsManageExternalConnections,PermissionsUseReturnOrder, + PermissionsUseReturnOrderAPIs,PermissionsUseSubscriptionEmails,PermissionsUseOrderEntry,PermissionsUseRepricing, + PermissionsAIViewInsightObjects,PermissionsAICreateInsightObjects,PermissionsViewMLModels,PermissionsLifecycleManagementAPIUser, + PermissionsNativeWebviewScrolling,PermissionsViewDeveloperName,PermissionsBypassMFAForUiLogins,PermissionsClientSecretRotation, + PermissionsAccessToServiceProcess,PermissionsManageOrchInstsAndWorkItems,PermissionsManageDataspaceScope,PermissionsConfigureDataspaceScope, + PermissionsEditRepricing,PermissionsEnableIPFSUpload,PermissionsEnableBCTransactionPolling,PermissionsFSCArcGraphCommunityUser, + LastViewedDate,Name,UserLicenseId,UserType,CreatedDate,CreatedById,LastModifiedDate,LastModifiedById,SystemModstamp + + """ + + entity = "Profile" + name = "profiles" + path = "/query" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("Description", StringType), + Property("LastReferencedDate", StringType), + Property("PermissionsEmailSingle", BooleanType), + Property("PermissionsEmailMass", BooleanType), + Property("PermissionsEditTask", BooleanType), + Property("PermissionsEditEvent", BooleanType), + Property("PermissionsExportReport", BooleanType), + Property("PermissionsImportPersonal", BooleanType), + Property("PermissionsDataExport", BooleanType), + Property("PermissionsManageUsers", BooleanType), + Property("PermissionsEditPublicFilters", BooleanType), + Property("PermissionsEditPublicTemplates", BooleanType), + Property("PermissionsModifyAllData", BooleanType), + Property("PermissionsEditBillingInfo", BooleanType), + Property("PermissionsManageCases", BooleanType), + Property("PermissionsMassInlineEdit", BooleanType), + Property("PermissionsEditKnowledge", BooleanType), + Property("PermissionsManageKnowledge", BooleanType), + Property("PermissionsManageSolutions", BooleanType), + Property("PermissionsCustomizeApplication", BooleanType), + Property("PermissionsEditReadonlyFields", BooleanType), + Property("PermissionsRunReports", BooleanType), + Property("PermissionsViewSetup", BooleanType), + Property("PermissionsTransferAnyEntity", BooleanType), + Property("PermissionsNewReportBuilder", BooleanType), + Property("PermissionsActivateContract", BooleanType), + Property("PermissionsActivateOrder", BooleanType), + Property("PermissionsImportLeads", BooleanType), + Property("PermissionsManageLeads", BooleanType), + Property("PermissionsTransferAnyLead", BooleanType), + Property("PermissionsViewAllData", BooleanType), + Property("PermissionsEditPublicDocuments", BooleanType), + Property("PermissionsViewEncryptedData", BooleanType), + Property("PermissionsEditBrandTemplates", BooleanType), + Property("PermissionsEditHtmlTemplates", BooleanType), + Property("PermissionsChatterInternalUser", BooleanType), + Property("PermissionsManageEncryptionKeys", BooleanType), + Property("PermissionsDeleteActivatedContract", BooleanType), + Property("PermissionsChatterInviteExternalUsers", BooleanType), + Property("PermissionsSendSitRequests", BooleanType), + Property("PermissionsApiUserOnly", BooleanType), + Property("PermissionsManageRemoteAccess", BooleanType), + Property("PermissionsCanUseNewDashboardBuilder", BooleanType), + Property("PermissionsManageCategories", BooleanType), + Property("PermissionsConvertLeads", BooleanType), + Property("PermissionsPasswordNeverExpires", BooleanType), + Property("PermissionsUseTeamReassignWizards", BooleanType), + Property("PermissionsEditActivatedOrders", BooleanType), + Property("PermissionsInstallMultiforce", BooleanType), + Property("PermissionsPublishMultiforce", BooleanType), + Property("PermissionsChatterOwnGroups", BooleanType), + Property("PermissionsEditOppLineItemUnitPrice", BooleanType), + Property("PermissionsCreateMultiforce", BooleanType), + Property("PermissionsBulkApiHardDelete", BooleanType), + Property("PermissionsSolutionImport", BooleanType), + Property("PermissionsManageCallCenters", BooleanType), + Property("PermissionsManageSynonyms", BooleanType), + Property("PermissionsViewContent", BooleanType), + Property("PermissionsManageEmailClientConfig", BooleanType), + Property("PermissionsEnableNotifications", BooleanType), + Property("PermissionsManageDataIntegrations", BooleanType), + Property("PermissionsDistributeFromPersWksp", BooleanType), + Property("PermissionsViewDataCategories", BooleanType), + Property("PermissionsManageDataCategories", BooleanType), + Property("PermissionsAuthorApex", BooleanType), + Property("PermissionsManageMobile", BooleanType), + Property("PermissionsApiEnabled", BooleanType), + Property("PermissionsManageCustomReportTypes", BooleanType), + Property("PermissionsEditCaseComments", BooleanType), + Property("PermissionsTransferAnyCase", BooleanType), + Property("PermissionsContentAdministrator", BooleanType), + Property("PermissionsCreateWorkspaces", BooleanType), + Property("PermissionsManageContentPermissions", BooleanType), + Property("PermissionsManageContentProperties", BooleanType), + Property("PermissionsManageContentTypes", BooleanType), + Property("PermissionsManageExchangeConfig", BooleanType), + Property("PermissionsManageAnalyticSnapshots", BooleanType), + Property("PermissionsScheduleReports", BooleanType), + Property("PermissionsManageBusinessHourHolidays", BooleanType), + Property("PermissionsManageEntitlements", BooleanType), + Property("PermissionsManageDynamicDashboards", BooleanType), + Property("PermissionsCustomSidebarOnAllPages", BooleanType), + Property("PermissionsManageInteraction", BooleanType), + Property("PermissionsViewMyTeamsDashboards", BooleanType), + Property("PermissionsModerateChatter", BooleanType), + Property("PermissionsResetPasswords", BooleanType), + Property("PermissionsFlowUFLRequired", BooleanType), + Property("PermissionsCanInsertFeedSystemFields", BooleanType), + Property("PermissionsActivitiesAccess", BooleanType), + Property("PermissionsManageKnowledgeImportExport", BooleanType), + Property("PermissionsEmailTemplateManagement", BooleanType), + Property("PermissionsEmailAdministration", BooleanType), + Property("PermissionsManageChatterMessages", BooleanType), + Property("PermissionsAllowEmailIC", BooleanType), + Property("PermissionsChatterFileLink", BooleanType), + Property("PermissionsForceTwoFactor", BooleanType), + Property("PermissionsViewEventLogFiles", BooleanType), + Property("PermissionsManageNetworks", BooleanType), + Property("PermissionsManageAuthProviders", BooleanType), + Property("PermissionsRunFlow", BooleanType), + Property("PermissionsCreateCustomizeDashboards", BooleanType), + Property("PermissionsCreateDashboardFolders", BooleanType), + Property("PermissionsViewPublicDashboards", BooleanType), + Property("PermissionsManageDashbdsInPubFolders", BooleanType), + Property("PermissionsCreateCustomizeReports", BooleanType), + Property("PermissionsCreateReportFolders", BooleanType), + Property("PermissionsViewPublicReports", BooleanType), + Property("PermissionsManageReportsInPubFolders", BooleanType), + Property("PermissionsEditMyDashboards", BooleanType), + Property("PermissionsEditMyReports", BooleanType), + Property("PermissionsViewAllUsers", BooleanType), + Property("PermissionsAllowUniversalSearch", BooleanType), + Property("PermissionsConnectOrgToEnvironmentHub", BooleanType), + Property("PermissionsWorkCalibrationUser", BooleanType), + Property("PermissionsCreateCustomizeFilters", BooleanType), + Property("PermissionsWorkDotComUserPerm", BooleanType), + Property("PermissionsContentHubUser", BooleanType), + Property("PermissionsGovernNetworks", BooleanType), + Property("PermissionsSalesConsole", BooleanType), + Property("PermissionsTwoFactorApi", BooleanType), + Property("PermissionsDeleteTopics", BooleanType), + Property("PermissionsEditTopics", BooleanType), + Property("PermissionsCreateTopics", BooleanType), + Property("PermissionsAssignTopics", BooleanType), + Property("PermissionsIdentityEnabled", BooleanType), + Property("PermissionsIdentityConnect", BooleanType), + Property("PermissionsAllowViewKnowledge", BooleanType), + Property("PermissionsContentWorkspaces", BooleanType), + Property("PermissionsManageSearchPromotionRules", BooleanType), + Property("PermissionsCustomMobileAppsAccess", BooleanType), + Property("PermissionsViewHelpLink", BooleanType), + Property("PermissionsManageProfilesPermissionsets", BooleanType), + Property("PermissionsAssignPermissionSets", BooleanType), + Property("PermissionsManageRoles", BooleanType), + Property("PermissionsManageIpAddresses", BooleanType), + Property("PermissionsManageSharing", BooleanType), + Property("PermissionsManageInternalUsers", BooleanType), + Property("PermissionsManagePasswordPolicies", BooleanType), + Property("PermissionsManageLoginAccessPolicies", BooleanType), + Property("PermissionsViewPlatformEvents", BooleanType), + Property("PermissionsManageCustomPermissions", BooleanType), + Property("PermissionsCanVerifyComment", BooleanType), + Property("PermissionsManageUnlistedGroups", BooleanType), + Property("PermissionsStdAutomaticActivityCapture", BooleanType), + Property("PermissionsInsightsAppDashboardEditor", BooleanType), + Property("PermissionsManageTwoFactor", BooleanType), + Property("PermissionsInsightsAppUser", BooleanType), + Property("PermissionsInsightsAppAdmin", BooleanType), + Property("PermissionsInsightsAppEltEditor", BooleanType), + Property("PermissionsInsightsAppUploadUser", BooleanType), + Property("PermissionsInsightsCreateApplication", BooleanType), + Property("PermissionsLightningExperienceUser", BooleanType), + Property("PermissionsViewDataLeakageEvents", BooleanType), + Property("PermissionsConfigCustomRecs", BooleanType), + Property("PermissionsSubmitMacrosAllowed", BooleanType), + Property("PermissionsBulkMacrosAllowed", BooleanType), + Property("PermissionsShareInternalArticles", BooleanType), + Property("PermissionsManageSessionPermissionSets", BooleanType), + Property("PermissionsManageTemplatedApp", BooleanType), + Property("PermissionsUseTemplatedApp", BooleanType), + Property("PermissionsSendAnnouncementEmails", BooleanType), + Property("PermissionsChatterEditOwnPost", BooleanType), + Property("PermissionsChatterEditOwnRecordPost", BooleanType), + Property("PermissionsWaveTabularDownload", BooleanType), + Property("PermissionsAutomaticActivityCapture", BooleanType), + Property("PermissionsImportCustomObjects", BooleanType), + Property("PermissionsDelegatedTwoFactor", BooleanType), + Property("PermissionsChatterComposeUiCodesnippet", BooleanType), + Property("PermissionsSelectFilesFromSalesforce", BooleanType), + Property("PermissionsModerateNetworkUsers", BooleanType), + Property("PermissionsMergeTopics", BooleanType), + Property("PermissionsSubscribeToLightningReports", BooleanType), + Property("PermissionsManagePvtRptsAndDashbds", BooleanType), + Property("PermissionsAllowLightningLogin", BooleanType), + Property("PermissionsCampaignInfluence2", BooleanType), + Property("PermissionsViewDataAssessment", BooleanType), + Property("PermissionsRemoveDirectMessageMembers", BooleanType), + Property("PermissionsCanApproveFeedPost", BooleanType), + Property("PermissionsAddDirectMessageMembers", BooleanType), + Property("PermissionsAllowViewEditConvertedLeads", BooleanType), + Property("PermissionsShowCompanyNameAsUserBadge", BooleanType), + Property("PermissionsAccessCMC", BooleanType), + Property("PermissionsViewHealthCheck", BooleanType), + Property("PermissionsManageHealthCheck", BooleanType), + Property("PermissionsPackaging2", BooleanType), + Property("PermissionsManageCertificates", BooleanType), + Property("PermissionsCreateReportInLightning", BooleanType), + Property("PermissionsPreventClassicExperience", BooleanType), + Property("PermissionsHideReadByList", BooleanType), + Property("PermissionsListEmailSend", BooleanType), + Property("PermissionsFeedPinning", BooleanType), + Property("PermissionsChangeDashboardColors", BooleanType), + Property("PermissionsManageRecommendationStrategies", BooleanType), + Property("PermissionsManagePropositions", BooleanType), + Property("PermissionsCloseConversations", BooleanType), + Property("PermissionsSubscribeReportRolesGrps", BooleanType), + Property("PermissionsSubscribeDashboardRolesGrps", BooleanType), + Property("PermissionsUseWebLink", BooleanType), + Property("PermissionsHasUnlimitedNBAExecutions", BooleanType), + Property("PermissionsViewOnlyEmbeddedAppUser", BooleanType), + Property("PermissionsViewAllActivities", BooleanType), + Property("PermissionsSubscribeReportToOtherUsers", BooleanType), + Property("PermissionsLightningConsoleAllowedForUser", BooleanType), + Property("PermissionsSubscribeReportsRunAsUser", BooleanType), + Property("PermissionsSubscribeToLightningDashboards", BooleanType), + Property("PermissionsSubscribeDashboardToOtherUsers", BooleanType), + Property("PermissionsCreateLtngTempInPub", BooleanType), + Property("PermissionsAppointmentBookingUserAccess", BooleanType), + Property("PermissionsTransactionalEmailSend", BooleanType), + Property("PermissionsViewPrivateStaticResources", BooleanType), + Property("PermissionsCreateLtngTempFolder", BooleanType), + Property("PermissionsApexRestServices", BooleanType), + Property("PermissionsConfigureLiveMessage", BooleanType), + Property("PermissionsLiveMessageAgent", BooleanType), + Property("PermissionsEnableCommunityAppLauncher", BooleanType), + Property("PermissionsGiveRecognitionBadge", BooleanType), + Property("PermissionsLightningSchedulerUserAccess", BooleanType), + Property("PermissionsUseMySearch", BooleanType), + Property("PermissionsLtngPromoReserved01UserPerm", BooleanType), + Property("PermissionsManageSubscriptions", BooleanType), + Property("PermissionsWaveManagePrivateAssetsUser", BooleanType), + Property("PermissionsCanEditDataPrepRecipe", BooleanType), + Property("PermissionsAddAnalyticsRemoteConnections", BooleanType), + Property("PermissionsManageSurveys", BooleanType), + Property("PermissionsUseAssistantDialog", BooleanType), + Property("PermissionsUseQuerySuggestions", BooleanType), + Property("PermissionsPackaging2PromoteVersion", BooleanType), + Property("PermissionsRecordVisibilityAPI", BooleanType), + Property("PermissionsViewRoles", BooleanType), + Property("PermissionsCanManageMaps", BooleanType), + Property("PermissionsLMOutboundMessagingUserPerm", BooleanType), + Property("PermissionsModifyDataClassification", BooleanType), + Property("PermissionsPrivacyDataAccess", BooleanType), + Property("PermissionsQueryAllFiles", BooleanType), + Property("PermissionsModifyMetadata", BooleanType), + Property("PermissionsManageCMS", BooleanType), + Property("PermissionsSandboxTestingInCommunityApp", BooleanType), + Property("PermissionsCanEditPrompts", BooleanType), + Property("PermissionsViewUserPII", BooleanType), + Property("PermissionsManageHubConnections", BooleanType), + Property("PermissionsB2BMarketingAnalyticsUser", BooleanType), + Property("PermissionsTraceXdsQueries", BooleanType), + Property("PermissionsViewSecurityCommandCenter", BooleanType), + Property("PermissionsManageSecurityCommandCenter", BooleanType), + Property("PermissionsViewAllCustomSettings", BooleanType), + Property("PermissionsViewAllForeignKeyNames", BooleanType), + Property("PermissionsAddWaveNotificationRecipients", BooleanType), + Property("PermissionsHeadlessCMSAccess", BooleanType), + Property("PermissionsLMEndMessagingSessionUserPerm", BooleanType), + Property("PermissionsConsentApiUpdate", BooleanType), + Property("PermissionsPaymentsAPIUser", BooleanType), + Property("PermissionsAccessContentBuilder", BooleanType), + Property("PermissionsAccountSwitcherUser", BooleanType), + Property("PermissionsViewAnomalyEvents", BooleanType), + Property("PermissionsManageC360AConnections", BooleanType), + Property("PermissionsIsContactCenterAdmin", BooleanType), + Property("PermissionsIsContactCenterAgent", BooleanType), + Property("PermissionsManageReleaseUpdates", BooleanType), + Property("PermissionsViewAllProfiles", BooleanType), + Property("PermissionsSkipIdentityConfirmation", BooleanType), + Property("PermissionsCanToggleCallRecordings", BooleanType), + Property("PermissionsLearningManager", BooleanType), + Property("PermissionsSendCustomNotifications", BooleanType), + Property("PermissionsPackaging2Delete", BooleanType), + Property("PermissionsUseOmnichannelInventoryAPIs", BooleanType), + Property("PermissionsViewRestrictionAndScopingRules", BooleanType), + Property("PermissionsFSCComprehensiveUserAccess", BooleanType), + Property("PermissionsBotManageBots", BooleanType), + Property("PermissionsBotManageBotsTrainingData", BooleanType), + Property("PermissionsSchedulingLineAmbassador", BooleanType), + Property("PermissionsSchedulingFacilityManager", BooleanType), + Property("PermissionsOmnichannelInventorySync", BooleanType), + Property("PermissionsManageLearningReporting", BooleanType), + Property("PermissionsIsContactCenterSupervisor", BooleanType), + Property("PermissionsIsotopeCToCUser", BooleanType), + Property("PermissionsCanAccessCE", BooleanType), + Property("PermissionsUseAddOrderItemSummaryAPIs", BooleanType), + Property("PermissionsIsotopeAccess", BooleanType), + Property("PermissionsIsotopeLEX", BooleanType), + Property("PermissionsQuipMetricsAccess", BooleanType), + Property("PermissionsQuipUserEngagementMetrics", BooleanType), + Property("PermissionsRemoteMediaVirtualDesktop", BooleanType), + Property("PermissionsTransactionSecurityExempt", BooleanType), + Property("PermissionsManageStores", BooleanType), + Property("PermissionsManageExternalConnections", BooleanType), + Property("PermissionsUseReturnOrder", BooleanType), + Property("PermissionsUseReturnOrderAPIs", BooleanType), + Property("PermissionsUseSubscriptionEmails", BooleanType), + Property("PermissionsUseOrderEntry", BooleanType), + Property("PermissionsUseRepricing", BooleanType), + Property("PermissionsAIViewInsightObjects", BooleanType), + Property("PermissionsAICreateInsightObjects", BooleanType), + Property("PermissionsViewMLModels", BooleanType), + Property("PermissionsLifecycleManagementAPIUser", BooleanType), + Property("PermissionsNativeWebviewScrolling", BooleanType), + Property("PermissionsViewDeveloperName", BooleanType), + Property("PermissionsBypassMFAForUiLogins", BooleanType), + Property("PermissionsClientSecretRotation", BooleanType), + Property("PermissionsAccessToServiceProcess", BooleanType), + Property("PermissionsManageOrchInstsAndWorkItems", BooleanType), + Property("PermissionsManageDataspaceScope", BooleanType), + Property("PermissionsConfigureDataspaceScope", BooleanType), + Property("PermissionsEditRepricing", BooleanType), + Property("PermissionsEnableIPFSUpload", BooleanType), + Property("PermissionsEnableBCTransactionPolling", BooleanType), + Property("PermissionsFSCArcGraphCommunityUser", BooleanType), + Property("LastViewedDate", StringType), + Property("Name", StringType), + Property("UserLicenseId", StringType), + Property("UserType", StringType), + Property("CreatedDate", StringType), + Property("CreatedById", StringType), + Property("LastModifiedDate", StringType), + Property("LastModifiedById", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + def get_url_params(self, context, next_page_token): + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" + return params + + +class OpportunityHistoryStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_opportunityhistory.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + columns = """ + Id, CreatedById, CreatedDate, SystemModstamp, Amount, CloseDate, ExpectedRevenue, ForecastCategory, IsDeleted, OpportunityId, PrevAmount, PrevCloseDate, Probability, StageName + """ + + entity = "OpportunityHistory" + name = "opportunity_history" + path = "/query" + primary_keys = ["Id"] + replication_key = "CreatedDate" + replication_method = "INCREMENTAL" + records_jsonpath = "$[records][*]" # Or override `parse_response`. + + schema = PropertiesList( + Property("Id", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("SystemModstamp", StringType), + Property("Amount", NumberType), + Property("CloseDate", StringType), + Property("ExpectedRevenue", NumberType), + Property("ForecastCategory", StringType), + Property("IsDeleted", BooleanType), + Property("OpportunityId", StringType), + Property("PrevAmount", StringType), + Property("PrevCloseDate", StringType), + Property("Probability", NumberType), + Property("StageName", StringType), + ).to_dict() + + def get_url_params( + self, context: dict | None, next_page_token: t.Any + ): # noqa: ANN401, E501 + params = super().get_url_params(context, next_page_token) + params["q"] = f"SELECT {self.columns} FROM {self.entity}" # noqa: S608 + return params + + +class BulkOpportunityHistoryStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_opportunityhistory.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "opportunity_history_bulk" + path = "" + replication_key = "CreatedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("SystemModstamp", StringType), + Property("Amount", NumberType), + Property("CloseDate", StringType), + Property("ExpectedRevenue", NumberType), + Property("ForecastCategory", StringType), + Property("IsDeleted", BooleanType), + Property("OpportunityId", StringType), + Property("PrevAmount", StringType), + Property("PrevCloseDate", StringType), + Property("Probability", NumberType), + Property("StageName", StringType), + Property("AccountId", StringType), + Property("CampaignId", StringType), + Property("ContactId", StringType), + Property("Description", StringType), + Property("Fiscal", StringType), + Property("FiscalQuarter", StringType), + Property("FiscalYear", StringType), + Property("ForecastCategoryName", StringType), + Property("HasOpenActivity", BooleanType), + Property("HasOpportunityLineItem", BooleanType), + Property("HasOverdueTask", BooleanType), + Property("IsPrivate", BooleanType), + Property("IsWon", BooleanType), + Property("IsClosed", BooleanType), + Property("LastActivityDate", StringType), + Property("LastAmountChangedHistoryId", StringType), + Property("LastCloseDateChangedHistoryId", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("LastReferencedDate", StringType), + Property("LastStageChangeDate", StringType), + Property("LastViewedDate", StringType), + Property("LeadSource", StringType), + Property("Name", StringType), + Property("NextStep", StringType), + Property("OwnerId", StringType), + Property("Pricebook2Id", StringType), + Property("PushCount", NumberType), + Property("TotalOpportunityQuantity", StringType), + Property("Type", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def convert_to_numeric(self, value): + if value == "": + return None + try: + return int(value) + except ValueError: + try: + return float(value) + except ValueError: + return None + + def post_process( + self, + row: dict, + context: dict | None = None, + ) -> dict | None: + # List of column names with NumberType + number_columns = [ + "Amount", + "ExpectedRevenue", + "Probability", + "PushCount", + ] + + for column in number_columns: + row[column] = self.convert_to_numeric(row[column]) + return row + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + AccountId, Amount, CampaignID, CloseDate, ContactId, CreatedById, CreatedDate, Description, ExpectedRevenue, Fiscal, + FiscalQuarter, FiscalYear, ForecastCategory, ForecastCategoryName, HasOpenActivity, HasOpportunityLineItem, + HasOverDueTask, Id, IsClosed, IsDeleted, IsPrivate, IsWon, LastActivityDate, LastAmountChangedHistoryId, + LastCloseDateChangedHistoryId, LastModifiedById, LastModifiedDate, LastReferencedDate, LastStageChangeDate, + LastVieweddate, LeadSource, Name, NextStep, OwnerId, Pricebook2Id, Probability, PushCount, StageName, + SystemModstamp, TotalOpportunityQuantity, Type + """ + entity = "OPPORTUNITY" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "opportunity_history_bulk" + path = "" + primary_keys = ["Id"] + + @property + def url_base(self): + domain = self.config["domain"] + return f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield self.post_process(record, context) + except Exception as e: + self.logger.info(e) + + +class BulkAccountStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_account.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + entity = "Account" + name = "accounts_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("YearStarted", StringType), + Property("AccountNumber", StringType), + Property("AccountSource", StringType), + Property("AnnualRevenue", NumberType), + Property("city", StringType), + Property("country", StringType), + Property("geocodeAccuracy", StringType), + Property("latitude", StringType), + Property("longitude", StringType), + Property("postalCode", StringType), + Property("state", StringType), + Property("street", StringType), + Property("BillingCity", StringType), + Property("BillingCountry", StringType), + Property("BillingLatitude", StringType), + Property("BillingLongitude", StringType), + Property("BillingPostalCode", StringType), + Property("BillingState", StringType), + Property("BillingStreet", StringType), + Property("BillingGeocodeAccuracy", StringType), + Property("CleanStatus", StringType), + Property("Description", StringType), + Property("DunsNumber", StringType), + Property("Fax", StringType), + Property("Industry", StringType), + Property("Jigsaw", StringType), + Property("LastActivityDate", StringType), + Property("LastReferencedDate", StringType), + Property("LastViewedDate", StringType), + Property("MasterRecordId", StringType), + Property("NaicsCode", StringType), + Property("NaicsDesc", StringType), + Property("NumberOfEmployees", IntegerType), + Property("OperatingHoursId", StringType), + Property("OwnerId", StringType), + Property("Ownership", StringType), + Property("ParentId", StringType), + Property("Phone", StringType), + Property("PhotoUrl", StringType), + Property("Rating", StringType), + Property("city", StringType), + Property("country", StringType), + Property("geocodeAccuracy", StringType), + Property("latitude", StringType), + Property("longitude", StringType), + Property("postalCode", StringType), + Property("state", StringType), + Property("street", StringType), + Property("ShippingCity", StringType), + Property("ShippingCountry", StringType), + Property("ShippingGeocodeAccuracy", StringType), + Property("ShippingLatitude", StringType), + Property("ShippingLongitude", StringType), + Property("ShippingPostalCode", StringType), + Property("ShippingState", StringType), + Property("ShippingStreet", StringType), + Property("Sic", StringType), + Property("SicDesc", StringType), + Property("Site", StringType), + Property("TickerSymbol", StringType), + Property("Tradestyle", StringType), + Property("Type", StringType), + Property("Website", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("DandbCompanyId", StringType), + Property("IsDeleted", BooleanType), + Property("JigsawCompanyId", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + return f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + def convert_to_numeric(self, value): + if value == "": + return None + try: + return int(value) + except ValueError: + try: + return float(value) + except ValueError: + return None + + def post_process( + self, + row: dict, + context: dict | None = None, + ) -> dict | None: + # List of column names with NumberType + number_columns = [ + "AnnualRevenue", + "NumberOfEmployees", + ] + + for column in number_columns: + row[column] = self.convert_to_numeric(row[column]) + return row + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,Name,YearStarted,AccountNumber,AccountSource,AnnualRevenue,BillingCity,BillingCountry, + BillingLatitude,BillingLongitude,BillingPostalCode,BillingState,BillingStreet,BillingGeocodeAccuracy, + CleanStatus,Description,DunsNumber,Fax,Industry,Jigsaw,LastActivityDate,LastReferencedDate,LastViewedDate, + MasterRecordId,NaicsCode,NaicsDesc,NumberOfEmployees,OperatingHoursId,OwnerId,Ownership,ParentId,Phone, + PhotoUrl,Rating,ShippingCity,ShippingCountry,ShippingGeocodeAccuracy,ShippingLatitude, + ShippingLongitude,ShippingPostalCode,ShippingState,ShippingStreet,Sic,SicDesc,Site,TickerSymbol,Tradestyle,Type, + Website,CreatedById,CreatedDate,DandbCompanyId,IsDeleted,JigsawCompanyId, + LastModifiedById,LastModifiedDate,SystemModstamp + """ + entity = "ACCOUNT" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "accounts_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield self.post_process(record, context) + except Exception as e: + pass + self.logger.info(e) + + +class BulkContactStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_contact.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "contacts_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("AccountId", StringType), + Property("AssistantName", StringType), + Property("AssistantPhone", StringType), + Property("Birthdate", StringType), + Property("CleanStatus", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("Department", StringType), + Property("Description", StringType), + Property("Email", StringType), + Property("EmailBouncedDate", StringType), + Property("EmailBouncedReason", StringType), + Property("Fax", StringType), + Property("FirstName", StringType), + Property("LastName", StringType), + Property("HomePhone", StringType), + Property("IndividualId", StringType), + Property("IsDeleted", BooleanType), + Property("IsEmailBounced", BooleanType), + Property("Jigsaw", StringType), + Property("JigsawContactId", StringType), + Property("LastActivityDate", StringType), + Property("LastReferencedDate", StringType), + Property("LastViewedDate", StringType), + Property("LastCURequestDate", StringType), + Property("LastCUUpdateDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("LeadSource", StringType), + Property("city", StringType), + Property("country", StringType), + Property("geocodeAccuracy", StringType), + Property("latitude", StringType), + Property("longitude", StringType), + Property("postalCode", StringType), + Property("state", StringType), + Property("street", StringType), + Property("MailingCity", StringType), + Property("MailingCountry", StringType), + Property("MailingGeocodeAccuracy", StringType), + Property("MailingLatitude", StringType), + Property("MailingLongitude", StringType), + Property("MailingPostalCode", StringType), + Property("MailingState", StringType), + Property("MailingStreet", StringType), + Property("MasterRecordId", StringType), + Property("MobilePhone", StringType), + Property("city", StringType), + Property("country", StringType), + Property("geocodeAccuracy", StringType), + Property("latitude", StringType), + Property("longitude", StringType), + Property("postalCode", StringType), + Property("state", StringType), + Property("street", StringType), + Property("OtherCity", StringType), + Property("OtherCountry", StringType), + Property("OtherGeocodeAccuracy", StringType), + Property("OtherLatitude", StringType), + Property("OtherLongitude", StringType), + Property("OtherPhone", StringType), + Property("OtherPostalCode", StringType), + Property("OtherState", StringType), + Property("OtherStreet", StringType), + Property("OwnerId", StringType), + Property("Phone", StringType), + Property("PhotoUrl", StringType), + Property("ReportsToId", BooleanType), + Property("Salutation", StringType), + Property("SystemModstamp", StringType), + Property("Title", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + columns = """ + Id,Name,AccountId,AssistantName,AssistantPhone,Birthdate,CleanStatus,CreatedById,CreatedDate,Department, + Description,Email,EmailBouncedDate,EmailBouncedReason,Fax,FirstName,LastName,HomePhone,IndividualId,IsDeleted, + IsEmailBounced,Jigsaw,JigsawContactId,LastActivityDate,LastReferencedDate,LastViewedDate,LastCURequestDate, + LastCUUpdateDate,LastModifiedById,LastModifiedDate,LeadSource,MailingCity,MailingCountry, + MailingGeocodeAccuracy,MailingLatitude,MailingLongitude,MailingPostalCode,MailingState,MailingStreet,MasterRecordId, + MobilePhone,OtherCity,OtherCountry,OtherGeocodeAccuracy,OtherLatitude,OtherLongitude,OtherPhone,OtherPostalCode, + OtherState,OtherStreet,OwnerId,Phone,PhotoUrl,ReportsToId,Salutation,SystemModstamp,Title + """ + entity = "CONTACT" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "contacts_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield record + except Exception as e: + pass + self.logger.info(e) + + +class BulkCampaignStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_campaign.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "campaigns_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("ActualCost", NumberType), + Property("AmountAllOpportunities", NumberType), + Property("AmountWonOpportunities", NumberType), + Property("BudgetedCost", NumberType), + Property("CampaignMemberRecordTypeId", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("Description", StringType), + Property("EndDate", StringType), + Property("ExpectedResponse", NumberType), + Property("ExpectedRevenue", NumberType), + Property("IsActive", BooleanType), + Property("IsDeleted", BooleanType), + Property("LastActivityDate", StringType), + Property("LastReferencedDate", StringType), + Property("LastViewedDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", BooleanType), + Property("NumberOfContacts", IntegerType), + Property("NumberOfConvertedLeads", IntegerType), + Property("NumberOfLeads", IntegerType), + Property("NumberOfOpportunities", IntegerType), + Property("NumberOfResponses", IntegerType), + Property("NumberOfWonOpportunities", IntegerType), + Property("NumberSent", NumberType), + Property("OwnerId", StringType), + Property("ParentId", StringType), + Property("StartDate", StringType), + Property("Status", StringType), + Property("Type", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def convert_to_numeric(self, value): + if value == "": + return None + try: + return int(value) + except ValueError: + try: + return float(value) + except ValueError: + return None + + def post_process( + self, + row: dict, + context: dict | None = None, + ) -> dict | None: + # List of column names with NumberType + number_columns = [ + "ActualCost", + "AmountAllOpportunities", + "AmountWonOpportunities", + "BudgetedCost", + "ExpectedResponse", + "ExpectedRevenue", + "NumberSent", + "NumberOfContacts", + "NumberOfConvertedLeads", + "NumberOfLeads", + "NumberOfOpportunities", + "NumberOfResponses", + "NumberOfWonOpportunities", + ] + + for column in number_columns: + row[column] = self.convert_to_numeric(row[column]) + return row + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,Name,ActualCost,AmountAllOpportunities,AmountWonOpportunities,BudgetedCost,CampaignMemberRecordTypeId, + CreatedById,CreatedDate,Description,EndDate,ExpectedResponse,ExpectedRevenue,IsActive,IsDeleted,LastActivityDate, + LastReferencedDate,LastViewedDate,LastModifiedById,LastModifiedDate,NumberOfContacts,NumberOfConvertedLeads, + NumberOfLeads,NumberOfOpportunities,NumberOfResponses,NumberOfWonOpportunities,NumberSent,OwnerId,ParentId, + StartDate,Status,Type,SystemModstamp + """ + entity = "CAMPAIGN" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "campaigns_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield self.post_process(record, context) + except Exception as e: + pass + self.logger.info(e) + + +class BulkEntitlementStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_entitlement.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "entitlements_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("AccountId", StringType), + Property("AssetId", StringType), + Property("BusinessHoursId", StringType), + Property("CasesPerEntitlement", IntegerType), + Property("ContractLineItemId", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("EndDate", StringType), + Property("IsDeleted", BooleanType), + Property("IsPerIncident", BooleanType), + Property("LastReferencedDate", StringType), + Property("LastViewedDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("LocationId", StringType), + Property("SvcApptBookingWindowsId", StringType), + Property("RemainingCases", IntegerType), + Property("RemainingWorkOrders", IntegerType), + Property("ServiceContractId", StringType), + Property("SlaProcessId", StringType), + Property("StartDate", StringType), + Property("Status", StringType), + Property("Type", StringType), + Property("WorkOrdersPerEntitlement", IntegerType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def convert_to_numeric(self, value): + if value == "": + return None + try: + return int(value) + except ValueError: + try: + return float(value) + except ValueError: + return None + + def post_process( + self, + row: dict, + context: dict | None = None, + ) -> dict | None: + # List of column names with numeric or integer values + numeric_columns = [ + "CasesPerEntitlement", + "RemainingCases", + "RemainingWorkOrders", + "WorkOrdersPerEntitlement", + ] + + for column in numeric_columns: + if column in row: + row[column] = self.convert_to_numeric(row[column]) + + return row + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,Name,AccountId,AssetId,BusinessHoursId,CasesPerEntitlement,ContractLineItemId,CreatedById,CreatedDate,EndDate,IsDeleted, + IsPerIncident,LastReferencedDate,LastViewedDate,LastModifiedById,LastModifiedDate,LocationId,SvcApptBookingWindowsId, + RemainingCases,RemainingWorkOrders,ServiceContractId,SlaProcessId,StartDate,Status,Type,WorkOrdersPerEntitlement,SystemModstamp + """ + entity = "ENTITLEMENT" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "entitlements_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield self.post_process(record, context) + except Exception as e: + pass + self.logger.info(e) + + +class BulkCaseStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_case.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "cases_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("AccountId", StringType), + Property("AssetId", StringType), + Property("Comments", StringType), + Property("CaseNumber", StringType), + Property("ClosedDate", StringType), + Property("ContactEmail", StringType), + Property("ContactFax", StringType), + Property("ContactId", StringType), + Property("ContactMobile", StringType), + Property("ContactPhone", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("Description", StringType), + Property("IsClosed", BooleanType), + Property("IsDeleted", BooleanType), + Property("IsEscalated", BooleanType), + Property("LastReferencedDate", StringType), + Property("LastViewedDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("MasterRecordId", StringType), + Property("Origin", StringType), + Property("OwnerId", StringType), + Property("ParentId", StringType), + Property("Priority", StringType), + Property("Reason", StringType), + Property("SourceId", StringType), + Property("Status", StringType), + Property("Subject", StringType), + Property("SuppliedCompany", StringType), + Property("SuppliedEmail", StringType), + Property("SuppliedName", StringType), + Property("SuppliedPhone", StringType), + Property("Type", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,AccountId,AssetId,Comments,CaseNumber,ClosedDate,ContactEmail,ContactFax,ContactId,ContactMobile,ContactPhone,CreatedById, + CreatedDate,Description,IsClosed,IsDeleted,IsEscalated,LastReferencedDate,LastViewedDate,LastModifiedById, + LastModifiedDate,MasterRecordId,Origin,OwnerId,ParentId,Priority,Reason, + SourceId,Status,Subject,SuppliedCompany,SuppliedEmail,SuppliedName,SuppliedPhone,Type,SystemModstamp + """ + + entity = "CASE" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "cases_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield record + except Exception as e: + pass + self.logger.info(e) + + +class BulkEmailTemplateStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_emailtemplate.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "email_templates_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("ApiVersion", NumberType), + Property("Body", StringType), + Property("BrandTemplateId", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("Description", StringType), + Property("DeveloperName", StringType), + Property("Encoding", StringType), + Property("EnhancedLetterheadId", StringType), + Property("FolderId", StringType), + Property("FolderName", StringType), + Property("HtmlValue", StringType), + Property("IsActive", BooleanType), + Property("IsBuilderContent", BooleanType), + Property("LastUsedDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("Markup", StringType), + Property("NamespacePrefix", StringType), + Property("OwnerId", StringType), + Property("RelatedEntityType", StringType), + Property("Subject", StringType), + Property("TemplateStyle", StringType), + Property("TemplateType", StringType), + Property("TimesUsed", IntegerType), + Property("UiType", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def convert_to_numeric(self, value): + if value == "": + return None + try: + return int(value) + except ValueError: + try: + return float(value) + except ValueError: + return None + + def post_process( + self, + row: dict, + context: dict | None = None, + ) -> dict | None: + # List of column names with numeric or integer values + numeric_columns = ["ApiVersion", "TimesUsed"] + + for column in numeric_columns: + if column in row: + row[column] = self.convert_to_numeric(row[column]) + + return row + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,Name,ApiVersion,Body,BrandTemplateId,CreatedById,CreatedDate,Description,DeveloperName,Encoding,EnhancedLetterheadId, + FolderId,FolderName,HtmlValue,IsActive,IsBuilderContent,LastUsedDate,LastModifiedById,LastModifiedDate,Markup, + NamespacePrefix,OwnerId,RelatedEntityType,Subject,TemplateStyle,TemplateType,TimesUsed,UIType,SystemModstamp + """ + entity = "EMAILTEMPLATE" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "email_templates_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield self.post_process(record, context) + except Exception as e: + pass + self.logger.info(e) + + +class BulkFolderStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_folder.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "folders_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("AccessType", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("DeveloperName", StringType), + Property("IsReadonly", BooleanType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("NamespacePrefix", StringType), + Property("ParentId", StringType), + Property("Type", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,Name,AccessType,CreatedById,CreatedDate,DeveloperName,IsReadonly,LastModifiedById, + LastModifiedDate,NamespacePrefix,ParentId,Type,SystemModstamp + """ + entity = "FOLDER" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "folders_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield record + except Exception as e: + pass + self.logger.info(e) + + +class BulkGroupStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_group.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "groups_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("DeveloperName", StringType), + Property("DoesIncludeBosses", BooleanType), + Property("DoesSendEmailToMembers", BooleanType), + Property("Email", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("OwnerId", StringType), + Property("Type", StringType), + Property("RelatedId", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,Name,CreatedById,CreatedDate,DeveloperName,DoesIncludeBosses,DoesSendEmailToMembers, + Email,LastModifiedById,LastModifiedDate,OwnerId,Type,RelatedId,SystemModstamp + """ + entity = "GROUP" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "groups_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield record + except Exception as e: + pass + self.logger.info(e) + + +class BulkLeadStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_lead.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "leads_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("AnnualRevenue", NumberType), + Property("City", StringType), + Property("CleanStatus", StringType), + Property("Company", StringType), + Property("CompanyDunsNumber", StringType), + Property("ConvertedAccountId", StringType), + Property("ConvertedContactId", StringType), + Property("ConvertedDate", StringType), + Property("ConvertedOpportunityId", StringType), + Property("Country", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("DandbCompanyId", StringType), + Property("Description", StringType), + Property("Email", StringType), + Property("EmailBouncedDate", StringType), + Property("EmailBouncedReason", StringType), + Property("Fax", StringType), + Property("FirstName", StringType), + Property("GeocodeAccuracy", StringType), + Property("IndividualId", StringType), + Property("Industry", StringType), + Property("IsConverted", BooleanType), + Property("IsDeleted", BooleanType), + Property("IsUnreadByOwner", BooleanType), + Property("Jigsaw", StringType), + Property("JigsawContactId", StringType), + Property("LastActivityDate", StringType), + Property("LastName", StringType), + Property("LastReferencedDate", StringType), + Property("LastViewedDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("Latitude", StringType), + Property("Longitude", StringType), + Property("LeadSource", StringType), + Property("MasterRecordId", StringType), + Property("MobilePhone", StringType), + Property("NumberOfEmployees", IntegerType), + Property("OwnerId", StringType), + Property("Phone", StringType), + Property("PhotoUrl", StringType), + Property("PostalCode", StringType), + Property("Rating", StringType), + Property("Salutation", StringType), + Property("State", StringType), + Property("Status", StringType), + Property("Street", StringType), + Property("Title", StringType), + Property("Website", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def convert_to_numeric(self, value): + if value == "": + return None + try: + return int(value) + except ValueError: + try: + return float(value) + except ValueError: + return None + + def post_process( + self, + row: dict, + context: dict | None = None, + ) -> dict | None: + # List of column names with numeric or integer values + numeric_columns = ["AnnualRevenue", "NumberOfEmployees"] + for column in numeric_columns: + if column in row: + row[column] = self.convert_to_numeric(row[column]) + + return row + + def get_records(self, context: dict | None) -> requests.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + columns = """ + Id,Name,AnnualRevenue,City,CleanStatus,Company,CompanyDunsNumber,ConvertedAccountId,ConvertedContactId, + ConvertedDate,ConvertedOpportunityId,Country,CreatedById,CreatedDate,DandbCompanyId,Description, + Email,EmailBouncedDate,EmailBouncedReason,Fax,FirstName,GeocodeAccuracy,IndividualId,Industry,IsConverted, + IsDeleted,IsUnreadByOwner,Jigsaw,JigsawContactId,LastActivityDate,LastName,LastReferencedDate,LastViewedDate, + LastModifiedById,LastModifiedDate,Latitude,Longitude,LeadSource,MasterRecordId,MobilePhone, + NumberOfEmployees,OwnerId,Phone,PhotoUrl,PostalCode,Rating,Salutation, + State,Status,Street,Title,Website,SystemModstamp + """ + entity = "LEAD" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "leads_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield self.post_process(record, context) + except Exception as e: + pass + self.logger.info(e) + + +class BulkPeriodStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_period.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "periods_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "StartDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("EndDate", StringType), + Property("FiscalYearSettingsId", StringType), + Property("FullyQualifiedLabel", StringType), + Property("IsForecastPeriod", BooleanType), + Property("Number", IntegerType), + Property("PeriodLabel", StringType), + Property("QuarterLabel", StringType), + Property("StartDate", StringType), + Property("Type", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def convert_to_numeric(self, value): + if value == "": + return None + try: + return int(value) + except ValueError: + try: + return float(value) + except ValueError: + return None + + def post_process( + self, + row: dict, + context: dict | None = None, + ) -> dict | None: + # List of column names with numeric or integer values + numeric_columns = ["Number"] + for column in numeric_columns: + if column in row: + row[column] = self.convert_to_numeric(row[column]) + return row + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,EndDate,FiscalYearSettingsId,FullyQualifiedLabel,IsForecastPeriod, + Number,PeriodLabel,QuarterLabel,StartDate,Type,SystemModstamp + """ + entity = "PERIOD" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "periods_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield self.post_process(record, context) + except Exception as e: + pass + self.logger.info(e) + + +class BulkSolutionStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_solution.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "solutions_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("IsDeleted", BooleanType), + Property("IsHtml", BooleanType), + Property("IsPublished", BooleanType), + Property("IsPublishedInPublicKb", BooleanType), + Property("IsReviewed", BooleanType), + Property("LastReferencedDate", StringType), + Property("LastViewedDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("OwnerId", StringType), + Property("SolutionName", StringType), + Property("SolutionNote", StringType), + Property("SolutionNumber", StringType), + Property("Status", StringType), + Property("TimesUsed", IntegerType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def convert_to_numeric(self, value): + if value == "": + return None + try: + return int(value) + except ValueError: + try: + return float(value) + except ValueError: + return None + + def post_process( + self, + row: dict, + context: dict | None = None, + ) -> dict | None: + # List of column names with numeric or integer values + numeric_columns = ["TimesUsed"] + for column in numeric_columns: + if column in row: + row[column] = self.convert_to_numeric(row[column]) + return row + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,CreatedById,CreatedDate,IsDeleted,IsHtml,IsPublished,IsPublishedInPublicKb,IsReviewed, + LastReferencedDate,LastViewedDate,LastModifiedById,LastModifiedDate,OwnerId,SolutionName, + SolutionNote,SolutionNumber,Status,TimesUsed,SystemModstamp + """ + entity = "SOLUTION" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "solutions_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield self.post_process(record, context) + except Exception as e: + pass + self.logger.info(e) + + +class BulkStaticResourceStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_staticresource.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "static_resources_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("Body", StringType), + Property("BodyLength", IntegerType), + Property("CacheControl", StringType), + Property("ContentType", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("Description", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("NamespacePrefix", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def convert_to_numeric(self, value): + if value == "": + return None + try: + return int(value) + except ValueError: + try: + return float(value) + except ValueError: + return None + + def post_process( + self, + row: dict, + context: dict | None = None, + ) -> dict | None: + # List of column names with numeric or integer values + numeric_columns = ["BodyLength"] + for column in numeric_columns: + if column in row: + row[column] = self.convert_to_numeric(row[column]) + return row + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + columns = """ + Id,Name,BodyLength,CacheControl,ContentType,CreatedById,CreatedDate,Description, + LastModifiedById,LastModifiedDate,NamespacePrefix,SystemModstamp + """ + entity = "STATICRESOURCE" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "static_resources_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield self.post_process(record, context) + except Exception as e: + pass + self.logger.info(e) + + +class BulkWebLinkStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_weblink.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "web_links_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("Body", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("Description", StringType), + Property("DisplayType", StringType), + Property("EncodingKey", StringType), + Property("HasMenubar", BooleanType), + Property("HasScrollbars", BooleanType), + Property("HasToolbar", BooleanType), + Property("Height", IntegerType), + Property("IsProtected", BooleanType), + Property("IsResizable", BooleanType), + Property("LinkType", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("MasterLabel", StringType), + Property("NamespacePrefix", StringType), + Property("OpenType", StringType), + Property("PageOrSobjectType", StringType), + Property("Position", StringType), + Property("RequireRowSelection", BooleanType), + Property("ScontrolId", StringType), + Property("ShowsLocation", BooleanType), + Property("ShowsStatus", BooleanType), + Property("Url", StringType), + Property("Width", IntegerType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def convert_to_numeric(self, value): + if value == "": + return None + try: + return int(value) + except ValueError: + try: + return float(value) + except ValueError: + return None + + def post_process( + self, + row: dict, + context: dict | None = None, + ) -> dict | None: + # List of column names with numeric or integer values + numeric_columns = ["Height", "Width"] + for column in numeric_columns: + if column in row: + row[column] = self.convert_to_numeric(row[column]) + return row + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,Name,CreatedById,CreatedDate,Description,DisplayType,EncodingKey,HasMenubar,HasScrollbars,HasToolbar, + Height,IsProtected,IsResizable,LinkType,LastModifiedById,LastModifiedDate,MasterLabel,NamespacePrefix,OpenType, + PageOrSobjectType,Position,RequireRowSelection,ScontrolId,ShowsLocation,ShowsStatus,Url,Width,SystemModstamp + """ + entity = "WEBLINK" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "web_links_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield self.post_process(record, context) + except Exception as e: + pass + self.logger.info(e) + + +class BulkPricebook2Stream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_pricebook2.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "pricebooks_2_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("Description", StringType), + Property("IsActive", BooleanType), + Property("IsArchived", BooleanType), + Property("IsDeleted", BooleanType), + Property("IsStandard", BooleanType), + Property("LastReferencedDate", StringType), + Property("LastViewedDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,Name,CreatedById,CreatedDate,Description,IsActive,IsArchived,IsDeleted,IsStandard, + LastReferencedDate,LastViewedDate,LastModifiedById,LastModifiedDate,SystemModstamp + """ + entity = "PRICEBOOK2" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "pricebooks_2_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield record + except Exception as e: + pass + self.logger.info(e) + + +class BulkProduct2Stream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_product2.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "products_2_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("Description", StringType), + Property("DisplayUrl", StringType), + Property("ExternalDataSourceId", StringType), + Property("ExternalId", StringType), + Property("Family", StringType), + Property("IsActive", BooleanType), + Property("IsArchived", BooleanType), + Property("IsDeleted", BooleanType), + Property("LastReferencedDate", StringType), + Property("LastViewedDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("ProductClass", StringType), + Property("ProductCode", StringType), + Property("QuantityUnitOfMeasure", StringType), + Property("StockKeepingUnit", StringType), + Property("Type", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,Name,CreatedById,CreatedDate,Description,DisplayUrl,ExternalDataSourceId,ExternalId,Family,IsActive,IsArchived, + IsDeleted,LastReferencedDate,LastViewedDate,LastModifiedById,LastModifiedDate,ProductClass,ProductCode, + QuantityUnitOfMeasure,StockKeepingUnit,Type,SystemModstamp + """ + entity = "PRODUCT2" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "products_2_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield record + except Exception as e: + pass + self.logger.info(e) + + +class BulkPricebookEntryStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_pricebookentry.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "pricebook_entries_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("IsActive", BooleanType), + Property("IsArchived", BooleanType), + Property("IsDeleted", BooleanType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("Pricebook2Id", StringType), + Property("Product2Id", StringType), + Property("ProductCode", StringType), + Property("UnitPrice", NumberType), + Property("UseStandardPrice", BooleanType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def convert_to_numeric(self, value): + if value == "": + return None + try: + return int(value) + except ValueError: + try: + return float(value) + except ValueError: + return None + + def post_process( + self, + row: dict, + context: dict | None = None, + ) -> dict | None: + # List of column names with numeric or integer values + numeric_columns = ["UnitPrice"] + for column in numeric_columns: + if column in row: + row[column] = self.convert_to_numeric(row[column]) + return row + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,Name,CreatedById,CreatedDate,IsActive,IsArchived,IsDeleted,LastModifiedById,LastModifiedDate,Pricebook2Id, + Product2Id,ProductCode,UnitPrice,UseStandardPrice,SystemModstamp + """ + entity = "PRICEBOOKENTRY" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "pricebook_entries_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield self.post_process(record, context) + except Exception as e: + pass + self.logger.info(e) + + +class BulkUserAppInfoStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_userappinfo.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "user_app_info_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("AppDefinitionId", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("FormFactor", StringType), + Property("IsDeleted", BooleanType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("UserId", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,AppDefinitionId,CreatedById,CreatedDate,FormFactor,IsDeleted,LastModifiedById,LastModifiedDate,UserId,SystemModstamp + """ + entity = "USERAPPINFO" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "user_app_info_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield record + except Exception as e: + pass + self.logger.info(e) + + +class BulkUserRoleStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_role.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "user_roles_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("CaseAccessForAccountOwner", StringType), + Property("ContactAccessForAccountOwner", StringType), + Property("DeveloperName", StringType), + Property("ForecastUserId", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("MayForecastManagerShare", BooleanType), + Property("OpportunityAccessForAccountOwner", StringType), + Property("ParentRoleId", StringType), + Property("PortalAccountId", StringType), + Property("PortalAccountOwnerId", StringType), + Property("PortalType", StringType), + Property("RollupDescription", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,Name,CaseAccessForAccountOwner,ContactAccessForAccountOwner,DeveloperName,ForecastUserId,LastModifiedById,LastModifiedDate,MayForecastManagerShare, + OpportunityAccessForAccountOwner,ParentRoleId,PortalAccountId,PortalAccountOwnerId,PortalType,RollupDescription,SystemModstamp + """ + entity = "USERROLE" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "user_roles_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield record + except Exception as e: + pass + self.logger.info(e) + + +class BulkApexClassStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_apexclass.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "apex_classes_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("ApiVersion", NumberType), + Property("Body", StringType), + Property("BodyCrc", IntegerType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("IsValid", BooleanType), + Property("LengthWithoutComments", NumberType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("NamespacePrefix", StringType), + Property("Status", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def convert_to_numeric(self, value): + if value == "": + return None + try: + return int(value) + except ValueError: + try: + return float(value) + except ValueError: + return None + + def post_process( + self, + row: dict, + context: dict | None = None, + ) -> dict | None: + # List of column names with numeric or integer values + numeric_columns = ["ApiVersion", "BodyCrc", "LengthWithoutComments"] + for column in numeric_columns: + if column in row: + row[column] = self.convert_to_numeric(row[column]) + return row + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,Name,ApiVersion,Body,BodyCrc,CreatedById,CreatedDate,IsValid,LengthWithoutComments,LastModifiedById,LastModifiedDate, + NamespacePrefix,Status,SystemModstamp + """ + + entity = "APEXCLASS" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "apex_classes_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield self.post_process(record, context) + except Exception as e: + pass + self.logger.info(e) + + +class BulkApexPageStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_apexpage.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "apex_pages_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("ApiVersion", NumberType), + Property("ControllerKey", StringType), + Property("ControllerType", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("Description", StringType), + Property("IsAvailableInTouch", BooleanType), + Property("IsConfirmationTokenRequired", BooleanType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("Markup", StringType), + Property("MasterLabel", StringType), + Property("NamespacePrefix", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def convert_to_numeric(self, value): + if value == "": + return None + try: + return int(value) + except ValueError: + try: + return float(value) + except ValueError: + return None + + def post_process( + self, + row: dict, + context: dict | None = None, + ) -> dict | None: + # List of column names with numeric or integer values + numeric_columns = ["ApiVersion"] + for column in numeric_columns: + if column in row: + row[column] = self.convert_to_numeric(row[column]) + return row + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,Name,ApiVersion,ControllerKey,ControllerType,CreatedById,CreatedDate,Description,IsAvailableInTouch, + IsConfirmationTokenRequired,LastModifiedById,LastModifiedDate,Markup,MasterLabel,NamespacePrefix,SystemModstamp + """ + entity = "APEXPAGE" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "apex_pages_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield self.post_process(record, context) + except Exception as e: + pass + self.logger.info(e) + + +class BulkApexTriggerStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_apextrigger.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "apex_triggers_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("ApiVersion", NumberType), + Property("Body", StringType), + Property("BodyCrc", IntegerType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("IsValid", BooleanType), + Property("LengthWithoutComments", NumberType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("NamespacePrefix", StringType), + Property("Status", StringType), + Property("TableEnumOrId", StringType), + Property("UsageAfterDelete", BooleanType), + Property("UsageAfterInsert", BooleanType), + Property("UsageAfterUndelete", BooleanType), + Property("UsageAfterUpdate", BooleanType), + Property("UsageBeforeDelete", BooleanType), + Property("UsageBeforeInsert", BooleanType), + Property("UsageBeforeUpdate", BooleanType), + Property("UsageIsBulk", BooleanType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def convert_to_numeric(self, value): + if value == "": + return None + try: + return int(value) + except ValueError: + try: + return float(value) + except ValueError: + return None + + def post_process( + self, + row: dict, + context: dict | None = None, + ) -> dict | None: + # List of column names with numeric or integer values + numeric_columns = ["ApiVersion", "BodyCrc", "LengthWithoutComments"] + for column in numeric_columns: + if column in row: + row[column] = self.convert_to_numeric(row[column]) + return row + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,Name,ApiVersion,Body,BodyCrc,CreatedById,CreatedDate,IsValid,LengthWithoutComments,LastModifiedById,LastModifiedDate,NamespacePrefix, + Status,TableEnumOrId,UsageAfterDelete,UsageAfterInsert,UsageAfterUndelete,UsageAfterUpdate,UsageBeforeDelete,UsageBeforeInsert, + UsageBeforeUpdate,UsageIsBulk,SystemModstamp + """ + entity = "APEXTRIGGER" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "apex_triggers_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield self.post_process(record, context) + except Exception as e: + pass + self.logger.info(e) + + +class BulkCampaignMemberStatusStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_campaignmemberstatus.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "campaign_member_statuses_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("CampaignId", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("HasResponded", BooleanType), + Property("IsDefault", BooleanType), + Property("IsDeleted", BooleanType), + Property("Label", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("SortOrder", NumberType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def convert_to_numeric(self, value): + if value == "": + return None + try: + return int(value) + except ValueError: + try: + return float(value) + except ValueError: + return None + + def post_process( + self, + row: dict, + context: dict | None = None, + ) -> dict | None: + # List of column names with numeric or integer values + numeric_columns = ["SortOrder"] + for column in numeric_columns: + if column in row: + row[column] = self.convert_to_numeric(row[column]) + return row + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,CampaignId,CreatedById,CreatedDate,HasResponded,IsDefault,IsDeleted,Label,LastModifiedById,LastModifiedDate,SortOrder,SystemModstamp + """ + entity = "CAMPAIGNMEMBERSTATUS" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "campaign_member_statuses_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield self.post_process(record, context) + except Exception as e: + pass + self.logger.info(e) + + +class BulkFiscalYearSettings(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_fiscalyearsettings.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "fiscal_year_settings_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "StartDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("Description", StringType), + Property("EndDate", StringType), + Property("IsStandardYear", BooleanType), + Property("PeriodId", StringType), + Property("PeriodLabelScheme", StringType), + Property("PeriodPrefix", StringType), + Property("QuarterLabelScheme", StringType), + Property("QuarterPrefix", StringType), + Property("StartDate", StringType), + Property("WeekLabelScheme", StringType), + Property("WeekStartDay", StringType), + Property("YearType", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,Name,Description,EndDate,IsStandardYear,PeriodId,PeriodLabelScheme,PeriodPrefix,QuarterLabelScheme, + QuarterPrefix,StartDate,WeekLabelScheme,WeekStartDay,YearType,SystemModstamp + """ + entity = "FISCALYEARSETTINGS" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "fiscal_year_settings_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield record + except Exception as e: + pass + self.logger.info(e) + + +class BulkOpportunityStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_opportunity.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "opportunities_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("AccountId", StringType), + Property("Amount", NumberType), + Property("CampaignId", StringType), + Property("CloseDate", StringType), + Property("ContactId", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("Description", StringType), + Property("ExpectedRevenue", NumberType), + Property("Fiscal", StringType), + Property("FiscalQuarter", IntegerType), + Property("FiscalYear", IntegerType), + Property("ForecastCategory", StringType), + Property("ForecastCategoryName", StringType), + Property("HasOpenActivity", BooleanType), + Property("HasOpportunityLineItem", BooleanType), + Property("HasOverdueTask", BooleanType), + Property("IsClosed", BooleanType), + Property("IsDeleted", BooleanType), + Property("IsPrivate", BooleanType), + Property("IsWon", BooleanType), + Property("LastActivityDate", StringType), + Property("LastAmountChangedHistoryId", StringType), + Property("LastCloseDateChangedHistoryId", StringType), + Property("LastReferencedDate", StringType), + Property("LastStageChangeDate", StringType), + Property("LastViewedDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("LeadSource", StringType), + Property("NextStep", StringType), + Property("OwnerId", StringType), + Property("Pricebook2Id", StringType), + Property("Probability", NumberType), + Property("PushCount", IntegerType), + Property("StageName", StringType), + Property("TotalOpportunityQuantity", StringType), + Property("Type", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def convert_to_numeric(self, value): + if value == "": + return None + try: + return int(value) + except ValueError: + try: + return float(value) + except ValueError: + return None + + def post_process( + self, + row: dict, + context: dict | None = None, + ) -> dict | None: + # List of column names with numeric or integer values + numeric_columns = [ + "Amount", + "ExpectedRevenue", + "FiscalQuarter", + "FiscalYear", + "Probability", + "PushCount", + "TotalOpportunityQuantity", + ] + for column in numeric_columns: + if column in row: + row[column] = self.convert_to_numeric(row[column]) + return row + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,Name,AccountId,Amount,CampaignId,CloseDate,ContactId,CreatedById,CreatedDate, + Description,ExpectedRevenue,Fiscal,FiscalQuarter,FiscalYear,ForecastCategory,ForecastCategoryName,HasOpenActivity, + HasOpportunityLineItem,HasOverdueTask,IsClosed,IsDeleted,IsPrivate,IsWon,LastActivityDate,LastAmountChangedHistoryId, + LastCloseDateChangedHistoryId,LastReferencedDate,LastStageChangeDate,LastViewedDate,LastModifiedById,LastModifiedDate,LeadSource, + NextStep,OwnerId,Pricebook2Id,Probability,PushCount,StageName,TotalOpportunityQuantity,Type,SystemModstamp + """ + entity = "OPPORTUNITY" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "opportunities_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield self.post_process(record, context) + except Exception as e: + pass + self.logger.info(e) + + +class BulkOrganizationStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_organization.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "organizations_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("Division", StringType), + Property("Street", StringType), + Property("City", StringType), + Property("State", StringType), + Property("PostalCode", StringType), + Property("Country", StringType), + Property("Latitude", StringType), + Property("Longitude", StringType), + Property("GeocodeAccuracy", StringType), + Property("Phone", StringType), + Property("Fax", StringType), + Property("PrimaryContact", StringType), + Property("DefaultLocaleSidKey", StringType), + Property("TimeZoneSidKey", StringType), + Property("LanguageLocaleKey", StringType), + Property("ReceivesInfoEmails", BooleanType), + Property("ReceivesAdminInfoEmails", BooleanType), + Property("PreferencesRequireOpportunityProducts", BooleanType), + Property("PreferencesConsentManagementEnabled", BooleanType), + Property("PreferencesAutoSelectIndividualOnMerge", BooleanType), + Property("PreferencesLightningLoginEnabled", BooleanType), + Property("PreferencesOnlyLLPermUserAllowed", BooleanType), + Property("FiscalYearStartMonth", IntegerType), + Property("UsesStartDateAsFiscalYearName", BooleanType), + Property("DefaultAccountAccess", StringType), + Property("DefaultContactAccess", StringType), + Property("DefaultOpportunityAccess", StringType), + Property("DefaultLeadAccess", StringType), + Property("DefaultCaseAccess", StringType), + Property("DefaultCalendarAccess", StringType), + Property("DefaultPricebookAccess", StringType), + Property("DefaultCampaignAccess", StringType), + Property("SystemModstamp", StringType), + Property("ComplianceBccEmail", StringType), + Property("UiSkin", StringType), + Property("SignupCountryIsoCode", StringType), + Property("TrialExpirationDate", StringType), + Property("NumKnowledgeService", IntegerType), + Property("OrganizationType", StringType), + Property("NamespacePrefix", StringType), + Property("InstanceName", StringType), + Property("IsSandbox", BooleanType), + Property("WebToCaseDefaultOrigin", StringType), + Property("MonthlyPageViewsUsed", IntegerType), + Property("MonthlyPageViewsEntitlement", IntegerType), + Property("IsReadOnly", BooleanType), + Property("CreatedDate", StringType), + Property("CreatedById", StringType), + Property("LastModifiedDate", StringType), + Property("LastModifiedById", StringType), + Property("PreferencesTransactionSecurityPolicy", BooleanType), + Property("PreferencesTerminateOldestSession", BooleanType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def convert_to_numeric(self, value): + if value == "": + return None + try: + return int(value) + except ValueError: + try: + return float(value) + except ValueError: + return None + + def post_process( + self, + row: dict, + context: dict | None = None, + ) -> dict | None: + # List of column names with numeric or integer values + numeric_columns = [ + "FiscalYearStartMonth", + "NumKnowledgeService", + "MonthlyPageViewsUsed", + "MonthlyPageViewsEntitlement", + ] + for column in numeric_columns: + if column in row: + row[column] = self.convert_to_numeric(row[column]) + return row + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,Name,Division,Street,City,State,PostalCode,Country,Latitude,Longitude,GeocodeAccuracy,Phone,Fax, + PrimaryContact,DefaultLocaleSidKey,TimeZoneSidKey,LanguageLocaleKey,ReceivesInfoEmails, + ReceivesAdminInfoEmails,PreferencesRequireOpportunityProducts,PreferencesConsentManagementEnabled, + PreferencesAutoSelectIndividualOnMerge,PreferencesLightningLoginEnabled,PreferencesOnlyLLPermUserAllowed, + FiscalYearStartMonth,UsesStartDateAsFiscalYearName,DefaultAccountAccess,DefaultContactAccess, + DefaultOpportunityAccess,DefaultLeadAccess,DefaultCaseAccess,DefaultCalendarAccess,DefaultPricebookAccess, + DefaultCampaignAccess,SystemModstamp,ComplianceBccEmail,UiSkin,SignupCountryIsoCode,TrialExpirationDate, + NumKnowledgeService,OrganizationType,NamespacePrefix,InstanceName,IsSandbox,WebToCaseDefaultOrigin, + MonthlyPageViewsUsed,MonthlyPageViewsEntitlement,IsReadOnly,CreatedDate,CreatedById,LastModifiedDate, + PreferencesTransactionSecurityPolicy,LastModifiedById + """ + entity = "ORGANIZATION" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "organizations_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield self.post_process(record, context) + except Exception as e: + pass + self.logger.info(e) + + +class BulkServiceSetupProvisioningStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_servicesetupprovisioning.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "service_setup_provisionings_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("IsDeleted", BooleanType), + Property("JobName", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("Status", StringType), + Property("TaskContext", StringType), + Property("TaskName", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,Name,CreatedById,CreatedDate,IsDeleted,JobName,LastModifiedById,LastModifiedDate,Status,TaskContext,TaskName,SystemModstamp + """ + entity = "SERVICESETUPPROVISIONING" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "service_setup_provisionings_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield record + except Exception as e: + pass + self.logger.info(e) + + +class BulkBusinessHoursStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_businesshours.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "business_hours_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("FridayEndTime", StringType), + Property("FridayStartTime", StringType), + Property("IsActive", BooleanType), + Property("IsDefault", BooleanType), + Property("LastViewedDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("MondayEndTime", StringType), + Property("MondayStartTime", StringType), + Property("SaturdayEndTime", StringType), + Property("SaturdayStartTime", StringType), + Property("SundayEndTime", StringType), + Property("SundayStartTime", StringType), + Property("ThursdayEndTime", StringType), + Property("ThursdayStartTime", StringType), + Property("TimeZoneSidKey", StringType), + Property("TuesdayEndTime", StringType), + Property("TuesdayStartTime", StringType), + Property("WednesdayEndTime", StringType), + Property("WednesdayStartTime", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,Name,CreatedById,CreatedDate,FridayEndTime,FridayStartTime,IsActive,IsDefault,LastViewedDate,LastModifiedById,LastModifiedDate,MondayEndTime, + MondayStartTime,SaturdayEndTime,SaturdayStartTime,SundayEndTime,SundayStartTime,ThursdayEndTime,ThursdayStartTime,TimeZoneSidKey,TuesdayEndTime, + TuesdayStartTime,WednesdayEndTime,WednesdayStartTime,SystemModstamp + """ + + entity = "BUSINESSHOURS" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "business_hours_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield record + except Exception as e: + pass + self.logger.info(e) + + +class BulkUserStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_user.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "users_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Name", StringType), + Property("AboutMe", StringType), + Property("AccountId", StringType), + Property("Alias", StringType), + Property("BadgeText", StringType), + Property("BannerPhotoUrl", StringType), + Property("CallCenterId", StringType), + Property("City", StringType), + Property("CommunityNickname", StringType), + Property("CompanyName", StringType), + Property("ContactId", StringType), + Property("Country", StringType), + Property("CreatedById", StringType), + Property("CreatedDate", StringType), + Property("DefaultGroupNotificationFrequency", StringType), + Property("DelegatedApproverId", StringType), + Property("Department", StringType), + Property("DigestFrequency", StringType), + Property("Division", StringType), + Property("Email", StringType), + Property("EmailEncodingKey", StringType), + Property("EmailPreferencesAutoBcc", BooleanType), + Property("EmailPreferencesAutoBccStayInTouch", BooleanType), + Property("EmailPreferencesStayInTouchReminder", BooleanType), + Property("EmployeeNumber", StringType), + Property("Extension", StringType), + Property("Fax", StringType), + Property("FederationIdentifier", StringType), + Property("FirstName", StringType), + Property("ForecastEnabled", BooleanType), + Property("FullPhotoUrl", StringType), + Property("GeocodeAccuracy", StringType), + Property("IndividualId", StringType), + Property("IsActive", BooleanType), + Property("IsProfilePhotoActive", BooleanType), + Property("IsExtIndicatorVisible", BooleanType), + Property("JigsawImportLimitOverride", IntegerType), + Property("LanguageLocaleKey", StringType), + Property("LastLoginDate", StringType), + Property("LastName", StringType), + Property("LastReferencedDate", StringType), + Property("LastViewedDate", StringType), + Property("Latitude", StringType), + Property("LocaleSidKey", StringType), + Property("Longitude", StringType), + Property("LastPasswordChangeDate", StringType), + Property("LastModifiedById", StringType), + Property("LastModifiedDate", StringType), + Property("ManagerId", StringType), + Property("MediumBannerPhotoUrl", StringType), + Property("MediumPhotoUrl", StringType), + Property("MobilePhone", StringType), + Property("NumberOfFailedLogins", IntegerType), + Property("OfflinePdaTrialExpirationDate", StringType), + Property("OfflineTrialExpirationDate", StringType), + Property("OutOfOfficeMessage", StringType), + Property("Phone", StringType), + Property("PostalCode", StringType), + Property("ProfileId", StringType), + Property("ReceivesAdminInfoEmails", BooleanType), + Property("ReceivesInfoEmails", BooleanType), + Property("SenderEmail", StringType), + Property("SenderName", StringType), + Property("Signature", StringType), + Property("SmallBannerPhotoUrl", StringType), + Property("SmallPhotoUrl", StringType), + Property("State", StringType), + Property("StayInTouchNote", StringType), + Property("StayInTouchSignature", StringType), + Property("StayInTouchSubject", StringType), + Property("Street", StringType), + Property("TimeZoneSidKey", StringType), + Property("Title", StringType), + Property("Username", StringType), + Property("UserPermissionsCallCenterAutoLogin", BooleanType), + Property("UserPermissionsInteractionUser", BooleanType), + Property("UserPermissionsJigsawProspectingUser", BooleanType), + Property("UserPermissionsKnowledgeUser", BooleanType), + Property("UserPermissionsMarketingUser", BooleanType), + Property("UserPermissionsOfflineUser", BooleanType), + Property("UserPermissionsSFContentUser", BooleanType), + Property("UserPermissionsSiteforceContributorUser", BooleanType), + Property("UserPermissionsSiteforcePublisherUser", BooleanType), + Property("UserPermissionsSupportUser", BooleanType), + Property("UserPermissionsWorkDotComUserFeature", BooleanType), + Property("UserPreferencesActivityRemindersPopup", BooleanType), + Property("UserPreferencesApexPagesDeveloperMode", BooleanType), + Property("UserPreferencesCacheDiagnostics", BooleanType), + Property("UserPreferencesContentEmailAsAndWhen", BooleanType), + Property("UserPreferencesContentNoEmail", BooleanType), + Property("UserPreferencesCreateLEXAppsWTShown", BooleanType), + Property("UserPreferencesEnableAutoSubForFeeds", BooleanType), + Property("UserPreferencesDisableAllFeedsEmail", BooleanType), + Property("UserPreferencesDisableBookmarkEmail", BooleanType), + Property("UserPreferencesDisableChangeCommentEmail", BooleanType), + Property("UserPreferencesDisableEndorsementEmail", BooleanType), + Property("UserPreferencesDisableFileShareNotificationsForApi", BooleanType), + Property("UserPreferencesDisableFollowersEmail", BooleanType), + Property("UserPreferencesDisableLaterCommentEmail", BooleanType), + Property("UserPreferencesDisableLikeEmail", BooleanType), + Property("UserPreferencesDisableMentionsPostEmail", BooleanType), + Property("UserPreferencesDisableProfilePostEmail", BooleanType), + Property("UserPreferencesDisableSharePostEmail", BooleanType), + Property("UserPreferencesDisCommentAfterLikeEmail", BooleanType), + Property("UserPreferencesDisMentionsCommentEmail", BooleanType), + Property("UserPreferencesDisableMessageEmail", BooleanType), + Property("UserPreferencesDisProfPostCommentEmail", BooleanType), + Property("UserPreferencesEventRemindersCheckboxDefault", BooleanType), + Property("UserPreferencesExcludeMailAppAttachments", BooleanType), + Property("UserPreferencesFavoritesShowTopFavorites", BooleanType), + Property("UserPreferencesFavoritesWTShown", BooleanType), + Property("UserPreferencesGlobalNavBarWTShown", BooleanType), + Property("UserPreferencesGlobalNavGridMenuWTShown", BooleanType), + Property("UserPreferencesHasCelebrationBadge", BooleanType), + Property("UserPreferencesHasSentWarningEmail", BooleanType), + Property("UserPreferencesHasSentWarningEmail238", BooleanType), + Property("UserPreferencesHasSentWarningEmail240", BooleanType), + Property("UserPreferencesHideBiggerPhotoCallout", BooleanType), + Property("UserPreferencesHideChatterOnboardingSplash", BooleanType), + Property("UserPreferencesHideCSNDesktopTask", BooleanType), + Property("UserPreferencesHideCSNGetChatterMobileTask", BooleanType), + Property("UserPreferencesHideEndUserOnboardingAssistantModal", BooleanType), + Property("UserPreferencesHideLightningMigrationModal", BooleanType), + Property("UserPreferencesHideSecondChatterOnboardingSplash", BooleanType), + Property("UserPreferencesHideS1BrowserUI", BooleanType), + Property("UserPreferencesHideSfxWelcomeMat", BooleanType), + Property("UserPreferencesJigsawListUser", BooleanType), + Property("UserPreferencesLightningExperiencePreferred", BooleanType), + Property("UserPreferencesNativeEmailClient", BooleanType), + Property("UserPreferencesNewLightningReportRunPageEnabled", BooleanType), + Property("UserPreferencesPathAssistantCollapsed", BooleanType), + Property("UserPreferencesPreviewCustomTheme", BooleanType), + Property("UserPreferencesPreviewLightning", BooleanType), + Property("UserPreferencesRecordHomeReservedWTShown", BooleanType), + Property("UserPreferencesRecordHomeSectionCollapseWTShown", BooleanType), + Property("UserPreferencesReceiveNoNotificationsAsApprover", BooleanType), + Property("UserPreferencesReceiveNotificationsAsDelegatedApprover", BooleanType), + Property("UserPreferencesReminderSoundOff", BooleanType), + Property("UserPreferencesReverseOpenActivitiesView", BooleanType), + Property("UserPreferencesShowCityToExternalUsers", BooleanType), + Property("UserPreferencesShowCityToGuestUsers", BooleanType), + Property("UserPreferencesShowCountryToExternalUsers", BooleanType), + Property("UserPreferencesShowCountryToGuestUsers", BooleanType), + Property("UserPreferencesShowEmailToExternalUsers", BooleanType), + Property("UserPreferencesShowEmailToGuestUsers", BooleanType), + Property("UserPreferencesShowFaxToExternalUsers", BooleanType), + Property("UserPreferencesShowFaxToGuestUsers", BooleanType), + Property("UserPreferencesShowForecastingChangeSignals", BooleanType), + Property("UserPreferencesShowManagerToExternalUsers", BooleanType), + Property("UserPreferencesShowManagerToGuestUsers", BooleanType), + Property("UserPreferencesShowMobilePhoneToExternalUsers", BooleanType), + Property("UserPreferencesShowMobilePhoneToGuestUsers", BooleanType), + Property("UserPreferencesShowPostalCodeToExternalUsers", BooleanType), + Property("UserPreferencesShowPostalCodeToGuestUsers", BooleanType), + Property("UserPreferencesShowProfilePicToGuestUsers", BooleanType), + Property("UserPreferencesShowStateToExternalUsers", BooleanType), + Property("UserPreferencesShowStateToGuestUsers", BooleanType), + Property("UserPreferencesShowStreetAddressToExternalUsers", BooleanType), + Property("UserPreferencesShowStreetAddressToGuestUsers", BooleanType), + Property("UserPreferencesShowTitleToExternalUsers", BooleanType), + Property("UserPreferencesShowTitleToGuestUsers", BooleanType), + Property("UserPreferencesShowTerritoryTimeZoneShifts", BooleanType), + Property("UserPreferencesShowWorkPhoneToExternalUsers", BooleanType), + Property("UserPreferencesShowWorkPhoneToGuestUsers", BooleanType), + Property("UserPreferencesSortFeedByComment", BooleanType), + Property("UserPreferencesSRHOverrideActivities", BooleanType), + Property("UserPreferencesSuppressEventSFXReminders", BooleanType), + Property("UserPreferencesSuppressTaskSFXReminders", BooleanType), + Property("UserPreferencesTaskRemindersCheckboxDefault", BooleanType), + Property("UserPreferencesUserDebugModePref", BooleanType), + Property("UserRoleId", StringType), + Property("UserType", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def convert_to_numeric(self, value): + if value == "": + return None + try: + return int(value) + except ValueError: + try: + return float(value) + except ValueError: + return None + + def post_process( + self, + row: dict, + context: dict | None = None, + ) -> dict | None: + # List of column names with numeric or integer values + numeric_columns = ["JigsawImportLimitOverride", "NumberOfFailedLogins"] + for column in numeric_columns: + if column in row: + row[column] = self.convert_to_numeric(row[column]) + return row + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + columns = """ + Id,Name,AboutMe,AccountId,Alias,BadgeText,BannerPhotoUrl,CallCenterId,City,CommunityNickname,CompanyName, + ContactId,Country,CreatedById,CreatedDate,DefaultGroupNotificationFrequency,DelegatedApproverId,Department,DigestFrequency, + Division,Email,EmailEncodingKey,EmailPreferencesAutoBcc,EmailPreferencesAutoBccStayInTouch,EmailPreferencesStayInTouchReminder, + EmployeeNumber,Extension,Fax,FederationIdentifier,FirstName,ForecastEnabled,FullPhotoUrl,GeocodeAccuracy,IndividualId,IsActive,IsProfilePhotoActive, + IsExtIndicatorVisible,JigsawImportLimitOverride,LanguageLocaleKey,LastLoginDate,LastName,LastReferencedDate,LastViewedDate,Latitude,LocaleSidKey, + Longitude,LastPasswordChangeDate,LastModifiedById,LastModifiedDate,ManagerId,MediumBannerPhotoUrl,MediumPhotoUrl,MobilePhone,NumberOfFailedLogins, + OfflinePdaTrialExpirationDate,OfflineTrialExpirationDate,OutOfOfficeMessage,Phone,PostalCode,ProfileId,ReceivesAdminInfoEmails,ReceivesInfoEmails, + SenderEmail,SenderName,Signature,SmallBannerPhotoUrl,SmallPhotoUrl,State,StayInTouchNote,StayInTouchSignature,StayInTouchSubject,Street,TimeZoneSidKey, + Title,Username,UserPermissionsCallCenterAutoLogin,UserPermissionsInteractionUser,UserPermissionsJigsawProspectingUser,UserPermissionsKnowledgeUser, + UserPermissionsMarketingUser,UserPermissionsOfflineUser,UserPermissionsSFContentUser,UserPermissionsSiteforceContributorUser, + UserPermissionsSiteforcePublisherUser,UserPermissionsSupportUser,UserPermissionsWorkDotComUserFeature,UserPreferencesActivityRemindersPopup, + UserPreferencesApexPagesDeveloperMode,UserPreferencesCacheDiagnostics,UserPreferencesContentEmailAsAndWhen,UserPreferencesContentNoEmail, + UserPreferencesCreateLEXAppsWTShown,UserPreferencesEnableAutoSubForFeeds,UserPreferencesDisableAllFeedsEmail,UserPreferencesDisableBookmarkEmail, + UserPreferencesDisableChangeCommentEmail,UserPreferencesDisableEndorsementEmail,UserPreferencesDisableFileShareNotificationsForApi, + UserPreferencesDisableFollowersEmail,UserPreferencesDisableLaterCommentEmail,UserPreferencesDisableLikeEmail,UserPreferencesDisableMentionsPostEmail, + UserPreferencesDisableProfilePostEmail,UserPreferencesDisableSharePostEmail,UserPreferencesDisCommentAfterLikeEmail,UserPreferencesDisMentionsCommentEmail, + UserPreferencesDisableMessageEmail,UserPreferencesDisProfPostCommentEmail,UserPreferencesEventRemindersCheckboxDefault,UserPreferencesExcludeMailAppAttachments, + UserPreferencesFavoritesShowTopFavorites,UserPreferencesFavoritesWTShown,UserPreferencesGlobalNavBarWTShown,UserPreferencesGlobalNavGridMenuWTShown, + UserPreferencesHasCelebrationBadge,UserPreferencesHasSentWarningEmail,UserPreferencesHasSentWarningEmail238,UserPreferencesHasSentWarningEmail240, + UserPreferencesHideBiggerPhotoCallout,UserPreferencesHideChatterOnboardingSplash,UserPreferencesHideCSNDesktopTask,UserPreferencesHideCSNGetChatterMobileTask, + UserPreferencesHideEndUserOnboardingAssistantModal,UserPreferencesHideLightningMigrationModal, + UserPreferencesHideSecondChatterOnboardingSplash,UserPreferencesHideS1BrowserUI,UserPreferencesHideSfxWelcomeMat,UserPreferencesJigsawListUser, + UserPreferencesLightningExperiencePreferred,UserPreferencesNativeEmailClient,UserPreferencesNewLightningReportRunPageEnabled,UserPreferencesPathAssistantCollapsed, + UserPreferencesReceiveNoNotificationsAsApprover,UserPreferencesPreviewCustomTheme,UserPreferencesPreviewLightning,UserPreferencesRecordHomeReservedWTShown, + UserPreferencesRecordHomeSectionCollapseWTShown,UserPreferencesReverseOpenActivitiesView,UserPreferencesReceiveNotificationsAsDelegatedApprover, + UserPreferencesReminderSoundOff,UserPreferencesShowCityToExternalUsers,UserPreferencesShowCityToGuestUsers,UserPreferencesShowCountryToExternalUsers, + UserPreferencesShowCountryToGuestUsers,UserPreferencesShowEmailToExternalUsers,UserPreferencesShowEmailToGuestUsers,UserPreferencesShowFaxToExternalUsers, + UserPreferencesShowFaxToGuestUsers,UserPreferencesShowForecastingChangeSignals,UserPreferencesShowManagerToExternalUsers,UserPreferencesShowManagerToGuestUsers, + UserPreferencesShowMobilePhoneToExternalUsers,UserPreferencesShowMobilePhoneToGuestUsers,UserPreferencesShowPostalCodeToExternalUsers, + UserPreferencesShowPostalCodeToGuestUsers,UserPreferencesShowProfilePicToGuestUsers,UserPreferencesShowStateToExternalUsers, + UserPreferencesShowStateToGuestUsers,UserPreferencesShowStreetAddressToExternalUsers,UserPreferencesShowStreetAddressToGuestUsers, + UserPreferencesShowTitleToExternalUsers,UserPreferencesShowTitleToGuestUsers,UserPreferencesShowTerritoryTimeZoneShifts, + UserPreferencesShowWorkPhoneToExternalUsers,UserPreferencesShowWorkPhoneToGuestUsers,UserPreferencesSortFeedByComment,UserPreferencesSRHOverrideActivities, + UserPreferencesSuppressEventSFXReminders,UserPreferencesSuppressTaskSFXReminders,UserPreferencesTaskRemindersCheckboxDefault, + UserPreferencesUserDebugModePref,UserRoleId,UserType,SystemModstamp + """ + entity = "USER" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "users_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield self.post_process(record, context) + except Exception as e: + pass + self.logger.info(e) + + +class BulkProfileStream(SalesforceStream): + + """ + https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_businesshours.htm + """ + + """ + columns: columns which will be added to fields parameter in api + name: stream name + path: path which will be added to api url in client.py + schema: instream schema + primary_keys = primary keys for the table + replication_key = datetime keys for replication + records_jsonpath = json response body + """ + + name = "profiles_bulk" + path = "" + primary_keys = ["Id"] + replication_key = "LastModifiedDate" + replication_method = "INCREMENTAL" + + schema = PropertiesList( + Property("Id", StringType), + Property("Description", StringType), + Property("LastReferencedDate", StringType), + Property("PermissionsEmailSingle", BooleanType), + Property("PermissionsEmailMass", BooleanType), + Property("PermissionsEditTask", BooleanType), + Property("PermissionsEditEvent", BooleanType), + Property("PermissionsExportReport", BooleanType), + Property("PermissionsImportPersonal", BooleanType), + Property("PermissionsDataExport", BooleanType), + Property("PermissionsManageUsers", BooleanType), + Property("PermissionsEditPublicFilters", BooleanType), + Property("PermissionsEditPublicTemplates", BooleanType), + Property("PermissionsModifyAllData", BooleanType), + Property("PermissionsEditBillingInfo", BooleanType), + Property("PermissionsManageCases", BooleanType), + Property("PermissionsMassInlineEdit", BooleanType), + Property("PermissionsEditKnowledge", BooleanType), + Property("PermissionsManageKnowledge", BooleanType), + Property("PermissionsManageSolutions", BooleanType), + Property("PermissionsCustomizeApplication", BooleanType), + Property("PermissionsEditReadonlyFields", BooleanType), + Property("PermissionsRunReports", BooleanType), + Property("PermissionsViewSetup", BooleanType), + Property("PermissionsTransferAnyEntity", BooleanType), + Property("PermissionsNewReportBuilder", BooleanType), + Property("PermissionsActivateContract", BooleanType), + Property("PermissionsActivateOrder", BooleanType), + Property("PermissionsImportLeads", BooleanType), + Property("PermissionsManageLeads", BooleanType), + Property("PermissionsTransferAnyLead", BooleanType), + Property("PermissionsViewAllData", BooleanType), + Property("PermissionsEditPublicDocuments", BooleanType), + Property("PermissionsViewEncryptedData", BooleanType), + Property("PermissionsEditBrandTemplates", BooleanType), + Property("PermissionsEditHtmlTemplates", BooleanType), + Property("PermissionsChatterInternalUser", BooleanType), + Property("PermissionsManageEncryptionKeys", BooleanType), + Property("PermissionsDeleteActivatedContract", BooleanType), + Property("PermissionsChatterInviteExternalUsers", BooleanType), + Property("PermissionsSendSitRequests", BooleanType), + Property("PermissionsApiUserOnly", BooleanType), + Property("PermissionsManageRemoteAccess", BooleanType), + Property("PermissionsCanUseNewDashboardBuilder", BooleanType), + Property("PermissionsManageCategories", BooleanType), + Property("PermissionsConvertLeads", BooleanType), + Property("PermissionsPasswordNeverExpires", BooleanType), + Property("PermissionsUseTeamReassignWizards", BooleanType), + Property("PermissionsEditActivatedOrders", BooleanType), + Property("PermissionsInstallMultiforce", BooleanType), + Property("PermissionsPublishMultiforce", BooleanType), + Property("PermissionsChatterOwnGroups", BooleanType), + Property("PermissionsEditOppLineItemUnitPrice", BooleanType), + Property("PermissionsCreateMultiforce", BooleanType), + Property("PermissionsBulkApiHardDelete", BooleanType), + Property("PermissionsSolutionImport", BooleanType), + Property("PermissionsManageCallCenters", BooleanType), + Property("PermissionsManageSynonyms", BooleanType), + Property("PermissionsViewContent", BooleanType), + Property("PermissionsManageEmailClientConfig", BooleanType), + Property("PermissionsEnableNotifications", BooleanType), + Property("PermissionsManageDataIntegrations", BooleanType), + Property("PermissionsDistributeFromPersWksp", BooleanType), + Property("PermissionsViewDataCategories", BooleanType), + Property("PermissionsManageDataCategories", BooleanType), + Property("PermissionsAuthorApex", BooleanType), + Property("PermissionsManageMobile", BooleanType), + Property("PermissionsApiEnabled", BooleanType), + Property("PermissionsManageCustomReportTypes", BooleanType), + Property("PermissionsEditCaseComments", BooleanType), + Property("PermissionsTransferAnyCase", BooleanType), + Property("PermissionsContentAdministrator", BooleanType), + Property("PermissionsCreateWorkspaces", BooleanType), + Property("PermissionsManageContentPermissions", BooleanType), + Property("PermissionsManageContentProperties", BooleanType), + Property("PermissionsManageContentTypes", BooleanType), + Property("PermissionsManageExchangeConfig", BooleanType), + Property("PermissionsManageAnalyticSnapshots", BooleanType), + Property("PermissionsScheduleReports", BooleanType), + Property("PermissionsManageBusinessHourHolidays", BooleanType), + Property("PermissionsManageEntitlements", BooleanType), + Property("PermissionsManageDynamicDashboards", BooleanType), + Property("PermissionsCustomSidebarOnAllPages", BooleanType), + Property("PermissionsManageInteraction", BooleanType), + Property("PermissionsViewMyTeamsDashboards", BooleanType), + Property("PermissionsModerateChatter", BooleanType), + Property("PermissionsResetPasswords", BooleanType), + Property("PermissionsFlowUFLRequired", BooleanType), + Property("PermissionsCanInsertFeedSystemFields", BooleanType), + Property("PermissionsActivitiesAccess", BooleanType), + Property("PermissionsManageKnowledgeImportExport", BooleanType), + Property("PermissionsEmailTemplateManagement", BooleanType), + Property("PermissionsEmailAdministration", BooleanType), + Property("PermissionsManageChatterMessages", BooleanType), + Property("PermissionsAllowEmailIC", BooleanType), + Property("PermissionsChatterFileLink", BooleanType), + Property("PermissionsForceTwoFactor", BooleanType), + Property("PermissionsViewEventLogFiles", BooleanType), + Property("PermissionsManageNetworks", BooleanType), + Property("PermissionsManageAuthProviders", BooleanType), + Property("PermissionsRunFlow", BooleanType), + Property("PermissionsCreateCustomizeDashboards", BooleanType), + Property("PermissionsCreateDashboardFolders", BooleanType), + Property("PermissionsViewPublicDashboards", BooleanType), + Property("PermissionsManageDashbdsInPubFolders", BooleanType), + Property("PermissionsCreateCustomizeReports", BooleanType), + Property("PermissionsCreateReportFolders", BooleanType), + Property("PermissionsViewPublicReports", BooleanType), + Property("PermissionsManageReportsInPubFolders", BooleanType), + Property("PermissionsEditMyDashboards", BooleanType), + Property("PermissionsEditMyReports", BooleanType), + Property("PermissionsViewAllUsers", BooleanType), + Property("PermissionsAllowUniversalSearch", BooleanType), + Property("PermissionsConnectOrgToEnvironmentHub", BooleanType), + Property("PermissionsWorkCalibrationUser", BooleanType), + Property("PermissionsCreateCustomizeFilters", BooleanType), + Property("PermissionsWorkDotComUserPerm", BooleanType), + Property("PermissionsContentHubUser", BooleanType), + Property("PermissionsGovernNetworks", BooleanType), + Property("PermissionsSalesConsole", BooleanType), + Property("PermissionsTwoFactorApi", BooleanType), + Property("PermissionsDeleteTopics", BooleanType), + Property("PermissionsEditTopics", BooleanType), + Property("PermissionsCreateTopics", BooleanType), + Property("PermissionsAssignTopics", BooleanType), + Property("PermissionsIdentityEnabled", BooleanType), + Property("PermissionsIdentityConnect", BooleanType), + Property("PermissionsAllowViewKnowledge", BooleanType), + Property("PermissionsContentWorkspaces", BooleanType), + Property("PermissionsManageSearchPromotionRules", BooleanType), + Property("PermissionsCustomMobileAppsAccess", BooleanType), + Property("PermissionsViewHelpLink", BooleanType), + Property("PermissionsManageProfilesPermissionsets", BooleanType), + Property("PermissionsAssignPermissionSets", BooleanType), + Property("PermissionsManageRoles", BooleanType), + Property("PermissionsManageIpAddresses", BooleanType), + Property("PermissionsManageSharing", BooleanType), + Property("PermissionsManageInternalUsers", BooleanType), + Property("PermissionsManagePasswordPolicies", BooleanType), + Property("PermissionsManageLoginAccessPolicies", BooleanType), + Property("PermissionsViewPlatformEvents", BooleanType), + Property("PermissionsManageCustomPermissions", BooleanType), + Property("PermissionsCanVerifyComment", BooleanType), + Property("PermissionsManageUnlistedGroups", BooleanType), + Property("PermissionsStdAutomaticActivityCapture", BooleanType), + Property("PermissionsInsightsAppDashboardEditor", BooleanType), + Property("PermissionsManageTwoFactor", BooleanType), + Property("PermissionsInsightsAppUser", BooleanType), + Property("PermissionsInsightsAppAdmin", BooleanType), + Property("PermissionsInsightsAppEltEditor", BooleanType), + Property("PermissionsInsightsAppUploadUser", BooleanType), + Property("PermissionsInsightsCreateApplication", BooleanType), + Property("PermissionsLightningExperienceUser", BooleanType), + Property("PermissionsViewDataLeakageEvents", BooleanType), + Property("PermissionsConfigCustomRecs", BooleanType), + Property("PermissionsSubmitMacrosAllowed", BooleanType), + Property("PermissionsBulkMacrosAllowed", BooleanType), + Property("PermissionsShareInternalArticles", BooleanType), + Property("PermissionsManageSessionPermissionSets", BooleanType), + Property("PermissionsManageTemplatedApp", BooleanType), + Property("PermissionsUseTemplatedApp", BooleanType), + Property("PermissionsSendAnnouncementEmails", BooleanType), + Property("PermissionsChatterEditOwnPost", BooleanType), + Property("PermissionsChatterEditOwnRecordPost", BooleanType), + Property("PermissionsWaveTabularDownload", BooleanType), + Property("PermissionsAutomaticActivityCapture", BooleanType), + Property("PermissionsImportCustomObjects", BooleanType), + Property("PermissionsDelegatedTwoFactor", BooleanType), + Property("PermissionsChatterComposeUiCodesnippet", BooleanType), + Property("PermissionsSelectFilesFromSalesforce", BooleanType), + Property("PermissionsModerateNetworkUsers", BooleanType), + Property("PermissionsMergeTopics", BooleanType), + Property("PermissionsSubscribeToLightningReports", BooleanType), + Property("PermissionsManagePvtRptsAndDashbds", BooleanType), + Property("PermissionsAllowLightningLogin", BooleanType), + Property("PermissionsCampaignInfluence2", BooleanType), + Property("PermissionsViewDataAssessment", BooleanType), + Property("PermissionsRemoveDirectMessageMembers", BooleanType), + Property("PermissionsCanApproveFeedPost", BooleanType), + Property("PermissionsAddDirectMessageMembers", BooleanType), + Property("PermissionsAllowViewEditConvertedLeads", BooleanType), + Property("PermissionsShowCompanyNameAsUserBadge", BooleanType), + Property("PermissionsAccessCMC", BooleanType), + Property("PermissionsViewHealthCheck", BooleanType), + Property("PermissionsManageHealthCheck", BooleanType), + Property("PermissionsPackaging2", BooleanType), + Property("PermissionsManageCertificates", BooleanType), + Property("PermissionsCreateReportInLightning", BooleanType), + Property("PermissionsPreventClassicExperience", BooleanType), + Property("PermissionsHideReadByList", BooleanType), + Property("PermissionsListEmailSend", BooleanType), + Property("PermissionsFeedPinning", BooleanType), + Property("PermissionsChangeDashboardColors", BooleanType), + Property("PermissionsManageRecommendationStrategies", BooleanType), + Property("PermissionsManagePropositions", BooleanType), + Property("PermissionsCloseConversations", BooleanType), + Property("PermissionsSubscribeReportRolesGrps", BooleanType), + Property("PermissionsSubscribeDashboardRolesGrps", BooleanType), + Property("PermissionsUseWebLink", BooleanType), + Property("PermissionsHasUnlimitedNBAExecutions", BooleanType), + Property("PermissionsViewOnlyEmbeddedAppUser", BooleanType), + Property("PermissionsViewAllActivities", BooleanType), + Property("PermissionsSubscribeReportToOtherUsers", BooleanType), + Property("PermissionsLightningConsoleAllowedForUser", BooleanType), + Property("PermissionsSubscribeReportsRunAsUser", BooleanType), + Property("PermissionsSubscribeToLightningDashboards", BooleanType), + Property("PermissionsSubscribeDashboardToOtherUsers", BooleanType), + Property("PermissionsCreateLtngTempInPub", BooleanType), + Property("PermissionsAppointmentBookingUserAccess", BooleanType), + Property("PermissionsTransactionalEmailSend", BooleanType), + Property("PermissionsViewPrivateStaticResources", BooleanType), + Property("PermissionsCreateLtngTempFolder", BooleanType), + Property("PermissionsApexRestServices", BooleanType), + Property("PermissionsConfigureLiveMessage", BooleanType), + Property("PermissionsLiveMessageAgent", BooleanType), + Property("PermissionsEnableCommunityAppLauncher", BooleanType), + Property("PermissionsGiveRecognitionBadge", BooleanType), + Property("PermissionsLightningSchedulerUserAccess", BooleanType), + Property("PermissionsUseMySearch", BooleanType), + Property("PermissionsLtngPromoReserved01UserPerm", BooleanType), + Property("PermissionsManageSubscriptions", BooleanType), + Property("PermissionsWaveManagePrivateAssetsUser", BooleanType), + Property("PermissionsCanEditDataPrepRecipe", BooleanType), + Property("PermissionsAddAnalyticsRemoteConnections", BooleanType), + Property("PermissionsManageSurveys", BooleanType), + Property("PermissionsUseAssistantDialog", BooleanType), + Property("PermissionsUseQuerySuggestions", BooleanType), + Property("PermissionsPackaging2PromoteVersion", BooleanType), + Property("PermissionsRecordVisibilityAPI", BooleanType), + Property("PermissionsViewRoles", BooleanType), + Property("PermissionsCanManageMaps", BooleanType), + Property("PermissionsLMOutboundMessagingUserPerm", BooleanType), + Property("PermissionsModifyDataClassification", BooleanType), + Property("PermissionsPrivacyDataAccess", BooleanType), + Property("PermissionsQueryAllFiles", BooleanType), + Property("PermissionsModifyMetadata", BooleanType), + Property("PermissionsManageCMS", BooleanType), + Property("PermissionsSandboxTestingInCommunityApp", BooleanType), + Property("PermissionsCanEditPrompts", BooleanType), + Property("PermissionsViewUserPII", BooleanType), + Property("PermissionsManageHubConnections", BooleanType), + Property("PermissionsB2BMarketingAnalyticsUser", BooleanType), + Property("PermissionsTraceXdsQueries", BooleanType), + Property("PermissionsViewSecurityCommandCenter", BooleanType), + Property("PermissionsManageSecurityCommandCenter", BooleanType), + Property("PermissionsViewAllCustomSettings", BooleanType), + Property("PermissionsViewAllForeignKeyNames", BooleanType), + Property("PermissionsAddWaveNotificationRecipients", BooleanType), + Property("PermissionsHeadlessCMSAccess", BooleanType), + Property("PermissionsLMEndMessagingSessionUserPerm", BooleanType), + Property("PermissionsConsentApiUpdate", BooleanType), + Property("PermissionsPaymentsAPIUser", BooleanType), + Property("PermissionsAccessContentBuilder", BooleanType), + Property("PermissionsAccountSwitcherUser", BooleanType), + Property("PermissionsViewAnomalyEvents", BooleanType), + Property("PermissionsManageC360AConnections", BooleanType), + Property("PermissionsIsContactCenterAdmin", BooleanType), + Property("PermissionsIsContactCenterAgent", BooleanType), + Property("PermissionsManageReleaseUpdates", BooleanType), + Property("PermissionsViewAllProfiles", BooleanType), + Property("PermissionsSkipIdentityConfirmation", BooleanType), + Property("PermissionsCanToggleCallRecordings", BooleanType), + Property("PermissionsLearningManager", BooleanType), + Property("PermissionsSendCustomNotifications", BooleanType), + Property("PermissionsPackaging2Delete", BooleanType), + Property("PermissionsUseOmnichannelInventoryAPIs", BooleanType), + Property("PermissionsViewRestrictionAndScopingRules", BooleanType), + Property("PermissionsFSCComprehensiveUserAccess", BooleanType), + Property("PermissionsBotManageBots", BooleanType), + Property("PermissionsBotManageBotsTrainingData", BooleanType), + Property("PermissionsSchedulingLineAmbassador", BooleanType), + Property("PermissionsSchedulingFacilityManager", BooleanType), + Property("PermissionsOmnichannelInventorySync", BooleanType), + Property("PermissionsManageLearningReporting", BooleanType), + Property("PermissionsIsContactCenterSupervisor", BooleanType), + Property("PermissionsIsotopeCToCUser", BooleanType), + Property("PermissionsCanAccessCE", BooleanType), + Property("PermissionsUseAddOrderItemSummaryAPIs", BooleanType), + Property("PermissionsIsotopeAccess", BooleanType), + Property("PermissionsIsotopeLEX", BooleanType), + Property("PermissionsQuipMetricsAccess", BooleanType), + Property("PermissionsQuipUserEngagementMetrics", BooleanType), + Property("PermissionsRemoteMediaVirtualDesktop", BooleanType), + Property("PermissionsTransactionSecurityExempt", BooleanType), + Property("PermissionsManageStores", BooleanType), + Property("PermissionsManageExternalConnections", BooleanType), + Property("PermissionsUseReturnOrder", BooleanType), + Property("PermissionsUseReturnOrderAPIs", BooleanType), + Property("PermissionsUseSubscriptionEmails", BooleanType), + Property("PermissionsUseOrderEntry", BooleanType), + Property("PermissionsUseRepricing", BooleanType), + Property("PermissionsAIViewInsightObjects", BooleanType), + Property("PermissionsAICreateInsightObjects", BooleanType), + Property("PermissionsViewMLModels", BooleanType), + Property("PermissionsLifecycleManagementAPIUser", BooleanType), + Property("PermissionsNativeWebviewScrolling", BooleanType), + Property("PermissionsViewDeveloperName", BooleanType), + Property("PermissionsBypassMFAForUiLogins", BooleanType), + Property("PermissionsClientSecretRotation", BooleanType), + Property("PermissionsAccessToServiceProcess", BooleanType), + Property("PermissionsManageOrchInstsAndWorkItems", BooleanType), + Property("PermissionsManageDataspaceScope", BooleanType), + Property("PermissionsConfigureDataspaceScope", BooleanType), + Property("PermissionsEditRepricing", BooleanType), + Property("PermissionsEnableIPFSUpload", BooleanType), + Property("PermissionsEnableBCTransactionPolling", BooleanType), + Property("PermissionsFSCArcGraphCommunityUser", BooleanType), + Property("LastViewedDate", StringType), + Property("Name", StringType), + Property("UserLicenseId", StringType), + Property("UserType", StringType), + Property("CreatedDate", StringType), + Property("CreatedById", StringType), + Property("LastModifiedDate", StringType), + Property("LastModifiedById", StringType), + Property("SystemModstamp", StringType), + ).to_dict() + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + return url + + def get_records(self, context: dict | None) -> t.Iterable[dict[str, t.Any]]: + """ + We can send a POST request with headers, payload, and access token to /jobs/query path to create a job id + We can send a GET request to jobs/query/jobid/results path to get the bulk data in csv + We have a while statemnet which does that and gets the job id which has the bulk data + We can load the csv data into json with parse_response function + We can load the json data with get_records function + """ + + def get_job_id(self): + """ + We can get the job id in this function and pass it to the child class to get the bulk data + """ + + job_id_list = [] + domain = self.config["domain"] + + access_token = self.authenticator._auth_headers.get("Authorization").split("Bearer ")[1] + + columns = """ + Id,Description,LastReferencedDate,PermissionsEmailSingle,PermissionsEmailMass,PermissionsEditTask,PermissionsEditEvent, + PermissionsExportReport,PermissionsImportPersonal,PermissionsDataExport,PermissionsManageUsers,PermissionsEditPublicFilters, + PermissionsEditPublicTemplates,PermissionsModifyAllData,PermissionsEditBillingInfo,PermissionsManageCases, + PermissionsMassInlineEdit,PermissionsEditKnowledge,PermissionsManageKnowledge,PermissionsManageSolutions, + PermissionsCustomizeApplication,PermissionsEditReadonlyFields,PermissionsRunReports,PermissionsViewSetup, + PermissionsTransferAnyEntity,PermissionsNewReportBuilder,PermissionsActivateContract,PermissionsActivateOrder, + PermissionsImportLeads,PermissionsManageLeads,PermissionsTransferAnyLead,PermissionsViewAllData,PermissionsEditPublicDocuments, + PermissionsViewEncryptedData,PermissionsEditBrandTemplates,PermissionsEditHtmlTemplates,PermissionsChatterInternalUser, + PermissionsManageEncryptionKeys,PermissionsDeleteActivatedContract,PermissionsChatterInviteExternalUsers, + PermissionsSendSitRequests,PermissionsApiUserOnly,PermissionsManageRemoteAccess,PermissionsCanUseNewDashboardBuilder, + PermissionsManageCategories,PermissionsConvertLeads,PermissionsPasswordNeverExpires,PermissionsUseTeamReassignWizards, + PermissionsEditActivatedOrders,PermissionsInstallMultiforce,PermissionsPublishMultiforce,PermissionsChatterOwnGroups, + PermissionsEditOppLineItemUnitPrice,PermissionsCreateMultiforce,PermissionsBulkApiHardDelete,PermissionsSolutionImport, + PermissionsManageCallCenters,PermissionsManageSynonyms,PermissionsViewContent,PermissionsManageEmailClientConfig, + PermissionsEnableNotifications,PermissionsManageDataIntegrations,PermissionsDistributeFromPersWksp,PermissionsViewDataCategories, + PermissionsManageDataCategories,PermissionsAuthorApex,PermissionsManageMobile,PermissionsApiEnabled,PermissionsManageCustomReportTypes, + PermissionsEditCaseComments,PermissionsTransferAnyCase,PermissionsContentAdministrator,PermissionsCreateWorkspaces, + PermissionsManageContentPermissions,PermissionsManageContentProperties,PermissionsManageContentTypes,PermissionsManageExchangeConfig, + PermissionsManageAnalyticSnapshots,PermissionsScheduleReports,PermissionsManageBusinessHourHolidays,PermissionsManageEntitlements, + PermissionsManageDynamicDashboards,PermissionsCustomSidebarOnAllPages,PermissionsManageInteraction,PermissionsViewMyTeamsDashboards, + PermissionsModerateChatter,PermissionsResetPasswords,PermissionsFlowUFLRequired,PermissionsCanInsertFeedSystemFields, + PermissionsActivitiesAccess,PermissionsManageKnowledgeImportExport,PermissionsEmailTemplateManagement,PermissionsEmailAdministration, + PermissionsManageChatterMessages,PermissionsAllowEmailIC,PermissionsChatterFileLink,PermissionsForceTwoFactor, + PermissionsViewEventLogFiles,PermissionsManageNetworks,PermissionsManageAuthProviders,PermissionsRunFlow, + PermissionsCreateCustomizeDashboards,PermissionsCreateDashboardFolders,PermissionsViewPublicDashboards, + PermissionsManageDashbdsInPubFolders,PermissionsCreateCustomizeReports,PermissionsCreateReportFolders,PermissionsViewPublicReports, + PermissionsManageReportsInPubFolders,PermissionsEditMyDashboards,PermissionsEditMyReports,PermissionsViewAllUsers, + PermissionsAllowUniversalSearch,PermissionsConnectOrgToEnvironmentHub,PermissionsWorkCalibrationUser,PermissionsCreateCustomizeFilters, + PermissionsWorkDotComUserPerm,PermissionsContentHubUser,PermissionsGovernNetworks,PermissionsSalesConsole, + PermissionsTwoFactorApi,PermissionsDeleteTopics,PermissionsEditTopics,PermissionsCreateTopics,PermissionsAssignTopics, + PermissionsIdentityEnabled,PermissionsIdentityConnect,PermissionsAllowViewKnowledge,PermissionsContentWorkspaces, + PermissionsManageSearchPromotionRules,PermissionsCustomMobileAppsAccess,PermissionsViewHelpLink,PermissionsManageProfilesPermissionsets, + PermissionsAssignPermissionSets,PermissionsManageRoles,PermissionsManageIpAddresses,PermissionsManageSharing, + PermissionsManageInternalUsers,PermissionsManagePasswordPolicies,PermissionsManageLoginAccessPolicies,PermissionsViewPlatformEvents, + PermissionsManageCustomPermissions,PermissionsCanVerifyComment,PermissionsManageUnlistedGroups,PermissionsStdAutomaticActivityCapture, + PermissionsInsightsAppDashboardEditor,PermissionsManageTwoFactor,PermissionsInsightsAppUser,PermissionsInsightsAppAdmin, + PermissionsInsightsAppEltEditor,PermissionsInsightsAppUploadUser,PermissionsInsightsCreateApplication,PermissionsLightningExperienceUser, + PermissionsViewDataLeakageEvents,PermissionsConfigCustomRecs,PermissionsSubmitMacrosAllowed,PermissionsBulkMacrosAllowed, + PermissionsShareInternalArticles,PermissionsManageSessionPermissionSets,PermissionsManageTemplatedApp,PermissionsUseTemplatedApp, + PermissionsSendAnnouncementEmails,PermissionsChatterEditOwnPost,PermissionsChatterEditOwnRecordPost,PermissionsWaveTabularDownload, + PermissionsAutomaticActivityCapture,PermissionsImportCustomObjects,PermissionsDelegatedTwoFactor,PermissionsChatterComposeUiCodesnippet, + PermissionsSelectFilesFromSalesforce,PermissionsModerateNetworkUsers,PermissionsMergeTopics,PermissionsSubscribeToLightningReports, + PermissionsManagePvtRptsAndDashbds,PermissionsAllowLightningLogin,PermissionsCampaignInfluence2,PermissionsViewDataAssessment, + PermissionsRemoveDirectMessageMembers,PermissionsCanApproveFeedPost,PermissionsAddDirectMessageMembers,PermissionsAllowViewEditConvertedLeads, + PermissionsShowCompanyNameAsUserBadge,PermissionsAccessCMC,PermissionsViewHealthCheck,PermissionsManageHealthCheck, + PermissionsPackaging2,PermissionsManageCertificates,PermissionsCreateReportInLightning,PermissionsPreventClassicExperience, + PermissionsHideReadByList,PermissionsListEmailSend,PermissionsFeedPinning,PermissionsChangeDashboardColors, + PermissionsManageRecommendationStrategies,PermissionsManagePropositions,PermissionsCloseConversations,PermissionsSubscribeReportRolesGrps, + PermissionsSubscribeDashboardRolesGrps,PermissionsUseWebLink,PermissionsHasUnlimitedNBAExecutions,PermissionsViewOnlyEmbeddedAppUser, + PermissionsViewAllActivities,PermissionsSubscribeReportToOtherUsers,PermissionsLightningConsoleAllowedForUser, + PermissionsSubscribeReportsRunAsUser,PermissionsSubscribeToLightningDashboards,PermissionsSubscribeDashboardToOtherUsers, + PermissionsCreateLtngTempInPub,PermissionsAppointmentBookingUserAccess,PermissionsTransactionalEmailSend, + PermissionsViewPrivateStaticResources,PermissionsCreateLtngTempFolder,PermissionsApexRestServices,PermissionsConfigureLiveMessage, + PermissionsLiveMessageAgent,PermissionsEnableCommunityAppLauncher,PermissionsGiveRecognitionBadge,PermissionsLightningSchedulerUserAccess, + PermissionsUseMySearch,PermissionsLtngPromoReserved01UserPerm,PermissionsManageSubscriptions,PermissionsWaveManagePrivateAssetsUser, + PermissionsCanEditDataPrepRecipe,PermissionsAddAnalyticsRemoteConnections,PermissionsManageSurveys,PermissionsUseAssistantDialog, + PermissionsUseQuerySuggestions,PermissionsPackaging2PromoteVersion,PermissionsRecordVisibilityAPI,PermissionsViewRoles, + PermissionsCanManageMaps,PermissionsLMOutboundMessagingUserPerm,PermissionsModifyDataClassification,PermissionsPrivacyDataAccess, + PermissionsQueryAllFiles,PermissionsModifyMetadata,PermissionsManageCMS,PermissionsSandboxTestingInCommunityApp, + PermissionsCanEditPrompts,PermissionsViewUserPII,PermissionsManageHubConnections,PermissionsB2BMarketingAnalyticsUser, + PermissionsTraceXdsQueries,PermissionsViewSecurityCommandCenter,PermissionsManageSecurityCommandCenter,PermissionsViewAllCustomSettings, + PermissionsViewAllForeignKeyNames,PermissionsAddWaveNotificationRecipients,PermissionsHeadlessCMSAccess,PermissionsLMEndMessagingSessionUserPerm, + PermissionsConsentApiUpdate,PermissionsPaymentsAPIUser,PermissionsAccessContentBuilder,PermissionsAccountSwitcherUser, + PermissionsViewAnomalyEvents,PermissionsManageC360AConnections,PermissionsIsContactCenterAdmin,PermissionsIsContactCenterAgent, + PermissionsManageReleaseUpdates,PermissionsViewAllProfiles,PermissionsSkipIdentityConfirmation,PermissionsCanToggleCallRecordings, + PermissionsLearningManager,PermissionsSendCustomNotifications,PermissionsPackaging2Delete,PermissionsUseOmnichannelInventoryAPIs, + PermissionsViewRestrictionAndScopingRules,PermissionsFSCComprehensiveUserAccess,PermissionsBotManageBots, + PermissionsBotManageBotsTrainingData,PermissionsSchedulingLineAmbassador,PermissionsSchedulingFacilityManager, + PermissionsOmnichannelInventorySync,PermissionsManageLearningReporting,PermissionsIsContactCenterSupervisor, + PermissionsIsotopeCToCUser,PermissionsCanAccessCE,PermissionsUseAddOrderItemSummaryAPIs,PermissionsIsotopeAccess, + PermissionsIsotopeLEX,PermissionsQuipMetricsAccess,PermissionsQuipUserEngagementMetrics,PermissionsRemoteMediaVirtualDesktop, + PermissionsTransactionSecurityExempt,PermissionsManageStores,PermissionsManageExternalConnections,PermissionsUseReturnOrder, + PermissionsUseReturnOrderAPIs,PermissionsUseSubscriptionEmails,PermissionsUseOrderEntry,PermissionsUseRepricing, + PermissionsAIViewInsightObjects,PermissionsAICreateInsightObjects,PermissionsViewMLModels,PermissionsLifecycleManagementAPIUser, + PermissionsNativeWebviewScrolling,PermissionsViewDeveloperName,PermissionsBypassMFAForUiLogins,PermissionsClientSecretRotation, + PermissionsAccessToServiceProcess,PermissionsManageOrchInstsAndWorkItems,PermissionsManageDataspaceScope,PermissionsConfigureDataspaceScope, + PermissionsEditRepricing,PermissionsEnableIPFSUpload,PermissionsEnableBCTransactionPolling,PermissionsFSCArcGraphCommunityUser, + LastViewedDate,Name,UserLicenseId,UserType,CreatedDate,CreatedById,LastModifiedDate,LastModifiedById,SystemModstamp + + """ + entity = "PROFILE" + + headers = get_headers(access_token) + payload = json.dumps( + {"operation": "query", "query": f"SELECT {columns} FROM {entity}"} + ) + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query" + + response = requests.request("POST", url, headers=headers, data=payload) + job_id = response.json()["id"] + self.logger.info( + f"Job ID fetched for {entity}. Sending the call for result" + ) + + while not job_id_list: + """ + We can check if a job id has bulk data and return that job id if it has it + """ + + time.sleep(10) + job_id_url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + job_id_response = requests.request("GET", job_id_url, headers=headers) + + if job_id_response.status_code == 200: + job_id_list.append(job_id) + self.logger.info("Bulk API - Created Data Job") + + return job_id_list[0] + + job_id = get_job_id(self) + + class BulkResults(SalesforceStream): + name = "profiles_bulk" + path = "" + + @property + def url_base(self): + domain = self.config["domain"] + url = f"https://{domain}.salesforce.com/services/data/v58.0/jobs/query/{job_id}/results" + return url + + def parse_response(self, response: requests.Response) -> t.Iterable[dict]: + """ + We can load the csv response into json and return it for get_records function + """ + + if len(response.text) > 0: + csv_data = StringIO(response.text) + reader = csv.DictReader(csv_data) + data_list = [row for row in reader] + self.logger.info("Bulk API - Updated CSV response to JSON") + return data_list + else: + self.logger.info("Bulk API - Empty response") + return [] + + bulk_results_stream = BulkResults(self._tap, schema={"properties": {}}) + + try: + for record in bulk_results_stream.get_records(context): + yield record + except Exception as e: + pass + self.logger.info(e) diff --git a/tap_salesforce/sync.py b/tap_salesforce/sync.py deleted file mode 100644 index dc1157e..0000000 --- a/tap_salesforce/sync.py +++ /dev/null @@ -1,197 +0,0 @@ -import time -import singer -import singer.utils as singer_utils -from singer import Transformer, metadata, metrics -from requests.exceptions import RequestException -from tap_salesforce.salesforce.bulk import Bulk - -LOGGER = singer.get_logger() - -BLACKLISTED_FIELDS = set(['attributes']) - -def remove_blacklisted_fields(data): - return {k: v for k, v in data.items() if k not in BLACKLISTED_FIELDS} - -# pylint: disable=unused-argument -def transform_bulk_data_hook(data, typ, schema): - result = data - if isinstance(data, dict): - result = remove_blacklisted_fields(data) - - # Salesforce Bulk API returns CSV's with empty strings for text fields. - # When the text field is nillable and the data value is an empty string, - # change the data so that it is None. - if data == "" and "null" in schema['type']: - result = None - - return result - -def get_stream_version(catalog_entry, state): - tap_stream_id = catalog_entry['tap_stream_id'] - catalog_metadata = metadata.to_map(catalog_entry['metadata']) - replication_key = catalog_metadata.get((), {}).get('replication-key') - - if singer.get_bookmark(state, tap_stream_id, 'version') is None: - stream_version = int(time.time() * 1000) - else: - stream_version = singer.get_bookmark(state, tap_stream_id, 'version') - - if replication_key: - return stream_version - return int(time.time() * 1000) - -def resume_syncing_bulk_query(sf, catalog_entry, job_id, state, counter): - bulk = Bulk(sf) - current_bookmark = singer.get_bookmark(state, catalog_entry['tap_stream_id'], 'JobHighestBookmarkSeen') or sf.get_start_date(state, catalog_entry) - current_bookmark = singer_utils.strptime_with_tz(current_bookmark) - batch_ids = singer.get_bookmark(state, catalog_entry['tap_stream_id'], 'BatchIDs') - - start_time = singer_utils.now() - stream = catalog_entry['stream'] - stream_alias = catalog_entry.get('stream_alias') - catalog_metadata = metadata.to_map(catalog_entry.get('metadata')) - replication_key = catalog_metadata.get((), {}).get('replication-key') - stream_version = get_stream_version(catalog_entry, state) - schema = catalog_entry['schema'] - - if not bulk.job_exists(job_id): - LOGGER.info("Found stored Job ID that no longer exists, resetting bookmark and removing JobID from state.") - return counter - - # Iterate over the remaining batches, removing them once they are synced - for batch_id in batch_ids[:]: - with Transformer(pre_hook=transform_bulk_data_hook) as transformer: - for rec in bulk.get_batch_results(job_id, batch_id, catalog_entry): - counter.increment() - rec = transformer.transform(rec, schema) - rec = fix_record_anytype(rec, schema) - singer.write_message( - singer.RecordMessage( - stream=( - stream_alias or stream), - record=rec, - version=stream_version, - time_extracted=start_time)) - - # Update bookmark if necessary - replication_key_value = replication_key and singer_utils.strptime_with_tz(rec[replication_key]) - if replication_key_value and replication_key_value <= start_time and replication_key_value > current_bookmark: - current_bookmark = singer_utils.strptime_with_tz(rec[replication_key]) - - state = singer.write_bookmark(state, - catalog_entry['tap_stream_id'], - 'JobHighestBookmarkSeen', - singer_utils.strftime(current_bookmark)) - batch_ids.remove(batch_id) - LOGGER.info("Finished syncing batch %s. Removing batch from state.", batch_id) - LOGGER.info("Batches to go: %d", len(batch_ids)) - singer.write_state(state) - -def sync_stream(sf, catalog_entry, state, state_msg_threshold): - stream = catalog_entry['stream'] - - with metrics.record_counter(stream) as counter: - try: - sync_records(sf, catalog_entry, state, counter, state_msg_threshold) - # Write the state generated for the last record generated by sf.query - singer.write_state(state) - except RequestException as ex: - raise Exception("Error syncing {}: {} Response: {}".format( - stream, ex, ex.response.text)) - except Exception as ex: - raise Exception("Error syncing {}: {}".format( - stream, ex)) from ex - -def sync_records(sf, catalog_entry, state, counter, state_msg_threshold): - chunked_bookmark = singer_utils.strptime_with_tz(sf.get_start_date(state, catalog_entry)) - stream = catalog_entry['stream'] - schema = catalog_entry['schema'] - stream_alias = catalog_entry.get('stream_alias') - catalog_metadata = metadata.to_map(catalog_entry['metadata']) - replication_key = catalog_metadata.get((), {}).get('replication-key') - stream_version = get_stream_version(catalog_entry, state) - activate_version_message = singer.ActivateVersionMessage(stream=(stream_alias or stream), - version=stream_version) - - start_time = singer_utils.now() - - LOGGER.info('Syncing Salesforce data for stream %s', stream) - - for rec in sf.query(catalog_entry, state): - counter.increment() - with Transformer(pre_hook=transform_bulk_data_hook) as transformer: - rec = transformer.transform(rec, schema) - rec = fix_record_anytype(rec, schema) - singer.write_message( - singer.RecordMessage( - stream=( - stream_alias or stream), - record=rec, - version=stream_version, - time_extracted=start_time)) - - replication_key_value = replication_key and singer_utils.strptime_with_tz(rec[replication_key]) - - if sf.pk_chunking: - if replication_key_value and replication_key_value <= start_time and replication_key_value > chunked_bookmark: - # Replace the highest seen bookmark and save the state in case we need to resume later - chunked_bookmark = singer_utils.strptime_with_tz(rec[replication_key]) - state = singer.write_bookmark( - state, - catalog_entry['tap_stream_id'], - 'JobHighestBookmarkSeen', - singer_utils.strftime(chunked_bookmark)) - - if counter.value % state_msg_threshold == 0: - singer.write_state(state) - # Before writing a bookmark, make sure Salesforce has not given us a - # record with one outside our range - elif replication_key_value and replication_key_value <= start_time: - state = singer.write_bookmark( - state, - catalog_entry['tap_stream_id'], - replication_key, - rec[replication_key]) - - if counter.value % state_msg_threshold == 0: - singer.write_state(state) - - # Tables with no replication_key will send an - # activate_version message for the next sync - if not replication_key: - singer.write_message(activate_version_message) - state = singer.write_bookmark( - state, catalog_entry['tap_stream_id'], 'version', None) - - # If pk_chunking is set, only write a bookmark at the end - if sf.pk_chunking: - # Write a bookmark with the highest value we've seen - state = singer.write_bookmark( - state, - catalog_entry['tap_stream_id'], - replication_key, - singer_utils.strftime(chunked_bookmark)) - -def fix_record_anytype(rec, schema): - """Modifies a record when the schema has no 'type' element due to a SF type of 'anyType.' - Attempts to set the record's value for that element to an int, float, or string.""" - def try_cast(val, coercion): - try: - return coercion(val) - except BaseException: - return val - - for k, v in rec.items(): - if schema['properties'][k].get("type") is None: - val = v - val = try_cast(v, int) - val = try_cast(v, float) - if v in ["true", "false"]: - val = (v == "true") - - if v == "": - val = None - - rec[k] = val - - return rec diff --git a/tap_salesforce/tap.py b/tap_salesforce/tap.py new file mode 100644 index 0000000..d5d728f --- /dev/null +++ b/tap_salesforce/tap.py @@ -0,0 +1,167 @@ +"""Salesforce tap class.""" + +from __future__ import annotations + +from singer_sdk import Tap +from singer_sdk import typing as th # JSON schema typing helpers + +from tap_salesforce import streams + +""" + https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_what_is_rest_api.htm +""" + + +class TapSalesforce(Tap): + """Singer Tap for the Salesforce.""" + + name = "tap-salesforce" + + config_jsonschema = th.PropertiesList( + th.Property( + "client_id", + th.StringType, + required=True, + secret=True, # Flag config as protected. + description=( + "Client id, used for getting access token if access token is not " + "available" + ), + ), + th.Property( + "client_secret", + th.StringType, + required=True, + secret=True, # Flag config as protected. + description=( + "Client secret, used for getting access token if access token is not " + "available" + ), + ), + th.Property( + "start_date", + th.DateTimeType, + description="Earliest record date to sync", + ), + th.Property( + "end_date", + th.DateTimeType, + description="Latest record date to sync", + ), + th.Property( + "domain", + th.StringType, + description="Website domain for site url, ie., https://{domain}.salesforce.com/services/data/", + required=True, + ), + th.Property( + "bulk_load", + th.BooleanType, + description="Toggle for using BULK API method", + required=True, + default=False, + ), + th.Property( + "auth", + th.DiscriminatedUnion( + "flow", + oauth=th.ObjectType( + th.Property( + "access_token", + th.StringType, + required=True, + secret=True, + ), + additional_properties=False, + ), + password=th.ObjectType( + th.Property("username", th.StringType, required=True), + th.Property("password", th.StringType, required=True, secret=True), + additional_properties=False, + ), + ), + description=( + "Auth type for Salesforce API requires either access_token or " + "username/password" + ), + required=True, + ), + ).to_dict() + + def discover_streams(self) -> list[streams.SalesforceStream]: + """Return a list of discovered streams. + + Returns: + A list of discovered streams. + """ + bulk_load = self.config["bulk_load"] + if bulk_load is True: + return [ + streams.BulkOpportunityHistoryStream(self), + streams.BulkAccountStream(self), + streams.BulkContactStream(self), + streams.BulkCampaignStream(self), + streams.BulkEntitlementStream(self), + streams.BulkCaseStream(self), + streams.BulkEmailTemplateStream(self), + streams.BulkFolderStream(self), + streams.BulkGroupStream(self), + streams.BulkLeadStream(self), + streams.BulkPeriodStream(self), + streams.BulkSolutionStream(self), + streams.BulkStaticResourceStream(self), + streams.BulkWebLinkStream(self), + streams.BulkPricebook2Stream(self), + streams.BulkProduct2Stream(self), + streams.BulkPricebookEntryStream(self), + streams.BulkUserAppInfoStream(self), + streams.BulkUserRoleStream(self), + streams.BulkApexClassStream(self), + streams.BulkApexPageStream(self), + streams.BulkApexTriggerStream(self), + streams.BulkCampaignMemberStatusStream(self), + streams.BulkFiscalYearSettings(self), + streams.BulkOpportunityStream(self), + streams.BulkOrganizationStream(self), + streams.BulkServiceSetupProvisioningStream(self), + streams.BulkBusinessHoursStream(self), + streams.BulkUserStream(self), + streams.BulkProfileStream(self), + ] + else: + return [ + streams.AccountStream(self), + streams.ContactStream(self), + streams.CampaignStream(self), + streams.EntitlementStream(self), + streams.CaseStream(self), + streams.EmailTemplateStream(self), + streams.FolderStream(self), + streams.GroupStream(self), + streams.LeadStream(self), + streams.PeriodStream(self), + streams.SolutionStream(self), + streams.StaticResourceStream(self), + streams.WebLinkStream(self), + streams.Pricebook2Stream(self), + streams.Product2Stream(self), + streams.PricebookEntryStream(self), + streams.UserAppInfoStream(self), + streams.UserRoleStream(self), + streams.ApexClassStream(self), + streams.ApexPageStream(self), + streams.ApexTriggerStream(self), + streams.CampaignMemberStatusStream(self), + streams.FiscalYearSettingsStream(self), + streams.OpportunityStream(self), + streams.OrganizationStream(self), + streams.ServiceSetupProvisioningStream(self), + streams.BusinessHoursStream(self), + streams.UserStream(self), + streams.ProfileStream(self), + streams.OpportunityHistoryStream(self), + ] + + +if __name__ == "__main__": + TapSalesforce.cli() diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..1ca55d7 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ +"""Test suite for tap-salesforce.""" diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..6bb3ec2 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,3 @@ +"""Test Configuration.""" + +pytest_plugins = ("singer_sdk.testing.pytest_plugin",) diff --git a/tests/test_core.py b/tests/test_core.py new file mode 100644 index 0000000..0873c22 --- /dev/null +++ b/tests/test_core.py @@ -0,0 +1,24 @@ +"""Tests standard tap features using the built-in SDK tests library.""" + +import datetime +import os + +from singer_sdk.testing import get_tap_test_class + +from tap_salesforce.tap import TapSalesforce + +SAMPLE_CONFIG = { + "start_date": "2023-01-01T00:00:00Z", + "domain": os.environ.get("TAP_SALESFORCE_DOMAIN"), + "auth": { + "flow": "password", + "username": os.environ.get("TAP_SALESFORCE_AUTH_USERNAME"), + "password": os.environ.get("TAP_SALESFORCE_AUTH_PASSWORD"), + } +} + +# Run standard built-in tap tests from the SDK: +TestTapSalesforce = get_tap_test_class( + tap_class=TapSalesforce, + config=SAMPLE_CONFIG, +) diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..bf5cc3d --- /dev/null +++ b/tox.ini @@ -0,0 +1,53 @@ +# This file can be used to customize tox tests as well as other test frameworks like flake8 and mypy + +[tox] +envlist = py39, py310, py311 +isolated_build = true + +[testenv] +allowlist_externals = poetry +whitelist_externals = poetry + +commands = + poetry install -v + - poetry run pytest + - poetry run black --check tap_salesforce/ + - poetry run flake8 tap_salesforce + - poetry run pydocstyle tap_salesforce + - poetry run mypy tap_salesforce --exclude='tap_salesforce/tests' + +[testenv:pytest] +# Run the python tests. +# To execute, run `tox -e pytest` +envlist = py39, py310, py311 +commands = + poetry install + poetry run pytest + +[testenv:format] +# Attempt to auto-resolve lint errors before they are raised. +# To execute, run `tox -e format` +commands = + poetry install -v + - poetry run black tap_salesforce/ + - poetry run isort tap_salesforce + +[testenv:lint] +# Raise an error if lint and style standards are not met. +# To execute, run `tox -e lint` +commands = + poetry install -v + - poetry run black --check --diff tap_salesforce/ + - poetry run isort --check tap_salesforce + - poetry run flake8 tap_salesforce + - poetry run pydocstyle tap_salesforce + # refer to mypy.ini for specific settings + - poetry run mypy tap_salesforce --exclude='tap_salesforce/tests' + +[flake8] +ignore = W503 +max-line-length = 88 +max-complexity = 10 + +[pydocstyle] +ignore = D105,D203,D213