BokaMera.API.Host

<back to all web services

SettingsChangeLogQuery

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, bookingsupplier-administrator-read, superadmin
The following routes are available for this service:
GET/settings/changelogGet change log for settingsReturns a log of all changes made to company settings. Supports filtering and pagination via AutoQuery.
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 SettingsChangeLogQueryResponse:
    # @ApiMember(Description="The change log entry id")
    id: int = 0
    """
    The change log entry id
    """


    # @ApiMember(Description="The company id")
    company_id: Optional[str] = None
    """
    The company id
    """


    # @ApiMember(Description="The settings type that was changed, e.g. BookingSettings")
    settings_type: Optional[str] = None
    """
    The settings type that was changed, e.g. BookingSettings
    """


    # @ApiMember(Description="The property name that was changed")
    property_name: Optional[str] = None
    """
    The property name that was changed
    """


    # @ApiMember(Description="The value before the change")
    old_value: Optional[str] = None
    """
    The value before the change
    """


    # @ApiMember(Description="The value after the change")
    new_value: Optional[str] = None
    """
    The value after the change
    """


    # @ApiMember(Description="The user who made the change")
    modified_by: Optional[str] = None
    """
    The user who made the change
    """


    # @ApiMember(Description="When the change was made")
    created_date: datetime.datetime = datetime.datetime(1, 1, 1)
    """
    When the change was made
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BaseModel:
    pass


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SettingsChangeLog(BaseModel, IBaseModelCreated):
    id: int = 0
    # @Required()
    company_id: Optional[str] = None

    # @Required()
    # @StringLength(128)
    settings_type: Optional[str] = None

    # @Required()
    # @StringLength(256)
    property_name: Optional[str] = None

    # @StringLength(2147483647)
    old_value: Optional[str] = None

    # @StringLength(2147483647)
    new_value: Optional[str] = None

    # @StringLength(256)
    modified_by: Optional[str] = None

    # @Required()
    created_date: datetime.datetime = datetime.datetime(1, 1, 1)

    modified_date: Optional[datetime.datetime] = None


# @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
# @ApiResponse(Description="You have too low privileges to call this service", StatusCode=403)
# @ValidateRequest(Validator="IsAuthenticated")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SettingsChangeLogQuery(QueryDb2[SettingsChangeLog, SettingsChangeLogQueryResponse], ICompany):
    # @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.", ParameterType="query")
    company_id: Optional[str] = None
    """
    The company id, if empty will use the company id for the user you are logged in with.
    """


    # @ApiMember(Description="Filter by settings type, e.g. BookingSettings, PaymentSettings, CompanySetting, EAccountingSettings", ParameterType="query")
    settings_type: Optional[str] = None
    """
    Filter by settings type, e.g. BookingSettings, PaymentSettings, CompanySetting, EAccountingSettings
    """


    # @ApiMember(Description="Filter by property name, e.g. SendEmailReminder", ParameterType="query")
    property_name: Optional[str] = None
    """
    Filter by property name, e.g. SendEmailReminder
    """


    # @ApiMember(Description="Filter by who made the change", ParameterType="query")
    modified_by: Optional[str] = None
    """
    Filter by who made the change
    """


    # @ApiMember(Description="Filter changes created on or after this date", ParameterType="query")
    created_date_greater_than_or_equal_to: Optional[datetime.datetime] = None
    """
    Filter changes created on or after this date
    """


    # @ApiMember(Description="Filter changes created on or before this date", ParameterType="query")
    created_date_less_than_or_equal_to: Optional[datetime.datetime] = None
    """
    Filter changes created on or before this date
    """


@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 SettingsChangeLogQuery DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /settings/changelog HTTP/1.1 
Host: testapi.bokamera.se 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"Offset":0,"Total":0,"Results":[{"Id":0,"SettingsType":"String","PropertyName":"String","OldValue":"String","NewValue":"String","ModifiedBy":"String"}],"Meta":{"String":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}