Skip to content

Commit ca813c7

Browse files
ilaifMidnighter
andcommitted
refactor: use keyword arguments
Co-authored-by: Midnighter <[email protected]>
1 parent db43e25 commit ca813c7

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/structurizr/api/structurizr_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ def __enter__(self):
103103
raise StructurizrClientException(
104104
f"Failed to lock the Structurizr workspace {self.workspace_id}."
105105
)
106+
106107
return self
107108

108109
def __exit__(self, exc_type, exc_val, exc_tb):
@@ -161,11 +162,11 @@ def put_workspace(self, workspace: Workspace) -> None:
161162
workspace_json = ws_io.json()
162163
logger.debug(workspace_json)
163164
request = self._client.build_request(
164-
"PUT", self._workspace_url, data=workspace_json
165+
method="PUT", url=self._workspace_url, data=workspace_json,
165166
)
166167
request.headers.update(
167168
self._add_headers(
168-
request.url.full_path,
169+
url_path=request.url.full_path,
169170
method="PUT",
170171
content=workspace_json,
171172
content_type=self._application_json,

src/structurizr/api/structurizr_client_settings.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class StructurizrClientSettings(BaseSettings):
6464
"""
6565

6666
url: HttpUrl = Field(
67-
"https://api.structurizr.com",
67+
default="https://api.structurizr.com",
6868
env="STRUCTURIZR_URL",
6969
description="The Structurizr API URL.",
7070
)
@@ -84,18 +84,18 @@ class StructurizrClientSettings(BaseSettings):
8484
description="The Structurizr workspace API secret.",
8585
)
8686
user: str = Field(
87-
USER,
87+
default=USER,
8888
env="STRUCTURIZR_USER",
8989
description="A string identifying the user (e.g. an e-mail address or "
9090
"username).",
9191
)
9292
agent: str = Field(
93-
AGENT,
93+
default=AGENT,
9494
env="STRUCTURIZR_AGENT",
9595
description="A string identifying the agent (e.g. 'structurizr-java/1.2.0').",
9696
)
9797
workspace_archive_location: DirectoryPath = Field(
98-
Path.cwd(),
98+
default=Path.cwd(),
9999
env="STRUCTURIZR_WORKSPACE_ARCHIVE_LOCATION",
100100
description="A directory for archiving downloaded workspaces.",
101101
)

0 commit comments

Comments
 (0)