models.v1alpha1: leverage BaseModel
@@ -22,6 +22,7 @@ class PetSet(BaseModel):
self._kind = 'PetSet'
self._api_version = 'apps/v1alpha1'
+
self._spec = PetSetSpec()
self._status = PetSetStatus()
@@ -29,12 +30,8 @@ class PetSet(BaseModel):
self._build_with_model(model)
def _build_with_model(self, model):
- if 'kind' in model:
- self.kind = model['kind']
- if 'apiVersion' in model:
- self.api_version = model['apiVersion']
- if 'metadata' in model:
- self.metadata = ObjectMeta(model['metadata'])
+ super(PetSet, self).build_with_model(model)
+
if 'spec' in model:
self.spec = PetSetSpec(model['spec'])
if 'status' in model:
@@ -68,6 +65,7 @@ class PetSet(BaseModel):
def serialize(self):
data = super(PetSet, self).serialize()
+
if self.spec is not None:
data['spec'] = self.spec.serialize()
if self.status is not None:
