• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

atlanticwave-sdx / datamodel / 13122001380

03 Feb 2025 08:13PM UTC coverage: 76.84% (-1.1%) from 77.961%
13122001380

Pull #165

github

web-flow
Merge a88d2e506 into ed2e76d4d
Pull Request #165: 1.drop python3.9 and 3.10; 2. better handle the vlan errors in request;

56 of 97 new or added lines in 6 files covered. (57.73%)

1 existing line in 1 file now uncovered.

1420 of 1848 relevant lines covered (76.84%)

1.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.0
/src/sdx_datamodel/models/node.py
1
# coding: utf-8
2

3
from __future__ import absolute_import
2✔
4

5
from datetime import date, datetime  # noqa: F401
2✔
6
from typing import Dict, List  # noqa: F401
2✔
7

8
from sdx_datamodel import util
2✔
9
from sdx_datamodel.models.base_model_ import Model
2✔
10
from sdx_datamodel.models.location import Location  # noqa: F401,E501
2✔
11
from sdx_datamodel.models.port import Port  # noqa: F401,E501
2✔
12
from sdx_datamodel.parsing.locationhandler import LocationHandler
2✔
13
from sdx_datamodel.parsing.porthandler import PortHandler
2✔
14

15

16
class Node(Model):
2✔
17
    """NOTE: This class is auto generated by the swagger code generator program.
18

19
    Do not edit the class manually.
20
    """
21

22
    def __init__(
2✔
23
        self,
24
        id=None,
25
        name=None,
26
        short_name=None,
27
        location=None,
28
        ports=None,
29
        status=None,
30
        state=None,
31
        private_attributes=None,
32
    ):  # noqa: E501
33
        """Node - a model defined in Swagger
34

35
        :param id: The id of this Node.  # noqa: E501
36
        :type id: str
37
        :param name: The name of this Node.  # noqa: E501
38
        :type name: str
39
        :param short_name: The short_name of this Node.  # noqa: E501
40
        :type short_name: str
41
        :param location: The location of this Node.  # noqa: E501
42
        :type location: Location
43
        :param ports: The ports of this Node.  # noqa: E501
44
        :type ports: List[Port]
45
        :param status: The status of this Node. # noqa: E501
46
        :type status: str
47
        :param state: The status of this Node. # noqa: E501
48
        :type state: str
49
        :param private_attributes: The private_attributes of this Node.  # noqa: E501
50
        :type private_attributes: List[str]
51
        """
52
        self.swagger_types = {
2✔
53
            "id": str,
54
            "name": str,
55
            "short_name": str,
56
            "status": str,
57
            "state": str,
58
            "location": Location,
59
            "ports": List[Port],
60
            "private_attributes": List[str],
61
        }
62

63
        self.attribute_map = {
2✔
64
            "id": "id",
65
            "name": "name",
66
            "short_name": "short_name",
67
            "location": "location",
68
            "ports": "ports",
69
            "status": "status",
70
            "state": "state",
71
            "private_attributes": "private_attributes",
72
        }
73
        self._id = id
2✔
74
        self._name = name
2✔
75
        short_name = None
2✔
76
        self._short_name = short_name
2✔
77
        self._location = None
2✔
78
        self._status = status
2✔
79
        self._state = state
2✔
80
        self._location = self.set_location(location)
2✔
81
        self._ports = []  # list of Port objects
2✔
82
        self._private_attributes = []
2✔
83
        self._ports = self.set_ports(ports)
2✔
84
        if private_attributes is not None:
2✔
85
            self._private_attributes = private_attributes
×
86

87
    @classmethod
2✔
88
    def from_dict(cls, dikt):
2✔
89
        """Returns the dict as a model
90

91
        :param dikt: A dict.
92
        :type: dict
93
        :return: The node of this Node.  # noqa: E501
94
        :rtype: Node
95
        """
96
        return util.deserialize_model(dikt, cls)
×
97

98
    @property
2✔
99
    def id(self):
2✔
100
        """Gets the id of this Node.
101

102

103
        :return: The id of this Node.
104
        :rtype: str
105
        """
106
        return self._id
2✔
107

108
    @id.setter
2✔
109
    def id(self, id):
2✔
110
        """Sets the id of this Node.
111

112

113
        :param id: The id of this Node.
114
        :type id: str
115
        """
116
        if id is None:
2✔
117
            raise ValueError(
2✔
118
                "Invalid value for `id`, must not be `None`"
119
            )  # noqa: E501
120

121
        self._id = id
×
122

123
    @property
2✔
124
    def name(self):
2✔
125
        """Gets the name of this Node.
126

127

128
        :return: The name of this Node.
129
        :rtype: str
130
        """
131
        return self._name
2✔
132

133
    @name.setter
2✔
134
    def name(self, name):
2✔
135
        """Sets the name of this Node.
136

137

138
        :param name: The name of this Node.
139
        :type name: str
140
        """
141
        if name is None:
2✔
142
            raise ValueError(
2✔
143
                "Invalid value for `name`, must not be `None`"
144
            )  # noqa: E501
145

146
        self._name = name
×
147

148
    @property
2✔
149
    def status(self):
2✔
150
        """Gets the status of this Node.
151

152

153
        :return: The status of this Node.
154
        :rtype: str
155
        """
156
        return self._status
2✔
157

158
    @status.setter
2✔
159
    def status(self, status):
2✔
160
        """Sets the status of this Node.
161

162

163
        :param status: The status of this Node.
164
        :type status: str
165
        """
NEW
166
        if status is None:
×
NEW
167
            raise ValueError(
×
168
                "Invalid value for `status`, must not be `None`"
169
            )  # noqa: E501
170

NEW
171
        self._status = status
×
172

173
    @property
2✔
174
    def state(self):
2✔
175
        """Gets the state of this Node.
176

177

178
        :return: The state of this Node.
179
        :rtype: str
180
        """
181
        return self._state
2✔
182

183
    @state.setter
2✔
184
    def state(self, state):
2✔
185
        """Sets the state of this Node.
186

187

188
        :param state: The state of this Node.
189
        :type state: str
190
        """
NEW
191
        if state is None:
×
NEW
192
            raise ValueError(
×
193
                "Invalid value for `state`, must not be `None`"
194
            )  # noqa: E501
195

NEW
196
        self._state = state
×
197

198
    @property
2✔
199
    def short_name(self):
2✔
200
        """Gets the short_name of this Node.
201

202

203
        :return: The short_name of this Node.
204
        :rtype: str
205
        """
206
        return self._short_name
2✔
207

208
    @short_name.setter
2✔
209
    def short_name(self, short_name):
2✔
210
        """Sets the short_name of this Node.
211

212

213
        :param short_name: The short_name of this Node.
214
        :type short_name: str
215
        """
216

217
        self._short_name = short_name
×
218

219
    @property
2✔
220
    def location(self):
2✔
221
        """Gets the location of this Node.
222

223

224
        :return: The location of this Node.
225
        :rtype: Location
226
        """
227
        return self._location
2✔
228

229
    @location.setter
2✔
230
    def location(self, location):
2✔
231
        """Sets the location of this Node.
232

233

234
        :param location: The location of this Node.
235
        :type location: Location
236
        """
237
        if location is None:
×
238
            raise ValueError(
×
239
                "Invalid value for `location`, must not be `None`"
240
            )  # noqa: E501
241

242
        self._location = location
×
243

244
    def set_location(self, location):
2✔
245
        """Sets the location of this Node.
246

247
        :param location: The location of this Node.
248
        :type: Location
249
        """
250
        if location is None:
2✔
251
            raise ValueError(
×
252
                "Invalid value for `location`, must not be `None`"
253
            )
254

255
        location_handler = LocationHandler()
2✔
256
        self._location = location_handler.import_location_data(location)
2✔
257

258
        return self.location
2✔
259

260
    @property
2✔
261
    def ports(self):
2✔
262
        """Gets the ports of this Node.
263

264

265
        :return: The ports of this Node.
266
        :rtype: List[Port]
267
        """
268
        return self._ports
2✔
269

270
    @ports.setter
2✔
271
    def ports(self, ports):
2✔
272
        """Sets the ports of this Node.
273

274

275
        :param ports: The ports of this Node.
276
        :type ports: List[Port]
277
        """
278
        if ports is None:
×
279
            raise ValueError(
×
280
                "Invalid value for `ports`, must not be `None`"
281
            )  # noqa: E501
282

283
        self._ports = ports
×
284

285
    def set_ports(self, ports):
2✔
286
        """Sets the ports of this Node.
287

288

289
        :param ports: The ports of this Node.
290
        :type: list[port]
291
        """
292
        if ports is None:
2✔
293
            raise ValueError("Invalid value for `ports`, must not be `None`")
×
294

295
        if self._ports is None:
2✔
296
            self._ports = []
×
297

298
        for port in ports:
2✔
299
            port_handler = PortHandler()
2✔
300
            port_obj = port_handler.import_port_data(port)
2✔
301
            self._ports.append(port_obj)
2✔
302

303
        return self._ports
2✔
304

305
    @property
2✔
306
    def private_attributes(self):
2✔
307
        """Gets the private_attributes of this Node.
308

309

310
        :return: The private_attributes of this Node.
311
        :rtype: List[str]
312
        """
313
        return self._private_attributes
2✔
314

315
    @private_attributes.setter
2✔
316
    def private_attributes(self, private_attributes):
2✔
317
        """Sets the private_attributes of this Node.
318

319

320
        :param private_attributes: The private_attributes of this Node.
321
        :type private_attributes: List[str]
322
        """
323

324
        self._private_attributes = private_attributes
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc