moto/scripts/template/lib/responses.py.j2
Toshiya Kawasaki 56793a3b2a Fix scaffold to support rest-json style API (#1291)
* append appropriate urls when scaffolding

* make dispatch for rest-api

* fix dispatch for rest-json

* fix moto/core/response to obtain path and body parameters

* small fixes

* remove unused import

* fix get_int_param

* fix scaffold

* fix formatting of scaffold

* fix misc

* escape service to handle service w/ hyphen like iot-data

* escape service w/ hyphen

* fix regexp to extract region from url

* escape service

* fix syntax

* skip loading body to json object when request body is None
2017-10-24 20:45:39 +02:00

18 lines
410 B
Django/Jinja

from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from .models import {{ escaped_service }}_backends
import json
class {{ service_class }}Response(BaseResponse):
SERVICE_NAME = '{{ service }}'
@property
def {{ escaped_service }}_backend(self):
return {{ escaped_service }}_backends[self.region]
# add methods from here
# add templates from here