Skip to content

Commit

Permalink
Release 1.6.22
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Sep 7, 2024
1 parent 2b3b661 commit 502a44e
Show file tree
Hide file tree
Showing 11 changed files with 109 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 = "flagright"
version = "1.6.21"
version = "1.6.22"
description = ""
readme = "README.md"
authors = []
Expand Down
4 changes: 4 additions & 0 deletions src/flagright/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
Date,
DeviceData,
EmailId,
EmploymentDetails,
EmploymentStatus,
ExecutedRuleVars,
ExecutedRulesResult,
Expand All @@ -89,6 +90,7 @@
ListMetadata,
ListSubtype,
ListType,
MartialStatus,
MccDetails,
MpesaDetails,
MpesaPaymentMethod,
Expand Down Expand Up @@ -346,6 +348,7 @@
"Date",
"DeviceData",
"EmailId",
"EmploymentDetails",
"EmploymentStatus",
"ExecutedRuleVars",
"ExecutedRulesResult",
Expand All @@ -371,6 +374,7 @@
"ListMetadata",
"ListSubtype",
"ListType",
"MartialStatus",
"MccDetails",
"MpesaDetails",
"MpesaPaymentMethod",
Expand Down
2 changes: 1 addition & 1 deletion src/flagright/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": "flagright",
"X-Fern-SDK-Version": "1.6.21",
"X-Fern-SDK-Version": "1.6.22",
}
headers["x-api-key"] = self.api_key
return headers
Expand Down
11 changes: 11 additions & 0 deletions src/flagright/resources/consumer_users/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from ...types.api_error_response import ApiErrorResponse
from ...types.consumer_user_segment import ConsumerUserSegment
from ...types.contact_details import ContactDetails
from ...types.employment_details import EmploymentDetails
from ...types.employment_status import EmploymentStatus
from ...types.expected_income import ExpectedIncome
from ...types.kyc_status_details import KycStatusDetails
Expand Down Expand Up @@ -56,6 +57,7 @@ def create(
occupation: typing.Optional[str] = OMIT,
legal_documents: typing.Optional[typing.List[LegalDocument]] = OMIT,
contact_details: typing.Optional[ContactDetails] = OMIT,
employment_details: typing.Optional[EmploymentDetails] = OMIT,
transaction_limits: typing.Optional[TransactionLimits] = OMIT,
expected_income: typing.Optional[ExpectedIncome] = OMIT,
risk_level: typing.Optional[RiskLevel] = OMIT,
Expand Down Expand Up @@ -103,6 +105,8 @@ def create(
- contact_details: typing.Optional[ContactDetails].
- employment_details: typing.Optional[EmploymentDetails].
- transaction_limits: typing.Optional[TransactionLimits].
- expected_income: typing.Optional[ExpectedIncome].
Expand Down Expand Up @@ -212,6 +216,8 @@ def create(
_request["legalDocuments"] = legal_documents
if contact_details is not OMIT:
_request["contactDetails"] = contact_details
if employment_details is not OMIT:
_request["employmentDetails"] = employment_details
if transaction_limits is not OMIT:
_request["transactionLimits"] = transaction_limits
if expected_income is not OMIT:
Expand Down Expand Up @@ -313,6 +319,7 @@ async def create(
occupation: typing.Optional[str] = OMIT,
legal_documents: typing.Optional[typing.List[LegalDocument]] = OMIT,
contact_details: typing.Optional[ContactDetails] = OMIT,
employment_details: typing.Optional[EmploymentDetails] = OMIT,
transaction_limits: typing.Optional[TransactionLimits] = OMIT,
expected_income: typing.Optional[ExpectedIncome] = OMIT,
risk_level: typing.Optional[RiskLevel] = OMIT,
Expand Down Expand Up @@ -360,6 +367,8 @@ async def create(
- contact_details: typing.Optional[ContactDetails].
- employment_details: typing.Optional[EmploymentDetails].
- transaction_limits: typing.Optional[TransactionLimits].
- expected_income: typing.Optional[ExpectedIncome].
Expand Down Expand Up @@ -469,6 +478,8 @@ async def create(
_request["legalDocuments"] = legal_documents
if contact_details is not OMIT:
_request["contactDetails"] = contact_details
if employment_details is not OMIT:
_request["employmentDetails"] = employment_details
if transaction_limits is not OMIT:
_request["transactionLimits"] = transaction_limits
if expected_income is not OMIT:
Expand Down
4 changes: 4 additions & 0 deletions src/flagright/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
from .date import Date
from .device_data import DeviceData
from .email_id import EmailId
from .employment_details import EmploymentDetails
from .employment_status import EmploymentStatus
from .executed_rule_vars import ExecutedRuleVars
from .executed_rules_result import ExecutedRulesResult
Expand All @@ -92,6 +93,7 @@
from .list_metadata import ListMetadata
from .list_subtype import ListSubtype
from .list_type import ListType
from .martial_status import MartialStatus
from .mcc_details import MccDetails
from .mpesa_details import MpesaDetails
from .mpesa_payment_method import MpesaPaymentMethod
Expand Down Expand Up @@ -318,6 +320,7 @@
"Date",
"DeviceData",
"EmailId",
"EmploymentDetails",
"EmploymentStatus",
"ExecutedRuleVars",
"ExecutedRulesResult",
Expand All @@ -342,6 +345,7 @@
"ListMetadata",
"ListSubtype",
"ListType",
"MartialStatus",
"MccDetails",
"MpesaDetails",
"MpesaPaymentMethod",
Expand Down
3 changes: 3 additions & 0 deletions src/flagright/types/address.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class Address(pydantic.BaseModel):
city: str = pydantic.Field(description="City of the user's residence address")
state: typing.Optional[str] = pydantic.Field(description="State of the user's residence address")
country: str = pydantic.Field(description="User's country of residence")
address_type: typing.Optional[str] = pydantic.Field(
alias="addressType", description="Type of the address (ex - Residential, Postal, etc.)"
)
tags: typing.Optional[typing.List[Tag]] = pydantic.Field(
description="Additional information that can be added via tags"
)
Expand Down
39 changes: 39 additions & 0 deletions src/flagright/types/employment_details.py
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

from ..core.datetime_utils import serialize_datetime

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


class EmploymentDetails(pydantic.BaseModel):
"""
Details of User's employment
"""

employment_sector: typing.Optional[str] = pydantic.Field(
alias="employmentSector", description="Sector of employment"
)
employer_name: typing.Optional[str] = pydantic.Field(alias="employerName", description="Name of the employer")
business_industry: typing.Optional[typing.List[str]] = pydantic.Field(
alias="businessIndustry", description="The industry in which the business operates for a business customer"
)

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}
37 changes: 37 additions & 0 deletions src/flagright/types/martial_status.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This file was auto-generated by Fern from our API Definition.

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class MartialStatus(str, enum.Enum):
"""
Martial status of the individual
"""

DIVORCED = "DIVORCED"
MARRIED = "MARRIED"
SINGLE = "SINGLE"
WIDOWED = "WIDOWED"
NA = "NA"

def visit(
self,
divorced: typing.Callable[[], T_Result],
married: typing.Callable[[], T_Result],
single: typing.Callable[[], T_Result],
widowed: typing.Callable[[], T_Result],
na: typing.Callable[[], T_Result],
) -> T_Result:
if self is MartialStatus.DIVORCED:
return divorced()
if self is MartialStatus.MARRIED:
return married()
if self is MartialStatus.SINGLE:
return single()
if self is MartialStatus.WIDOWED:
return widowed()
if self is MartialStatus.NA:
return na()
5 changes: 5 additions & 0 deletions src/flagright/types/user_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from .consumer_name import ConsumerName
from .country_code import CountryCode
from .gender import Gender
from .martial_status import MartialStatus
from .place_of_birth import PlaceOfBirth

try:
Expand All @@ -24,9 +25,13 @@ class UserDetails(pydantic.BaseModel):
date_of_birth: typing.Optional[str] = pydantic.Field(
alias="dateOfBirth", description="Date of birth of the user (YYYY-MM-DD)"
)
user_category: typing.Optional[str] = pydantic.Field(
alias="userCategory", description="Internal category of the user"
)
country_of_residence: typing.Optional[CountryCode] = pydantic.Field(alias="countryOfResidence")
country_of_nationality: typing.Optional[CountryCode] = pydantic.Field(alias="countryOfNationality")
gender: typing.Optional[Gender]
martial_status: typing.Optional[MartialStatus] = pydantic.Field(alias="martialStatus")
place_of_birth: typing.Optional[PlaceOfBirth] = pydantic.Field(alias="placeOfBirth")

def json(self, **kwargs: typing.Any) -> str:
Expand Down
2 changes: 2 additions & 0 deletions src/flagright/types/user_optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from .acquisition_channel import AcquisitionChannel
from .consumer_user_segment import ConsumerUserSegment
from .contact_details import ContactDetails
from .employment_details import EmploymentDetails
from .employment_status import EmploymentStatus
from .expected_income import ExpectedIncome
from .kyc_status_details import KycStatusDetails
Expand Down Expand Up @@ -44,6 +45,7 @@ class UserOptional(pydantic.BaseModel):
alias="legalDocuments", description="User's legal identity documents - See Document Model for details"
)
contact_details: typing.Optional[ContactDetails] = pydantic.Field(alias="contactDetails")
employment_details: typing.Optional[EmploymentDetails] = pydantic.Field(alias="employmentDetails")
transaction_limits: typing.Optional[TransactionLimits] = pydantic.Field(alias="transactionLimits")
expected_income: typing.Optional[ExpectedIncome] = pydantic.Field(alias="expectedIncome")
risk_level: typing.Optional[RiskLevel] = pydantic.Field(alias="riskLevel")
Expand Down
2 changes: 2 additions & 0 deletions src/flagright/types/user_with_rules_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from .acquisition_channel import AcquisitionChannel
from .consumer_user_segment import ConsumerUserSegment
from .contact_details import ContactDetails
from .employment_details import EmploymentDetails
from .employment_status import EmploymentStatus
from .executed_rules_result import ExecutedRulesResult
from .expected_income import ExpectedIncome
Expand Down Expand Up @@ -45,6 +46,7 @@ class UserWithRulesResult(pydantic.BaseModel):
alias="legalDocuments", description="User's legal identity documents - See Document Model for details"
)
contact_details: typing.Optional[ContactDetails] = pydantic.Field(alias="contactDetails")
employment_details: typing.Optional[EmploymentDetails] = pydantic.Field(alias="employmentDetails")
transaction_limits: typing.Optional[TransactionLimits] = pydantic.Field(alias="transactionLimits")
expected_income: typing.Optional[ExpectedIncome] = pydantic.Field(alias="expectedIncome")
risk_level: typing.Optional[RiskLevel] = pydantic.Field(alias="riskLevel")
Expand Down

0 comments on commit 502a44e

Please sign in to comment.