-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f89daae
commit 0484716
Showing
124 changed files
with
5,306 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,6 @@ | ||
# This file was auto-generated by Fern from our API Definition. | ||
|
||
from .environment import MercoaEnvironment | ||
from .resources import ( | ||
CodeableConcept, | ||
Coding, | ||
Document, | ||
DownloadDocumentResponse, | ||
GetDocumentsResponse, | ||
QueryStatus, | ||
TriggerDocumentsQueryResponse, | ||
document, | ||
) | ||
from .resources import Address, UsState, commons, devices, medical | ||
from .environment import MetriportEnvironment | ||
|
||
__all__ = [ | ||
"CodeableConcept", | ||
"Coding", | ||
"Document", | ||
"DownloadDocumentResponse", | ||
"GetDocumentsResponse", | ||
"MercoaEnvironment", | ||
"QueryStatus", | ||
"TriggerDocumentsQueryResponse", | ||
"document", | ||
] | ||
__all__ = ["Address", "MetriportEnvironment", "UsState", "commons", "devices", "medical"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,55 @@ | ||
# This file was auto-generated by Fern from our API Definition. | ||
|
||
from backports.cached_property import cached_property | ||
|
||
from .environment import MercoaEnvironment | ||
from .resources.document.client import AsyncDocumentClient, DocumentClient | ||
|
||
|
||
class Mercoa: | ||
def __init__(self, *, environment: MercoaEnvironment = MercoaEnvironment.PRODUCTION, api_key: str): | ||
self._environment = environment | ||
self.api_key = api_key | ||
|
||
@cached_property | ||
def document(self) -> DocumentClient: | ||
return DocumentClient(environment=self._environment, api_key=self.api_key) | ||
|
||
|
||
class AsyncMercoa: | ||
def __init__(self, *, environment: MercoaEnvironment = MercoaEnvironment.PRODUCTION, api_key: str): | ||
self._environment = environment | ||
self.api_key = api_key | ||
|
||
@cached_property | ||
def document(self) -> AsyncDocumentClient: | ||
return AsyncDocumentClient(environment=self._environment, api_key=self.api_key) | ||
import typing | ||
|
||
import httpx | ||
|
||
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper | ||
from .environment import MetriportEnvironment | ||
from .resources.devices.client import AsyncDevicesClient, DevicesClient | ||
from .resources.medical.client import AsyncMedicalClient, MedicalClient | ||
|
||
|
||
class Metriport: | ||
def __init__( | ||
self, | ||
*, | ||
base_url: typing.Optional[str] = None, | ||
environment: MetriportEnvironment = MetriportEnvironment.PRODUCTION, | ||
api_key: str, | ||
timeout: typing.Optional[float] = 60 | ||
): | ||
self._client_wrapper = SyncClientWrapper( | ||
base_url=_get_base_url(base_url=base_url, environment=environment), | ||
api_key=api_key, | ||
httpx_client=httpx.Client(timeout=timeout), | ||
) | ||
self.devices = DevicesClient(client_wrapper=self._client_wrapper) | ||
self.medical = MedicalClient(client_wrapper=self._client_wrapper) | ||
|
||
|
||
class AsyncMetriport: | ||
def __init__( | ||
self, | ||
*, | ||
base_url: typing.Optional[str] = None, | ||
environment: MetriportEnvironment = MetriportEnvironment.PRODUCTION, | ||
api_key: str, | ||
timeout: typing.Optional[float] = 60 | ||
): | ||
self._client_wrapper = AsyncClientWrapper( | ||
base_url=_get_base_url(base_url=base_url, environment=environment), | ||
api_key=api_key, | ||
httpx_client=httpx.AsyncClient(timeout=timeout), | ||
) | ||
self.devices = AsyncDevicesClient(client_wrapper=self._client_wrapper) | ||
self.medical = AsyncMedicalClient(client_wrapper=self._client_wrapper) | ||
|
||
|
||
def _get_base_url(*, base_url: typing.Optional[str] = None, environment: MetriportEnvironment) -> str: | ||
if base_url is not None: | ||
return base_url | ||
elif environment is not None: | ||
return environment.value | ||
else: | ||
raise Exception("Please pass in either base_url or environment to construct the client") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
# This file was auto-generated by Fern from our API Definition. | ||
|
||
from .api_error import ApiError | ||
from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper | ||
from .datetime_utils import serialize_datetime | ||
from .jsonable_encoder import jsonable_encoder | ||
from .remove_none_from_headers import remove_none_from_headers | ||
from .remove_none_from_dict import remove_none_from_dict | ||
|
||
__all__ = ["ApiError", "jsonable_encoder", "remove_none_from_headers", "serialize_datetime"] | ||
__all__ = [ | ||
"ApiError", | ||
"AsyncClientWrapper", | ||
"BaseClientWrapper", | ||
"SyncClientWrapper", | ||
"jsonable_encoder", | ||
"remove_none_from_dict", | ||
"serialize_datetime", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# This file was auto-generated by Fern from our API Definition. | ||
|
||
import typing | ||
|
||
import httpx | ||
|
||
|
||
class BaseClientWrapper: | ||
def __init__(self, *, api_key: str, base_url: str): | ||
self.api_key = api_key | ||
self._base_url = base_url | ||
|
||
def get_headers(self) -> typing.Dict[str, str]: | ||
headers: typing.Dict[str, str] = { | ||
"X-Fern-Language": "Python", | ||
"X-Fern-SDK-Name": "fern-metriport", | ||
"X-Fern-SDK-Version": "0.1.2", | ||
} | ||
headers["X-API-Key"] = self.api_key | ||
return headers | ||
|
||
def get_base_url(self) -> str: | ||
return self._base_url | ||
|
||
|
||
class SyncClientWrapper(BaseClientWrapper): | ||
def __init__(self, *, api_key: str, base_url: str, httpx_client: httpx.Client): | ||
super().__init__(api_key=api_key, base_url=base_url) | ||
self.httpx_client = httpx_client | ||
|
||
|
||
class AsyncClientWrapper(BaseClientWrapper): | ||
def __init__(self, *, api_key: str, base_url: str, httpx_client: httpx.AsyncClient): | ||
super().__init__(api_key=api_key, base_url=base_url) | ||
self.httpx_client = httpx_client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# This file was auto-generated by Fern from our API Definition. | ||
|
||
from typing import Any, Dict, Optional | ||
|
||
|
||
def remove_none_from_dict(original: Dict[str, Optional[Any]]) -> Dict[str, Any]: | ||
new: Dict[str, Any] = {} | ||
for key, value in original.items(): | ||
if value is not None: | ||
new[key] = value | ||
return new |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,6 @@ | ||
# This file was auto-generated by Fern from our API Definition. | ||
|
||
from . import document | ||
from .document import ( | ||
CodeableConcept, | ||
Coding, | ||
Document, | ||
DownloadDocumentResponse, | ||
GetDocumentsResponse, | ||
QueryStatus, | ||
TriggerDocumentsQueryResponse, | ||
) | ||
from . import commons, devices, medical | ||
from .commons import Address, UsState | ||
|
||
__all__ = [ | ||
"CodeableConcept", | ||
"Coding", | ||
"Document", | ||
"DownloadDocumentResponse", | ||
"GetDocumentsResponse", | ||
"QueryStatus", | ||
"TriggerDocumentsQueryResponse", | ||
"document", | ||
] | ||
__all__ = ["Address", "UsState", "commons", "devices", "medical"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# This file was auto-generated by Fern from our API Definition. | ||
|
||
from .types import Address, UsState | ||
|
||
__all__ = ["Address", "UsState"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This file was auto-generated by Fern from our API Definition. | ||
|
||
from .address import Address | ||
from .us_state import UsState | ||
|
||
__all__ = ["Address", "UsState"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# 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 .us_state import UsState | ||
|
||
|
||
class Address(pydantic.BaseModel): | ||
address_line_1: str = pydantic.Field(alias="addressLine1", description="The address.") | ||
address_line_2: typing.Optional[str] = pydantic.Field( | ||
alias="addressLine2", description="The address details, for example `#4451`" | ||
) | ||
city: str = pydantic.Field(description="The city.") | ||
state: UsState = pydantic.Field(description="The 2 letter state acronym, for example `CA`") | ||
zip: str = pydantic.Field(description="Zip must be a string consisting of 5 numbers.") | ||
country: str = pydantic.Field(description="Defaults to “USA”") | ||
|
||
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 | ||
smart_union = True | ||
allow_population_by_field_name = True | ||
json_encoders = {dt.datetime: serialize_datetime} |
Oops, something went wrong.