Source code for models_v2.target_vm_credentials_6

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


[docs]class TargetVmCredentials6(object): """Implementation of the 'TargetVmCredentials6' model. Specifies credentials to access the target VM. This is required if bringDisksOnline is set to true and useExistingAgent set to false. Attributes: username (string): Specifies the username to access target entity. password (string): Specifies the password to access target entity. """ # Create a mapping from Model property names to API property names _names = { "username":'username', "password":'password' } def __init__(self, username=None, password=None): """Constructor for the TargetVmCredentials6 class""" # Initialize members of the class self.username = username self.password = password
[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 username = dictionary.get('username') password = dictionary.get('password') # Return an object of this model return cls(username, password)