U
    3d                     @   s   G d d de ZdS )c                   @   s<   e Zd ZdZdddZdd Zdd Zd	d
 ZdddZdS )
DBSnapshota  
    Represents a RDS DB Snapshot

    Properties reference available from the AWS documentation at http://docs.amazonwebservices.com/AmazonRDS/latest/APIReference/API_DBSnapshot.html

    :ivar engine_version: Specifies the version of the database engine
    :ivar license_model: License model information for the restored DB instance
    :ivar allocated_storage: Specifies the allocated storage size in gigabytes (GB)
    :ivar availability_zone: Specifies the name of the Availability Zone the DB Instance was located in at the time of the DB Snapshot
    :ivar connection: boto.rds.RDSConnection associated with the current object
    :ivar engine: Specifies the name of the database engine
    :ivar id: Specifies the identifier for the DB Snapshot (DBSnapshotIdentifier)
    :ivar instance_create_time: Specifies the time (UTC) when the snapshot was taken
    :ivar instance_id: Specifies the the DBInstanceIdentifier of the DB Instance this DB Snapshot was created from (DBInstanceIdentifier)
    :ivar master_username: Provides the master username for the DB Instance
    :ivar port: Specifies the port that the database engine was listening on at the time of the snapshot
    :ivar snapshot_create_time: Provides the time (UTC) when the snapshot was taken
    :ivar status: Specifies the status of this DB Snapshot. Possible values are [ available, backing-up, creating, deleted, deleting, failed, modifying, rebooting, resetting-master-credentials ]
    :ivar iops: Specifies the Provisioned IOPS (I/O operations per second) value of the DB instance at the time of the snapshot.
    :ivar option_group_name: Provides the option group name for the DB snapshot.
    :ivar percent_progress: The percentage of the estimated data that has been transferred.
    :ivar snapshot_type: Provides the type of the DB snapshot.
    :ivar source_region: The region that the DB snapshot was created in or copied from.
    :ivar vpc_id: Provides the Vpc Id associated with the DB snapshot.
    Nc                 C   s|   || _ || _d | _d | _d | _d | _d | _d | _d | _d | _	d | _
d | _d | _d | _d | _d | _d | _d | _d | _d | _d S N)
connectionidengineengine_versionsnapshot_create_timeinstance_create_timeportstatusavailability_zonemaster_usernameallocated_storageinstance_idlicense_modeliopsoption_group_namepercent_progresssnapshot_typesource_regionvpc_id)selfr   r    r   7/tmp/pip-unpacked-wheel-d7dsrkjd/boto/rds/dbsnapshot.py__init__1   s(    zDBSnapshot.__init__c                 C   s
   d| j  S )NzDBSnapshot:%s)r   )r   r   r   r   __repr__G   s    zDBSnapshot.__repr__c                 C   s   d S r   r   )r   nameattrsr   r   r   r   startElementJ   s    zDBSnapshot.startElementc                 C   sd  |dkr|| _ nN|dkr$|| _n<|dkr6|| _n*|dkrH|| _n|dkrZ|| _n|dkrj|| _n|dkr~t|| _n|dkr|| _n|d	kr|| _	n|d
kr|| _
n|dkrt|| _n|dkr|| _n|dkr|| _n~|dkrt|| _nj|dkr|| _nX|dkrt|| _nB|dkr0|| _n0|dkrB|| _n|dkrT|| _nt| || d S )NZEngineZEngineVersionZInstanceCreateTimeZSnapshotCreateTimeZDBInstanceIdentifierZDBSnapshotIdentifierZPortZStatusZAvailabilityZoneZMasterUsernameZAllocatedStorageZSnapshotTimeZLicenseModelZIopsZOptionGroupNameZPercentProgressZSnapshotTypeZSourceRegionZVpcId)r   r   r   r   r   r   intr	   r
   r   r   r   timer   r   r   r   r   r   r   setattr)r   r   valuer   r   r   r   
endElementM   sN    









zDBSnapshot.endElementFc                 C   sX   | j | j}t|dkr@|D ]}|j| jkr| j|j qn|rRtd| j | jS )a  
        Update the DB snapshot's status information by making a call to fetch
        the current snapshot attributes from the service.

        :type validate: bool
        :param validate: By default, if EC2 returns no data about the
                         instance the update method returns quietly.  If
                         the validate param is True, however, it will
                         raise a ValueError exception if no data is
                         returned from EC2.
            z%s is not a valid Snapshot ID)r   Zget_all_dbsnapshotsr   len__dict__update
ValueErrorr
   )r   validatersir   r   r   r&   w   s    zDBSnapshot.update)NN)F)	__name__
__module____qualname____doc__r   r   r   r"   r&   r   r   r   r   r      s   
*r   N)objectr   r   r   r   r   <module>       