Skip to content

Commit

Permalink
Release 0.5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Sep 3, 2024
1 parent 7669012 commit 52d6ceb
Show file tree
Hide file tree
Showing 24 changed files with 137 additions and 16 deletions.
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 = "mercoa"
version = "0.5.6"
version = "0.5.7"
description = ""
readme = "README.md"
authors = []
Expand Down
6 changes: 3 additions & 3 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -8700,15 +8700,15 @@ from mercoa.commons import (
IndividualGovernmentId,
PhoneNumber,
)
from mercoa.entity_types import RepresentativeRequest, Responsibilities
from mercoa.entity_types import RepresentativeUpdateRequest, Responsibilities

client = Mercoa(
token="YOUR_TOKEN",
)
client.entity.representative.update(
entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
representative_id="rep_7df2974a-4069-454c-912f-7e58ebe030fb",
request=RepresentativeRequest(
request=RepresentativeUpdateRequest(
name=FullName(
first_name="John",
middle_name="Quincy",
Expand Down Expand Up @@ -8774,7 +8774,7 @@ client.entity.representative.update(
<dl>
<dd>

**request:** `RepresentativeRequest`
**request:** `RepresentativeUpdateRequest`

</dd>
</dl>
Expand Down
4 changes: 4 additions & 0 deletions src/mercoa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
RepresentativeId,
RepresentativeRequest,
RepresentativeResponse,
RepresentativeUpdateRequest,
Responsibilities,
Rule,
Rule_Approver,
Expand Down Expand Up @@ -156,6 +157,7 @@
InvoiceFeesRequest,
InvoiceFeesResponse,
InvoiceId,
InvoiceLineItemCategory,
InvoiceLineItemCreationRequest,
InvoiceLineItemId,
InvoiceLineItemIndividualUpdateRequest,
Expand Down Expand Up @@ -446,6 +448,7 @@
"InvoiceFeesRequest",
"InvoiceFeesResponse",
"InvoiceId",
"InvoiceLineItemCategory",
"InvoiceLineItemCreationRequest",
"InvoiceLineItemId",
"InvoiceLineItemIndividualUpdateRequest",
Expand Down Expand Up @@ -559,6 +562,7 @@
"RepresentativeId",
"RepresentativeRequest",
"RepresentativeResponse",
"RepresentativeUpdateRequest",
"Responsibilities",
"Rule",
"Rule_Approver",
Expand Down
2 changes: 1 addition & 1 deletion src/mercoa/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_headers(self) -> typing.Dict[str, str]:
headers: typing.Dict[str, str] = {
"X-Fern-Language": "Python",
"X-Fern-SDK-Name": "mercoa",
"X-Fern-SDK-Version": "0.5.6",
"X-Fern-SDK-Version": "0.5.7",
}
headers["Authorization"] = f"Bearer {self._get_token()}"
return headers
Expand Down
17 changes: 9 additions & 8 deletions src/mercoa/entity/representative/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from ...commons.errors.unimplemented import Unimplemented
from ...entity_types.types.representative_request import RepresentativeRequest
from ...entity_types.types.representative_id import RepresentativeId
from ...entity_types.types.representative_update_request import RepresentativeUpdateRequest
from ...core.client_wrapper import AsyncClientWrapper

# this is used as the default value for optional parameters
Expand Down Expand Up @@ -443,7 +444,7 @@ def update(
entity_id: EntityId,
representative_id: RepresentativeId,
*,
request: RepresentativeRequest,
request: RepresentativeUpdateRequest,
request_options: typing.Optional[RequestOptions] = None,
) -> RepresentativeResponse:
"""
Expand All @@ -454,7 +455,7 @@ def update(
representative_id : RepresentativeId
request : RepresentativeRequest
request : RepresentativeUpdateRequest
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand All @@ -473,15 +474,15 @@ def update(
IndividualGovernmentId,
PhoneNumber,
)
from mercoa.entity_types import RepresentativeRequest, Responsibilities
from mercoa.entity_types import RepresentativeUpdateRequest, Responsibilities
client = Mercoa(
token="YOUR_TOKEN",
)
client.entity.representative.update(
entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
representative_id="rep_7df2974a-4069-454c-912f-7e58ebe030fb",
request=RepresentativeRequest(
request=RepresentativeUpdateRequest(
name=FullName(
first_name="John",
middle_name="Quincy",
Expand Down Expand Up @@ -1171,7 +1172,7 @@ async def update(
entity_id: EntityId,
representative_id: RepresentativeId,
*,
request: RepresentativeRequest,
request: RepresentativeUpdateRequest,
request_options: typing.Optional[RequestOptions] = None,
) -> RepresentativeResponse:
"""
Expand All @@ -1182,7 +1183,7 @@ async def update(
representative_id : RepresentativeId
request : RepresentativeRequest
request : RepresentativeUpdateRequest
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand All @@ -1203,7 +1204,7 @@ async def update(
IndividualGovernmentId,
PhoneNumber,
)
from mercoa.entity_types import RepresentativeRequest, Responsibilities
from mercoa.entity_types import RepresentativeUpdateRequest, Responsibilities
client = AsyncMercoa(
token="YOUR_TOKEN",
Expand All @@ -1214,7 +1215,7 @@ async def main() -> None:
await client.entity.representative.update(
entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
representative_id="rep_7df2974a-4069-454c-912f-7e58ebe030fb",
request=RepresentativeRequest(
request=RepresentativeUpdateRequest(
name=FullName(
first_name="John",
middle_name="Quincy",
Expand Down
2 changes: 2 additions & 0 deletions src/mercoa/entity_types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
RepresentativeId,
RepresentativeRequest,
RepresentativeResponse,
RepresentativeUpdateRequest,
Responsibilities,
Rule,
Rule_Approver,
Expand Down Expand Up @@ -142,6 +143,7 @@
"RepresentativeId",
"RepresentativeRequest",
"RepresentativeResponse",
"RepresentativeUpdateRequest",
"Responsibilities",
"Rule",
"Rule_Approver",
Expand Down
2 changes: 2 additions & 0 deletions src/mercoa/entity_types/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
from .representative_id import RepresentativeId
from .representative_request import RepresentativeRequest
from .representative_response import RepresentativeResponse
from .representative_update_request import RepresentativeUpdateRequest
from .responsibilities import Responsibilities
from .rule import Rule, Rule_Approver
from .tax_id import TaxId
Expand Down Expand Up @@ -134,6 +135,7 @@
"RepresentativeId",
"RepresentativeRequest",
"RepresentativeResponse",
"RepresentativeUpdateRequest",
"Responsibilities",
"Rule",
"Rule_Approver",
Expand Down
79 changes: 79 additions & 0 deletions src/mercoa/entity_types/types/representative_update_request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# This file was auto-generated by Fern from our API Definition.

from ...core.pydantic_utilities import UniversalBaseModel
import typing
from ...commons.types.full_name import FullName
from ...commons.types.phone_number import PhoneNumber
from ...commons.types.address import Address
from ...commons.types.birth_date import BirthDate
import pydantic
from ...commons.types.individual_government_id import IndividualGovernmentId
from .responsibilities import Responsibilities
from ...core.pydantic_utilities import IS_PYDANTIC_V2


class RepresentativeUpdateRequest(UniversalBaseModel):
"""
Examples
--------
from mercoa.commons import (
Address,
BirthDate,
FullName,
IndividualGovernmentId,
PhoneNumber,
)
from mercoa.entity_types import RepresentativeUpdateRequest, Responsibilities
RepresentativeUpdateRequest(
name=FullName(
first_name="John",
middle_name="Quincy",
last_name="Adams",
suffix="Jr.",
),
phone=PhoneNumber(
country_code="1",
number="4155551234",
),
email="john.doe@acme.com",
address=Address(
address_line_1="123 Main St",
address_line_2="Unit 1",
city="San Francisco",
state_or_province="CA",
postal_code="94105",
country="US",
),
birth_date=BirthDate(
day="1",
month="1",
year="1980",
),
government_id=IndividualGovernmentId(
ssn="123-45-6789",
),
responsibilities=Responsibilities(
is_owner=True,
ownership_percentage=40,
is_controller=True,
),
)
"""

name: typing.Optional[FullName] = None
phone: typing.Optional[PhoneNumber] = None
email: typing.Optional[str] = None
address: typing.Optional[Address] = None
birth_date: typing.Optional[BirthDate] = pydantic.Field(alias="birthDate", default=None)
government_id: typing.Optional[IndividualGovernmentId] = pydantic.Field(alias="governmentID", default=None)
responsibilities: typing.Optional[Responsibilities] = None

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:

class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
4 changes: 4 additions & 0 deletions src/mercoa/invoice/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ def create(
name="Product A",
quantity=1.0,
unit_price=100.0,
category="EXPENSE",
service_start_date=datetime.datetime.fromisoformat(
"2021-01-01 00:00:00+00:00",
),
Expand Down Expand Up @@ -617,6 +618,7 @@ def update(
name="Product A",
quantity=1.0,
unit_price=100.0,
category="EXPENSE",
service_start_date=datetime.datetime.fromisoformat(
"2021-01-01 00:00:00+00:00",
),
Expand Down Expand Up @@ -1131,6 +1133,7 @@ async def main() -> None:
name="Product A",
quantity=1.0,
unit_price=100.0,
category="EXPENSE",
service_start_date=datetime.datetime.fromisoformat(
"2021-01-01 00:00:00+00:00",
),
Expand Down Expand Up @@ -1436,6 +1439,7 @@ async def main() -> None:
name="Product A",
quantity=1.0,
unit_price=100.0,
category="EXPENSE",
service_start_date=datetime.datetime.fromisoformat(
"2021-01-01 00:00:00+00:00",
),
Expand Down
2 changes: 2 additions & 0 deletions src/mercoa/invoice_types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
InvoiceFeesRequest,
InvoiceFeesResponse,
InvoiceId,
InvoiceLineItemCategory,
InvoiceLineItemCreationRequest,
InvoiceLineItemId,
InvoiceLineItemIndividualUpdateRequest,
Expand Down Expand Up @@ -81,6 +82,7 @@
"InvoiceFeesRequest",
"InvoiceFeesResponse",
"InvoiceId",
"InvoiceLineItemCategory",
"InvoiceLineItemCreationRequest",
"InvoiceLineItemId",
"InvoiceLineItemIndividualUpdateRequest",
Expand Down
2 changes: 2 additions & 0 deletions src/mercoa/invoice_types/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from .invoice_fees_request import InvoiceFeesRequest
from .invoice_fees_response import InvoiceFeesResponse
from .invoice_id import InvoiceId
from .invoice_line_item_category import InvoiceLineItemCategory
from .invoice_line_item_creation_request import InvoiceLineItemCreationRequest
from .invoice_line_item_id import InvoiceLineItemId
from .invoice_line_item_individual_update_request import InvoiceLineItemIndividualUpdateRequest
Expand Down Expand Up @@ -83,6 +84,7 @@
"InvoiceFeesRequest",
"InvoiceFeesResponse",
"InvoiceId",
"InvoiceLineItemCategory",
"InvoiceLineItemCreationRequest",
"InvoiceLineItemId",
"InvoiceLineItemIndividualUpdateRequest",
Expand Down
1 change: 1 addition & 0 deletions src/mercoa/invoice_types/types/find_invoice_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ class FindInvoiceResponse(UniversalBaseModel):
name="Product A",
quantity=1.0,
unit_price=100.0,
category="EXPENSE",
service_start_date=datetime.datetime.fromisoformat(
"2021-01-01 00:00:00+00:00",
),
Expand Down
1 change: 1 addition & 0 deletions src/mercoa/invoice_types/types/invoice_creation_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class InvoiceCreationRequest(InvoiceRequestBase):
name="Product A",
quantity=1.0,
unit_price=100.0,
category="EXPENSE",
service_start_date=datetime.datetime.fromisoformat(
"2021-01-01 00:00:00+00:00",
),
Expand Down
7 changes: 7 additions & 0 deletions src/mercoa/invoice_types/types/invoice_line_item_category.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was auto-generated by Fern from our API Definition.

import typing

InvoiceLineItemCategory = typing.Union[
typing.Literal["EXPENSE", "REVENUE", "TAX", "SHIPPING", "DISCOUNT", "OTHER"], typing.Any
]
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class InvoiceLineItemCreationRequest(InvoiceLineItemRequestBase):
name="Product A",
quantity=1.0,
unit_price=100.0,
category="EXPENSE",
service_start_date=datetime.datetime.fromisoformat(
"2021-01-01 00:00:00+00:00",
),
Expand Down
Loading

0 comments on commit 52d6ceb

Please sign in to comment.