Skip to content

Commit 73d1d14

Browse files
authored
feat(cockpit): add default notion for datasources (#361)
1 parent ad72f47 commit 73d1d14

File tree

6 files changed

+24
-0
lines changed

6 files changed

+24
-0
lines changed

scaleway-async/scaleway_async/cockpit/v1beta1/api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,15 @@ async def create_datasource(
283283
*,
284284
name: str,
285285
type_: DatasourceType,
286+
is_default: bool,
286287
project_id: Optional[str] = None,
287288
) -> Datasource:
288289
"""
289290
Create a datasource for the specified Project ID and the given type.
290291
:param project_id: ID of the Project the Cockpit belongs to.
291292
:param name: Datasource name.
292293
:param type_: Datasource type.
294+
:param is_default: Specifies that the returned output is the default datasource per type.
293295
:return: :class:`Datasource <Datasource>`
294296
295297
Usage:
@@ -298,6 +300,7 @@ async def create_datasource(
298300
result = await api.create_datasource(
299301
name="example",
300302
type_=unknown_datasource_type,
303+
is_default=True,
301304
)
302305
"""
303306

@@ -308,6 +311,7 @@ async def create_datasource(
308311
CreateDatasourceRequest(
309312
name=name,
310313
type_=type_,
314+
is_default=is_default,
311315
project_id=project_id,
312316
),
313317
self.client,

scaleway-async/scaleway_async/cockpit/v1beta1/marshalling.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,9 @@ def marshal_CreateDatasourceRequest(
568568
) -> Dict[str, Any]:
569569
output: Dict[str, Any] = {}
570570

571+
if request.is_default is not None:
572+
output["is_default"] = request.is_default
573+
571574
if request.name is not None:
572575
output["name"] = request.name
573576

scaleway-async/scaleway_async/cockpit/v1beta1/types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,11 @@ class CreateDatasourceRequest:
634634
Datasource type.
635635
"""
636636

637+
is_default: bool
638+
"""
639+
Specifies that the returned output is the default datasource per type.
640+
"""
641+
637642

638643
@dataclass
639644
class ListDatasourcesRequest:

scaleway/scaleway/cockpit/v1beta1/api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,15 @@ def create_datasource(
283283
*,
284284
name: str,
285285
type_: DatasourceType,
286+
is_default: bool,
286287
project_id: Optional[str] = None,
287288
) -> Datasource:
288289
"""
289290
Create a datasource for the specified Project ID and the given type.
290291
:param project_id: ID of the Project the Cockpit belongs to.
291292
:param name: Datasource name.
292293
:param type_: Datasource type.
294+
:param is_default: Specifies that the returned output is the default datasource per type.
293295
:return: :class:`Datasource <Datasource>`
294296
295297
Usage:
@@ -298,6 +300,7 @@ def create_datasource(
298300
result = api.create_datasource(
299301
name="example",
300302
type_=unknown_datasource_type,
303+
is_default=True,
301304
)
302305
"""
303306

@@ -308,6 +311,7 @@ def create_datasource(
308311
CreateDatasourceRequest(
309312
name=name,
310313
type_=type_,
314+
is_default=is_default,
311315
project_id=project_id,
312316
),
313317
self.client,

scaleway/scaleway/cockpit/v1beta1/marshalling.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,9 @@ def marshal_CreateDatasourceRequest(
568568
) -> Dict[str, Any]:
569569
output: Dict[str, Any] = {}
570570

571+
if request.is_default is not None:
572+
output["is_default"] = request.is_default
573+
571574
if request.name is not None:
572575
output["name"] = request.name
573576

scaleway/scaleway/cockpit/v1beta1/types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,11 @@ class CreateDatasourceRequest:
634634
Datasource type.
635635
"""
636636

637+
is_default: bool
638+
"""
639+
Specifies that the returned output is the default datasource per type.
640+
"""
641+
637642

638643
@dataclass
639644
class ListDatasourcesRequest:

0 commit comments

Comments
 (0)