
    5                     l   d Z ddlmZ ddlmZ ddlmZ  G d dej                        Z G d de      Z G d	 d
e      Z G d de      Z	 G d de      Z
 G d de      Z G d de      Zdej                  defdZ G d de      Z G d de      Z G d de      Z G d de      Z G d de      Zy )!zManagement API gcloud errors.    )	constants)
exceptions)	resourcesc                       e Zd ZdZy)ErrorzBase error for this module.N__name__
__module____qualname____doc__     3lib/googlecloudsdk/command_lib/scc/manage/errors.pyr   r      s    #r   r   c                   (     e Zd ZdZdef fdZ xZS )InvalidParentError,An error representing an invalid CRM parent.bad_parent_argc                 4    t         t        |   d| d       y )N"zh" is not a valid parent. The parent name should begin with "organizations/", "projects/", or "folders/".superr   __init__selfr   	__class__s     r   r   zInvalidParentError.__init__   s&    	%
N D 	Dr   r	   r
   r   r   strr   __classcell__r   s   @r   r   r          4S  r   r   c                   (     e Zd ZdZdef fdZ xZS )InvalidParentFlagErrorr   r   c                 ,    t         |   d| d       y )Nr   zZ" is not a valid parent. The parent name should begin with "organizations/"or "projects/".)r   r   r   s     r   r   zInvalidParentFlagError.__init__'   s"    	G
N 6 	6r   r   r   s   @r   r"   r"   $   r    r   r"   c                   (     e Zd ZdZdef fdZ xZS )InvalidServiceNameErrorz.An error representing an invalid service name.bad_service_name_argc                     dj                  t        j                  D cg c]  }t        |       c}      }t        t
        |   d| d| d       y c c}w )Nu   
		• 'uH   ' is not a valid service name.

	The service name must be one of:
		• 
)joinr   SUPPORTED_SERVICESr   r   r   r   )r   r&   servicevalid_service_namesr   s       r   r   z InvalidServiceNameError.__init__1   se    &++%.%A%AB%A'W%AB 
%
 ! "22E1Fb	J 	Cs   Ar   r   s   @r   r%   r%   .   s    63  r   r%   c                   "     e Zd ZdZ fdZ xZS ) MissingCustomModuleNameOrIdErrorz9An error representing a missing custom module name or id.c                 ,    t         t        |   d       y )Nz!Missing custom module name or ID.r   )r   r   s    r   r   z)MissingCustomModuleNameOrIdError.__init__?   s    	% CDr   )r	   r
   r   r   r   r   r   s   @r   r/   r/   <   s    AE Er   r/   c                   (     e Zd ZdZdef fdZ xZS )InvalidCustomModuleIdErrorzZAn error representing a custom module ID that does not conform to _CUSTOM_MODULE_ID_REGEX.bad_module_id_argc                 `    |t         t        |   d       y t         t        |   d| d       y )NzMissing custom module ID.r   zj" is not a valid custom module ID. The ID should consist only of numbers and be 1-20 characters in length.r   )r   r3   r   s     r   r   z#InvalidCustomModuleIdError.__init__F   s=     E4!"=>E4!  !N Nr   r   r   s   @r   r2   r2   C   s    b  r   r2   c                   ,     e Zd ZdZdedef fdZ xZS )InvalidCustomModuleNameErrorz4An error representing an invalid custom module name.bad_module_name_argmodule_typec                 n    dj                  t        |            }t        t        |   d| d| d       y )Nz

		r   zI" is not a valid custom module name.

	The expected format is one of:

		r)   )r*   _GetValidNameFormatForModuler   r   r   )r   r7   r8   valid_formatsr   s       r   r   z%InvalidCustomModuleNameError.__init__S   sA    OO$@$MNM	%
  !..;_B	@r   r   r   s   @r   r6   r6   P   s    <# C  r   r6   r8   returnc                     d|  d|  d|  g}|D cg c]0  }t         j                  j                  |      j                  d      2 c}S c c}w )z@Returns a list of name format strings for the given module_type.z1securitycentermanagement.organizations.locations.z,securitycentermanagement.projects.locations.z+securitycentermanagement.folders.locations. )r   REGISTRYGetCollectionInfoGetPath)r8   collections
collections      r   r:   r:   \   sl     	:+G4[MB3K=A+ $
#* **:6>>rB#
  
s   5Ac                       e Zd ZdZy)InvalidCustomConfigFileErrorz6Error if a custom config file is improperly formatted.Nr   r   r   r   rE   rE   m   s    >r   rE   c                       e Zd ZdZy)InvalidResourceFileErrorz2Error if a test data file is improperly formatted.Nr   r   r   r   rG   rG   q   s    :r   rG   c                       e Zd ZdZy)InvalidConfigValueFileErrorz5Error if a config value file is improperly formatted.Nr   r   r   r   rI   rI   u   s    =r   rI   c                       e Zd ZdZy)InvalidUpdateMaskInputErrorzTError if neither a custom configuration or an enablement state were given to update.Nr   r   r   r   rK   rK   y   s    \r   rK   c                       e Zd ZdZy)InvalidEnablementStateErrorzAError if an enablement state is anything but ENABLED or DISABLED.Nr   r   r   r   rM   rM   }   s    Ir   rM   N)r   %googlecloudsdk.command_lib.scc.manager   googlecloudsdk.corer   r   r   r   r"   r%   r/   r2   r6   CustomModuleTyper   r:   rE   rG   rI   rK   rM   r   r   r   <module>rQ      s    $ ; * )$J $ U e Eu E
 
	5 	++"?5 ?;u ;>% >]% ]J% Jr   