Skip to content

Commit

Permalink
Release 2.1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed May 16, 2024
1 parent 44d00f1 commit 444f024
Show file tree
Hide file tree
Showing 12 changed files with 195 additions and 2 deletions.
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 = "vital"
version = "2.1.9"
version = "2.1.10"
description = ""
readme = "README.md"
authors = []
Expand Down
10 changes: 10 additions & 0 deletions src/vital/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
from .types import (
ActivityV2InDb,
Address,
Answer,
AoE,
AoEAnswer,
AppointmentAvailabilitySlots,
AppointmentEventStatus,
AppointmentProvider,
Expand Down Expand Up @@ -208,6 +211,8 @@
ProviderMfaRequest,
ProviderMfaRequestMethod,
Providers,
Question,
QuestionType,
RawActivity,
RawBody,
RawDevices,
Expand Down Expand Up @@ -271,6 +276,9 @@
__all__ = [
"ActivityV2InDb",
"Address",
"Answer",
"AoE",
"AoEAnswer",
"AppointmentAvailabilitySlots",
"AppointmentEventStatus",
"AppointmentProvider",
Expand Down Expand Up @@ -477,6 +485,8 @@
"ProviderMfaRequest",
"ProviderMfaRequestMethod",
"Providers",
"Question",
"QuestionType",
"RawActivity",
"RawBody",
"RawDevices",
Expand Down
2 changes: 1 addition & 1 deletion src/vital/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def get_headers(self) -> typing.Dict[str, str]:
headers: typing.Dict[str, str] = {
"X-Fern-Language": "Python",
"X-Fern-SDK-Name": "vital",
"X-Fern-SDK-Version": "2.1.9",
"X-Fern-SDK-Version": "2.1.10",
}
headers["x-vital-api-key"] = self.api_key
return headers
Expand Down
11 changes: 11 additions & 0 deletions src/vital/resources/lab_tests/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from ...core.jsonable_encoder import jsonable_encoder
from ...core.remove_none_from_dict import remove_none_from_dict
from ...errors.unprocessable_entity_error import UnprocessableEntityError
from ...types.ao_e_answer import AoEAnswer
from ...types.appointment_availability_slots import AppointmentAvailabilitySlots
from ...types.appointment_provider import AppointmentProvider
from ...types.area_info import AreaInfo
Expand Down Expand Up @@ -785,6 +786,7 @@ def create_order(
priority: typing.Optional[bool] = OMIT,
consents: typing.Optional[typing.List[Consent]] = OMIT,
activate_by: typing.Optional[str] = OMIT,
aoe_answers: typing.Optional[typing.List[AoEAnswer]] = OMIT,
patient_details: PatientDetails,
patient_address: PatientAddressCompatible,
) -> PostOrderResponse:
Expand All @@ -806,6 +808,8 @@ def create_order(
- activate_by: typing.Optional[str]. Schedule an Order to be processed in a future date.
- aoe_answers: typing.Optional[typing.List[AoEAnswer]].
- patient_details: PatientDetails.
- patient_address: PatientAddressCompatible.
Expand All @@ -826,6 +830,8 @@ def create_order(
_request["consents"] = consents
if activate_by is not OMIT:
_request["activate_by"] = activate_by
if aoe_answers is not OMIT:
_request["aoe_answers"] = aoe_answers
_response = self._client_wrapper.httpx_client.request(
"POST",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "v3/order"),
Expand Down Expand Up @@ -1711,6 +1717,7 @@ async def create_order(
priority: typing.Optional[bool] = OMIT,
consents: typing.Optional[typing.List[Consent]] = OMIT,
activate_by: typing.Optional[str] = OMIT,
aoe_answers: typing.Optional[typing.List[AoEAnswer]] = OMIT,
patient_details: PatientDetails,
patient_address: PatientAddressCompatible,
) -> PostOrderResponse:
Expand All @@ -1732,6 +1739,8 @@ async def create_order(
- activate_by: typing.Optional[str]. Schedule an Order to be processed in a future date.
- aoe_answers: typing.Optional[typing.List[AoEAnswer]].
- patient_details: PatientDetails.
- patient_address: PatientAddressCompatible.
Expand All @@ -1752,6 +1761,8 @@ async def create_order(
_request["consents"] = consents
if activate_by is not OMIT:
_request["activate_by"] = activate_by
if aoe_answers is not OMIT:
_request["aoe_answers"] = aoe_answers
_response = await self._client_wrapper.httpx_client.request(
"POST",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "v3/order"),
Expand Down
10 changes: 10 additions & 0 deletions src/vital/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

from .activity_v_2_in_db import ActivityV2InDb
from .address import Address
from .answer import Answer
from .ao_e import AoE
from .ao_e_answer import AoEAnswer
from .appointment_availability_slots import AppointmentAvailabilitySlots
from .appointment_event_status import AppointmentEventStatus
from .appointment_provider import AppointmentProvider
Expand Down Expand Up @@ -217,6 +220,8 @@
from .provider_mfa_request import ProviderMfaRequest
from .provider_mfa_request_method import ProviderMfaRequestMethod
from .providers import Providers
from .question import Question
from .question_type import QuestionType
from .raw_activity import RawActivity
from .raw_body import RawBody
from .raw_devices import RawDevices
Expand Down Expand Up @@ -259,6 +264,9 @@
__all__ = [
"ActivityV2InDb",
"Address",
"Answer",
"AoE",
"AoEAnswer",
"AppointmentAvailabilitySlots",
"AppointmentEventStatus",
"AppointmentProvider",
Expand Down Expand Up @@ -464,6 +472,8 @@
"ProviderMfaRequest",
"ProviderMfaRequestMethod",
"Providers",
"Question",
"QuestionType",
"RawActivity",
"RawBody",
"RawDevices",
Expand Down
30 changes: 30 additions & 0 deletions src/vital/types/answer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

from ..core.datetime_utils import serialize_datetime

try:
import pydantic.v1 as pydantic # type: ignore
except ImportError:
import pydantic # type: ignore


class Answer(pydantic.BaseModel):
id: int
code: str
value: str

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
json_encoders = {dt.datetime: serialize_datetime}
29 changes: 29 additions & 0 deletions src/vital/types/ao_e.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

from ..core.datetime_utils import serialize_datetime
from .question import Question

try:
import pydantic.v1 as pydantic # type: ignore
except ImportError:
import pydantic # type: ignore


class AoE(pydantic.BaseModel):
questions: typing.List[Question]

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
json_encoders = {dt.datetime: serialize_datetime}
30 changes: 30 additions & 0 deletions src/vital/types/ao_e_answer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

from ..core.datetime_utils import serialize_datetime

try:
import pydantic.v1 as pydantic # type: ignore
except ImportError:
import pydantic # type: ignore


class AoEAnswer(pydantic.BaseModel):
marker_id: int
question_id: int
answer: str

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
json_encoders = {dt.datetime: serialize_datetime}
2 changes: 2 additions & 0 deletions src/vital/types/client_facing_marker.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import typing

from ..core.datetime_utils import serialize_datetime
from .ao_e import AoE
from .marker_type import MarkerType

try:
Expand All @@ -22,6 +23,7 @@ class ClientFacingMarker(pydantic.BaseModel):
type: typing.Optional[MarkerType]
unit: typing.Optional[str]
price: typing.Optional[str]
aoe: typing.Optional[AoE]

def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
Expand Down
2 changes: 2 additions & 0 deletions src/vital/types/client_facing_marker_complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import typing

from ..core.datetime_utils import serialize_datetime
from .ao_e import AoE
from .client_facing_result import ClientFacingResult
from .marker_type import MarkerType

Expand All @@ -23,6 +24,7 @@ class ClientFacingMarkerComplete(pydantic.BaseModel):
type: typing.Optional[MarkerType]
unit: typing.Optional[str]
price: typing.Optional[str]
aoe: typing.Optional[AoE]
expected_results: typing.List[ClientFacingResult]

def json(self, **kwargs: typing.Any) -> str:
Expand Down
36 changes: 36 additions & 0 deletions src/vital/types/question.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

from ..core.datetime_utils import serialize_datetime
from .answer import Answer
from .question_type import QuestionType

try:
import pydantic.v1 as pydantic # type: ignore
except ImportError:
import pydantic # type: ignore


class Question(pydantic.BaseModel):
id: int
required: bool
code: str
value: str
type: QuestionType
sequence: int
answers: typing.List[Answer]

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
json_encoders = {dt.datetime: serialize_datetime}
33 changes: 33 additions & 0 deletions src/vital/types/question_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This file was auto-generated by Fern from our API Definition.

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class QuestionType(str, enum.Enum):
"""
An enumeration.
"""

CHOICE = "choice"
TEXT = "text"
NUMERIC = "numeric"
MULTI_CHOICE = "multi_choice"

def visit(
self,
choice: typing.Callable[[], T_Result],
text: typing.Callable[[], T_Result],
numeric: typing.Callable[[], T_Result],
multi_choice: typing.Callable[[], T_Result],
) -> T_Result:
if self is QuestionType.CHOICE:
return choice()
if self is QuestionType.TEXT:
return text()
if self is QuestionType.NUMERIC:
return numeric()
if self is QuestionType.MULTI_CHOICE:
return multi_choice()

0 comments on commit 444f024

Please sign in to comment.