def create_api_method_response(restApiId, resourcePath, httpMethod, statusCode, responseParameters=None, responseModels=None, region=None, key=None, keyid=None, profile=None):
 try:
  resource = describe_api_resource(restApiId, resourcePath, region=region, key=key, keyid=keyid, profile=profile).get('resource')
  if resource:
   responseParameters = (dict() if (responseParameters is None) else responseParameters)
   responseModels = (dict() if (responseModels is None) else responseModels)
   conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
   response = conn.put_method_response(restApiId=restApiId, resourceId=resource['id'], httpMethod=httpMethod, statusCode=str(statusCode), responseParameters=responseParameters, responseModels=responseModels)
   return {'created': True, 'response': response}
  return {'created': False, 'error': 'no such resource'}
 except ClientError as e:
  return {'created': False, 'error': salt.utils.boto3.get_error(e)}

def create_api_method_response ( restApiId , resourcePath , httpMethod , statusCode , responseParameters = None , responseModels = None , region = None , key = None , keyid = None , profile = None ) : try : resource = describe_api_resource ( restApiId , resourcePath , region = region , key = key , keyid = keyid , profile = profile ) . get ( 'resource' ) if resource : responseParameters = ( dict ( ) if ( responseParameters is None ) else responseParameters ) responseModels = ( dict ( ) if ( responseModels is None ) else responseModels ) conn = _get_conn ( region = region , key = key , keyid = keyid , profile = profile ) response = conn . put_method_response ( restApiId = restApiId , resourceId = resource [ 'id' ] , httpMethod = httpMethod , statusCode = str ( statusCode ) , responseParameters = responseParameters , responseModels = responseModels ) return { 'created' : True , 'response' : response } return { 'created' : False , 'error' : 'no such resource' } except ClientError as e : return { 'created' : False , 'error' : salt . utils . boto3 . get_error ( e ) }
create api method response for a method on a given resource in the given api cli example: .