Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "fa469c0", "specHash": "60778fb", "version": "0.1.0" }
{ "engineHash": "e7c6d12", "specHash": "a05e5d7", "version": "0.1.0" }
42 changes: 6 additions & 36 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ on:
pull_request:
branches:
- sdk-gen
push:
branches:
- sdk-gen
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -29,7 +26,8 @@ jobs:
python -m pip install --upgrade pip
python -m pip install -e .[dev]
python -m pip install tox-gh-actions
- name: Test with tox
- name: All Tests
if: startsWith(github.head_ref, 'codegen-release')
env:
JWT_CONFIG_BASE_64: ${{ secrets.JWT_CONFIG_BASE_64 }}
ADMIN_USER_ID: ${{ secrets.ADMIN_USER_ID }}
Expand All @@ -49,41 +47,13 @@ jobs:
SLACK_PARTNER_ITEM_ID: ${{ secrets.SLACK_PARTNER_ITEM_ID }}
run: |
tox

coverage:
name: Coverage report
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[dev]
python -m pip install coveralls
- name: Send coverage report to Coveralls
run: |
tox -e coverage
coveralls --service=github
- name: Smoke Tests
if: "!startsWith(github.head_ref, 'codegen-release')"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JWT_CONFIG_BASE_64: ${{ secrets.JWT_CONFIG_BASE_64 }}
ADMIN_USER_ID: ${{ secrets.ADMIN_USER_ID }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
USER_ID: ${{ secrets.USER_ID }}
ENTERPRISE_ID: ${{ secrets.ENTERPRISE_ID }}
BOX_FILE_REQUEST_ID: ${{ secrets.BOX_FILE_REQUEST_ID }}
BOX_EXTERNAL_USER_EMAIL: ${{ secrets.BOX_EXTERNAL_USER_EMAIL }}
BOX_EXTERNAL_USER_ID: ${{ secrets.BOX_EXTERNAL_USER_ID }}
WORKFLOW_FOLDER_ID: ${{ secrets.WORKFLOW_FOLDER_ID }}
APP_ITEM_ASSOCIATION_FILE_ID: ${{ secrets.APP_ITEM_ASSOCIATION_FILE_ID }}
APP_ITEM_ASSOCIATION_FOLDER_ID: ${{ secrets.APP_ITEM_ASSOCIATION_FOLDER_ID }}
APP_ITEM_SHARED_LINK: ${{ secrets.APP_ITEM_SHARED_LINK }}
SLACK_AUTOMATION_USER_ID: ${{ secrets.SLACK_AUTOMATION_USER_ID }}
SLACK_ORG_ID: ${{ secrets.SLACK_ORG_ID }}
SLACK_PARTNER_ITEM_ID: ${{ secrets.SLACK_PARTNER_ITEM_ID }}
run: |
tox -- test/auth.py test/files.py test/downloads.py test/uploads.py
6 changes: 6 additions & 0 deletions box_sdk_gen/managers/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ class CreateWebhookTriggers(str, Enum):
SIGN_REQUEST_DECLINED = 'SIGN_REQUEST.DECLINED'
SIGN_REQUEST_EXPIRED = 'SIGN_REQUEST.EXPIRED'
SIGN_REQUEST_SIGNER_EMAIL_BOUNCED = 'SIGN_REQUEST.SIGNER_EMAIL_BOUNCED'
SIGN_REQUEST_SIGN_SIGNER_SIGNED = 'SIGN_REQUEST.SIGN_SIGNER_SIGNED'
SIGN_REQUEST_SIGN_DOCUMENT_CREATED = 'SIGN_REQUEST.SIGN_DOCUMENT_CREATED'
SIGN_REQUEST_SIGN_ERROR_FINALIZING = 'SIGN_REQUEST.SIGN_ERROR_FINALIZING'


class UpdateWebhookByIdTargetTypeField(str, Enum):
Expand Down Expand Up @@ -191,6 +194,9 @@ class UpdateWebhookByIdTriggers(str, Enum):
SIGN_REQUEST_DECLINED = 'SIGN_REQUEST.DECLINED'
SIGN_REQUEST_EXPIRED = 'SIGN_REQUEST.EXPIRED'
SIGN_REQUEST_SIGNER_EMAIL_BOUNCED = 'SIGN_REQUEST.SIGNER_EMAIL_BOUNCED'
SIGN_REQUEST_SIGN_SIGNER_SIGNED = 'SIGN_REQUEST.SIGN_SIGNER_SIGNED'
SIGN_REQUEST_SIGN_DOCUMENT_CREATED = 'SIGN_REQUEST.SIGN_DOCUMENT_CREATED'
SIGN_REQUEST_SIGN_ERROR_FINALIZING = 'SIGN_REQUEST.SIGN_ERROR_FINALIZING'


class WebhooksManager:
Expand Down
6 changes: 4 additions & 2 deletions box_sdk_gen/networking/retries.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from abc import abstractmethod

from typing import Optional

from box_sdk_gen.networking.fetch_options import FetchOptions

from box_sdk_gen.networking.fetch_response import FetchResponse
Expand Down Expand Up @@ -57,7 +59,7 @@ def should_retry(
is_successful: bool = (
fetch_response.status >= 200 and fetch_response.status < 400
)
retry_after_header: str = fetch_response.headers.get('Retry-After')
retry_after_header: Optional[str] = fetch_response.headers.get('Retry-After')
is_accepted_with_retry_after: bool = (
fetch_response.status == 202 and not retry_after_header == None
)
Expand All @@ -84,7 +86,7 @@ def retry_after(
fetch_response: FetchResponse,
attempt_number: int,
) -> float:
retry_after_header: str = fetch_response.headers.get('Retry-After')
retry_after_header: Optional[str] = fetch_response.headers.get('Retry-After')
if not retry_after_header == None:
return float(retry_after_header)
randomization: float = random(
Expand Down
3 changes: 3 additions & 0 deletions box_sdk_gen/schemas/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ class WebhookTriggersField(str, Enum):
SIGN_REQUEST_DECLINED = 'SIGN_REQUEST.DECLINED'
SIGN_REQUEST_EXPIRED = 'SIGN_REQUEST.EXPIRED'
SIGN_REQUEST_SIGNER_EMAIL_BOUNCED = 'SIGN_REQUEST.SIGNER_EMAIL_BOUNCED'
SIGN_REQUEST_SIGN_SIGNER_SIGNED = 'SIGN_REQUEST.SIGN_SIGNER_SIGNED'
SIGN_REQUEST_SIGN_DOCUMENT_CREATED = 'SIGN_REQUEST.SIGN_DOCUMENT_CREATED'
SIGN_REQUEST_SIGN_ERROR_FINALIZING = 'SIGN_REQUEST.SIGN_ERROR_FINALIZING'


class Webhook(WebhookMini):
Expand Down