o
    ȷe1=                     @   s   d Z ddlmZ ddlmZ G dd deZG dd deZG dd	 d	eZG d
d deZ	G dd deZ
G dd deZdS )z
Represents an OptionGroup
    )DBSecurityGroup)	ResultSetc                   @   s@   e Zd ZdZ			dddZdd Zdd	 Zd
d Zdd ZdS )OptionGroupa  
    Represents an RDS option group

    Properties reference available from the AWS documentation at
    http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_OptionGroup.html

    :ivar connection: :py:class:`boto.rds.RDSConnection` associated with the
                      current object
    :ivar name: Name of the option group
    :ivar description: The description of the option group
    :ivar engine_name: The name of the database engine to use
    :ivar major_engine_version: The major version number of the engine to use
    :ivar allow_both_vpc_and_nonvpc: Indicates whether this option group can be
                                     applied to both VPC and non-VPC instances.
                                     The value ``True`` indicates the option
                                     group can be applied to both VPC and
                                     non-VPC instances.
    :ivar vpc_id: If AllowsVpcAndNonVpcInstanceMemberships is 'false', this
                  field is blank. If AllowsVpcAndNonVpcInstanceMemberships is
                  ``True`` and this field is blank, then this option group can
                  be applied to both VPC and non-VPC instances. If this field
                  contains a value, then this option group can only be applied
                  to instances that are in the VPC indicated by this field.
    :ivar options: The list of :py:class:`boto.rds.optiongroup.Option` objects
                   associated with the group
    NFc                 C   s.   || _ || _|| _|| _|| _|| _g | _d S N)nameengine_namemajor_engine_versiondescriptionallow_both_vpc_and_nonvpcvpc_idoptions)self
connectionr   r   r   r	   r
   r    r   K/var/www/ideatree/venv/lib/python3.10/site-packages/boto/rds/optiongroup.py__init__:   s   
zOptionGroup.__init__c                 C   
   d| j  S )NzOptionGroup:%sr   r   r   r   r   __repr__E      
zOptionGroup.__repr__c                 C   s    |dkrt dtfg| _d S d S )NOptions)r   Optionr   r   r   attrsr   r   r   r   startElementH   s
   zOptionGroup.startElementc                 C   s   |dkr	|| _ d S |dkr|| _d S |dkr|| _d S |dkr$|| _d S |dkr8| dkr3d| _d S d| _d S |d	krA|| _d S t| || d S )
NOptionGroupName
EngineNameMajorEngineVersionOptionGroupDescription%AllowsVpcAndNonVpcInstanceMembershipstrueTFVpcId)r   r   r   r	   lowerr
   r   setattrr   r   valuer   r   r   r   
endElementP   s   






zOptionGroup.endElementc                 C   s   | j | jS r   )r   delete_option_groupr   r   r   r   r   deletec   s   zOptionGroup.delete)NNNNNFN)	__name__
__module____qualname____doc__r   r   r   r'   r)   r   r   r   r   r      s    
r   c                   @   s8   e Zd ZdZ			dddZdd Zdd	 Zd
d ZdS )r   a  
    Describes a Option for use in an OptionGroup

    :ivar name: The name of the option
    :ivar description: The description of the option.
    :ivar permanent: Indicate if this option is permanent.
    :ivar persistent: Indicate if this option is persistent.
    :ivar port: If required, the port configured for this option to use.
    :ivar settings: The option settings for this option.
    :ivar db_security_groups: If the option requires access to a port, then
                              this DB Security Group allows access to the port.
    :ivar vpc_security_groups: If the option requires access to a port, then
                               this VPC Security Group allows access to the
                               port.
    NFc	           	      C   sh   || _ || _|| _|| _|| _|| _|| _|| _| jd u r g | _| jd u r(g | _| jd u r2g | _d S d S r   )r   r	   	permanent
persistentportsettingsdb_security_groupsvpc_security_groups)	r   r   r	   r.   r/   r0   r1   r2   r3   r   r   r   r   w   s   



zOption.__init__c                 C   r   )Nz	Option:%sr   r   r   r   r   r      r   zOption.__repr__c                 C   sX   |dkrt dtfg| _d S |dkrt dtfg| _d S |dkr*t dtfg| _d S d S )NOptionSettingsDBSecurityGroupMembershipsVpcSecurityGroupMemberships)r   OptionSettingr1   r   r2   VpcSecurityGroupr3   r   r   r   r   r      s   zOption.startElementc                 C   s   |dkr	|| _ d S |dkr|| _d S |dkr&| dkr!d| _d S d| _d S |dkr:| dkr5d| _d S d| _d S |dkrEt|| _d S t| || d S )	N
OptionNameOptionDescription	Permanentr!   TF
PersistentPort)r   r	   r#   	permenantr/   intr0   r$   r%   r   r   r   r'      s   





zOption.endElement)NNFFNNNNr*   r+   r,   r-   r   r   r   r'   r   r   r   r   r   g   s    
r   c                   @   s8   e Zd ZdZ			dddZdd Zdd	 Zd
d ZdS )r7   a  
    Describes a OptionSetting for use in an Option

    :ivar name: The name of the option that has settings that you can set.
    :ivar description: The description of the option setting.
    :ivar value: The current value of the option setting.
    :ivar default_value: The default value of the option setting.
    :ivar allowed_values: The allowed values of the option setting.
    :ivar data_type: The data type of the option setting.
    :ivar apply_type: The DB engine specific parameter type.
    :ivar is_modifiable: A Boolean value that, when true, indicates the option
                         setting can be modified from the default.
    :ivar is_collection: Indicates if the option setting is part of a
                         collection.
    NFc
           
      C   s:   || _ || _|| _|| _|| _|| _|| _|| _|	| _d S r   )	r   r	   r&   default_valueallowed_values	data_type
apply_typeis_modifiableis_collection)
r   r   r	   r&   rA   rB   rC   rD   rE   rF   r   r   r   r      s   
zOptionSetting.__init__c                 C   r   )NzOptionSetting:%sr   r   r   r   r   r      r   zOptionSetting.__repr__c                 C      d S r   r   r   r   r   r   r         zOptionSetting.startElementc                 C   s   |dkr	|| _ d S |dkr|| _d S |dkr|| _d S |dkr$|| _d S |dkr-|| _d S |dkr6|| _d S |dkr?|| _d S |dkrS| d	krNd
| _d S d| _d S |dkrg| d	krbd
| _	d S d| _	d S t
| || d S )NNameDescriptionValueDefaultValueAllowedValuesDataType	ApplyTypeIsModifiabler!   TFIsCollection)r   r	   r&   rA   rB   rC   rD   r#   rE   rF   r$   r%   r   r   r   r'      s.   










zOptionSetting.endElement)	NNNFNNNFFr@   r   r   r   r   r7      s    
r7   c                   @   s2   e Zd ZdZdddZdd Zdd Zd	d
 ZdS )r8   zA
    Describes a VPC security group for use in a OptionGroup
    Nc                 C   s   || _ || _d S r   )r   status)r   r   rR   r   r   r   r      s   
zVpcSecurityGroup.__init__c                 C   r   )NzVpcSecurityGroup:%s)r   r   r   r   r   r      r   zVpcSecurityGroup.__repr__c                 C   rG   r   r   r   r   r   r   r      rH   zVpcSecurityGroup.startElementc                 C   s4   |dkr	|| _ d S |dkr|| _d S t| || d S )NVpcSecurityGroupIdStatus)r   rR   r$   r%   r   r   r   r'     s
   

zVpcSecurityGroup.endElement)NNr@   r   r   r   r   r8      s    
r8   c                   @   s:   e Zd ZdZ				dddZdd Zdd	 Zd
d ZdS )OptionGroupOptiona  
    Describes a OptionGroupOption for use in an OptionGroup

    :ivar name: The name of the option
    :ivar description: The description of the option.
    :ivar engine_name: Engine name that this option can be applied to.
    :ivar major_engine_version: Indicates the major engine version that the
                                option is available for.
    :ivar min_minor_engine_version: The minimum required engine version for the
                                    option to be applied.
    :ivar permanent: Indicate if this option is permanent.
    :ivar persistent: Indicate if this option is persistent.
    :ivar port_required: Specifies whether the option requires a port.
    :ivar default_port: If the option requires a port, specifies the default
                        port for the option.
    :ivar settings: The option settings for this option.
    :ivar depends_on: List of all options that are prerequisites for this
                      option.
    NFc                 C   sj   || _ || _|| _|| _|| _|| _|| _|| _|	| _|
| _	|| _
| j	d u r)g | _	| j
d u r3g | _
d S d S r   )r   r	   r   r   min_minor_engine_versionr.   r/   port_requireddefault_portr1   
depends_on)r   r   r	   r   r   rV   r.   r/   rW   rX   r1   rY   r   r   r   r      s    


zOptionGroupOption.__init__c                 C   r   )NzOptionGroupOption:%sr   r   r   r   r   r   6  r   zOptionGroupOption.__repr__c                 C   s2   |dkrt dtfg| _d S |dkrg | _d S d S )NOptionGroupOptionSettingsOptionsDependedOn)r   OptionGroupOptionSettingr1   rY   r   r   r   r   r   9  s   
zOptionGroupOption.startElementc                 C   s   |dkr	|| _ d S |dkr|| _d S |dkr|| _d S |dkr$|| _d S |dkr-|| _d S |dkrA| dkr<d| _d S d	| _d S |d
krU| dkrPd| _d S d	| _d S |dkri| dkrdd| _d S d	| _d S |dkrtt	|| _
d S t| || d S )NrI   rJ   r   r   !MinimumRequiredMinorEngineVersionr;   r!   TFr<   PortRequiredDefaultPort)r   r	   r   r   rV   r#   r>   r/   rW   r?   rX   r$   r%   r   r   r   r'   C  s2   










zOptionGroupOption.endElement)NNNNNFFFNNNr@   r   r   r   r   rU     s    

rU   c                   @   s6   e Zd ZdZ		dddZdd Zdd	 Zd
d ZdS )r\   a  
    Describes a OptionGroupOptionSetting for use in an OptionGroupOption.

    :ivar name: The name of the option that has settings that you can set.
    :ivar description: The description of the option setting.
    :ivar value: The current value of the option setting.
    :ivar default_value: The default value of the option setting.
    :ivar allowed_values: The allowed values of the option setting.
    :ivar data_type: The data type of the option setting.
    :ivar apply_type: The DB engine specific parameter type.
    :ivar is_modifiable: A Boolean value that, when true, indicates the option
                         setting can be modified from the default.
    :ivar is_collection: Indicates if the option setting is part of a
                         collection.
    NFc                 C   s(   || _ || _|| _|| _|| _|| _d S r   )r   r	   rA   rB   rD   rE   )r   r   r	   rA   rB   rD   rE   r   r   r   r   t  s   
z!OptionGroupOptionSetting.__init__c                 C   r   )NzOptionGroupOptionSetting:%sr   r   r   r   r   r   }  r   z!OptionGroupOptionSetting.__repr__c                 C   rG   r   r   r   r   r   r   r     rH   z%OptionGroupOptionSetting.startElementc                 C   s   |dkr	|| _ d S |dkr|| _d S |dkr|| _d S |dkr$|| _d S |dkr-|| _d S |dkrA| dkr<d| _d S d	| _d S t| || d S )
NSettingNameSettingDescriptionrL   rM   rO   rP   r!   TF)r   r	   rA   rB   rD   r#   rE   r$   r%   r   r   r   r'     s   






z#OptionGroupOptionSetting.endElement)NNFNNFr@   r   r   r   r   r\   c  s    
	r\   N)r-   boto.rds.dbsecuritygroupr   boto.resultsetr   objectr   r   r7   r8   rU   r\   r   r   r   r   <module>   s   HMAW