Skip to content

Commit

Permalink
Release 1.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Apr 23, 2024
1 parent e0eb3b7 commit da6284a
Show file tree
Hide file tree
Showing 16 changed files with 134 additions and 90 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.5.3"
version = "1.5.4"
description = ""
readme = "README.md"
authors = []
Expand Down
5 changes: 3 additions & 2 deletions src/flagright/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Address,
AlertClosedDetails,
Amount,
ApiErrorResponse,
BooleanString,
Business,
BusinessBase,
Expand Down Expand Up @@ -154,7 +155,7 @@
WebhookEventData,
WebhookEventType,
)
from .errors import BadRequestError, ForbiddenError, TooManyRequestsError, UnauthorizedError
from .errors import BadRequestError, TooManyRequestsError, UnauthorizedError
from .resources import (
BusinessUsersCreateResponse,
ConsumerUsersCreateResponse,
Expand All @@ -175,6 +176,7 @@
"Address",
"AlertClosedDetails",
"Amount",
"ApiErrorResponse",
"BadRequestError",
"BooleanString",
"Business",
Expand Down Expand Up @@ -230,7 +232,6 @@
"FailedRulesResult",
"FalsePositiveDetails",
"FlagrightEnvironment",
"ForbiddenError",
"Gender",
"GeneralBankAccountPaymentMethod",
"GenericBankAccountDetails",
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.5.3",
"X-Fern-SDK-Version": "1.5.4",
}
headers["x-api-key"] = self.api_key
return headers
Expand Down
3 changes: 1 addition & 2 deletions src/flagright/errors/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# This file was auto-generated by Fern from our API Definition.

from .bad_request_error import BadRequestError
from .forbidden_error import ForbiddenError
from .too_many_requests_error import TooManyRequestsError
from .unauthorized_error import UnauthorizedError

__all__ = ["BadRequestError", "ForbiddenError", "TooManyRequestsError", "UnauthorizedError"]
__all__ = ["BadRequestError", "TooManyRequestsError", "UnauthorizedError"]
5 changes: 2 additions & 3 deletions src/flagright/errors/bad_request_error.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# This file was auto-generated by Fern from our API Definition.

import typing

from ..core.api_error import ApiError
from ..types.api_error_response import ApiErrorResponse


class BadRequestError(ApiError):
def __init__(self, body: typing.Any):
def __init__(self, body: ApiErrorResponse):
super().__init__(status_code=400, body=body)
10 changes: 0 additions & 10 deletions src/flagright/errors/forbidden_error.py

This file was deleted.

5 changes: 2 additions & 3 deletions src/flagright/errors/too_many_requests_error.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# This file was auto-generated by Fern from our API Definition.

import typing

from ..core.api_error import ApiError
from ..types.api_error_response import ApiErrorResponse


class TooManyRequestsError(ApiError):
def __init__(self, body: typing.Any):
def __init__(self, body: ApiErrorResponse):
super().__init__(status_code=429, body=body)
5 changes: 2 additions & 3 deletions src/flagright/errors/unauthorized_error.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# This file was auto-generated by Fern from our API Definition.

import typing

from ..core.api_error import ApiError
from ..types.api_error_response import ApiErrorResponse


class UnauthorizedError(ApiError):
def __init__(self, body: typing.Any):
def __init__(self, body: ApiErrorResponse):
super().__init__(status_code=401, body=body)
25 changes: 15 additions & 10 deletions src/flagright/resources/business_user_events/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from ...errors.bad_request_error import BadRequestError
from ...errors.too_many_requests_error import TooManyRequestsError
from ...errors.unauthorized_error import UnauthorizedError
from ...types.api_error_response import ApiErrorResponse
from ...types.boolean_string import BooleanString
from ...types.business_user_event import BusinessUserEvent
from ...types.business_with_rules_result import BusinessWithRulesResult
Expand Down Expand Up @@ -81,11 +82,11 @@ def create(
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(BusinessWithRulesResult, _response.json()) # type: ignore
if _response.status_code == 400:
raise BadRequestError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise BadRequestError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 401:
raise UnauthorizedError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise UnauthorizedError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 429:
raise TooManyRequestsError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise TooManyRequestsError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
try:
_response_json = _response.json()
except JSONDecodeError:
Expand Down Expand Up @@ -118,10 +119,12 @@ def get(self, event_id: str) -> BusinessUserEvent:
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(BusinessUserEvent, _response.json()) # type: ignore
if _response.status_code == 400:
raise BadRequestError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 401:
raise UnauthorizedError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise UnauthorizedError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 429:
raise TooManyRequestsError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise TooManyRequestsError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
try:
_response_json = _response.json()
except JSONDecodeError:
Expand Down Expand Up @@ -186,11 +189,11 @@ async def create(
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(BusinessWithRulesResult, _response.json()) # type: ignore
if _response.status_code == 400:
raise BadRequestError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise BadRequestError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 401:
raise UnauthorizedError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise UnauthorizedError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 429:
raise TooManyRequestsError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise TooManyRequestsError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
try:
_response_json = _response.json()
except JSONDecodeError:
Expand Down Expand Up @@ -223,10 +226,12 @@ async def get(self, event_id: str) -> BusinessUserEvent:
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(BusinessUserEvent, _response.json()) # type: ignore
if _response.status_code == 400:
raise BadRequestError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 401:
raise UnauthorizedError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise UnauthorizedError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 429:
raise TooManyRequestsError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise TooManyRequestsError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
try:
_response_json = _response.json()
except JSONDecodeError:
Expand Down
25 changes: 15 additions & 10 deletions src/flagright/resources/business_users/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from ...errors.bad_request_error import BadRequestError
from ...errors.too_many_requests_error import TooManyRequestsError
from ...errors.unauthorized_error import UnauthorizedError
from ...types.api_error_response import ApiErrorResponse
from ...types.business import Business
from ...types.business_with_rules_result import BusinessWithRulesResult
from .types.business_users_create_response import BusinessUsersCreateResponse
Expand Down Expand Up @@ -76,11 +77,11 @@ def create(self, *, request: Business) -> BusinessUsersCreateResponse:
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(BusinessUsersCreateResponse, _response.json()) # type: ignore
if _response.status_code == 400:
raise BadRequestError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise BadRequestError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 401:
raise UnauthorizedError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise UnauthorizedError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 429:
raise TooManyRequestsError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise TooManyRequestsError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
try:
_response_json = _response.json()
except JSONDecodeError:
Expand Down Expand Up @@ -115,10 +116,12 @@ def get(self, user_id: str) -> BusinessWithRulesResult:
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(BusinessWithRulesResult, _response.json()) # type: ignore
if _response.status_code == 400:
raise BadRequestError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 401:
raise UnauthorizedError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise UnauthorizedError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 429:
raise TooManyRequestsError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise TooManyRequestsError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
try:
_response_json = _response.json()
except JSONDecodeError:
Expand Down Expand Up @@ -179,11 +182,11 @@ async def create(self, *, request: Business) -> BusinessUsersCreateResponse:
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(BusinessUsersCreateResponse, _response.json()) # type: ignore
if _response.status_code == 400:
raise BadRequestError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise BadRequestError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 401:
raise UnauthorizedError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise UnauthorizedError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 429:
raise TooManyRequestsError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise TooManyRequestsError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
try:
_response_json = _response.json()
except JSONDecodeError:
Expand Down Expand Up @@ -218,10 +221,12 @@ async def get(self, user_id: str) -> BusinessWithRulesResult:
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(BusinessWithRulesResult, _response.json()) # type: ignore
if _response.status_code == 400:
raise BadRequestError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 401:
raise UnauthorizedError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise UnauthorizedError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 429:
raise TooManyRequestsError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise TooManyRequestsError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
try:
_response_json = _response.json()
except JSONDecodeError:
Expand Down
25 changes: 15 additions & 10 deletions src/flagright/resources/consumer_user_events/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from ...errors.bad_request_error import BadRequestError
from ...errors.too_many_requests_error import TooManyRequestsError
from ...errors.unauthorized_error import UnauthorizedError
from ...types.api_error_response import ApiErrorResponse
from ...types.boolean_string import BooleanString
from ...types.consumer_user_event import ConsumerUserEvent
from ...types.user_with_rules_result import UserWithRulesResult
Expand Down Expand Up @@ -81,11 +82,11 @@ def create(
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(UserWithRulesResult, _response.json()) # type: ignore
if _response.status_code == 400:
raise BadRequestError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise BadRequestError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 401:
raise UnauthorizedError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise UnauthorizedError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 429:
raise TooManyRequestsError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise TooManyRequestsError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
try:
_response_json = _response.json()
except JSONDecodeError:
Expand Down Expand Up @@ -118,10 +119,12 @@ def get(self, event_id: str) -> ConsumerUserEvent:
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(ConsumerUserEvent, _response.json()) # type: ignore
if _response.status_code == 400:
raise BadRequestError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 401:
raise UnauthorizedError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise UnauthorizedError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 429:
raise TooManyRequestsError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise TooManyRequestsError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
try:
_response_json = _response.json()
except JSONDecodeError:
Expand Down Expand Up @@ -186,11 +189,11 @@ async def create(
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(UserWithRulesResult, _response.json()) # type: ignore
if _response.status_code == 400:
raise BadRequestError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise BadRequestError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 401:
raise UnauthorizedError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise UnauthorizedError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 429:
raise TooManyRequestsError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise TooManyRequestsError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
try:
_response_json = _response.json()
except JSONDecodeError:
Expand Down Expand Up @@ -223,10 +226,12 @@ async def get(self, event_id: str) -> ConsumerUserEvent:
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(ConsumerUserEvent, _response.json()) # type: ignore
if _response.status_code == 400:
raise BadRequestError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 401:
raise UnauthorizedError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise UnauthorizedError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
if _response.status_code == 429:
raise TooManyRequestsError(pydantic.parse_obj_as(typing.Any, _response.json())) # type: ignore
raise TooManyRequestsError(pydantic.parse_obj_as(ApiErrorResponse, _response.json())) # type: ignore
try:
_response_json = _response.json()
except JSONDecodeError:
Expand Down
Loading

0 comments on commit da6284a

Please sign in to comment.