in src/sagemaker_core/tools/shapes_codegen.py [0:0]
def _generate_doc_string_for_shape(self, shape):
"""
Generates the docstring for a given shape.
:param shape: The name of the shape.
:return: The generated docstring as a string.
"""
shape_dict = self.combined_shapes[shape]
docstring = f"{shape}"
if "documentation" in shape_dict:
docstring += f"\n {shape_dict['documentation']}"
docstring += "\n\nAttributes"
docstring += "\n----------------------"
if "members" in shape_dict:
for member, member_attributes in shape_dict["members"].items():
# Add alias if field name is json, to address the Bug: https://github.com/aws/sagemaker-python-sdk/issues/4944
if shape in SHAPES_WITH_JSON_FIELD_ALIAS and member == "Json":
updated_member = "JsonFormat"
docstring += f"\n{convert_to_snake_case(updated_member)}"
else:
docstring += f"\n{convert_to_snake_case(member)}"
if "documentation" in member_attributes:
docstring += f": {member_attributes['documentation']}"
docstring = remove_html_tags(docstring)
return escape_special_rst_characters(docstring)