Skip to content

Commit

Permalink
Release 0.5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Aug 25, 2024
1 parent 0ab38ce commit 304fafd
Show file tree
Hide file tree
Showing 16 changed files with 831 additions and 27 deletions.
14 changes: 7 additions & 7 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.4"
version = "0.5.5"
description = ""
readme = "README.md"
authors = []
Expand Down
195 changes: 193 additions & 2 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,14 @@ client.entity_group.get(
<dl>
<dd>

**entity_metadata:** `typing.Optional[bool]` — If true, will return simple key/value metadata for entities in the group. For more complex metadata, use the Metadata API.

</dd>
</dl>

<dl>
<dd>

**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.

</dd>
Expand Down Expand Up @@ -379,6 +387,90 @@ client.entity_group.delete(
</dl>


</dd>
</dl>
</details>

<details><summary><code>client.entity_group.<a href="src/mercoa/entity_group/client.py">get_token</a>(...)</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

Generate a JWT token for an entity group with the given options. This token can be used to authenticate to any entity in the entity group in the Mercoa API and iFrame.

<Warning>We recommend using [this endpoint](/api-reference/entity-group/user/get-token). This will enable features such as approvals and comments.</Warning>
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```python
from mercoa import Mercoa
from mercoa.entity_types import TokenGenerationOptions

client = Mercoa(
token="YOUR_TOKEN",
)
client.entity_group.get_token(
entity_group_id="entg_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
request=TokenGenerationOptions(
expires_in="1h",
),
)

```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**entity_group_id:** `EntityGroupId` — Entity Group ID or Entity Group ForeignID

</dd>
</dl>

<dl>
<dd>

**request:** `TokenGenerationOptions`

</dd>
</dl>

<dl>
<dd>

**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>
Expand Down Expand Up @@ -860,6 +952,97 @@ client.entity_group.user.delete(
</dl>


</dd>
</dl>
</details>

<details><summary><code>client.entity_group.user.<a href="src/mercoa/entity_group/user/client.py">get_token</a>(...)</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

Generate a JWT token for an entity group with the given options. This token can be used to authenticate to any entity in the entity group as the user in the Mercoa API and iFrame.
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```python
from mercoa import Mercoa
from mercoa.entity_types import TokenGenerationOptions

client = Mercoa(
token="YOUR_TOKEN",
)
client.entity_group.user.get_token(
entity_group_id="entg_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
foreign_id="MY-DB-ID-12345",
request=TokenGenerationOptions(
expires_in="1h",
),
)

```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**entity_group_id:** `EntityGroupId` — Entity Group ID or Entity Group ForeignID

</dd>
</dl>

<dl>
<dd>

**foreign_id:** `str` — ID used to identify user in your system

</dd>
</dl>

<dl>
<dd>

**request:** `TokenGenerationOptions`

</dd>
</dl>

<dl>
<dd>

**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>
Expand Down Expand Up @@ -1126,6 +1309,14 @@ client.entity.get(
<dl>
<dd>

**metadata:** `typing.Optional[bool]` — If true, will return simple key/value metadata for the entity. For more complex metadata, use the Metadata API.

</dd>
</dl>

<dl>
<dd>

**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.

</dd>
Expand Down Expand Up @@ -5143,7 +5334,7 @@ client.entity.counterparty.find_payees(
<dl>
<dd>

**counterparty_id:** `typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]]` — Filter by counterparty ids
**counterparty_id:** `typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]]` — Filter by counterparty ids (Foreign ID is supported)

</dd>
</dl>
Expand Down Expand Up @@ -5276,7 +5467,7 @@ client.entity.counterparty.find_payors(
<dl>
<dd>

**counterparty_id:** `typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]]` — Filter by counterparty ids
**counterparty_id:** `typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]]` — Filter by counterparty ids (Foreign ID is supported)

</dd>
</dl>
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.4",
"X-Fern-SDK-Version": "0.5.5",
}
headers["Authorization"] = f"Bearer {self._get_token()}"
return headers
Expand Down
26 changes: 24 additions & 2 deletions src/mercoa/entity/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,13 +394,22 @@ def create(
)
raise ApiError(status_code=_response.status_code, body=_response_json)

def get(self, entity_id: EntityId, *, request_options: typing.Optional[RequestOptions] = None) -> EntityResponse:
def get(
self,
entity_id: EntityId,
*,
metadata: typing.Optional[bool] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> EntityResponse:
"""
Parameters
----------
entity_id : EntityId
Entity ID or Entity ForeignID
metadata : typing.Optional[bool]
If true, will return simple key/value metadata for the entity. For more complex metadata, use the Metadata API.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand All @@ -422,6 +431,9 @@ def get(self, entity_id: EntityId, *, request_options: typing.Optional[RequestOp
_response = self._client_wrapper.httpx_client.request(
f"entity/{jsonable_encoder(entity_id)}",
method="GET",
params={
"metadata": metadata,
},
request_options=request_options,
)
try:
Expand Down Expand Up @@ -1910,14 +1922,21 @@ async def main() -> None:
raise ApiError(status_code=_response.status_code, body=_response_json)

async def get(
self, entity_id: EntityId, *, request_options: typing.Optional[RequestOptions] = None
self,
entity_id: EntityId,
*,
metadata: typing.Optional[bool] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> EntityResponse:
"""
Parameters
----------
entity_id : EntityId
Entity ID or Entity ForeignID
metadata : typing.Optional[bool]
If true, will return simple key/value metadata for the entity. For more complex metadata, use the Metadata API.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Expand Down Expand Up @@ -1947,6 +1966,9 @@ async def main() -> None:
_response = await self._client_wrapper.httpx_client.request(
f"entity/{jsonable_encoder(entity_id)}",
method="GET",
params={
"metadata": metadata,
},
request_options=request_options,
)
try:
Expand Down
8 changes: 4 additions & 4 deletions src/mercoa/entity/counterparty/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def find_payees(
If true, will include counterparty invoice metrics as part of the response
counterparty_id : typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]]
Filter by counterparty ids
Filter by counterparty ids (Foreign ID is supported)
limit : typing.Optional[int]
Number of counterparties to return. Limit can range between 1 and 100, and the default is 10.
Expand Down Expand Up @@ -231,7 +231,7 @@ def find_payors(
If true, will include counterparty invoice metrics as part of the response
counterparty_id : typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]]
Filter by counterparty ids
Filter by counterparty ids (Foreign ID is supported)
limit : typing.Optional[int]
Number of counterparties to return. Limit can range between 1 and 100, and the default is 10.
Expand Down Expand Up @@ -932,7 +932,7 @@ async def find_payees(
If true, will include counterparty invoice metrics as part of the response
counterparty_id : typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]]
Filter by counterparty ids
Filter by counterparty ids (Foreign ID is supported)
limit : typing.Optional[int]
Number of counterparties to return. Limit can range between 1 and 100, and the default is 10.
Expand Down Expand Up @@ -1104,7 +1104,7 @@ async def find_payors(
If true, will include counterparty invoice metrics as part of the response
counterparty_id : typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]]
Filter by counterparty ids
Filter by counterparty ids (Foreign ID is supported)
limit : typing.Optional[int]
Number of counterparties to return. Limit can range between 1 and 100, and the default is 10.
Expand Down
Loading

0 comments on commit 304fafd

Please sign in to comment.