'Delete a deployed REST API Gateway.'

def undeploy_api_gateway(self, lambda_name, domain_name=None):

    print('Deleting    API    Gateway..')
    api_id = self.get_api_id(lambda_name)
    if domain_name:
        try:
            self.apigateway_client.delete_base_path_mapping(domainName=domain_name, basePath='(none)')
        except Exception as e:
            pass
    was_deleted = self.delete_stack(lambda_name, wait=True)
    if (not was_deleted):
        for api in self.get_rest_apis(lambda_name):
            self.apigateway_client.delete_rest_api(restApiId=api['id'])
