-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgsa_aggregation_criterion.py
161 lines (131 loc) · 5.3 KB
/
gsa_aggregation_criterion.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""
MI Server API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import re # noqa: F401
from typing import TYPE_CHECKING, Any, BinaryIO, Dict, List, Optional, Union # noqa: F401
from . import ModelBase, Unset, Unset_Type
if TYPE_CHECKING:
from datetime import datetime
import pathlib
from . import *
class GsaAggregationCriterion(ModelBase):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes
----------
swagger_types: Dict[str, str]
The key is attribute name and the value is attribute type.
attribute_map: Dict[str, str]
The key is attribute name and the value is json key in definition.
subtype_mapping: Dict[str, str]
The key is the unmangled property name and the value is the corresponding type.
discriminator_class_map: Dict[str, str]
They key is discriminator value and the value is associated subtype.
discriminator: Optional[str]
Name of the property used as discriminator for subtypes.
"""
swagger_types: Dict[str, str] = {
"type": "GsaAggregationType",
}
attribute_map: Dict[str, str] = {
"type": "type",
}
subtype_mapping: Dict[str, str] = {
"type": "GsaAggregationType",
}
discriminator_value_class_map = {
"attribute".lower(): "#/components/schemas/GsaAttributeAggregationCriterion",
"text".lower(): "#/components/schemas/GsaFreeTextAggregationCriterion",
}
discriminator: Optional[str] = "type"
def __init__(
self,
*,
type: "GsaAggregationType",
) -> None:
"""GsaAggregationCriterion - a model defined in Swagger
Parameters
----------
type: GsaAggregationType
"""
self._type: GsaAggregationType
self.type = type
@property
def type(self) -> "GsaAggregationType":
"""Gets the type of this GsaAggregationCriterion.
Returns
-------
GsaAggregationType
The type of this GsaAggregationCriterion.
"""
return self._type
@type.setter
def type(self, type: "GsaAggregationType") -> None:
"""Sets the type of this GsaAggregationCriterion.
Parameters
----------
type: GsaAggregationType
The type of this GsaAggregationCriterion.
"""
# Field is not nullable
if type is None:
raise ValueError("Invalid value for 'type', must not be 'None'")
# Field is required
if type is Unset: # type: ignore[comparison-overlap, unused-ignore]
raise ValueError("Invalid value for 'type', must not be 'Unset'")
self._type = type
@classmethod
def get_real_child_model(cls, data: Dict[str, str]) -> str:
"""Returns the real base class as determined by the discriminator
Parameters
----------
data: ModelBase
Object representing a subclass of this class
"""
discriminator_value = str(data[cls._get_discriminator_field_name()]).lower()
# The actual class name is not available in swagger-codegen,
# so we have to extract it from the JSON reference
return cls.discriminator_value_class_map[discriminator_value].rsplit("/", 1)[-1]
@classmethod
def _get_discriminator_field_name(cls) -> str:
assert cls.discriminator
name_tokens = cls.discriminator.split("_")
later_tokens = [element.capitalize() for element in name_tokens[1:]]
return "".join([name_tokens[0], *later_tokens])
def __repr__(self) -> str:
"""For 'print' and 'pprint'"""
return self.to_str()
def __eq__(self, other: Any) -> bool:
"""Returns true if both objects are equal"""
if not isinstance(other, GsaAggregationCriterion):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other: Any) -> bool:
"""Returns true if both objects are not equal"""
return not self == other