Skip to content

Commit

Permalink
Release v0.0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed May 25, 2023
1 parent 161700c commit 47559c8
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[tool.poetry]
name = "mercoa"
version = "v0.0.10"
version = "v0.0.11"
description = ""
authors = []
packages = [
Expand All @@ -10,10 +10,10 @@ packages = [

[tool.poetry.dependencies]
python = "^3.7"
backports-cached_property = "1.0.2"
types-backports = "0.1.3"
httpx = "0.23.3"
pydantic = "^1.9.2"
types-backports = "0.1.3"
backports-cached_property = "1.0.2"

[tool.poetry.dev-dependencies]
mypy = "0.971"
Expand Down
4 changes: 4 additions & 0 deletions src/mercoa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
CustomId,
CustomPaymentMethodRequest,
CustomPaymentMethodResponse,
CustomPaymentMethodUpdateRequest,
DocumentResponse,
Ein,
EmailLogResponse,
Expand Down Expand Up @@ -83,6 +84,7 @@
PaymentMethodsRequest,
PaymentMethodsResponse,
PaymentMethodType,
PaymentMethodUpdateRequest,
PaymentRailMarkup,
PaymentRailMarkupType,
PaymentRailRequest,
Expand Down Expand Up @@ -150,6 +152,7 @@
"CustomId",
"CustomPaymentMethodRequest",
"CustomPaymentMethodResponse",
"CustomPaymentMethodUpdateRequest",
"DocumentResponse",
"Ein",
"EmailLogResponse",
Expand Down Expand Up @@ -196,6 +199,7 @@
"PaymentMethodSchemaRequest",
"PaymentMethodSchemaResponse",
"PaymentMethodType",
"PaymentMethodUpdateRequest",
"PaymentMethodsRequest",
"PaymentMethodsResponse",
"PaymentRailMarkup",
Expand Down
4 changes: 4 additions & 0 deletions src/mercoa/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,12 @@
CustomId,
CustomPaymentMethodRequest,
CustomPaymentMethodResponse,
CustomPaymentMethodUpdateRequest,
PaymentMethodId,
PaymentMethodRequest,
PaymentMethodResponse,
PaymentMethodType,
PaymentMethodUpdateRequest,
)
from .payment_method_schema import (
PaymentMethodSchemaField,
Expand Down Expand Up @@ -139,6 +141,7 @@
"CustomId",
"CustomPaymentMethodRequest",
"CustomPaymentMethodResponse",
"CustomPaymentMethodUpdateRequest",
"DocumentResponse",
"Ein",
"EmailLogResponse",
Expand Down Expand Up @@ -184,6 +187,7 @@
"PaymentMethodSchemaRequest",
"PaymentMethodSchemaResponse",
"PaymentMethodType",
"PaymentMethodUpdateRequest",
"PaymentMethodsRequest",
"PaymentMethodsResponse",
"PaymentRailMarkup",
Expand Down
4 changes: 4 additions & 0 deletions src/mercoa/resources/payment_method/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
CustomId,
CustomPaymentMethodRequest,
CustomPaymentMethodResponse,
CustomPaymentMethodUpdateRequest,
PaymentMethodId,
PaymentMethodRequest,
PaymentMethodResponse,
PaymentMethodType,
PaymentMethodUpdateRequest,
)

__all__ = [
Expand All @@ -40,8 +42,10 @@
"CustomId",
"CustomPaymentMethodRequest",
"CustomPaymentMethodResponse",
"CustomPaymentMethodUpdateRequest",
"PaymentMethodId",
"PaymentMethodRequest",
"PaymentMethodResponse",
"PaymentMethodType",
"PaymentMethodUpdateRequest",
]
5 changes: 3 additions & 2 deletions src/mercoa/resources/payment_method/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from .types.payment_method_request import PaymentMethodRequest
from .types.payment_method_response import PaymentMethodResponse
from .types.payment_method_type import PaymentMethodType
from .types.payment_method_update_request import PaymentMethodUpdateRequest


class PaymentMethodClient:
Expand Down Expand Up @@ -83,7 +84,7 @@ def get(self, entity_id: EntityId, payment_method_id: PaymentMethodId) -> Paymen
raise ApiError(status_code=_response.status_code, body=_response_json)

def update(
self, entity_id: EntityId, payment_method_id: PaymentMethodId, *, request: PaymentMethodRequest
self, entity_id: EntityId, payment_method_id: PaymentMethodId, *, request: PaymentMethodUpdateRequest
) -> PaymentMethodResponse:
_response = httpx.request(
"PUT",
Expand Down Expand Up @@ -229,7 +230,7 @@ async def get(self, entity_id: EntityId, payment_method_id: PaymentMethodId) ->
raise ApiError(status_code=_response.status_code, body=_response_json)

async def update(
self, entity_id: EntityId, payment_method_id: PaymentMethodId, *, request: PaymentMethodRequest
self, entity_id: EntityId, payment_method_id: PaymentMethodId, *, request: PaymentMethodUpdateRequest
) -> PaymentMethodResponse:
async with httpx.AsyncClient() as _client:
_response = await _client.request(
Expand Down
4 changes: 4 additions & 0 deletions src/mercoa/resources/payment_method/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
from .custom_id import CustomId
from .custom_payment_method_request import CustomPaymentMethodRequest
from .custom_payment_method_response import CustomPaymentMethodResponse
from .custom_payment_method_update_request import CustomPaymentMethodUpdateRequest
from .payment_method_id import PaymentMethodId
from .payment_method_request import PaymentMethodRequest
from .payment_method_response import PaymentMethodResponse
from .payment_method_type import PaymentMethodType
from .payment_method_update_request import PaymentMethodUpdateRequest

__all__ = [
"BankAccountId",
Expand All @@ -38,8 +40,10 @@
"CustomId",
"CustomPaymentMethodRequest",
"CustomPaymentMethodResponse",
"CustomPaymentMethodUpdateRequest",
"PaymentMethodId",
"PaymentMethodRequest",
"PaymentMethodResponse",
"PaymentMethodType",
"PaymentMethodUpdateRequest",
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

import pydantic

from ....core.datetime_utils import serialize_datetime
from ...payment_method_schema.types.payment_method_schema_id import PaymentMethodSchemaId


class CustomPaymentMethodUpdateRequest(pydantic.BaseModel):
foreign_id: typing.Optional[str] = pydantic.Field(
alias="foreignId", description=("ID for this payment method in your system\n")
)
account_name: typing.Optional[str] = pydantic.Field(alias="accountName")
account_number: typing.Optional[str] = pydantic.Field(alias="accountNumber")
schema_id: typing.Optional[PaymentMethodSchemaId] = pydantic.Field(
alias="schemaId",
description=(
"Payment method schema used for this payment method. Defines the fields that this payment method contains.\n"
),
)
data: typing.Optional[typing.Dict[str, str]] = pydantic.Field(
description=("Object of key/value pairs that matches the keys in the linked payment method schema.\n")
)

def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
return super().json(**kwargs_with_defaults)

def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
return super().dict(**kwargs_with_defaults)

class Config:
frozen = True
allow_population_by_field_name = True
json_encoders = {dt.datetime: serialize_datetime}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

import pydantic

from ....core.datetime_utils import serialize_datetime
from .custom_payment_method_update_request import CustomPaymentMethodUpdateRequest


class PaymentMethodUpdateRequest(pydantic.BaseModel):
custom: typing.Optional[CustomPaymentMethodUpdateRequest]

def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
return super().json(**kwargs_with_defaults)

def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
return super().dict(**kwargs_with_defaults)

class Config:
frozen = True
json_encoders = {dt.datetime: serialize_datetime}

0 comments on commit 47559c8

Please sign in to comment.