MCPcopy Create free account
hub / github.com/aws/aws-cli / document_expires_shape

Function document_expires_shape

awscli/botocore/handlers.py:1146–1180  ·  view source on GitHub ↗
(section, event_name, **kwargs)

Source from the content-addressed store, hash-verified

1144
1145
1146def document_expires_shape(section, event_name, **kwargs):
1147 # Updates the documentation for S3 operations that include the 'Expires' member
1148 # in their response structure. Documents a synthetic member 'ExpiresString' and
1149 # includes a deprecation notice for 'Expires'.
1150 if 'response-example' in event_name:
1151 if not section.has_section('structure-value'):
1152 return
1153 parent = section.get_section('structure-value')
1154 if not parent.has_section('Expires'):
1155 return
1156 param_line = parent.get_section('Expires')
1157 param_line.add_new_section('ExpiresString')
1158 new_param_line = param_line.get_section('ExpiresString')
1159 new_param_line.write("'ExpiresString': 'string',")
1160 new_param_line.style.new_line()
1161 elif 'response-params' in event_name:
1162 if not section.has_section('Expires'):
1163 return
1164 param_section = section.get_section('Expires')
1165 # Add a deprecation notice for the "Expires" param
1166 doc_section = param_section.get_section('param-documentation')
1167 doc_section.style.start_note()
1168 doc_section.write(
1169 'This member has been deprecated. Please use ``ExpiresString`` instead.'
1170 )
1171 doc_section.style.end_note()
1172 # Document the "ExpiresString" param
1173 new_param_section = param_section.add_new_section('ExpiresString')
1174 new_param_section.style.new_paragraph()
1175 new_param_section.write('- **ExpiresString** *(string) --*')
1176 new_param_section.style.indent()
1177 new_param_section.style.new_paragraph()
1178 new_param_section.write(
1179 'The raw, unparsed value of the ``Expires`` field.'
1180 )
1181
1182
1183def _handle_200_error(operation_model, response_dict, **kwargs):

Callers

nothing calls this directly

Calls 9

has_sectionMethod · 0.80
get_sectionMethod · 0.45
add_new_sectionMethod · 0.45
writeMethod · 0.45
new_lineMethod · 0.45
start_noteMethod · 0.45
end_noteMethod · 0.45
new_paragraphMethod · 0.45
indentMethod · 0.45

Tested by

no test coverage detected