MCPcopy Index your code
hub / github.com/aws/aws-cli / _document_constraints

Method _document_constraints

awscli/clidocs.py:379–394  ·  view source on GitHub ↗

Documents parameter value constraints

(self, model, doc)

Source from the content-addressed store, hash-verified

377 doc.style.end_note()
378
379 def _document_constraints(self, model, doc):
380 """Documents parameter value constraints"""
381 if not hasattr(model, 'metadata'):
382 return
383 constraints = ['min', 'max', 'pattern']
384 if not any(
385 [constraint in model.metadata for constraint in constraints]
386 ):
387 return
388 doc.style.new_paragraph()
389 doc.write('Constraints:')
390 doc.style.start_ul()
391 for constraint in constraints:
392 if (val := model.metadata.get(constraint)) is not None:
393 doc.style.li(f'{constraint}: ``{val}``')
394 doc.style.end_ul()
395
396
397class ProviderDocumentEventHandler(CLIDocumentEventHandler):

Callers 2

doc_optionMethod · 0.95
_do_doc_memberMethod · 0.95

Calls 5

new_paragraphMethod · 0.45
writeMethod · 0.45
start_ulMethod · 0.45
liMethod · 0.45
end_ulMethod · 0.45

Tested by

no test coverage detected