File: Cloud.py

package info (click to toggle)
python-applicationinsights 0.11.10-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 876 kB
  • sloc: python: 5,948; makefile: 151; sh: 77
file content (78 lines) | stat: -rw-r--r-- 2,305 bytes parent folder | download | duplicates (3)
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
import collections
import copy
from .Utils import _write_complex_object

class Cloud(object):
    """Data contract class for type Cloud.
    """
    _defaults = collections.OrderedDict([
        ('ai.cloud.role', None),
        ('ai.cloud.roleInstance', None)
    ])
    
    def __init__(self):
        """Initializes a new instance of the class.
        """
        self._values = {
        }
        self._initialize()
        
    @property
    def role(self):
        """The role property.
        
        Returns:
            (string). the property value. (defaults to: None)
        """
        if 'ai.cloud.role' in self._values:
            return self._values['ai.cloud.role']
        return self._defaults['ai.cloud.role']
        
    @role.setter
    def role(self, value):
        """The role property.
        
        Args:
            value (string). the property value.
        """
        if value == self._defaults['ai.cloud.role'] and 'ai.cloud.role' in self._values:
            del self._values['ai.cloud.role']
        else:
            self._values['ai.cloud.role'] = value
        
    @property
    def role_instance(self):
        """The role_instance property.
        
        Returns:
            (string). the property value. (defaults to: None)
        """
        if 'ai.cloud.roleInstance' in self._values:
            return self._values['ai.cloud.roleInstance']
        return self._defaults['ai.cloud.roleInstance']
        
    @role_instance.setter
    def role_instance(self, value):
        """The role_instance property.
        
        Args:
            value (string). the property value.
        """
        if value == self._defaults['ai.cloud.roleInstance'] and 'ai.cloud.roleInstance' in self._values:
            del self._values['ai.cloud.roleInstance']
        else:
            self._values['ai.cloud.roleInstance'] = value
        
    def _initialize(self):
        """Initializes the current instance of the object.
        """
        pass
    
    def write(self):
        """Writes the contents of this object and returns the content as a dict object.
        
        Returns:
            (dict). the object that represents the same data as the current instance.
        """
        return _write_complex_object(self._defaults, self._values)