Skip to content

Commit bcd5d2b

Browse files
committed
feat: enhance onelens backend client with new RPC handlers and models for aggregated interactions, savings dashboard, and violations
1 parent 384d638 commit bcd5d2b

15 files changed

Lines changed: 9638 additions & 712 deletions

onelens_backend_client_v2/models.py

Lines changed: 3028 additions & 668 deletions
Large diffs are not rendered by default.

onelens_backend_client_v2/rpc/__init__.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,34 @@
212212
AggregatedPoliciesServiceRpcHandler,
213213
)
214214

215+
from onelens_backend_client_v2.rpc.aggregated_savings_dashboard_service_rpc_handler import (
216+
AggregatedSavingsDashboardServiceRpcHandler,
217+
)
218+
219+
from onelens_backend_client_v2.rpc.aggregated_violations_service_rpc_handler import (
220+
AggregatedViolationsServiceRpcHandler,
221+
)
222+
223+
from onelens_backend_client_v2.rpc.aggregated_interactions_service_rpc_handler import (
224+
AggregatedInteractionsServiceRpcHandler,
225+
)
226+
227+
from onelens_backend_client_v2.rpc.custom_tickets_service_rpc_handler import (
228+
CustomTicketsServiceRpcHandler,
229+
)
230+
231+
from onelens_backend_client_v2.rpc.custom_policy_service_rpc_handler import (
232+
CustomPolicyServiceRpcHandler,
233+
)
234+
235+
from onelens_backend_client_v2.rpc.custom_ticket_history_service_rpc_handler import (
236+
CustomTicketHistoryServiceRpcHandler,
237+
)
238+
239+
from onelens_backend_client_v2.rpc.hierarchy_node_service_v2_rpc_handler import (
240+
HierarchyNodeServiceV2RpcHandler,
241+
)
242+
215243
from onelens_backend_client_v2.rpc.network_flow_analysis_requests_service_rpc_handler import (
216244
NetworkFlowAnalysisRequestsServiceRpcHandler,
217245
)
@@ -272,5 +300,12 @@
272300
"TenantOnboardingServiceRpcHandler",
273301
"AggregatedTicketsServiceRpcHandler",
274302
"AggregatedPoliciesServiceRpcHandler",
303+
"AggregatedSavingsDashboardServiceRpcHandler",
304+
"AggregatedViolationsServiceRpcHandler",
305+
"AggregatedInteractionsServiceRpcHandler",
306+
"CustomTicketsServiceRpcHandler",
307+
"CustomPolicyServiceRpcHandler",
308+
"CustomTicketHistoryServiceRpcHandler",
309+
"HierarchyNodeServiceV2RpcHandler",
275310
"NetworkFlowAnalysisRequestsServiceRpcHandler",
276311
]
Lines changed: 271 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,271 @@
1+
# AggregatedInteractionsServiceRpcHandler API
2+
3+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
4+
from typing import Any, Dict, List, Optional, Tuple, Union
5+
from typing_extensions import Annotated
6+
7+
8+
from onelens_backend_client_v2.models import ManagePolicyStatusRequest
9+
10+
11+
from onelens_backend_client_v2.models import ManagePolicyStatusResponse
12+
13+
14+
from onelens_backend_client_v2.models import UpdateAggregatedTicketRequest
15+
16+
17+
from onelens_backend_client_v2.models import UpdateAggregatedTicketResponse
18+
19+
20+
from onelens_backend_client_v2.api_client import ApiClient, RequestSerialized
21+
22+
23+
class AggregatedInteractionsServiceRpcHandler:
24+
"""NOTE: This class is auto generated. Do not edit the class manually."""
25+
26+
def __init__(self, api_client=None) -> None:
27+
if api_client is None:
28+
api_client = ApiClient.get_default()
29+
self.api_client = api_client
30+
31+
@validate_call
32+
def manage_policy_status(
33+
self,
34+
request: ManagePolicyStatusRequest,
35+
_request_timeout: Union[
36+
None,
37+
Annotated[StrictFloat, Field(gt=0)],
38+
Tuple[
39+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
40+
],
41+
] = None,
42+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
43+
_content_type: Optional[StrictStr] = None,
44+
_headers: Optional[Dict[StrictStr, Any]] = None,
45+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
46+
) -> ManagePolicyStatusResponse:
47+
"""Manage policy status with rule type based routing
48+
49+
50+
51+
:param request: (required)
52+
:type request: ManagePolicyStatusRequest
53+
:param _request_timeout: timeout setting for this request. If one
54+
number provided, it will be total request
55+
timeout. It can also be a pair (tuple) of
56+
(connection, read) timeouts.
57+
:type _request_timeout: int, tuple(int, int), optional
58+
:param _request_auth: set to override the auth_settings for an a single
59+
request; this effectively ignores the
60+
authentication in the spec for a single request.
61+
:type _request_auth: dict, optional
62+
:param _content_type: force content-type for the request.
63+
:type _content_type: str, Optional
64+
:param _headers: set to override the headers for a single
65+
request; this effectively ignores the headers
66+
in the spec for a single request.
67+
:type _headers: dict, optional
68+
:param _host_index: set to override the host_index for a single
69+
request; this effectively ignores the host_index
70+
in the spec for a single request.
71+
:type _host_index: int, optional
72+
:return: Returns the result object.
73+
"""
74+
75+
_param = self._manage_policy_status_serialize(
76+
request=request,
77+
_request_auth=_request_auth,
78+
_content_type=_content_type,
79+
_headers=_headers,
80+
_host_index=_host_index,
81+
)
82+
83+
_response_types_map: Dict[str, Optional[str]] = {
84+
"200": "ManagePolicyStatusResponse",
85+
"422": "HTTPValidationError",
86+
}
87+
response_data = self.api_client.call_api(
88+
*_param, _request_timeout=_request_timeout
89+
)
90+
response_data.read()
91+
return self.api_client.response_deserialize(
92+
response_data=response_data,
93+
response_types_map=_response_types_map,
94+
).data
95+
96+
def _manage_policy_status_serialize(
97+
self,
98+
request: ManagePolicyStatusRequest,
99+
_request_auth,
100+
_content_type,
101+
_headers,
102+
_host_index,
103+
) -> RequestSerialized:
104+
_host = None
105+
106+
_collection_formats: Dict[str, str] = {}
107+
108+
_path_params: Dict[str, str] = {}
109+
_query_params: List[Tuple[str, str]] = []
110+
_header_params: Dict[str, Optional[str]] = _headers or {}
111+
_form_params: List[Tuple[str, str]] = []
112+
_files: Dict[str, Union[str, bytes]] = {}
113+
_body_params: Optional[bytes] = None
114+
115+
# process the body parameter
116+
if request is not None:
117+
_body_params = request
118+
119+
# set the HTTP header `Accept`
120+
_header_params["Accept"] = self.api_client.select_header_accept(
121+
["application/json"]
122+
)
123+
124+
# set the HTTP header `Content-Type`
125+
if _content_type:
126+
_header_params["Content-Type"] = _content_type
127+
else:
128+
_default_content_type = self.api_client.select_header_content_type(
129+
["application/json"]
130+
)
131+
if _default_content_type is not None:
132+
_header_params["Content-Type"] = _default_content_type
133+
134+
# authentication setting
135+
_auth_settings: List[str] = []
136+
137+
return self.api_client.param_serialize(
138+
method="POST",
139+
resource_path="/rpc/aggregated_interactions_service/manage_policy_status",
140+
path_params=_path_params,
141+
query_params=_query_params,
142+
header_params=_header_params,
143+
body=_body_params,
144+
post_params=_form_params,
145+
files=_files,
146+
auth_settings=_auth_settings,
147+
collection_formats=_collection_formats,
148+
_host=_host,
149+
_request_auth=_request_auth,
150+
)
151+
152+
@validate_call
153+
def update_ticket(
154+
self,
155+
request: UpdateAggregatedTicketRequest,
156+
_request_timeout: Union[
157+
None,
158+
Annotated[StrictFloat, Field(gt=0)],
159+
Tuple[
160+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
161+
],
162+
] = None,
163+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
164+
_content_type: Optional[StrictStr] = None,
165+
_headers: Optional[Dict[StrictStr, Any]] = None,
166+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
167+
) -> UpdateAggregatedTicketResponse:
168+
"""Update tickets with provider and ticket type based routing
169+
170+
171+
172+
:param request: (required)
173+
:type request: UpdateAggregatedTicketRequest
174+
:param _request_timeout: timeout setting for this request. If one
175+
number provided, it will be total request
176+
timeout. It can also be a pair (tuple) of
177+
(connection, read) timeouts.
178+
:type _request_timeout: int, tuple(int, int), optional
179+
:param _request_auth: set to override the auth_settings for an a single
180+
request; this effectively ignores the
181+
authentication in the spec for a single request.
182+
:type _request_auth: dict, optional
183+
:param _content_type: force content-type for the request.
184+
:type _content_type: str, Optional
185+
:param _headers: set to override the headers for a single
186+
request; this effectively ignores the headers
187+
in the spec for a single request.
188+
:type _headers: dict, optional
189+
:param _host_index: set to override the host_index for a single
190+
request; this effectively ignores the host_index
191+
in the spec for a single request.
192+
:type _host_index: int, optional
193+
:return: Returns the result object.
194+
"""
195+
196+
_param = self._update_ticket_serialize(
197+
request=request,
198+
_request_auth=_request_auth,
199+
_content_type=_content_type,
200+
_headers=_headers,
201+
_host_index=_host_index,
202+
)
203+
204+
_response_types_map: Dict[str, Optional[str]] = {
205+
"200": "UpdateAggregatedTicketResponse",
206+
"422": "HTTPValidationError",
207+
}
208+
response_data = self.api_client.call_api(
209+
*_param, _request_timeout=_request_timeout
210+
)
211+
response_data.read()
212+
return self.api_client.response_deserialize(
213+
response_data=response_data,
214+
response_types_map=_response_types_map,
215+
).data
216+
217+
def _update_ticket_serialize(
218+
self,
219+
request: UpdateAggregatedTicketRequest,
220+
_request_auth,
221+
_content_type,
222+
_headers,
223+
_host_index,
224+
) -> RequestSerialized:
225+
_host = None
226+
227+
_collection_formats: Dict[str, str] = {}
228+
229+
_path_params: Dict[str, str] = {}
230+
_query_params: List[Tuple[str, str]] = []
231+
_header_params: Dict[str, Optional[str]] = _headers or {}
232+
_form_params: List[Tuple[str, str]] = []
233+
_files: Dict[str, Union[str, bytes]] = {}
234+
_body_params: Optional[bytes] = None
235+
236+
# process the body parameter
237+
if request is not None:
238+
_body_params = request
239+
240+
# set the HTTP header `Accept`
241+
_header_params["Accept"] = self.api_client.select_header_accept(
242+
["application/json"]
243+
)
244+
245+
# set the HTTP header `Content-Type`
246+
if _content_type:
247+
_header_params["Content-Type"] = _content_type
248+
else:
249+
_default_content_type = self.api_client.select_header_content_type(
250+
["application/json"]
251+
)
252+
if _default_content_type is not None:
253+
_header_params["Content-Type"] = _default_content_type
254+
255+
# authentication setting
256+
_auth_settings: List[str] = []
257+
258+
return self.api_client.param_serialize(
259+
method="POST",
260+
resource_path="/rpc/aggregated_interactions_service/update_ticket",
261+
path_params=_path_params,
262+
query_params=_query_params,
263+
header_params=_header_params,
264+
body=_body_params,
265+
post_params=_form_params,
266+
files=_files,
267+
auth_settings=_auth_settings,
268+
collection_formats=_collection_formats,
269+
_host=_host,
270+
_request_auth=_request_auth,
271+
)

0 commit comments

Comments
 (0)