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
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RequestSummary:
name: Optional[str] = None
total_requests: int = 0
total_request_length: int = 0
min_request_length: int = 0
max_request_length: int = 0
total_duration: float = 0.0
min_duration: float = 0.0
max_duration: float = 0.0
status: Optional[Dict[int, int]] = None
durations: Optional[Dict[str, int]] = None
apis: Optional[Dict[str, int]] = None
users: Optional[Dict[str, int]] = None
ips: Optional[Dict[str, int]] = None
api_keys: Optional[Dict[str, int]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AnalyticsReports:
id: int = 0
created: datetime.datetime = datetime.datetime(1, 1, 1)
version: Decimal = decimal.Decimal(0)
apis: Optional[Dict[str, RequestSummary]] = None
users: Optional[Dict[str, RequestSummary]] = None
tags: Optional[Dict[str, RequestSummary]] = None
status: Optional[Dict[str, RequestSummary]] = None
days: Optional[Dict[str, RequestSummary]] = None
api_keys: Optional[Dict[str, RequestSummary]] = None
ips: Optional[Dict[str, RequestSummary]] = None
browsers: Optional[Dict[str, RequestSummary]] = None
devices: Optional[Dict[str, RequestSummary]] = None
bots: Optional[Dict[str, RequestSummary]] = None
durations: Optional[Dict[str, int]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetAnalyticsReportsResponse:
result: Optional[AnalyticsReports] = None
response_status: Optional[ResponseStatus] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetAnalyticsReports(IGet):
month: Optional[datetime.datetime] = None
filter: Optional[str] = None
value: Optional[str] = None
force: Optional[bool] = None
Python GetAnalyticsReports DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /xml/reply/GetAnalyticsReports HTTP/1.1
Host: blazordiffusion.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<GetAnalyticsReports xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
<Month>0001-01-01T00:00:00</Month>
<Filter>String</Filter>
<Value>String</Value>
<Force>false</Force>
</GetAnalyticsReports>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <GetAnalyticsReportsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types"> <Result> <Id>0</Id> <Created>0001-01-01T00:00:00</Created> <Version>0</Version> <Apis xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringRequestSummaryEdXdwojR> <d3p1:Key>String</d3p1:Key> <d3p1:Value> <Name>String</Name> <TotalRequests>0</TotalRequests> <TotalRequestLength>0</TotalRequestLength> <MinRequestLength>0</MinRequestLength> <MaxRequestLength>0</MaxRequestLength> <TotalDuration>0</TotalDuration> <MinDuration>0</MinDuration> <MaxDuration>0</MaxDuration> <Status> <d3p1:KeyValueOfintlong> <d3p1:Key>0</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfintlong> </Status> <Durations> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Durations> <Apis> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Apis> <Users> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Users> <Ips> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Ips> <ApiKeys> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </ApiKeys> </d3p1:Value> </d3p1:KeyValueOfstringRequestSummaryEdXdwojR> </Apis> <Users xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringRequestSummaryEdXdwojR> <d3p1:Key>String</d3p1:Key> <d3p1:Value> <Name>String</Name> <TotalRequests>0</TotalRequests> <TotalRequestLength>0</TotalRequestLength> <MinRequestLength>0</MinRequestLength> <MaxRequestLength>0</MaxRequestLength> <TotalDuration>0</TotalDuration> <MinDuration>0</MinDuration> <MaxDuration>0</MaxDuration> <Status> <d3p1:KeyValueOfintlong> <d3p1:Key>0</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfintlong> </Status> <Durations> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Durations> <Apis> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Apis> <Users> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Users> <Ips> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Ips> <ApiKeys> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </ApiKeys> </d3p1:Value> </d3p1:KeyValueOfstringRequestSummaryEdXdwojR> </Users> <Tags xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringRequestSummaryEdXdwojR> <d3p1:Key>String</d3p1:Key> <d3p1:Value> <Name>String</Name> <TotalRequests>0</TotalRequests> <TotalRequestLength>0</TotalRequestLength> <MinRequestLength>0</MinRequestLength> <MaxRequestLength>0</MaxRequestLength> <TotalDuration>0</TotalDuration> <MinDuration>0</MinDuration> <MaxDuration>0</MaxDuration> <Status> <d3p1:KeyValueOfintlong> <d3p1:Key>0</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfintlong> </Status> <Durations> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Durations> <Apis> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Apis> <Users> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Users> <Ips> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Ips> <ApiKeys> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </ApiKeys> </d3p1:Value> </d3p1:KeyValueOfstringRequestSummaryEdXdwojR> </Tags> <Status xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringRequestSummaryEdXdwojR> <d3p1:Key>String</d3p1:Key> <d3p1:Value> <Name>String</Name> <TotalRequests>0</TotalRequests> <TotalRequestLength>0</TotalRequestLength> <MinRequestLength>0</MinRequestLength> <MaxRequestLength>0</MaxRequestLength> <TotalDuration>0</TotalDuration> <MinDuration>0</MinDuration> <MaxDuration>0</MaxDuration> <Status> <d3p1:KeyValueOfintlong> <d3p1:Key>0</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfintlong> </Status> <Durations> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Durations> <Apis> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Apis> <Users> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Users> <Ips> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Ips> <ApiKeys> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </ApiKeys> </d3p1:Value> </d3p1:KeyValueOfstringRequestSummaryEdXdwojR> </Status> <Days xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringRequestSummaryEdXdwojR> <d3p1:Key>String</d3p1:Key> <d3p1:Value> <Name>String</Name> <TotalRequests>0</TotalRequests> <TotalRequestLength>0</TotalRequestLength> <MinRequestLength>0</MinRequestLength> <MaxRequestLength>0</MaxRequestLength> <TotalDuration>0</TotalDuration> <MinDuration>0</MinDuration> <MaxDuration>0</MaxDuration> <Status> <d3p1:KeyValueOfintlong> <d3p1:Key>0</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfintlong> </Status> <Durations> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Durations> <Apis> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Apis> <Users> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Users> <Ips> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Ips> <ApiKeys> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </ApiKeys> </d3p1:Value> </d3p1:KeyValueOfstringRequestSummaryEdXdwojR> </Days> <ApiKeys xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringRequestSummaryEdXdwojR> <d3p1:Key>String</d3p1:Key> <d3p1:Value> <Name>String</Name> <TotalRequests>0</TotalRequests> <TotalRequestLength>0</TotalRequestLength> <MinRequestLength>0</MinRequestLength> <MaxRequestLength>0</MaxRequestLength> <TotalDuration>0</TotalDuration> <MinDuration>0</MinDuration> <MaxDuration>0</MaxDuration> <Status> <d3p1:KeyValueOfintlong> <d3p1:Key>0</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfintlong> </Status> <Durations> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Durations> <Apis> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Apis> <Users> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Users> <Ips> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Ips> <ApiKeys> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </ApiKeys> </d3p1:Value> </d3p1:KeyValueOfstringRequestSummaryEdXdwojR> </ApiKeys> <Ips xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringRequestSummaryEdXdwojR> <d3p1:Key>String</d3p1:Key> <d3p1:Value> <Name>String</Name> <TotalRequests>0</TotalRequests> <TotalRequestLength>0</TotalRequestLength> <MinRequestLength>0</MinRequestLength> <MaxRequestLength>0</MaxRequestLength> <TotalDuration>0</TotalDuration> <MinDuration>0</MinDuration> <MaxDuration>0</MaxDuration> <Status> <d3p1:KeyValueOfintlong> <d3p1:Key>0</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfintlong> </Status> <Durations> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Durations> <Apis> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Apis> <Users> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Users> <Ips> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Ips> <ApiKeys> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </ApiKeys> </d3p1:Value> </d3p1:KeyValueOfstringRequestSummaryEdXdwojR> </Ips> <Browsers xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringRequestSummaryEdXdwojR> <d3p1:Key>String</d3p1:Key> <d3p1:Value> <Name>String</Name> <TotalRequests>0</TotalRequests> <TotalRequestLength>0</TotalRequestLength> <MinRequestLength>0</MinRequestLength> <MaxRequestLength>0</MaxRequestLength> <TotalDuration>0</TotalDuration> <MinDuration>0</MinDuration> <MaxDuration>0</MaxDuration> <Status> <d3p1:KeyValueOfintlong> <d3p1:Key>0</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfintlong> </Status> <Durations> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Durations> <Apis> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Apis> <Users> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Users> <Ips> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Ips> <ApiKeys> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </ApiKeys> </d3p1:Value> </d3p1:KeyValueOfstringRequestSummaryEdXdwojR> </Browsers> <Devices xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringRequestSummaryEdXdwojR> <d3p1:Key>String</d3p1:Key> <d3p1:Value> <Name>String</Name> <TotalRequests>0</TotalRequests> <TotalRequestLength>0</TotalRequestLength> <MinRequestLength>0</MinRequestLength> <MaxRequestLength>0</MaxRequestLength> <TotalDuration>0</TotalDuration> <MinDuration>0</MinDuration> <MaxDuration>0</MaxDuration> <Status> <d3p1:KeyValueOfintlong> <d3p1:Key>0</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfintlong> </Status> <Durations> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Durations> <Apis> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Apis> <Users> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Users> <Ips> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Ips> <ApiKeys> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </ApiKeys> </d3p1:Value> </d3p1:KeyValueOfstringRequestSummaryEdXdwojR> </Devices> <Bots xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringRequestSummaryEdXdwojR> <d3p1:Key>String</d3p1:Key> <d3p1:Value> <Name>String</Name> <TotalRequests>0</TotalRequests> <TotalRequestLength>0</TotalRequestLength> <MinRequestLength>0</MinRequestLength> <MaxRequestLength>0</MaxRequestLength> <TotalDuration>0</TotalDuration> <MinDuration>0</MinDuration> <MaxDuration>0</MaxDuration> <Status> <d3p1:KeyValueOfintlong> <d3p1:Key>0</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfintlong> </Status> <Durations> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Durations> <Apis> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Apis> <Users> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Users> <Ips> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Ips> <ApiKeys> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </ApiKeys> </d3p1:Value> </d3p1:KeyValueOfstringRequestSummaryEdXdwojR> </Bots> <Durations xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringlong> <d3p1:Key>String</d3p1:Key> <d3p1:Value>0</d3p1:Value> </d3p1:KeyValueOfstringlong> </Durations> </Result> <ResponseStatus> <ErrorCode>String</ErrorCode> <Message>String</Message> <StackTrace>String</StackTrace> <Errors> <ResponseError> <ErrorCode>String</ErrorCode> <FieldName>String</FieldName> <Message>String</Message> <Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d5p1:KeyValueOfstringstring> <d5p1:Key>String</d5p1:Key> <d5p1:Value>String</d5p1:Value> </d5p1:KeyValueOfstringstring> </Meta> </ResponseError> </Errors> <Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:KeyValueOfstringstring> <d3p1:Key>String</d3p1:Key> <d3p1:Value>String</d3p1:Value> </d3p1:KeyValueOfstringstring> </Meta> </ResponseStatus> </GetAnalyticsReportsResponse>