Skip to content

Commit 89aa933

Browse files
author
Ammar Husain Mian Fazulul
committed
added test plan module
1 parent 06671e0 commit 89aa933

File tree

6 files changed

+27
-31
lines changed

6 files changed

+27
-31
lines changed

nisystemlink/clients/test_plan/models/_execution_definition.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ class NoneExecution(JsonModel):
8282
action: str
8383
"""User defined action to perform in workflow (user defined)."""
8484

85-
type: Literal["None"] = Field(default="None")
86-
"""Type of execution, default is 'None'."""
85+
type: Literal["NONE"] = Field(default="NONE")
86+
"""Type of execution, default is 'NONE'."""
8787

8888

8989
ExecutionDefinition = Annotated[

nisystemlink/clients/test_plan/test_plan/_test_plan_client.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@
44
from nisystemlink.clients.core._http_configuration import HttpConfiguration
55
from nisystemlink.clients.core._uplink._base_client import BaseClient
66
from nisystemlink.clients.core._uplink._methods import get, post
7+
from nisystemlink.clients.test_plan.test_plan.models._paged_test_plans import (
8+
PagedTestPlans,
9+
)
710
from uplink import retry
811

12+
913
from .models import (
1014
_QueryTestPlansRequest,
1115
CreateTestPlansRequest,
1216
CreateTestPlansResponse,
1317
DeleteTestPlansRequest,
1418
QueryTestPlansRequest,
15-
QueryTestPlansResponse,
1619
ScheduleTestPlansRequest,
1720
ScheduleTestPlansResponse,
1821
TestPlan,
@@ -85,27 +88,25 @@ def delete_test_plans(self, ids: DeleteTestPlansRequest) -> None:
8588
@post("query-testplans")
8689
def __query_test_plans(
8790
self, query_request: _QueryTestPlansRequest
88-
) -> QueryTestPlansResponse:
91+
) -> PagedTestPlans:
8992
"""Query test plans.
9093
9194
Args:
9295
query: The query to execute.
9396
9497
Returns:
95-
A QueryTestPlansResponse object containing test plans that match the query.
98+
A PagedTestPlans object containing test plans that match the query.
9699
"""
97100
...
98101

99-
def query_test_plans(
100-
self, query_request: QueryTestPlansRequest
101-
) -> QueryTestPlansResponse:
102+
def query_test_plans(self, query_request: QueryTestPlansRequest) -> PagedTestPlans:
102103
"""Query test plans.
103104
104105
Args:
105106
query: The query to execute.
106107
107108
Returns:
108-
A QueryTestPlansResponse object containing test plans that match the query.
109+
A PagedTestPlans object containing test plans that match the query.
109110
"""
110111
projection_str = (
111112
[projection.name for projection in query_request.projection]

nisystemlink/clients/test_plan/test_plan/models/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
TestPlanField,
1111
_QueryTestPlansRequest,
1212
)
13-
from ._query_test_plans_response import QueryTestPlansResponse
1413
from ._schedule_test_plans_request import ScheduleTestPlansRequest
1514
from ._state import State
1615
from ._test_plan import TestPlan
@@ -19,5 +18,6 @@
1918
from ._update_test_plans_response import UpdateTestPlansResponse
2019
from ._workflow_definition import WorkflowDefinition
2120
from ._order_by import OrderBy
21+
from ._paged_test_plans import PagedTestPlans
2222

2323
# flake8: noqa
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from typing import List, Optional
2+
3+
from nisystemlink.clients.core._uplink._with_paging import WithPaging
4+
from nisystemlink.clients.test_plan.test_plan.models._test_plan import TestPlan
5+
6+
7+
class PagedTestPlans(WithPaging):
8+
"""The response containing the list of products, total count of products and the continuation
9+
token if applicable.
10+
"""
11+
12+
test_plans: List[TestPlan]
13+
"""A list of all the products in this page."""
14+
15+
total_count: Optional[int] = None
16+
"""The total number of products that match the query."""

nisystemlink/clients/test_plan/test_plan/models/_query_test_plans_response.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

nisystemlink/clients/test_plan/test_plan/models/_schedule_test_plans_response.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@ class ScheduleTestPlansResponse(JsonModel):
1818

1919
error: Optional[ApiError] = None
2020
"""The error that occurred when scheduling the test plans."""
21-

0 commit comments

Comments
 (0)