Blazor Diffusion

<back to all web services

QueryArtifactComments

Comments
import 'package:servicestack/servicestack.dart';

// @DataContract
abstract class QueryBase
{
    // @DataMember(Order=1)
    int? skip;

    // @DataMember(Order=2)
    int? take;

    // @DataMember(Order=3)
    String? orderBy;

    // @DataMember(Order=4)
    String? orderByDesc;

    // @DataMember(Order=5)
    String? include;

    // @DataMember(Order=6)
    String? fields;

    // @DataMember(Order=7)
    Map<String,String?>? meta;

    QueryBase({this.skip,this.take,this.orderBy,this.orderByDesc,this.include,this.fields,this.meta});
    QueryBase.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        skip = json['skip'];
        take = json['take'];
        orderBy = json['orderBy'];
        orderByDesc = json['orderByDesc'];
        include = json['include'];
        fields = json['fields'];
        meta = JsonConverters.toStringMap(json['meta']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'skip': skip,
        'take': take,
        'orderBy': orderBy,
        'orderByDesc': orderByDesc,
        'include': include,
        'fields': fields,
        'meta': meta
    };

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

abstract class QueryDb2<From,Into> extends QueryBase
{
    QueryDb2();
    QueryDb2.fromJson(Map<String, dynamic> json) : super.fromJson(json);
    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson();
    getTypeName() => "QueryDb<$From,$Into>";
    TypeContext? context = _ctx;
}

class CommentResult implements IConvertible
{
    int? id;
    int? artifactId;
    int? replyId;
    String? content;
    int? upVotes;
    int? downVotes;
    int? votes;
    String? flagReason;
    String? notes;
    int? appUserId;
    String? displayName;
    String? handle;
    String? profileUrl;
    String? avatar;
    DateTime? createdDate;
    DateTime? modifiedDate;

    CommentResult({this.id,this.artifactId,this.replyId,this.content,this.upVotes,this.downVotes,this.votes,this.flagReason,this.notes,this.appUserId,this.displayName,this.handle,this.profileUrl,this.avatar,this.createdDate,this.modifiedDate});
    CommentResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        artifactId = json['artifactId'];
        replyId = json['replyId'];
        content = json['content'];
        upVotes = json['upVotes'];
        downVotes = json['downVotes'];
        votes = json['votes'];
        flagReason = json['flagReason'];
        notes = json['notes'];
        appUserId = json['appUserId'];
        displayName = json['displayName'];
        handle = json['handle'];
        profileUrl = json['profileUrl'];
        avatar = json['avatar'];
        createdDate = JsonConverters.fromJson(json['createdDate'],'DateTime',context!);
        modifiedDate = JsonConverters.fromJson(json['modifiedDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'artifactId': artifactId,
        'replyId': replyId,
        'content': content,
        'upVotes': upVotes,
        'downVotes': downVotes,
        'votes': votes,
        'flagReason': flagReason,
        'notes': notes,
        'appUserId': appUserId,
        'displayName': displayName,
        'handle': handle,
        'profileUrl': profileUrl,
        'avatar': avatar,
        'createdDate': JsonConverters.toJson(createdDate,'DateTime',context!),
        'modifiedDate': JsonConverters.toJson(modifiedDate,'DateTime',context!)
    };

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

// @DataContract
abstract class AuditBase
{
    // @DataMember(Order=1)
    DateTime? createdDate;

    // @DataMember(Order=2)
    // @required()
    String? createdBy;

    // @DataMember(Order=3)
    DateTime? modifiedDate;

    // @DataMember(Order=4)
    // @required()
    String? modifiedBy;

    // @DataMember(Order=5)
    DateTime? deletedDate;

    // @DataMember(Order=6)
    String? deletedBy;

    AuditBase({this.createdDate,this.createdBy,this.modifiedDate,this.modifiedBy,this.deletedDate,this.deletedBy});
    AuditBase.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        createdDate = JsonConverters.fromJson(json['createdDate'],'DateTime',context!);
        createdBy = json['createdBy'];
        modifiedDate = JsonConverters.fromJson(json['modifiedDate'],'DateTime',context!);
        modifiedBy = json['modifiedBy'];
        deletedDate = JsonConverters.fromJson(json['deletedDate'],'DateTime',context!);
        deletedBy = json['deletedBy'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'createdDate': JsonConverters.toJson(createdDate,'DateTime',context!),
        'createdBy': createdBy,
        'modifiedDate': JsonConverters.toJson(modifiedDate,'DateTime',context!),
        'modifiedBy': modifiedBy,
        'deletedDate': JsonConverters.toJson(deletedDate,'DateTime',context!),
        'deletedBy': deletedBy
    };

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

class ArtifactComment extends AuditBase implements IConvertible
{
    int? id;
    int? artifactId;
    int? replyId;
    String? content;
    int? upVotes;
    int? downVotes;
    int? votes;
    String? flagReason;
    String? notes;
    String? refId;
    int? appUserId;

    ArtifactComment({this.id,this.artifactId,this.replyId,this.content,this.upVotes,this.downVotes,this.votes,this.flagReason,this.notes,this.refId,this.appUserId});
    ArtifactComment.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        id = json['id'];
        artifactId = json['artifactId'];
        replyId = json['replyId'];
        content = json['content'];
        upVotes = json['upVotes'];
        downVotes = json['downVotes'];
        votes = json['votes'];
        flagReason = json['flagReason'];
        notes = json['notes'];
        refId = json['refId'];
        appUserId = json['appUserId'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'id': id,
        'artifactId': artifactId,
        'replyId': replyId,
        'content': content,
        'upVotes': upVotes,
        'downVotes': downVotes,
        'votes': votes,
        'flagReason': flagReason,
        'notes': notes,
        'refId': refId,
        'appUserId': appUserId
    });

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

class QueryArtifactComments extends QueryDb2<ArtifactComment,CommentResult> implements IConvertible
{
    int? artifactId;

    QueryArtifactComments({this.artifactId});
    QueryArtifactComments.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        artifactId = json['artifactId'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'artifactId': artifactId
    });

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

class Artifact extends AuditBase implements IConvertible
{
    int? id;
    // @References(typeof(Creative))
    int? creativeId;

    String? fileName;
    String? filePath;
    String? contentType;
    int? contentLength;
    int? width;
    int? height;
    int? seed;
    String? prompt;
    bool? nsfw;
    int? averageHash;
    int? perceptualHash;
    int? differenceHash;
    String? background;
    String? lqip;
    int? quality;
    int? likesCount;
    int? albumsCount;
    int? downloadsCount;
    int? searchCount;
    int? temporalScore;
    int? score;
    int? rank;
    String? refId;
    Map<String,String?>? versions = {};

    Artifact({this.id,this.creativeId,this.fileName,this.filePath,this.contentType,this.contentLength,this.width,this.height,this.seed,this.prompt,this.nsfw,this.averageHash,this.perceptualHash,this.differenceHash,this.background,this.lqip,this.quality,this.likesCount,this.albumsCount,this.downloadsCount,this.searchCount,this.temporalScore,this.score,this.rank,this.refId,this.versions});
    Artifact.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        id = json['id'];
        creativeId = json['creativeId'];
        fileName = json['fileName'];
        filePath = json['filePath'];
        contentType = json['contentType'];
        contentLength = json['contentLength'];
        width = json['width'];
        height = json['height'];
        seed = json['seed'];
        prompt = json['prompt'];
        nsfw = json['nsfw'];
        averageHash = json['averageHash'];
        perceptualHash = json['perceptualHash'];
        differenceHash = json['differenceHash'];
        background = json['background'];
        lqip = json['lqip'];
        quality = json['quality'];
        likesCount = json['likesCount'];
        albumsCount = json['albumsCount'];
        downloadsCount = json['downloadsCount'];
        searchCount = json['searchCount'];
        temporalScore = json['temporalScore'];
        score = json['score'];
        rank = json['rank'];
        refId = json['refId'];
        versions = JsonConverters.toStringMap(json['versions']);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'id': id,
        'creativeId': creativeId,
        'fileName': fileName,
        'filePath': filePath,
        'contentType': contentType,
        'contentLength': contentLength,
        'width': width,
        'height': height,
        'seed': seed,
        'prompt': prompt,
        'nsfw': nsfw,
        'averageHash': averageHash,
        'perceptualHash': perceptualHash,
        'differenceHash': differenceHash,
        'background': background,
        'lqip': lqip,
        'quality': quality,
        'likesCount': likesCount,
        'albumsCount': albumsCount,
        'downloadsCount': downloadsCount,
        'searchCount': searchCount,
        'temporalScore': temporalScore,
        'score': score,
        'rank': rank,
        'refId': refId,
        'versions': versions
    });

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

class ArtifactResult extends Artifact implements IConvertible
{
    String? userPrompt;
    List<String>? artistNames = [];
    List<String>? modifierNames = [];
    int? primaryArtifactId;
    String? ownerRef;
    double? similarity;

    ArtifactResult({this.userPrompt,this.artistNames,this.modifierNames,this.primaryArtifactId,this.ownerRef,this.similarity});
    ArtifactResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        userPrompt = json['userPrompt'];
        artistNames = JsonConverters.fromJson(json['artistNames'],'List<String>',context!);
        modifierNames = JsonConverters.fromJson(json['modifierNames'],'List<String>',context!);
        primaryArtifactId = json['primaryArtifactId'];
        ownerRef = json['ownerRef'];
        similarity = JsonConverters.toDouble(json['similarity']);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'userPrompt': userPrompt,
        'artistNames': JsonConverters.toJson(artistNames,'List<String>',context!),
        'modifierNames': JsonConverters.toJson(modifierNames,'List<String>',context!),
        'primaryArtifactId': primaryArtifactId,
        'ownerRef': ownerRef,
        'similarity': similarity
    });

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

// @DataContract
class QueryResponse<T> implements IConvertible
{
    // @DataMember(Order=1)
    int? offset;

    // @DataMember(Order=2)
    int? total;

    // @DataMember(Order=3)
    List<ArtifactResult>? results;

    // @DataMember(Order=4)
    Map<String,String?>? meta;

    // @DataMember(Order=5)
    ResponseStatus? responseStatus;

    QueryResponse({this.offset,this.total,this.results,this.meta,this.responseStatus});
    QueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        offset = json['offset'];
        total = json['total'];
        results = JsonConverters.fromJson(json['results'],'List<ArtifactResult>',context!);
        meta = JsonConverters.toStringMap(json['meta']);
        responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'offset': offset,
        'total': total,
        'results': JsonConverters.toJson(results,'List<ArtifactResult>',context!),
        'meta': meta,
        'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
    };

    getTypeName() => "QueryResponse<$T>";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'blazordiffusion.com', types: <String, TypeInfo> {
    'CommentResult': TypeInfo(TypeOf.Class, create:() => CommentResult()),
    'ArtifactComment': TypeInfo(TypeOf.Class, create:() => ArtifactComment()),
    'QueryArtifactComments': TypeInfo(TypeOf.Class, create:() => QueryArtifactComments()),
    'List<CommentResult>': TypeInfo(TypeOf.Class, create:() => <CommentResult>[]),
    'Artifact': TypeInfo(TypeOf.Class, create:() => Artifact()),
    'ArtifactResult': TypeInfo(TypeOf.Class, create:() => ArtifactResult()),
    'List<ArtifactResult>': TypeInfo(TypeOf.Class, create:() => <ArtifactResult>[]),
});

Dart QueryArtifactComments DTOs

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

HTTP + XML

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

POST /xml/reply/QueryArtifactComments HTTP/1.1 
Host: blazordiffusion.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<QueryArtifactComments xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BlazorDiffusion.ServiceModel">
  <Skip xmlns="http://schemas.servicestack.net/types">0</Skip>
  <Take xmlns="http://schemas.servicestack.net/types">0</Take>
  <OrderBy xmlns="http://schemas.servicestack.net/types">String</OrderBy>
  <OrderByDesc xmlns="http://schemas.servicestack.net/types">String</OrderByDesc>
  <Include xmlns="http://schemas.servicestack.net/types">String</Include>
  <Fields xmlns="http://schemas.servicestack.net/types">String</Fields>
  <Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.servicestack.net/types">
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value>String</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
  </Meta>
  <ArtifactId>0</ArtifactId>
</QueryArtifactComments>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<QueryResponseOfCommentResult55quYL7_S xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
  <Offset>0</Offset>
  <Total>0</Total>
  <Results xmlns:d2p1="http://schemas.datacontract.org/2004/07/BlazorDiffusion.ServiceModel">
    <d2p1:CommentResult>
      <d2p1:AppUserId>0</d2p1:AppUserId>
      <d2p1:ArtifactId>0</d2p1:ArtifactId>
      <d2p1:Avatar>String</d2p1:Avatar>
      <d2p1:Content>String</d2p1:Content>
      <d2p1:CreatedDate>0001-01-01T00:00:00</d2p1:CreatedDate>
      <d2p1:DisplayName>String</d2p1:DisplayName>
      <d2p1:DownVotes>0</d2p1:DownVotes>
      <d2p1:FlagReason>String</d2p1:FlagReason>
      <d2p1:Handle>String</d2p1:Handle>
      <d2p1:Id>0</d2p1:Id>
      <d2p1:ModifiedDate>0001-01-01T00:00:00</d2p1:ModifiedDate>
      <d2p1:Notes>String</d2p1:Notes>
      <d2p1:ProfileUrl>String</d2p1:ProfileUrl>
      <d2p1:ReplyId>0</d2p1:ReplyId>
      <d2p1:UpVotes>0</d2p1:UpVotes>
      <d2p1:Votes>0</d2p1:Votes>
    </d2p1:CommentResult>
  </Results>
  <Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value>String</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
  </Meta>
  <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>
</QueryResponseOfCommentResult55quYL7_S>