@@ -250,387 +250,3 @@ def get_permitted_network(self, instance_id: str, dnszone_id: str, permitted_net
250
250
response = self .send (request )
251
251
return response
252
252
253
-
254
- ##############################################################################
255
- # Models
256
- ##############################################################################
257
-
258
-
259
- class FirstHref ():
260
- """
261
- href.
262
-
263
- :attr str href: (optional) href.
264
- """
265
-
266
- def __init__ (self , * , href : str = None ) -> None :
267
- """
268
- Initialize a FirstHref object.
269
-
270
- :param str href: (optional) href.
271
- """
272
- self .href = href
273
-
274
- @classmethod
275
- def from_dict (cls , _dict : Dict ) -> 'FirstHref' :
276
- """Initialize a FirstHref object from a json dictionary."""
277
- args = {}
278
- if 'href' in _dict :
279
- args ['href' ] = _dict .get ('href' )
280
- return cls (** args )
281
-
282
- @classmethod
283
- def _from_dict (cls , _dict ):
284
- """Initialize a FirstHref object from a json dictionary."""
285
- return cls .from_dict (_dict )
286
-
287
- def to_dict (self ) -> Dict :
288
- """Return a json dictionary representing this model."""
289
- _dict = {}
290
- if hasattr (self , 'href' ) and self .href is not None :
291
- _dict ['href' ] = self .href
292
- return _dict
293
-
294
- def _to_dict (self ):
295
- """Return a json dictionary representing this model."""
296
- return self .to_dict ()
297
-
298
- def __str__ (self ) -> str :
299
- """Return a `str` version of this FirstHref object."""
300
- return json .dumps (self .to_dict (), indent = 2 )
301
-
302
- def __eq__ (self , other : 'FirstHref' ) -> bool :
303
- """Return `true` when self and other are equal, false otherwise."""
304
- if not isinstance (other , self .__class__ ):
305
- return False
306
- return self .__dict__ == other .__dict__
307
-
308
- def __ne__ (self , other : 'FirstHref' ) -> bool :
309
- """Return `true` when self and other are not equal, false otherwise."""
310
- return not self == other
311
-
312
-
313
- class ListPermittedNetworks ():
314
- """
315
- List permitted networks response.
316
-
317
- :attr List[PermittedNetwork] permitted_networks: An array of permitted networks.
318
- :attr int offset: Specify how many permitted networks to skip over, the default
319
- value is 0.
320
- :attr int limit: Specify how many permitted networks are returned, the default
321
- value is 10.
322
- :attr int total_count: Total number of permitted networks.
323
- :attr FirstHref first: href.
324
- :attr NextHref next: (optional) href.
325
- """
326
-
327
- def __init__ (self , permitted_networks : List ['PermittedNetwork' ], offset : int , limit : int , total_count : int , first : 'FirstHref' , * , next : 'NextHref' = None ) -> None :
328
- """
329
- Initialize a ListPermittedNetworks object.
330
-
331
- :param List[PermittedNetwork] permitted_networks: An array of permitted
332
- networks.
333
- :param int offset: Specify how many permitted networks to skip over, the
334
- default value is 0.
335
- :param int limit: Specify how many permitted networks are returned, the
336
- default value is 10.
337
- :param int total_count: Total number of permitted networks.
338
- :param FirstHref first: href.
339
- :param NextHref next: (optional) href.
340
- """
341
- self .permitted_networks = permitted_networks
342
- self .offset = offset
343
- self .limit = limit
344
- self .total_count = total_count
345
- self .first = first
346
- self .next = next
347
-
348
- @classmethod
349
- def from_dict (cls , _dict : Dict ) -> 'ListPermittedNetworks' :
350
- """Initialize a ListPermittedNetworks object from a json dictionary."""
351
- args = {}
352
- if 'permitted_networks' in _dict :
353
- args ['permitted_networks' ] = [PermittedNetwork .from_dict (x ) for x in _dict .get ('permitted_networks' )]
354
- else :
355
- raise ValueError ('Required property \' permitted_networks\' not present in ListPermittedNetworks JSON' )
356
- if 'offset' in _dict :
357
- args ['offset' ] = _dict .get ('offset' )
358
- else :
359
- raise ValueError ('Required property \' offset\' not present in ListPermittedNetworks JSON' )
360
- if 'limit' in _dict :
361
- args ['limit' ] = _dict .get ('limit' )
362
- else :
363
- raise ValueError ('Required property \' limit\' not present in ListPermittedNetworks JSON' )
364
- if 'total_count' in _dict :
365
- args ['total_count' ] = _dict .get ('total_count' )
366
- else :
367
- raise ValueError ('Required property \' total_count\' not present in ListPermittedNetworks JSON' )
368
- if 'first' in _dict :
369
- args ['first' ] = FirstHref .from_dict (_dict .get ('first' ))
370
- else :
371
- raise ValueError ('Required property \' first\' not present in ListPermittedNetworks JSON' )
372
- if 'next' in _dict :
373
- args ['next' ] = NextHref .from_dict (_dict .get ('next' ))
374
- return cls (** args )
375
-
376
- @classmethod
377
- def _from_dict (cls , _dict ):
378
- """Initialize a ListPermittedNetworks object from a json dictionary."""
379
- return cls .from_dict (_dict )
380
-
381
- def to_dict (self ) -> Dict :
382
- """Return a json dictionary representing this model."""
383
- _dict = {}
384
- if hasattr (self , 'permitted_networks' ) and self .permitted_networks is not None :
385
- _dict ['permitted_networks' ] = [x .to_dict () for x in self .permitted_networks ]
386
- if hasattr (self , 'offset' ) and self .offset is not None :
387
- _dict ['offset' ] = self .offset
388
- if hasattr (self , 'limit' ) and self .limit is not None :
389
- _dict ['limit' ] = self .limit
390
- if hasattr (self , 'total_count' ) and self .total_count is not None :
391
- _dict ['total_count' ] = self .total_count
392
- if hasattr (self , 'first' ) and self .first is not None :
393
- _dict ['first' ] = self .first .to_dict ()
394
- if hasattr (self , 'next' ) and self .next is not None :
395
- _dict ['next' ] = self .next .to_dict ()
396
- return _dict
397
-
398
- def _to_dict (self ):
399
- """Return a json dictionary representing this model."""
400
- return self .to_dict ()
401
-
402
- def __str__ (self ) -> str :
403
- """Return a `str` version of this ListPermittedNetworks object."""
404
- return json .dumps (self .to_dict (), indent = 2 )
405
-
406
- def __eq__ (self , other : 'ListPermittedNetworks' ) -> bool :
407
- """Return `true` when self and other are equal, false otherwise."""
408
- if not isinstance (other , self .__class__ ):
409
- return False
410
- return self .__dict__ == other .__dict__
411
-
412
- def __ne__ (self , other : 'ListPermittedNetworks' ) -> bool :
413
- """Return `true` when self and other are not equal, false otherwise."""
414
- return not self == other
415
-
416
-
417
- class NextHref ():
418
- """
419
- href.
420
-
421
- :attr str href: (optional) href.
422
- """
423
-
424
- def __init__ (self , * , href : str = None ) -> None :
425
- """
426
- Initialize a NextHref object.
427
-
428
- :param str href: (optional) href.
429
- """
430
- self .href = href
431
-
432
- @classmethod
433
- def from_dict (cls , _dict : Dict ) -> 'NextHref' :
434
- """Initialize a NextHref object from a json dictionary."""
435
- args = {}
436
- if 'href' in _dict :
437
- args ['href' ] = _dict .get ('href' )
438
- return cls (** args )
439
-
440
- @classmethod
441
- def _from_dict (cls , _dict ):
442
- """Initialize a NextHref object from a json dictionary."""
443
- return cls .from_dict (_dict )
444
-
445
- def to_dict (self ) -> Dict :
446
- """Return a json dictionary representing this model."""
447
- _dict = {}
448
- if hasattr (self , 'href' ) and self .href is not None :
449
- _dict ['href' ] = self .href
450
- return _dict
451
-
452
- def _to_dict (self ):
453
- """Return a json dictionary representing this model."""
454
- return self .to_dict ()
455
-
456
- def __str__ (self ) -> str :
457
- """Return a `str` version of this NextHref object."""
458
- return json .dumps (self .to_dict (), indent = 2 )
459
-
460
- def __eq__ (self , other : 'NextHref' ) -> bool :
461
- """Return `true` when self and other are equal, false otherwise."""
462
- if not isinstance (other , self .__class__ ):
463
- return False
464
- return self .__dict__ == other .__dict__
465
-
466
- def __ne__ (self , other : 'NextHref' ) -> bool :
467
- """Return `true` when self and other are not equal, false otherwise."""
468
- return not self == other
469
-
470
-
471
- class PermittedNetwork ():
472
- """
473
- Permitted network details.
474
-
475
- :attr str id: (optional) Unique identifier of a permitted network.
476
- :attr datetime created_on: (optional) The time when a permitted network is
477
- created.
478
- :attr datetime modified_on: (optional) The recent time when a permitted network
479
- is modified.
480
- :attr List[PermittedNetworkVpc] permitted_network: (optional) Permitted network
481
- data.
482
- :attr str type: (optional) The type of a permitted network.
483
- :attr str state: (optional) The state of a permitted network.
484
- """
485
-
486
- def __init__ (self , * , id : str = None , created_on : datetime = None , modified_on : datetime = None , permitted_network : List ['PermittedNetworkVpc' ] = None , type : str = None , state : str = None ) -> None :
487
- """
488
- Initialize a PermittedNetwork object.
489
-
490
- :param str id: (optional) Unique identifier of a permitted network.
491
- :param datetime created_on: (optional) The time when a permitted network is
492
- created.
493
- :param datetime modified_on: (optional) The recent time when a permitted
494
- network is modified.
495
- :param List[PermittedNetworkVpc] permitted_network: (optional) Permitted
496
- network data.
497
- :param str type: (optional) The type of a permitted network.
498
- :param str state: (optional) The state of a permitted network.
499
- """
500
- self .id = id
501
- self .created_on = created_on
502
- self .modified_on = modified_on
503
- self .permitted_network = permitted_network
504
- self .type = type
505
- self .state = state
506
-
507
- @classmethod
508
- def from_dict (cls , _dict : Dict ) -> 'PermittedNetwork' :
509
- """Initialize a PermittedNetwork object from a json dictionary."""
510
- args = {}
511
- if 'id' in _dict :
512
- args ['id' ] = _dict .get ('id' )
513
- if 'created_on' in _dict :
514
- args ['created_on' ] = string_to_datetime (_dict .get ('created_on' ))
515
- if 'modified_on' in _dict :
516
- args ['modified_on' ] = string_to_datetime (_dict .get ('modified_on' ))
517
- if 'permitted_network' in _dict :
518
- args ['permitted_network' ] = [PermittedNetworkVpc .from_dict (x ) for x in _dict .get ('permitted_network' )]
519
- if 'type' in _dict :
520
- args ['type' ] = _dict .get ('type' )
521
- if 'state' in _dict :
522
- args ['state' ] = _dict .get ('state' )
523
- return cls (** args )
524
-
525
- @classmethod
526
- def _from_dict (cls , _dict ):
527
- """Initialize a PermittedNetwork object from a json dictionary."""
528
- return cls .from_dict (_dict )
529
-
530
- def to_dict (self ) -> Dict :
531
- """Return a json dictionary representing this model."""
532
- _dict = {}
533
- if hasattr (self , 'id' ) and self .id is not None :
534
- _dict ['id' ] = self .id
535
- if hasattr (self , 'created_on' ) and self .created_on is not None :
536
- _dict ['created_on' ] = datetime_to_string (self .created_on )
537
- if hasattr (self , 'modified_on' ) and self .modified_on is not None :
538
- _dict ['modified_on' ] = datetime_to_string (self .modified_on )
539
- if hasattr (self , 'permitted_network' ) and self .permitted_network is not None :
540
- _dict ['permitted_network' ] = [x .to_dict () for x in self .permitted_network ]
541
- if hasattr (self , 'type' ) and self .type is not None :
542
- _dict ['type' ] = self .type
543
- if hasattr (self , 'state' ) and self .state is not None :
544
- _dict ['state' ] = self .state
545
- return _dict
546
-
547
- def _to_dict (self ):
548
- """Return a json dictionary representing this model."""
549
- return self .to_dict ()
550
-
551
- def __str__ (self ) -> str :
552
- """Return a `str` version of this PermittedNetwork object."""
553
- return json .dumps (self .to_dict (), indent = 2 )
554
-
555
- def __eq__ (self , other : 'PermittedNetwork' ) -> bool :
556
- """Return `true` when self and other are equal, false otherwise."""
557
- if not isinstance (other , self .__class__ ):
558
- return False
559
- return self .__dict__ == other .__dict__
560
-
561
- def __ne__ (self , other : 'PermittedNetwork' ) -> bool :
562
- """Return `true` when self and other are not equal, false otherwise."""
563
- return not self == other
564
-
565
-
566
- class TypeEnum (Enum ):
567
- """
568
- The type of a permitted network.
569
- """
570
- VPC = "vpc"
571
-
572
-
573
- class StateEnum (Enum ):
574
- """
575
- The state of a permitted network.
576
- """
577
- ACTIVE = "ACTIVE"
578
- REMOVAL_IN_PROGRESS = "REMOVAL_IN_PROGRESS"
579
-
580
-
581
- class PermittedNetworkVpc ():
582
- """
583
- Permitted network data for VPC.
584
-
585
- :attr str vpc_crn: CRN string uniquely identifies a VPC.
586
- """
587
-
588
- def __init__ (self , vpc_crn : str ) -> None :
589
- """
590
- Initialize a PermittedNetworkVpc object.
591
-
592
- :param str vpc_crn: CRN string uniquely identifies a VPC.
593
- """
594
- self .vpc_crn = vpc_crn
595
-
596
- @classmethod
597
- def from_dict (cls , _dict : Dict ) -> 'PermittedNetworkVpc' :
598
- """Initialize a PermittedNetworkVpc object from a json dictionary."""
599
- args = {}
600
- if 'vpc_crn' in _dict :
601
- args ['vpc_crn' ] = _dict .get ('vpc_crn' )
602
- else :
603
- raise ValueError ('Required property \' vpc_crn\' not present in PermittedNetworkVpc JSON' )
604
- return cls (** args )
605
-
606
- @classmethod
607
- def _from_dict (cls , _dict ):
608
- """Initialize a PermittedNetworkVpc object from a json dictionary."""
609
- return cls .from_dict (_dict )
610
-
611
- def to_dict (self ) -> Dict :
612
- """Return a json dictionary representing this model."""
613
- _dict = {}
614
- if hasattr (self , 'vpc_crn' ) and self .vpc_crn is not None :
615
- _dict ['vpc_crn' ] = self .vpc_crn
616
- return _dict
617
-
618
- def _to_dict (self ):
619
- """Return a json dictionary representing this model."""
620
- return self .to_dict ()
621
-
622
- def __str__ (self ) -> str :
623
- """Return a `str` version of this PermittedNetworkVpc object."""
624
- return json .dumps (self .to_dict (), indent = 2 )
625
-
626
- def __eq__ (self , other : 'PermittedNetworkVpc' ) -> bool :
627
- """Return `true` when self and other are equal, false otherwise."""
628
- if not isinstance (other , self .__class__ ):
629
- return False
630
- return self .__dict__ == other .__dict__
631
-
632
- def __ne__ (self , other : 'PermittedNetworkVpc' ) -> bool :
633
- """Return `true` when self and other are not equal, false otherwise."""
634
- return not self == other
635
-
636
-
0 commit comments