
    ]j<                    t   d dl mZ d dlZd dlmZmZmZmZ d dlm	Z	 d dl
mZ d dlmZmZmZ d dlmZ d dlmZ d d	lmZ d d
lmZ erd dlmZ d dl
mZmZ  ej6                         Z ed      Z G d de      Z edded      ZejA                  d      Z!ejA                  d      Z"ejA                  d      Z#ejA                  d      Z$ejA                  d      Z%ejA                  d      Z&ejA                  d      Z'e!jQ                  dddd       e!jQ                  d dd!d"       e!jQ                  d#d$d%d&       e!jQ                  d'd()       e!jQ                  d*d+eD  cg c]  } | jR                   c} ,       e!jQ                  d-d.)       e!jQ                  d/d0eD  cg c]  } | jR                   c} ,       e!jQ                  d1d2)       e$jQ                  d3d4d%d&       e$jQ                  d5d6d%d&       e$jQ                  d7d8d9       e$jQ                  d:d%dd;<       e$jQ                  d=d>d%d&       e$jQ                  d?d@d%d&       e$jQ                  dAdBd%d&       e$jQ                  dCdDd%d&       e$jQ                  dEdFd%d&       e$jQ                  dGdHd%d&       e$jQ                  dIdJeD cg c]  }|jR                   c},       e$jQ                  dKdLd%d&       e$jQ                  dMdNd%d&       e$jQ                  dOdPd%d&       e$jQ                  dQdRd%d&       e$jQ                  dSdTd%d&       e"jQ                  dUdVe*W       e"jQ                  dXdYeD cg c]  }|jR                   c}dZ       e"jQ                  d[d\d%d&       e"jQ                  d]d^d%d&       e"jQ                  d_d`eD cg c]  }|jR                   c}da       e"jQ                  dbdcd%d&       e"jQ                  ddded%d&       e"jQ                  dfdgd%d&       e"jQ                  dhdid%d&       e"jQ                  djdkd%d&       e"jQ                  dldmd%d&       e"jQ                  dndod%d&       e"jQ                  dpdqd%d&       e#jQ                  drdsdtd%d&       e#jQ                  dudvd9       e#jQ                  dwdxe*dy       e#jQ                  dzd{e*dy       e#jQ                  d|d}d%d&       e#jQ                  d~dd%d&       e#jQ                  ddd9       e#jQ                  ddd%d&       e#jQ                  ddd%d&       e#jQ                  ddd9       e#jQ                  ddd%d&       e#jQ                  ddd%d&       e#jQ                  dd%dd       e#jQ                  ddd%d&       e#jQ                  ddeD cg c]  }|jR                   c}dZ       e%jQ                  dd ed      W       e%jQ                  dde*d       e%jQ                  ddde*       e%jQ                  dde*W       e%jQ                  dde dd9       e%jQ                  dd ed      W       e%jQ                  dd%dd<       e%jQ                  ddd%d&       e!jQ                  dde*d       e!jQ                  dde*d       e%jQ                  dd ed      W       e&jQ                  ddeD cg c]  }|jR                   c}dd       e&jQ                  ddd%d&       e&jQ                  ddd%d&       e&jQ                  ddd%d&       e'jQ                  ddd%d&       e'jQ                  ddd%d&       e'jQ                  ddddd<       e'jQ                  dd%dd<       e'jQ                  dd%d¬ë       g dĢZ+yc c} w c c} w c c}w c c}w c c}w c c}w c c}w )    )annotationsN)ArgumentParserFileTypeHelpFormatter	Namespace)
attrgetter)TYPE_CHECKING)DataModelTypeInputFileTypeOpenAPIScope)PythonVersion)	UnionMode)LiteralType)StrictTypes)Action)IterableOptionalF)no_colorc                  4     e Zd ZddZd fdZd fdZ xZS )SortingHelpFormatterc                    d| dS )Nz[36;1mz[0m )selftexts     L/root/env/lib/python3.12/site-packages/datamodel_code_generator/arguments.py
_bold_cyanzSortingHelpFormatter._bold_cyan   s    D6))    c                P    t        |t        d            }t        |   |       y )Noption_strings)key)sortedr   superadd_arguments)r   actions	__class__s     r   r#   z"SortingHelpFormatter.add_arguments   s"    j1A&BCg&r   c                p    t         |   t        j                  s|s|      S | j	                  |            S )N)r"   start_section	namespacer   r   )r   headingr%   s     r   r'   z"SortingHelpFormatter.start_section   s8    w$ ))G
 	
>Boog>V
 	
r   )r   strreturnr*   )r$   zIterable[Action]r+   None)r)   zOptional[str]r+   r,   )__name__
__module____qualname__r   r#   r'   __classcell__)r%   s   @r   r   r      s    *'
 
r   r   z
  datamodel-codegen [options]zFGenerate Python data models from schema definitions or structured data)usagedescriptionformatter_classadd_helpOptionszTyping customizationzField customizationzModel customizationzTemplate customizationzOpenAPI-only optionszGeneral optionsz--http-headers+HTTP_HEADERz_Set headers in HTTP requests to the remote host. (example: "Authorization: Basic dXNlcjpwYXNz"))nargsmetavarhelpz--http-query-parametersHTTP_QUERY_PARAMETERSzQSet query parameters in HTTP requests to the remote host. (example: "ref=branch")z--http-ignore-tlsz9Disable verification of the remote host's TLS certificate
store_true)r:   actiondefaultz--inputz%Input file/directory (default: stdin))r:   z--input-file-typezInput file type (default: auto))r:   choicesz--outputzOutput file (default: stdout)z--output-model-typez/Output model type (default: pydantic.BaseModel)z--urlz9Input file URL. `--input` is ignored when `--url` is usedz--allow-extra-fieldszSAllow to pass extra fields, if this flag is not passed, extra fields are forbidden.z --allow-population-by-field-namezAllow population by field namez--class-namezSet class name of root model)r:   r>   z--collapse-root-modelszaModels generated with a root-type field will be merged into the models using that root-type model)r=   r>   r:   z--disable-appending-item-suffixz9Disable appending `Item` suffix to model name in an arrayz--disable-timestampz!Disable timestamp on file headersz--enable-faux-immutabilityzEnable faux immutabilityz--enable-version-headerz&Enable package version on file headersz--keep-model-orderzKeep generated models' orderz--reuse-modelzKReuse models on the field when a module has the model with the same contentz--target-python-versionz$target python version (default: 3.8)z--treat-dot-as-modulez$treat dotted module names as modulesz--use-schema-descriptionz2Use schema description to populate class docstringz--use-title-as-namez#use titles as class names of modelsz--use-pendulumz use pendulum instead of datetimez--use-exact-importszximport exact types instead of modules, for example: "from .foo import Bar" instead of "from . import foo" with "foo.Bar"z--base-classz(Base Class (default: pydantic.BaseModel))r:   typez--enum-field-as-literalzParse enum field as literal. all: all enum field type are Literal. one: field type is Literal when an enum has only one possible value)r:   r?   r>   z--field-constraintsz.Use field constraints and not con* annotationsz--set-default-enum-memberz1Set enum members as default values for enum fieldz--strict-typeszUse strict types)r:   r?   r8   z--use-annotatedzUUse typing.Annotated for Field(). Also, `--field-constraints` option will be enabled.z--use-generic-container-typeszUse generic container types for type hinting (typing.Sequence, typing.Mapping). If `--use-standard-collections` option is set, then import from collections.abc instead of typingz4--use-non-positive-negative-number-constrained-typeszcUse the Non{Positive,Negative}{FloatInt} types instead of the corresponding con* constrained types.z--use-one-literal-as-defaultz6Use one literal as default value for one literal fieldz--use-standard-collectionsz6Use standard collections for type hinting (list, dict)z--use-subclass-enumzYDefine Enum class as subclass with field type when enum has type (int, float, bytes, str)z--use-union-operatorz(Use | operator for Union type (PEP 604).z--use-unique-items-as-setzEdefine field type as `set` when the field attribute has `uniqueItems`z--capitalise-enum-membersz--capitalize-enum-memberszCapitalize field names on enumz--empty-enum-field-namez7Set field name when enum value is empty (default:  `_`)z--field-extra-keysz"Add extra keys to field parameters)r:   r@   r8   z#--field-extra-keys-without-x-prefixzdAdd extra keys with `x-` prefix to field parameters. The extra keys are stripped of the `x-` prefix.z--field-include-all-keysz Add all keys to field parametersz--force-optionalz"Force optional for required fieldsz--original-field-name-delimiterzlSet delimiter to convert to snake case. This option only can be used with --snake-case-field (default: `_` )z"--remove-special-field-name-prefixzERemove field name prefix if it has a special meaning e.g. underscoresz--snake-case-fieldz*Change camel-case field name to snake-casez--special-field-name-prefixzaSet field name prefix when first character can't be used as Python field name (default:  `field`)z--strip-default-nonezStrip default None on fieldsz--use-defaultz-Use default value even if a field is requiredz--use-default-kwargzTUse `default=` instead of a positional argument for Fields that have default values.)r=   r:   r>   z--use-field-descriptionz2Use schema description to populate field docstringz--union-modez%Union mode for only pydantic v2 fieldz	--aliaseszAlias mapping filertz--custom-file-headerzCustom file header)r:   r@   r>   z--custom-file-header-pathzCustom file header file path)r:   r>   r@   z--custom-template-dirzCustom template directoryz
--encodingz+The encoding of input and output (default: )z--extra-template-datazExtra template dataz--use-double-quoteszModel generated with double quotes. Single quotes or your black config skip_string_normalization value will be used without this option.z--wrap-string-literalzjWrap string literal by using black `experimental-string-processing` option (require black 20.8b0 or later)z--additional-importsz_Custom imports for output (delimited list input). For example "datetime.date,datetime.datetime"z--custom-formattersz=List of modules with custom formatter (delimited list input).z--custom-formatters-kwargsz)A file with kwargs for custom formatters.z--openapi-scopesz5Scopes of OpenAPI model generation (default: schemas))r:   r?   r8   r>   z--strict-nullablez:Treat default field as a non-nullable field (Only OpenAPI)z--use-operation-id-as-namez4use operation id of OpenAPI as class names of modelsz--validationznDeprecated: Enable validation (Only OpenAPI). this option is deprecated. it will be removed in future releasesz--debugzWshow debug message (require "debug". `$ pip install 'datamodel-code-generator[debug]'`)z--disable-warningszdisable warningsz-hz--helpr:   z==SUPPRESS==zshow this help message and exitz
--no-colorzdisable colorized outputz	--versionzshow version)r=   r:   )
arg_parserDEFAULT_ENCODINGr(   ),
__future__r   localeargparser   r   r   r   operatorr   typingr	   datamodel_code_generatorr
   r   r   datamodel_code_generator.formatr   *datamodel_code_generator.model.pydantic_v2r   datamodel_code_generator.parserr   datamodel_code_generator.typesr   r   r   r   getpreferredencodingrD   r(   r   rC   add_argument_groupbase_optionstyping_optionsfield_optionsmodel_optionstemplate_optionsopenapi_optionsgeneral_optionsadd_argumentvaluer*   __all__)ivlttuos   000000r   <module>ra      s
   "  G G    O O 9 @ 7 6).6..0 u%	
= 
 
+X(	
 ,,Y7../EF--.CD--.CD001IJ //0FG//0AB
   
	j	     
#	\	     	D	     	0     	*+,QWW,  
   	(     	:+,QWW,  
   	D     	^	     &	)	     	'  
   
1	     %	D	     	,	      	#	     	1	     	'	     	V	     	/+,QWW,  
   	/	     	=	     	.	     	+	     
)     	3	  
   
J !,,"RXX,     	9	     	<	     	)*QWW*
	     	`	     #
h     :	n	     "	A	      	A	     	d	     	3	     	P	     	)     	B  
   	-	
	     )	o	
	     	+	     	-	     %	w  
   (	P	     	5	     !	l  
   	'	     	8	     	_	     	=	     	0'(QWW(	     		$  
   			     	'		     	$	  
   67G6H	J  
   		$  
   
Z	     	u	     	j		     	H		      	4	$     	@*+QWW+
     	E	      	?	     
     	d	     		     	*     	#	     	  M - -R -^ -$ +Z )X ,s*    ^^/^!^&/^+(^0^5