Exemple #1
0
    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
        all_endpoints_reachable = dictionary.get('allEndpointsReachable')
        bandwidth_limit = cohesity_management_sdk.models.bandwidth_limit.BandwidthLimit.from_dictionary(
            dictionary.get('bandwidthLimit')) if dictionary.get(
                'bandwidthLimit') else None
        clear_interfaces = dictionary.get('clearInterfaces')
        clear_vlan_id = dictionary.get('clearVlanId')
        cluster_id = dictionary.get('clusterId')
        cluster_incarnation_id = dictionary.get('clusterIncarnationId')
        compression_enabled = dictionary.get('compressionEnabled')
        encryption_key = dictionary.get('encryptionKey')
        iface_name = dictionary.get('ifaceName')
        local_ips = dictionary.get('localIps')
        name = dictionary.get('name')
        network_interface_group = dictionary.get('networkInterfaceGroup')
        network_interface_ids = dictionary.get('networkInterfaceIds')
        purpose_remote_access = dictionary.get('purposeRemoteAccess')
        purpose_replication = dictionary.get('purposeReplication')
        remote_access_credentials = cohesity_management_sdk.models.access_token_credential.AccessTokenCredential.from_dictionary(
            dictionary.get('remoteAccessCredentials')) if dictionary.get(
                'remoteAccessCredentials') else None
        remote_ips = dictionary.get('remoteIps')
        tenant_id = dictionary.get('tenantId')
        user_name = dictionary.get('userName')
        view_box_pair_info = None
        if dictionary.get('viewBoxPairInfo') != None:
            view_box_pair_info = list()
            for structure in dictionary.get('viewBoxPairInfo'):
                view_box_pair_info.append(
                    cohesity_management_sdk.models.view_box_pair_info.
                    ViewBoxPairInfo.from_dictionary(structure))
        vlan_id = dictionary.get('vlanId')

        # Return an object of this model
        return cls(all_endpoints_reachable, bandwidth_limit, clear_interfaces,
                   clear_vlan_id, cluster_id, cluster_incarnation_id,
                   compression_enabled, encryption_key, iface_name, local_ips,
                   name, network_interface_group, network_interface_ids,
                   purpose_remote_access, purpose_replication,
                   remote_access_credentials, remote_ips, tenant_id, user_name,
                   view_box_pair_info, vlan_id)
    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
        all_endpoints_reachable = dictionary.get('allEndpointsReachable')
        auto_register_target = dictionary.get('autoRegisterTarget')
        auto_registration = dictionary.get('autoRegistration')
        bandwidth_limit = cohesity_management_sdk.models.bandwidth_limit.BandwidthLimit.from_dictionary(
            dictionary.get('bandwidthLimit')) if dictionary.get(
                'bandwidthLimit') else None
        cluster_id = dictionary.get('clusterId')
        cluster_incarnation_id = dictionary.get('clusterIncarnationId')
        compression_enabled = dictionary.get('compressionEnabled')
        encryption_key = dictionary.get('encryptionKey')
        name = dictionary.get('name')
        network_interface = dictionary.get('networkInterface')
        password = dictionary.get('password')
        purpose_remote_access = dictionary.get('purposeRemoteAccess')
        purpose_replication = dictionary.get('purposeReplication')
        remote_access_credentials = cohesity_management_sdk.models.access_token_credential.AccessTokenCredential.from_dictionary(
            dictionary.get('remoteAccessCredentials')) if dictionary.get(
                'remoteAccessCredentials') else None
        remote_ips = dictionary.get('remoteIps')
        remote_iris_ports = dictionary.get('remoteIrisPorts')
        user_name = dictionary.get('userName')
        validate_only = dictionary.get('validateOnly')
        view_box_pair_info = None
        if dictionary.get('viewBoxPairInfo') != None:
            view_box_pair_info = list()
            for structure in dictionary.get('viewBoxPairInfo'):
                view_box_pair_info.append(
                    cohesity_management_sdk.models.view_box_pair_info.
                    ViewBoxPairInfo.from_dictionary(structure))

        # Return an object of this model
        return cls(all_endpoints_reachable, auto_register_target,
                   auto_registration, bandwidth_limit, cluster_id,
                   cluster_incarnation_id, compression_enabled, encryption_key,
                   name, network_interface, password, purpose_remote_access,
                   purpose_replication, remote_access_credentials, remote_ips,
                   remote_iris_ports, user_name, validate_only,
                   view_box_pair_info)