Skip to content
Merged
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
5 changes: 3 additions & 2 deletions .github/workflows/handle-release-pr-title-edit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ jobs:
update_pr_content:
name: Update pull request content
if: |
(github.event.action == 'edited' && github.event.changes.title.from != github.event.pull_request.title) ||
(github.event.action == 'unlabeled' && github.event.label.name == 'autorelease: custom version') &&
((github.event.action == 'edited' && github.event.changes.title.from != github.event.pull_request.title) ||
(github.event.action == 'unlabeled' && github.event.label.name == 'autorelease: custom version')) &&
startsWith(github.event.pull_request.head.ref, 'release-please--') &&
github.event.pull_request.state == 'open' &&
github.event.sender.login != 'stainless-bot' &&
github.repository == 'increase/increase-python'
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.13.4"
".": "0.13.5"
}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.13.5 (2023-10-03)

Full Changelog: [v0.13.4...v0.13.5](https://github.com/increase/increase-python/compare/v0.13.4...v0.13.5)

### Features

* **api:** expand event categories and Entity status options ([#144](https://github.com/increase/increase-python/issues/144)) ([5b452f0](https://github.com/increase/increase-python/commit/5b452f0f06d390f1440260314d39568e8d27456d))
* **client:** handle retry-after header with a date format ([#142](https://github.com/increase/increase-python/issues/142)) ([0363f9b](https://github.com/increase/increase-python/commit/0363f9b8d38ff94088ce0d67ff63657118dade58))


### Chores

* **tests:** update test examples ([#145](https://github.com/increase/increase-python/issues/145)) ([9cbe137](https://github.com/increase/increase-python/commit/9cbe13777b7f6271520452e51ec200f78bd01077))

## 0.13.4 (2023-09-29)

Full Changelog: [v0.13.3...v0.13.4](https://github.com/Increase/increase-python/compare/v0.13.3...v0.13.4)
Expand Down
4 changes: 2 additions & 2 deletions bin/check-test-server
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ function prism_is_running() {
}

function is_overriding_api_base_url() {
[ -n "$API_BASE_URL" ]
[ -n "$TEST_API_BASE_URL" ]
}

if is_overriding_api_base_url ; then
# If someone is running the tests against the live API, we can trust they know
# what they're doing and exit early.
echo -e "${GREEN}✔ Running tests against ${API_BASE_URL}${NC}"
echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}"

exit 0
elif prism_is_running ; then
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "increase"
version = "0.13.4"
version = "0.13.5"
description = "Client library for the increase API"
readme = "README.md"
authors = ["Increase <dev-feedback@increase.com>"]
Expand Down
18 changes: 16 additions & 2 deletions src/increase/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import json
import time
import uuid
import email
import inspect
import platform
import email.utils
from types import TracebackType
from random import random
from typing import (
Expand Down Expand Up @@ -616,10 +618,22 @@ def _calculate_retry_timeout(
try:
# About the Retry-After header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
#
# TODO: we may want to handle the case where the header is using the http-date syntax: "Retry-After:
# <http-date>". See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After#syntax for
# details.
retry_after = -1 if response_headers is None else int(response_headers.get("retry-after"))
if response_headers is not None:
retry_header = response_headers.get("retry-after")
try:
retry_after = int(retry_header)
except Exception:
retry_date_tuple = email.utils.parsedate_tz(retry_header)
if retry_date_tuple is None:
retry_after = -1
else:
retry_date = email.utils.mktime_tz(retry_date_tuple)
retry_after = int(retry_date - time.time())
else:
retry_after = -1

except Exception:
retry_after = -1

Expand Down
2 changes: 1 addition & 1 deletion src/increase/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless.

__title__ = "increase"
__version__ = "0.13.4" # x-release-please-version
__version__ = "0.13.5" # x-release-please-version
4 changes: 4 additions & 0 deletions src/increase/resources/entities/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def list(
created_at: entity_list_params.CreatedAt | NotGiven = NOT_GIVEN,
cursor: str | NotGiven = NOT_GIVEN,
limit: int | NotGiven = NOT_GIVEN,
status: entity_list_params.Status | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -200,6 +201,7 @@ def list(
"created_at": created_at,
"cursor": cursor,
"limit": limit,
"status": status,
},
entity_list_params.EntityListParams,
),
Expand Down Expand Up @@ -432,6 +434,7 @@ def list(
created_at: entity_list_params.CreatedAt | NotGiven = NOT_GIVEN,
cursor: str | NotGiven = NOT_GIVEN,
limit: int | NotGiven = NOT_GIVEN,
status: entity_list_params.Status | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -469,6 +472,7 @@ def list(
"created_at": created_at,
"cursor": cursor,
"limit": limit,
"status": status,
},
entity_list_params.EntityListParams,
),
Expand Down
28 changes: 28 additions & 0 deletions src/increase/resources/event_subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def create(
"ach_prenotification.updated",
"ach_transfer.created",
"ach_transfer.updated",
"bookkeeping_account.created",
"bookkeeping_entry_set.updated",
"card.created",
"card.updated",
"card_payment.created",
Expand All @@ -54,9 +56,12 @@ def create(
"document.created",
"entity.created",
"entity.updated",
"event_subscription.created",
"event_subscription.updated",
"export.created",
"export.updated",
"external_account.created",
"external_account.updated",
"file.created",
"group.updated",
"group.heartbeat",
Expand Down Expand Up @@ -120,6 +125,10 @@ def create(
updated.
- `ach_transfer.created` - Occurs whenever an ACH Transfer is created.
- `ach_transfer.updated` - Occurs whenever an ACH Transfer is updated.
- `bookkeeping_account.created` - Occurs whenever a Bookkeeping Account is
created.
- `bookkeeping_entry_set.updated` - Occurs whenever a Bookkeeping Entry Set is
created.
- `card.created` - Occurs whenever a Card is created.
- `card.updated` - Occurs whenever a Card is updated.
- `card_payment.created` - Occurs whenever a Card Payment is created.
Expand All @@ -141,9 +150,14 @@ def create(
- `document.created` - Occurs whenever a Document is created.
- `entity.created` - Occurs whenever an Entity is created.
- `entity.updated` - Occurs whenever an Entity is updated.
- `event_subscription.created` - Occurs whenever an Event Subscription is
created.
- `event_subscription.updated` - Occurs whenever an Event Subscription is
updated.
- `export.created` - Occurs whenever an Export is created.
- `export.updated` - Occurs whenever an Export is updated.
- `external_account.created` - Occurs whenever an External Account is created.
- `external_account.updated` - Occurs whenever an External Account is updated.
- `file.created` - Occurs whenever a File is created.
- `group.updated` - Occurs whenever a Group is updated.
- `group.heartbeat` - Increase may send webhooks with this category to see if a
Expand Down Expand Up @@ -379,6 +393,8 @@ async def create(
"ach_prenotification.updated",
"ach_transfer.created",
"ach_transfer.updated",
"bookkeeping_account.created",
"bookkeeping_entry_set.updated",
"card.created",
"card.updated",
"card_payment.created",
Expand All @@ -397,9 +413,12 @@ async def create(
"document.created",
"entity.created",
"entity.updated",
"event_subscription.created",
"event_subscription.updated",
"export.created",
"export.updated",
"external_account.created",
"external_account.updated",
"file.created",
"group.updated",
"group.heartbeat",
Expand Down Expand Up @@ -463,6 +482,10 @@ async def create(
updated.
- `ach_transfer.created` - Occurs whenever an ACH Transfer is created.
- `ach_transfer.updated` - Occurs whenever an ACH Transfer is updated.
- `bookkeeping_account.created` - Occurs whenever a Bookkeeping Account is
created.
- `bookkeeping_entry_set.updated` - Occurs whenever a Bookkeeping Entry Set is
created.
- `card.created` - Occurs whenever a Card is created.
- `card.updated` - Occurs whenever a Card is updated.
- `card_payment.created` - Occurs whenever a Card Payment is created.
Expand All @@ -484,9 +507,14 @@ async def create(
- `document.created` - Occurs whenever a Document is created.
- `entity.created` - Occurs whenever an Entity is created.
- `entity.updated` - Occurs whenever an Entity is updated.
- `event_subscription.created` - Occurs whenever an Event Subscription is
created.
- `event_subscription.updated` - Occurs whenever an Event Subscription is
updated.
- `export.created` - Occurs whenever an Export is created.
- `export.updated` - Occurs whenever an Export is updated.
- `external_account.created` - Occurs whenever an External Account is created.
- `external_account.updated` - Occurs whenever an External Account is updated.
- `file.created` - Occurs whenever a File is created.
- `group.updated` - Occurs whenever a Group is updated.
- `group.heartbeat` - Increase may send webhooks with this category to see if a
Expand Down
15 changes: 8 additions & 7 deletions src/increase/types/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,13 +492,14 @@ class Entity(BaseModel):
Will be present if `structure` is equal to `natural_person`.
"""

relationship: Optional[Literal["affiliated", "informational", "unaffiliated"]]
"""The relationship between your group and the entity.

- `affiliated` - The entity is controlled by your group.
- `informational` - The entity is for informational purposes only.
- `unaffiliated` - The entity is not controlled by your group, but can still
directly open accounts.
status: Literal["active", "archived", "disabled"]
"""The status of the entity.

- `active` - The entity is active.
- `archived` - The entity is archived, and can no longer be used to create
accounts.
- `disabled` - The entity is temporarily disabled and cannot be used for
financial activity.
"""

structure: Literal["corporation", "natural_person", "joint", "trust"]
Expand Down
21 changes: 18 additions & 3 deletions src/increase/types/entity_list_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

from __future__ import annotations

from typing import Union
from typing import List, Union
from datetime import datetime
from typing_extensions import Annotated, TypedDict
from typing_extensions import Literal, Annotated, TypedDict

from .._utils import PropertyInfo

__all__ = ["EntityListParams", "CreatedAt"]
__all__ = ["EntityListParams", "CreatedAt", "Status"]


class EntityListParams(TypedDict, total=False):
Expand All @@ -23,6 +23,8 @@ class EntityListParams(TypedDict, total=False):
The default (and maximum) is 100 objects.
"""

status: Status


class CreatedAt(TypedDict, total=False):
after: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
Expand All @@ -48,3 +50,16 @@ class CreatedAt(TypedDict, total=False):
Return results on or before this
[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.
"""


_StatusReservedKeywords = TypedDict(
"_StatusReservedKeywords",
{
"in": List[Literal["active", "archived", "disabled"]],
},
total=False,
)


class Status(_StatusReservedKeywords, total=False):
pass
14 changes: 14 additions & 0 deletions src/increase/types/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class Event(BaseModel):
"ach_prenotification.updated",
"ach_transfer.created",
"ach_transfer.updated",
"bookkeeping_account.created",
"bookkeeping_entry_set.updated",
"card.created",
"card.updated",
"card_payment.created",
Expand All @@ -48,9 +50,12 @@ class Event(BaseModel):
"document.created",
"entity.created",
"entity.updated",
"event_subscription.created",
"event_subscription.updated",
"export.created",
"export.updated",
"external_account.created",
"external_account.updated",
"file.created",
"group.updated",
"group.heartbeat",
Expand Down Expand Up @@ -100,6 +105,10 @@ class Event(BaseModel):
updated.
- `ach_transfer.created` - Occurs whenever an ACH Transfer is created.
- `ach_transfer.updated` - Occurs whenever an ACH Transfer is updated.
- `bookkeeping_account.created` - Occurs whenever a Bookkeeping Account is
created.
- `bookkeeping_entry_set.updated` - Occurs whenever a Bookkeeping Entry Set is
created.
- `card.created` - Occurs whenever a Card is created.
- `card.updated` - Occurs whenever a Card is updated.
- `card_payment.created` - Occurs whenever a Card Payment is created.
Expand All @@ -121,9 +130,14 @@ class Event(BaseModel):
- `document.created` - Occurs whenever a Document is created.
- `entity.created` - Occurs whenever an Entity is created.
- `entity.updated` - Occurs whenever an Entity is updated.
- `event_subscription.created` - Occurs whenever an Event Subscription is
created.
- `event_subscription.updated` - Occurs whenever an Event Subscription is
updated.
- `export.created` - Occurs whenever an Export is created.
- `export.updated` - Occurs whenever an Export is updated.
- `external_account.created` - Occurs whenever an External Account is created.
- `external_account.updated` - Occurs whenever an External Account is updated.
- `file.created` - Occurs whenever a File is created.
- `group.updated` - Occurs whenever a Group is updated.
- `group.heartbeat` - Increase may send webhooks with this category to see if a
Expand Down
5 changes: 5 additions & 0 deletions src/increase/types/event_list_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class EventListParams(TypedDict, total=False):
"ach_prenotification.updated",
"ach_transfer.created",
"ach_transfer.updated",
"bookkeeping_account.created",
"bookkeeping_entry_set.updated",
"card.created",
"card.updated",
"card_payment.created",
Expand All @@ -63,9 +65,12 @@ class EventListParams(TypedDict, total=False):
"document.created",
"entity.created",
"entity.updated",
"event_subscription.created",
"event_subscription.updated",
"export.created",
"export.updated",
"external_account.created",
"external_account.updated",
"file.created",
"group.updated",
"group.heartbeat",
Expand Down
Loading