| GET | /newsletter/fieldtranslations | Get field translations that could be used in messages | Get field translations that could be used in messages. |
|---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
Object = TypeVar('Object')
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QueryBase:
skip: Optional[int] = None
take: Optional[int] = None
order_by: Optional[str] = None
order_by_desc: Optional[str] = None
include: Optional[str] = None
fields: Optional[str] = None
meta: Optional[Dict[str, str]] = None
From = TypeVar('From')
Into = TypeVar('Into')
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QueryDb2(Generic[From, Into], QueryBase, IReturn[QueryResponse[Into]]):
@staticmethod
def response_type(): return QueryResponse[Into]
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class NewsletterFieldTranslationResponse:
# @ApiMember(Description="The field translation id")
id: int = 0
"""
The field translation id
"""
# @ApiMember(Description="The field translation code.")
code: Optional[str] = None
"""
The field translation code.
"""
# @ApiMember(Description="The field translation name.")
name: Optional[str] = None
"""
The field translation name.
"""
# @ApiMember(Description="The field translation description.")
description: Optional[str] = None
"""
The field translation description.
"""
# @ApiMember(Description="The field translation group.")
group: Optional[str] = None
"""
The field translation group.
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BaseModel:
pass
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FieldTranslation(BaseModel):
# @Required()
code: Optional[str] = None
# @Required()
name: Optional[str] = None
# @Required()
description: Optional[str] = None
# @Required()
group: Optional[str] = None
modified_date: Optional[datetime.datetime] = None
id: int = 0
# @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
# @ValidateRequest(Validator="IsAuthenticated")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class NewsletterFieldTranslationsQuery(QueryDb2[FieldTranslation, NewsletterFieldTranslationResponse]):
# @ApiMember(Description="The field translation id.")
id: Optional[int] = None
"""
The field translation id.
"""
# @ApiMember(Description="The field translation group")
group: Optional[str] = None
"""
The field translation group
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AccessKeyTypeResponse:
id: int = 0
key_type: Optional[str] = None
description: Optional[str] = None
T = TypeVar('T')
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QueryResponse(Generic[T]):
offset: int = 0
total: int = 0
results: List[AccessKeyTypeResponse] = field(default_factory=list)
meta: Optional[Dict[str, str]] = None
response_status: Optional[ResponseStatus] = None
Python NewsletterFieldTranslationsQuery DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /newsletter/fieldtranslations HTTP/1.1 Host: testapi.bokamera.se Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"Offset":0,"Total":0,"Results":[{"Id":0,"Code":"String","Name":"String","Description":"String","Group":"String"}],"Meta":{"String":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}