Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

🌿 Fern Regeneration -- January 15, 2024 #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
290 changes: 143 additions & 147 deletions poetry.lock

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
[tool.poetry]
name = "flipt"
version = "0.2.17"
version = "0.2.18"
description = ""
readme = "README.md"
authors = []
packages = [{ include = "flipt", from = "src" }]
packages = [
{ include = "flipt", from = "src"}
]

[tool.poetry.dependencies]
python = "^3.7"
httpx = ">=0.21.2"
pydantic = ">= 1.9.2, < 3.0.0"
pydantic = ">= 1.9.2, < 2.5.0"

[tool.poetry.dev-dependencies]
mypy = "^1.0"
mypy = "0.971"
pytest = "^7.4.0"

[build-system]
Expand Down
2 changes: 1 addition & 1 deletion src/flipt/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": "flipt",
"X-Fern-SDK-Version": "0.2.17",
"X-Fern-SDK-Version": "0.2.18",
}
token = self._get_token()
if token is not None:
Expand Down
4 changes: 4 additions & 0 deletions src/flipt/resources/auth/types/authentication_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ class AuthenticationMethod(str, enum.Enum):
METHOD_TOKEN = "METHOD_TOKEN"
METHOD_OIDC = "METHOD_OIDC"
METHOD_KUBERNETES = "METHOD_KUBERNETES"
METHOD_JWT = "METHOD_JWT"

def visit(
self,
method_none: typing.Callable[[], T_Result],
method_token: typing.Callable[[], T_Result],
method_oidc: typing.Callable[[], T_Result],
method_kubernetes: typing.Callable[[], T_Result],
method_jwt: typing.Callable[[], T_Result],
) -> T_Result:
if self is AuthenticationMethod.METHOD_NONE:
return method_none()
Expand All @@ -31,3 +33,5 @@ def visit(
return method_oidc()
if self is AuthenticationMethod.METHOD_KUBERNETES:
return method_kubernetes()
if self is AuthenticationMethod.METHOD_JWT:
return method_jwt()
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
class BatchEvaluationRequest(pydantic.BaseModel):
request_id: typing.Optional[str] = pydantic.Field(alias="requestId")
requests: typing.List[EvaluationRequest]
reference: typing.Optional[str]

def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
Expand Down
1 change: 1 addition & 0 deletions src/flipt/resources/evaluation/types/evaluation_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class EvaluationRequest(pydantic.BaseModel):
flag_key: str = pydantic.Field(alias="flagKey")
entity_id: str = pydantic.Field(alias="entityId")
context: typing.Dict[str, str]
reference: typing.Optional[str]

def json(self, **kwargs: typing.Any) -> str:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
Expand Down
24 changes: 20 additions & 4 deletions src/flipt/resources/flags/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def list(
limit: typing.Optional[int] = None,
offset: typing.Optional[int] = None,
page_token: typing.Optional[str] = None,
reference: typing.Optional[str] = None,
) -> FlagList:
"""
Parameters:
Expand All @@ -43,11 +44,15 @@ def list(
- offset: typing.Optional[int].

- page_token: typing.Optional[str].

- reference: typing.Optional[str].
"""
_response = self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/namespaces/{namespace_key}/flags"),
params=remove_none_from_dict({"limit": limit, "offset": offset, "pageToken": page_token}),
params=remove_none_from_dict(
{"limit": limit, "offset": offset, "pageToken": page_token, "reference": reference}
),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
Expand Down Expand Up @@ -81,18 +86,21 @@ def create(self, namespace_key: str, *, request: FlagCreateRequest) -> Flag:
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

def get(self, namespace_key: str, key: str) -> Flag:
def get(self, namespace_key: str, key: str, *, reference: typing.Optional[str] = None) -> Flag:
"""
Parameters:
- namespace_key: str.

- key: str.

- reference: typing.Optional[str].
"""
_response = self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(
f"{self._client_wrapper.get_base_url()}/", f"api/v1/namespaces/{namespace_key}/flags/{key}"
),
params=remove_none_from_dict({"reference": reference}),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
Expand Down Expand Up @@ -165,6 +173,7 @@ async def list(
limit: typing.Optional[int] = None,
offset: typing.Optional[int] = None,
page_token: typing.Optional[str] = None,
reference: typing.Optional[str] = None,
) -> FlagList:
"""
Parameters:
Expand All @@ -175,11 +184,15 @@ async def list(
- offset: typing.Optional[int].

- page_token: typing.Optional[str].

- reference: typing.Optional[str].
"""
_response = await self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/namespaces/{namespace_key}/flags"),
params=remove_none_from_dict({"limit": limit, "offset": offset, "pageToken": page_token}),
params=remove_none_from_dict(
{"limit": limit, "offset": offset, "pageToken": page_token, "reference": reference}
),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
Expand Down Expand Up @@ -213,18 +226,21 @@ async def create(self, namespace_key: str, *, request: FlagCreateRequest) -> Fla
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

async def get(self, namespace_key: str, key: str) -> Flag:
async def get(self, namespace_key: str, key: str, *, reference: typing.Optional[str] = None) -> Flag:
"""
Parameters:
- namespace_key: str.

- key: str.

- reference: typing.Optional[str].
"""
_response = await self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(
f"{self._client_wrapper.get_base_url()}/", f"api/v1/namespaces/{namespace_key}/flags/{key}"
),
params=remove_none_from_dict({"reference": reference}),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
Expand Down
24 changes: 20 additions & 4 deletions src/flipt/resources/namespaces/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def list(
limit: typing.Optional[int] = None,
offset: typing.Optional[int] = None,
page_token: typing.Optional[str] = None,
reference: typing.Optional[str] = None,
) -> NamespaceList:
"""
Parameters:
Expand All @@ -40,11 +41,15 @@ def list(
- offset: typing.Optional[int].

- page_token: typing.Optional[str].

- reference: typing.Optional[str].
"""
_response = self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/namespaces"),
params=remove_none_from_dict({"limit": limit, "offset": offset, "pageToken": page_token}),
params=remove_none_from_dict(
{"limit": limit, "offset": offset, "pageToken": page_token, "reference": reference}
),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
Expand Down Expand Up @@ -76,14 +81,17 @@ def create(self, *, request: NamespaceCreateRequest) -> Namespace:
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

def get(self, key: str) -> Namespace:
def get(self, key: str, *, reference: typing.Optional[str] = None) -> Namespace:
"""
Parameters:
- key: str.

- reference: typing.Optional[str].
"""
_response = self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/namespaces/{key}"),
params=remove_none_from_dict({"reference": reference}),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
Expand Down Expand Up @@ -147,6 +155,7 @@ async def list(
limit: typing.Optional[int] = None,
offset: typing.Optional[int] = None,
page_token: typing.Optional[str] = None,
reference: typing.Optional[str] = None,
) -> NamespaceList:
"""
Parameters:
Expand All @@ -155,11 +164,15 @@ async def list(
- offset: typing.Optional[int].

- page_token: typing.Optional[str].

- reference: typing.Optional[str].
"""
_response = await self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/namespaces"),
params=remove_none_from_dict({"limit": limit, "offset": offset, "pageToken": page_token}),
params=remove_none_from_dict(
{"limit": limit, "offset": offset, "pageToken": page_token, "reference": reference}
),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
Expand Down Expand Up @@ -191,14 +204,17 @@ async def create(self, *, request: NamespaceCreateRequest) -> Namespace:
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

async def get(self, key: str) -> Namespace:
async def get(self, key: str, *, reference: typing.Optional[str] = None) -> Namespace:
"""
Parameters:
- key: str.

- reference: typing.Optional[str].
"""
_response = await self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/namespaces/{key}"),
params=remove_none_from_dict({"reference": reference}),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
Expand Down
26 changes: 22 additions & 4 deletions src/flipt/resources/rollouts/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def list(
limit: typing.Optional[int] = None,
offset: typing.Optional[int] = None,
page_token: typing.Optional[str] = None,
reference: typing.Optional[str] = None,
) -> RolloutList:
"""
Parameters:
Expand All @@ -47,14 +48,18 @@ def list(
- offset: typing.Optional[int].

- page_token: typing.Optional[str].

- reference: typing.Optional[str].
"""
_response = self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(
f"{self._client_wrapper.get_base_url()}/",
f"api/v1/namespaces/{namespace_key}/flags/{flag_key}/rollouts",
),
params=remove_none_from_dict({"limit": limit, "offset": offset, "pageToken": page_token}),
params=remove_none_from_dict(
{"limit": limit, "offset": offset, "pageToken": page_token, "reference": reference}
),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
Expand Down Expand Up @@ -120,21 +125,24 @@ def order(self, namespace_key: str, flag_key: str, *, request: RolloutOrderReque
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

def get(self, namespace_key: str, flag_key: str, id: str) -> Rollout:
def get(self, namespace_key: str, flag_key: str, id: str, *, reference: typing.Optional[str] = None) -> Rollout:
"""
Parameters:
- namespace_key: str.

- flag_key: str.

- id: str.

- reference: typing.Optional[str].
"""
_response = self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(
f"{self._client_wrapper.get_base_url()}/",
f"api/v1/namespaces/{namespace_key}/flags/{flag_key}/rollouts/{id}",
),
params=remove_none_from_dict({"reference": reference}),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
Expand Down Expand Up @@ -214,6 +222,7 @@ async def list(
limit: typing.Optional[int] = None,
offset: typing.Optional[int] = None,
page_token: typing.Optional[str] = None,
reference: typing.Optional[str] = None,
) -> RolloutList:
"""
Parameters:
Expand All @@ -226,14 +235,18 @@ async def list(
- offset: typing.Optional[int].

- page_token: typing.Optional[str].

- reference: typing.Optional[str].
"""
_response = await self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(
f"{self._client_wrapper.get_base_url()}/",
f"api/v1/namespaces/{namespace_key}/flags/{flag_key}/rollouts",
),
params=remove_none_from_dict({"limit": limit, "offset": offset, "pageToken": page_token}),
params=remove_none_from_dict(
{"limit": limit, "offset": offset, "pageToken": page_token, "reference": reference}
),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
Expand Down Expand Up @@ -299,21 +312,26 @@ async def order(self, namespace_key: str, flag_key: str, *, request: RolloutOrde
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

async def get(self, namespace_key: str, flag_key: str, id: str) -> Rollout:
async def get(
self, namespace_key: str, flag_key: str, id: str, *, reference: typing.Optional[str] = None
) -> Rollout:
"""
Parameters:
- namespace_key: str.

- flag_key: str.

- id: str.

- reference: typing.Optional[str].
"""
_response = await self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(
f"{self._client_wrapper.get_base_url()}/",
f"api/v1/namespaces/{namespace_key}/flags/{flag_key}/rollouts/{id}",
),
params=remove_none_from_dict({"reference": reference}),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
Expand Down
Loading