/* Options:
Date: 2025-04-11 09:45:23
Version: 8.23
Tip: To override a DTO option, remove "//" prefix before updating
BaseUrl: https://testapi.bokamera.se

//GlobalNamespace: 
//AddServiceStackTypes: True
//AddResponseStatus: False
//AddImplicitVersion: 
//AddDescriptionAsComments: True
IncludeTypes: MessageLogQuery.*
//ExcludeTypes: 
//DefaultImports: package:servicestack/servicestack.dart
*/

import 'package:servicestack/servicestack.dart';

abstract class ICompany
{
    String? CompanyId;
}

class BaseModel implements IConvertible
{
    BaseModel();
    BaseModel.fromJson(Map<String, dynamic> json) : super();
    fromMap(Map<String, dynamic> json) {
        return this;
    }

    Map<String, dynamic> toJson() => {};
    getTypeName() => "BaseModel";
    TypeContext? context = _ctx;
}

class MessageLog extends BaseModel implements IBaseModelCreated, IConvertible
{
    int? BookingId;
    // @Required()
    bool? PublicMessage;

    // @Required()
    int? MessageType;

    // @Required()
    bool? iCalAttachment;

    // @Required()
    String? SenderName;

    DateTime? ModifiedDate;
    String? CorrelationId;
    // @Required()
    String? CompanyId;

    int? Id;
    // @Required()
    String? Receiver;

    // @Required()
    String? Sender;

    String? MessageTitle;
    // @Required()
    String? MessageBody;

    String? CreatedBy;
    // @Required()
    DateTime? CreatedDate;

    // @Required()
    bool? Sent;

    // @Required()
    DateTime? ToSendDate;

    DateTime? SentDate;
    // @Required()
    int? SendMethodId;

    int? MessageCount;
    int? SMSStatus;
    // @Required()
    int? MessageRetries;

    String? StorageUrl;
    String? Language;

    MessageLog({this.BookingId,this.PublicMessage,this.MessageType,this.iCalAttachment,this.SenderName,this.ModifiedDate,this.CorrelationId,this.CompanyId,this.Id,this.Receiver,this.Sender,this.MessageTitle,this.MessageBody,this.CreatedBy,this.CreatedDate,this.Sent,this.ToSendDate,this.SentDate,this.SendMethodId,this.MessageCount,this.SMSStatus,this.MessageRetries,this.StorageUrl,this.Language});
    MessageLog.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        BookingId = json['BookingId'];
        PublicMessage = json['PublicMessage'];
        MessageType = json['MessageType'];
        iCalAttachment = json['iCalAttachment'];
        SenderName = json['SenderName'];
        ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
        CorrelationId = json['CorrelationId'];
        CompanyId = json['CompanyId'];
        Id = json['Id'];
        Receiver = json['Receiver'];
        Sender = json['Sender'];
        MessageTitle = json['MessageTitle'];
        MessageBody = json['MessageBody'];
        CreatedBy = json['CreatedBy'];
        CreatedDate = JsonConverters.fromJson(json['CreatedDate'],'DateTime',context!);
        Sent = json['Sent'];
        ToSendDate = JsonConverters.fromJson(json['ToSendDate'],'DateTime',context!);
        SentDate = JsonConverters.fromJson(json['SentDate'],'DateTime',context!);
        SendMethodId = json['SendMethodId'];
        MessageCount = json['MessageCount'];
        SMSStatus = json['SMSStatus'];
        MessageRetries = json['MessageRetries'];
        StorageUrl = json['StorageUrl'];
        Language = json['Language'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'BookingId': BookingId,
        'PublicMessage': PublicMessage,
        'MessageType': MessageType,
        'iCalAttachment': iCalAttachment,
        'SenderName': SenderName,
        'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!),
        'CorrelationId': CorrelationId,
        'CompanyId': CompanyId,
        'Id': Id,
        'Receiver': Receiver,
        'Sender': Sender,
        'MessageTitle': MessageTitle,
        'MessageBody': MessageBody,
        'CreatedBy': CreatedBy,
        'CreatedDate': JsonConverters.toJson(CreatedDate,'DateTime',context!),
        'Sent': Sent,
        'ToSendDate': JsonConverters.toJson(ToSendDate,'DateTime',context!),
        'SentDate': JsonConverters.toJson(SentDate,'DateTime',context!),
        'SendMethodId': SendMethodId,
        'MessageCount': MessageCount,
        'SMSStatus': SMSStatus,
        'MessageRetries': MessageRetries,
        'StorageUrl': StorageUrl,
        'Language': Language
    });

    getTypeName() => "MessageLog";
    TypeContext? context = _ctx;
}

abstract class IBaseModelCreated
{
    DateTime? CreatedDate;
}

class MessageLogQueryResponse implements IConvertible
{
    /**
    * The message log id
    */
    // @ApiMember(Description="The message log id")
    int? Id;

    /**
    * The booking id for the message (if connected to a booking).
    */
    // @ApiMember(Description="The booking id for the message (if connected to a booking).")
    int? BookingId;

    /**
    * The message receiver. Either a email or a mobile phone number.
    */
    // @ApiMember(Description="The message receiver. Either a email or a mobile phone number.")
    String? Receiver;

    /**
    * Message Title.
    */
    // @ApiMember(Description="Message Title.")
    String? MessageTitle;

    /**
    * Message Storage Url.
    */
    // @ApiMember(Description="Message Storage Url.")
    String? StorageUrl;

    /**
    * Message Body.
    */
    // @ApiMember(Description="Message Body.")
    String? MessageBody;

    /**
    * When message was created.
    */
    // @ApiMember(Description="When message was created.")
    DateTime? Created;

    /**
    * When the message will be sent.
    */
    // @ApiMember(Description="When the message will be sent.")
    DateTime? ToSendDate;

    /**
    * When the message was sent.
    */
    // @ApiMember(Description="When the message was sent.")
    DateTime? SentDate;

    /**
    * If Message is sent
    */
    // @ApiMember(Description="If Message is sent")
    bool? Sent;

    /**
    * Number of retries to send the message
    */
    // @ApiMember(Description="Number of retries to send the message")
    int? MessageRetries;

    /**
    * Send Method. 1 = Email, 2 = SMS
    */
    // @ApiMember(Description="Send Method. 1 = Email, 2 = SMS")
    int? SendMethodId;

    MessageLogQueryResponse({this.Id,this.BookingId,this.Receiver,this.MessageTitle,this.StorageUrl,this.MessageBody,this.Created,this.ToSendDate,this.SentDate,this.Sent,this.MessageRetries,this.SendMethodId});
    MessageLogQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        BookingId = json['BookingId'];
        Receiver = json['Receiver'];
        MessageTitle = json['MessageTitle'];
        StorageUrl = json['StorageUrl'];
        MessageBody = json['MessageBody'];
        Created = JsonConverters.fromJson(json['Created'],'DateTime',context!);
        ToSendDate = JsonConverters.fromJson(json['ToSendDate'],'DateTime',context!);
        SentDate = JsonConverters.fromJson(json['SentDate'],'DateTime',context!);
        Sent = json['Sent'];
        MessageRetries = json['MessageRetries'];
        SendMethodId = json['SendMethodId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'BookingId': BookingId,
        'Receiver': Receiver,
        'MessageTitle': MessageTitle,
        'StorageUrl': StorageUrl,
        'MessageBody': MessageBody,
        'Created': JsonConverters.toJson(Created,'DateTime',context!),
        'ToSendDate': JsonConverters.toJson(ToSendDate,'DateTime',context!),
        'SentDate': JsonConverters.toJson(SentDate,'DateTime',context!),
        'Sent': Sent,
        'MessageRetries': MessageRetries,
        'SendMethodId': SendMethodId
    };

    getTypeName() => "MessageLogQueryResponse";
    TypeContext? context = _ctx;
}

// @Route("/messages/log", "GET")
// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ValidateRequest(Validator="IsAuthenticated")
class MessageLogQuery extends QueryDb2<MessageLog,MessageLogQueryResponse> implements IReturn<QueryResponse<MessageLogQueryResponse>>, ICompany, IConvertible, IGet
{
    /**
    * The company id, if empty will use the company id for the user you are logged in with.
    */
    // @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.", ParameterType="path")
    String? CompanyId;

    /**
    * If you want to search on sent messages
    */
    // @ApiMember(DataType="boolean", Description="If you want to search on sent messages", ParameterType="query")
    bool? Sent;

    /**
    * Message Id
    */
    // @ApiMember(DataType="int", Description="Message Id", ParameterType="query")
    int? Id;

    /**
    * If you want to search on a messages for a specific booking
    */
    // @ApiMember(DataType="int", Description="If you want to search on a messages for a specific booking", ParameterType="query")
    int? BookingId;

    /**
    * If you want to search on a messages for a specific receiver
    */
    // @ApiMember(DataType="string", Description="If you want to search on a messages for a specific receiver", ParameterType="query")
    String? Receiver;

    /**
    * If you want to search on a messages created a specific date
    */
    // @ApiMember(DataType="datetime", Description="If you want to search on a messages created a specific date", ParameterType="query")
    DateTime? Created;

    /**
    * If you want to search on a messages sent a specific date
    */
    // @ApiMember(DataType="datetime", Description="If you want to search on a messages sent a specific date", ParameterType="query")
    DateTime? SentDate;

    ResponseStatus? ResponseStatus;

    MessageLogQuery({this.CompanyId,this.Sent,this.Id,this.BookingId,this.Receiver,this.Created,this.SentDate,this.ResponseStatus});
    MessageLogQuery.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        CompanyId = json['CompanyId'];
        Sent = json['Sent'];
        Id = json['Id'];
        BookingId = json['BookingId'];
        Receiver = json['Receiver'];
        Created = JsonConverters.fromJson(json['Created'],'DateTime',context!);
        SentDate = JsonConverters.fromJson(json['SentDate'],'DateTime',context!);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'CompanyId': CompanyId,
        'Sent': Sent,
        'Id': Id,
        'BookingId': BookingId,
        'Receiver': Receiver,
        'Created': JsonConverters.toJson(Created,'DateTime',context!),
        'SentDate': JsonConverters.toJson(SentDate,'DateTime',context!),
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    });

    createResponse() => QueryResponse<MessageLogQueryResponse>();
    getResponseTypeName() => "QueryResponse<MessageLogQueryResponse>";
    getTypeName() => "MessageLogQuery";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'testapi.bokamera.se', types: <String, TypeInfo> {
    'ICompany': TypeInfo(TypeOf.Interface),
    'BaseModel': TypeInfo(TypeOf.Class, create:() => BaseModel()),
    'MessageLog': TypeInfo(TypeOf.Class, create:() => MessageLog()),
    'IBaseModelCreated': TypeInfo(TypeOf.Interface),
    'MessageLogQueryResponse': TypeInfo(TypeOf.Class, create:() => MessageLogQueryResponse()),
    'QueryResponse<MessageLogQueryResponse>': TypeInfo(TypeOf.Class, create:() => QueryResponse<MessageLogQueryResponse>()),
    'MessageLogQuery': TypeInfo(TypeOf.Class, create:() => MessageLogQuery()),
    'List<MessageLogQueryResponse>': TypeInfo(TypeOf.Class, create:() => <MessageLogQueryResponse>[]),
});