def __init__( self, http_status, description, headers=None, content=None, links=None, extensions=None): self.http_status = http_status self.description = description self.headers = headers and dict(headers) or {} self.content = content and Content(content) or Content() self.links = links and dict(links) or {} self.extensions = extensions and dict(extensions) or {}
def create(self, content_spec): media_types = self.media_types_generator.generate(content_spec) return Content(media_types)
def __init__(self, content, required=False, extensions=None): self.content = Content(content) self.required = required self.extensions = extensions and dict(extensions) or {}
def __init__(self, content, required=False): self.content = Content(content) self.required = required