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
|
import collections
import copy
from .Utils import _write_complex_object
class Operation(object):
"""Data contract class for type Operation.
"""
_defaults = collections.OrderedDict([
('ai.operation.id', None),
('ai.operation.name', None),
('ai.operation.parentId', None),
('ai.operation.syntheticSource', None),
('ai.operation.correlationVector', None)
])
def __init__(self):
"""Initializes a new instance of the class.
"""
self._values = {
}
self._initialize()
@property
def id(self):
"""The id property.
Returns:
(string). the property value. (defaults to: None)
"""
if 'ai.operation.id' in self._values:
return self._values['ai.operation.id']
return self._defaults['ai.operation.id']
@id.setter
def id(self, value):
"""The id property.
Args:
value (string). the property value.
"""
if value == self._defaults['ai.operation.id'] and 'ai.operation.id' in self._values:
del self._values['ai.operation.id']
else:
self._values['ai.operation.id'] = value
@property
def name(self):
"""The name property.
Returns:
(string). the property value. (defaults to: None)
"""
if 'ai.operation.name' in self._values:
return self._values['ai.operation.name']
return self._defaults['ai.operation.name']
@name.setter
def name(self, value):
"""The name property.
Args:
value (string). the property value.
"""
if value == self._defaults['ai.operation.name'] and 'ai.operation.name' in self._values:
del self._values['ai.operation.name']
else:
self._values['ai.operation.name'] = value
@property
def parent_id(self):
"""The parent_id property.
Returns:
(string). the property value. (defaults to: None)
"""
if 'ai.operation.parentId' in self._values:
return self._values['ai.operation.parentId']
return self._defaults['ai.operation.parentId']
@parent_id.setter
def parent_id(self, value):
"""The parent_id property.
Args:
value (string). the property value.
"""
if value == self._defaults['ai.operation.parentId'] and 'ai.operation.parentId' in self._values:
del self._values['ai.operation.parentId']
else:
self._values['ai.operation.parentId'] = value
@property
def synthetic_source(self):
"""The synthetic_source property.
Returns:
(string). the property value. (defaults to: None)
"""
if 'ai.operation.syntheticSource' in self._values:
return self._values['ai.operation.syntheticSource']
return self._defaults['ai.operation.syntheticSource']
@synthetic_source.setter
def synthetic_source(self, value):
"""The synthetic_source property.
Args:
value (string). the property value.
"""
if value == self._defaults['ai.operation.syntheticSource'] and 'ai.operation.syntheticSource' in self._values:
del self._values['ai.operation.syntheticSource']
else:
self._values['ai.operation.syntheticSource'] = value
@property
def correlation_vector(self):
"""The correlation_vector property.
Returns:
(string). the property value. (defaults to: None)
"""
if 'ai.operation.correlationVector' in self._values:
return self._values['ai.operation.correlationVector']
return self._defaults['ai.operation.correlationVector']
@correlation_vector.setter
def correlation_vector(self, value):
"""The correlation_vector property.
Args:
value (string). the property value.
"""
if value == self._defaults['ai.operation.correlationVector'] and 'ai.operation.correlationVector' in self._values:
del self._values['ai.operation.correlationVector']
else:
self._values['ai.operation.correlationVector'] = 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)
|