Skip to content

Commit 651a7e2

Browse files
committed
Pull request #55: ISGAPPSEC2-36320 rename validate attribute
Merge in ISGAPPSEC/cyperf-api-wrapper from bugfix/ISGAPPSEC2-36320-wrapper-rename-validate-attribute to main Squashed commit of the following: commit a644af27b3b0323220adaf159cc9aaefe740e2d1 Author: iustmitu <iustin.mitu@keysight.com> Date: Mon Feb 2 17:27:44 2026 +0200 regenerated wrapper
1 parent 6425e50 commit 651a7e2

34 files changed

Lines changed: 392 additions & 14 deletions

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,7 @@ Class | Method | HTTP request | Description
718718
- [SetNtpOperationInput](docs/SetNtpOperationInput.md)
719719
- [SimulatedIdP](docs/SimulatedIdP.md)
720720
- [Snapshot](docs/Snapshot.md)
721+
- [SnowflakeExporter](docs/SnowflakeExporter.md)
721722
- [SortBodyField](docs/SortBodyField.md)
722723
- [SpecificObjective](docs/SpecificObjective.md)
723724
- [StartAgentsBatchDeleteRequestInner](docs/StartAgentsBatchDeleteRequestInner.md)

cyperf/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@
387387
from cyperf.models.set_ntp_operation_input import SetNtpOperationInput
388388
from cyperf.models.simulated_id_p import SimulatedIdP
389389
from cyperf.models.snapshot import Snapshot
390+
from cyperf.models.snowflake_exporter import SnowflakeExporter
390391
from cyperf.models.sort_body_field import SortBodyField
391392
from cyperf.models.specific_objective import SpecificObjective
392393
from cyperf.models.start_agents_batch_delete_request_inner import StartAgentsBatchDeleteRequestInner

cyperf/api_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,14 +543,14 @@ def __deserialize(self, data, klass):
543543
m = re.match(r'List\[(.*)]', klass)
544544
assert m is not None, "Malformed List type definition"
545545
sub_kls = m.group(1)
546-
return [self.__deserialize(sub_data, sub_kls)
546+
return [self.__deserialize(sub_data, sub_kls)
547547
for sub_data in data]
548548

549549
elif klass.startswith('Dict['):
550550
m = re.match(r'Dict\[([^,]*), (.*)]', klass)
551551
assert m is not None, "Malformed Dict type definition"
552552
sub_kls = m.group(2)
553-
return {k: self.__deserialize(v, sub_kls)
553+
return {k: self.__deserialize(v, sub_kls)
554554
for k, v in data.items()}
555555

556556
elif klass.startswith('typing.List['):

cyperf/dynamic_models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@
353353
SetNtpOperationInput = DynamicModel('SetNtpOperationInput', (), {} )
354354
SimulatedIdP = DynamicModel('SimulatedIdP', (), {} )
355355
Snapshot = DynamicModel('Snapshot', (), {} )
356+
SnowflakeExporter = DynamicModel('SnowflakeExporter', (), {} )
356357
SortBodyField = DynamicModel('SortBodyField', (), {} )
357358
SpecificObjective = DynamicModel('SpecificObjective', (), {} )
358359
StartAgentsBatchDeleteRequestInner = DynamicModel('StartAgentsBatchDeleteRequestInner', (), {} )

cyperf/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ class LinkNameException(Exception):
353353
from cyperf.models.set_ntp_operation_input import SetNtpOperationInput
354354
from cyperf.models.simulated_id_p import SimulatedIdP
355355
from cyperf.models.snapshot import Snapshot
356+
from cyperf.models.snowflake_exporter import SnowflakeExporter
356357
from cyperf.models.sort_body_field import SortBodyField
357358
from cyperf.models.specific_objective import SpecificObjective
358359
from cyperf.models.start_agents_batch_delete_request_inner import StartAgentsBatchDeleteRequestInner

cyperf/models/command_metadata.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ class CommandMetadata(BaseModel):
4747
sort_severity: Optional[StrictStr] = Field(default=None, description="The field by which the severity is sorted", alias="SortSeverity")
4848
static: Optional[StrictBool] = Field(default=None, description="If true, the application/strike is managed directly by the controller", alias="Static")
4949
supported_apps: Optional[List[StrictStr]] = Field(default=None, description="The apps that this strike can be used with", alias="SupportedApps")
50+
supported_protocols: Optional[List[StrictStr]] = Field(default=None, description="The list of protocols which support this command", alias="SupportedProtocols")
5051
year: Optional[StrictStr] = Field(default=None, description="The year of the strike", alias="Year")
51-
__properties: ClassVar[List[str]] = ["Direction", "IsBanner", "IsForAppTrafficOnly", "IsStreaming", "Keywords", "LegacyNames", "NoMultiFlowSupport", "Protocol", "RTPProfileMeta", "References", "RequiresUniqueness", "Severity", "SkipAttackGeneration", "SortSeverity", "Static", "SupportedApps", "Year"]
52+
__properties: ClassVar[List[str]] = ["Direction", "IsBanner", "IsForAppTrafficOnly", "IsStreaming", "Keywords", "LegacyNames", "NoMultiFlowSupport", "Protocol", "RTPProfileMeta", "References", "RequiresUniqueness", "Severity", "SkipAttackGeneration", "SortSeverity", "Static", "SupportedApps", "SupportedProtocols", "Year"]
5253

5354
model_config = ConfigDict(
5455
populate_by_name=True,
@@ -136,6 +137,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
136137
"SortSeverity": obj.get("SortSeverity"),
137138
"Static": obj.get("Static"),
138139
"SupportedApps": obj.get("SupportedApps") if obj.get("SupportedApps") is not None else [],
140+
"SupportedProtocols": obj.get("SupportedProtocols") if obj.get("SupportedProtocols") is not None else [],
139141
"Year": obj.get("Year")
140142
,
141143
"links": obj.get("links")

cyperf/models/config.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from cyperf.models.custom_dashboards import CustomDashboards
2828
from cyperf.models.expected_disk_space import ExpectedDiskSpace
2929
from cyperf.models.network_profile import NetworkProfile
30+
from cyperf.models.snowflake_exporter import SnowflakeExporter
3031
from typing import Optional, Set, Union
3132
from typing_extensions import Self
3233
from pydantic import Field, PrivateAttr
@@ -40,11 +41,12 @@ class Config(BaseModel):
4041
custom_dashboards: Optional[CustomDashboards] = Field(default=None, alias="CustomDashboards")
4142
expected_disk_space: Optional[List[ExpectedDiskSpace]] = Field(default=None, alias="ExpectedDiskSpace")
4243
network_profiles: Optional[List[NetworkProfile]] = Field(default=None, alias="NetworkProfiles")
44+
snowflake_exporter: Optional[SnowflakeExporter] = Field(default=None, alias="SnowflakeExporter")
4345
traffic_profiles: Optional[List[ApplicationProfile]] = Field(default=None, alias="TrafficProfiles")
4446
links: Optional[List[APILink]] = None
45-
validate: Optional[List[Union[StrictBytes, StrictStr]]] = None
46-
_validate_json_schema_extra: dict = PrivateAttr(default={"x-operation": "-,ValidateConfig" })
47-
__properties: ClassVar[List[str]] = ["AttackProfiles", "ConfigValidation", "CustomDashboards", "ExpectedDiskSpace", "NetworkProfiles", "TrafficProfiles", "links", "validate"]
47+
validate_session_config: Optional[List[Union[StrictBytes, StrictStr]]] = Field(default=None, alias="validate-session-config")
48+
_validate_session_config_json_schema_extra: dict = PrivateAttr(default={"x-operation": "-,ValidateConfig" })
49+
__properties: ClassVar[List[str]] = ["AttackProfiles", "ConfigValidation", "CustomDashboards", "ExpectedDiskSpace", "NetworkProfiles", "SnowflakeExporter", "TrafficProfiles", "links", "validate-session-config"]
4850

4951
model_config = ConfigDict(
5052
populate_by_name=True,
@@ -112,6 +114,9 @@ def to_dict(self) -> Dict[str, Any]:
112114
if _item:
113115
_items.append(_item.to_dict())
114116
_dict['NetworkProfiles'] = _items
117+
# override the default output from pydantic by calling `to_dict()` of snowflake_exporter
118+
if self.snowflake_exporter:
119+
_dict['SnowflakeExporter'] = self.snowflake_exporter.to_dict()
115120
# override the default output from pydantic by calling `to_dict()` of each item in traffic_profiles (list)
116121
_items = []
117122
if self.traffic_profiles:
@@ -145,9 +150,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
145150
"CustomDashboards": CustomDashboards.from_dict(obj["CustomDashboards"]) if obj.get("CustomDashboards") is not None else None,
146151
"ExpectedDiskSpace": ( [ExpectedDiskSpace.from_dict(_item) for _item in obj.get("ExpectedDiskSpace", [])] if obj.get("ExpectedDiskSpace") is not None else None),
147152
"NetworkProfiles": ( [NetworkProfile.from_dict(_item) for _item in obj.get("NetworkProfiles", [])] if obj.get("NetworkProfiles") is not None else None),
153+
"SnowflakeExporter": SnowflakeExporter.from_dict(obj["SnowflakeExporter"]) if obj.get("SnowflakeExporter") is not None else None,
148154
"TrafficProfiles": ( [ApplicationProfile.from_dict(_item) for _item in obj.get("TrafficProfiles", [])] if obj.get("TrafficProfiles") is not None else None),
149155
"links": ( [APILink.from_dict(_item) for _item in obj.get("links", [])] if obj.get("links") is not None else None),
150-
"validate": obj.get("validate") if obj.get("validate") is not None else []
156+
"validate-session-config": obj.get("validate-session-config") if obj.get("validate-session-config") is not None else []
151157
,
152158
"links": obj.get("links")
153159
})

cyperf/models/http_profile.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ class HTTPProfile(BaseModel):
4040
http_version: Optional[HTTPVersion] = Field(default=None, alias="HTTPVersion")
4141
headers: Optional[Params] = Field(default=None, alias="Headers")
4242
is_modified: Optional[StrictBool] = Field(default=None, alias="IsModified")
43+
max_concurrent_streams: Optional[StrictInt] = Field(default=None, description="The maximum number of streams for all HTTP/2 connections.", alias="MaxConcurrentStreams")
4344
name: StrictStr = Field(description="The name of the HTTP profile.", alias="Name")
4445
params: Optional[List[Params]] = Field(default=None, description="The list of parameters present in the HTTP profile.", alias="Params")
4546
use_application_server_headers: Optional[StrictBool] = Field(default=None, alias="UseApplicationServerHeaders")
4647
links: Optional[List[APILink]] = None
47-
__properties: ClassVar[List[str]] = ["AdditionalHeaders", "ConnectionPersistence", "ConnectionsMaxTransactions", "Description", "ExternalResourceURL", "HTTPVersion", "Headers", "IsModified", "Name", "Params", "UseApplicationServerHeaders", "links"]
48+
__properties: ClassVar[List[str]] = ["AdditionalHeaders", "ConnectionPersistence", "ConnectionsMaxTransactions", "Description", "ExternalResourceURL", "HTTPVersion", "Headers", "IsModified", "MaxConcurrentStreams", "Name", "Params", "UseApplicationServerHeaders", "links"]
4849

4950
model_config = ConfigDict(
5051
populate_by_name=True,
@@ -127,6 +128,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
127128
"HTTPVersion": obj.get("HTTPVersion"),
128129
"Headers": Params.from_dict(obj["Headers"]) if obj.get("Headers") is not None else None,
129130
"IsModified": obj.get("IsModified"),
131+
"MaxConcurrentStreams": obj.get("MaxConcurrentStreams"),
130132
"Name": obj.get("Name"),
131133
"Params": ( [Params.from_dict(_item) for _item in obj.get("Params", [])] if obj.get("Params") is not None else None),
132134
"UseApplicationServerHeaders": obj.get("UseApplicationServerHeaders"),

cyperf/models/param_type.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class ParamType(str, Enum):
3838
MEDIAPROFILE = 'MediaProfile'
3939
RANGE = 'range'
4040
INT = 'int'
41+
STATS_MINUS_PROFILE = 'stats-profile'
4142

4243
@classmethod
4344
def from_json(cls, json_str: str) -> Self:
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# coding: utf-8
2+
3+
"""
4+
CyPerf Application API
5+
6+
CyPerf REST API
7+
8+
The version of the OpenAPI document: 1.0.0
9+
Contact: support@keysight.com
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501
14+
15+
16+
from __future__ import annotations
17+
import pprint
18+
import re # noqa: F401
19+
import json
20+
21+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
22+
from typing import Any, ClassVar, Dict, List, Optional
23+
from typing_extensions import Annotated
24+
from cyperf.models.api_link import APILink
25+
from cyperf.models.params import Params
26+
from typing import Optional, Set, Union
27+
from typing_extensions import Self
28+
from pydantic import Field, PrivateAttr
29+
30+
class SnowflakeExporter(BaseModel):
31+
"""
32+
SnowflakeExporter
33+
""" # noqa: E501
34+
active: StrictBool = Field(description="Indicates whether the snowflake stats exporter is enabled or not.", alias="Active")
35+
polling_interval: Optional[Annotated[int, Field(strict=True)]] = Field(default=None, description="Polling interval used for fetching and uploading data.", alias="PollingInterval")
36+
profile: Optional[Params] = Field(default=None, description="The json snowflake profile.", alias="Profile")
37+
server_url: StrictStr = Field(description="Snowflake endpoint used for uploading data.", alias="ServerURL")
38+
links: Optional[List[APILink]] = None
39+
__properties: ClassVar[List[str]] = ["Active", "PollingInterval", "Profile", "ServerURL", "links"]
40+
41+
model_config = ConfigDict(
42+
populate_by_name=True,
43+
validate_assignment=True,
44+
protected_namespaces=(),
45+
)
46+
47+
48+
def to_str(self) -> str:
49+
"""Returns the string representation of the model using alias"""
50+
return pprint.pformat(self.model_dump(by_alias=True))
51+
52+
def to_json(self) -> str:
53+
"""Returns the JSON representation of the model using alias"""
54+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
55+
return json.dumps(self.to_dict())
56+
57+
@classmethod
58+
def from_json(cls, json_str: str) -> Optional[Self]:
59+
"""Create an instance of SnowflakeExporter from a JSON string"""
60+
return cls.from_dict(json.loads(json_str))
61+
62+
def to_dict(self) -> Dict[str, Any]:
63+
"""Return the dictionary representation of the model using alias.
64+
65+
This has the following differences from calling pydantic's
66+
`self.model_dump(by_alias=True)`:
67+
68+
* `None` is only added to the output dict for nullable fields that
69+
were set at model initialization. Other fields with value `None`
70+
are ignored.
71+
"""
72+
excluded_fields: Set[str] = set([
73+
])
74+
75+
_dict = self.model_dump(
76+
by_alias=True,
77+
exclude=excluded_fields,
78+
exclude_none=True,
79+
)
80+
# override the default output from pydantic by calling `to_dict()` of profile
81+
if self.profile:
82+
_dict['Profile'] = self.profile.to_dict()
83+
# override the default output from pydantic by calling `to_dict()` of each item in links (list)
84+
_items = []
85+
if self.links:
86+
for _item in self.links:
87+
if _item:
88+
_items.append(_item.to_dict())
89+
_dict['links'] = _items
90+
return _dict
91+
92+
@classmethod
93+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
94+
"""Create an instance of SnowflakeExporter from a dict"""
95+
if obj is None:
96+
return None
97+
98+
if not isinstance(obj, dict):
99+
_obj = cls.model_validate(obj)
100+
# _obj.api_client = client
101+
return _obj
102+
103+
_obj = cls.model_validate({
104+
"Active": obj.get("Active"),
105+
"PollingInterval": obj.get("PollingInterval"),
106+
"Profile": Params.from_dict(obj["Profile"]) if obj.get("Profile") is not None else None,
107+
"ServerURL": obj.get("ServerURL"),
108+
"links": ( [APILink.from_dict(_item) for _item in obj.get("links", [])] if obj.get("links") is not None else None)
109+
,
110+
"links": obj.get("links")
111+
})
112+
return _obj
113+
114+

0 commit comments

Comments
 (0)