Source code for models_v2.kubernetes_namespace_recovery_target_config

# -*- coding: utf-8 -*-

import cohesity_management_sdk.models_v2.kubernetes_namespace_recovery_new_source_config

[docs]class KubernetesNamespaceRecoveryTargetConfig(object): """Implementation of the 'Kubernetes Namespace Recovery Target Config' model. Specifies the recovery target configuration of the Namespace recovery. Attributes: recover_to_new_source (bool): Specifies whether or not to recover the Namespaces to a different source than they were backed up from. new_source_config (KubernetesNamespaceRecoveryNewSourceConfig): Specifies the new source configuration if a Kubernetes Namespace is being restored to a different source than the one from which it was protected. """ # Create a mapping from Model property names to API property names _names = { "recover_to_new_source":'recoverToNewSource', "new_source_config":'newSourceConfig' } def __init__(self, recover_to_new_source=None, new_source_config=None): """Constructor for the KubernetesNamespaceRecoveryTargetConfig class""" # Initialize members of the class self.recover_to_new_source = recover_to_new_source self.new_source_config = new_source_config
[docs] @classmethod def from_dictionary(cls, dictionary): """Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object as obtained from the deserialization of the server's response. The keys MUST match property names in the API description. Returns: object: An instance of this structure class. """ if dictionary is None: return None # Extract variables from the dictionary recover_to_new_source = dictionary.get('recoverToNewSource') new_source_config = cohesity_management_sdk.models_v2.kubernetes_namespace_recovery_new_source_config.KubernetesNamespaceRecoveryNewSourceConfig.from_dictionary(dictionary.get('newSourceConfig')) if dictionary.get('newSourceConfig') else None # Return an object of this model return cls(recover_to_new_source, new_source_config)