import 'package:servicestack/servicestack.dart';
// @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 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 AlbumArtifact implements IConvertible
{
int? id;
// @References(typeof(Album))
int? albumId;
// @References(typeof(Artifact))
int? artifactId;
String? description;
DateTime? createdDate;
DateTime? modifiedDate;
Artifact? artifact;
AlbumArtifact({this.id,this.albumId,this.artifactId,this.description,this.createdDate,this.modifiedDate,this.artifact});
AlbumArtifact.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
albumId = json['albumId'];
artifactId = json['artifactId'];
description = json['description'];
createdDate = JsonConverters.fromJson(json['createdDate'],'DateTime',context!);
modifiedDate = JsonConverters.fromJson(json['modifiedDate'],'DateTime',context!);
artifact = JsonConverters.fromJson(json['artifact'],'Artifact',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'albumId': albumId,
'artifactId': artifactId,
'description': description,
'createdDate': JsonConverters.toJson(createdDate,'DateTime',context!),
'modifiedDate': JsonConverters.toJson(modifiedDate,'DateTime',context!),
'artifact': JsonConverters.toJson(artifact,'Artifact',context!)
};
getTypeName() => "AlbumArtifact";
TypeContext? context = _ctx;
}
class Album extends AuditBase implements IConvertible
{
int? id;
String? name;
String? description;
String? slug;
List<String>? tags = [];
String? refId;
int? ownerId;
String? ownerRef;
int? primaryArtifactId;
bool? private;
int? rating;
int? likesCount;
int? downloadsCount;
int? searchCount;
int? score;
int? rank;
int? prefColumns;
List<AlbumArtifact>? artifacts = [];
Album({this.id,this.name,this.description,this.slug,this.tags,this.refId,this.ownerId,this.ownerRef,this.primaryArtifactId,this.private,this.rating,this.likesCount,this.downloadsCount,this.searchCount,this.score,this.rank,this.prefColumns,this.artifacts});
Album.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
id = json['id'];
name = json['name'];
description = json['description'];
slug = json['slug'];
tags = JsonConverters.fromJson(json['tags'],'List<String>',context!);
refId = json['refId'];
ownerId = json['ownerId'];
ownerRef = json['ownerRef'];
primaryArtifactId = json['primaryArtifactId'];
private = json['private'];
rating = json['rating'];
likesCount = json['likesCount'];
downloadsCount = json['downloadsCount'];
searchCount = json['searchCount'];
score = json['score'];
rank = json['rank'];
prefColumns = json['prefColumns'];
artifacts = JsonConverters.fromJson(json['artifacts'],'List<AlbumArtifact>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'id': id,
'name': name,
'description': description,
'slug': slug,
'tags': JsonConverters.toJson(tags,'List<String>',context!),
'refId': refId,
'ownerId': ownerId,
'ownerRef': ownerRef,
'primaryArtifactId': primaryArtifactId,
'private': private,
'rating': rating,
'likesCount': likesCount,
'downloadsCount': downloadsCount,
'searchCount': searchCount,
'score': score,
'rank': rank,
'prefColumns': prefColumns,
'artifacts': JsonConverters.toJson(artifacts,'List<AlbumArtifact>',context!)
});
getTypeName() => "Album";
TypeContext? context = _ctx;
}
// @ValidateRequest(Validator="IsAuthenticated")
class UpdateAlbum implements IPatchDb<Album>, IConvertible
{
int? id;
String? name;
String? description;
String? slug;
List<String>? tags;
int? primaryArtifactId;
bool? unpinPrimaryArtifact;
List<int>? addArtifactIds;
List<int>? removeArtifactIds;
UpdateAlbum({this.id,this.name,this.description,this.slug,this.tags,this.primaryArtifactId,this.unpinPrimaryArtifact,this.addArtifactIds,this.removeArtifactIds});
UpdateAlbum.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
description = json['description'];
slug = json['slug'];
tags = JsonConverters.fromJson(json['tags'],'List<String>',context!);
primaryArtifactId = json['primaryArtifactId'];
unpinPrimaryArtifact = json['unpinPrimaryArtifact'];
addArtifactIds = JsonConverters.fromJson(json['addArtifactIds'],'List<int>',context!);
removeArtifactIds = JsonConverters.fromJson(json['removeArtifactIds'],'List<int>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'name': name,
'description': description,
'slug': slug,
'tags': JsonConverters.toJson(tags,'List<String>',context!),
'primaryArtifactId': primaryArtifactId,
'unpinPrimaryArtifact': unpinPrimaryArtifact,
'addArtifactIds': JsonConverters.toJson(addArtifactIds,'List<int>',context!),
'removeArtifactIds': JsonConverters.toJson(removeArtifactIds,'List<int>',context!)
};
getTypeName() => "UpdateAlbum";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'blazordiffusion.com', types: <String, TypeInfo> {
'Artifact': TypeInfo(TypeOf.Class, create:() => Artifact()),
'AlbumArtifact': TypeInfo(TypeOf.Class, create:() => AlbumArtifact()),
'Album': TypeInfo(TypeOf.Class, create:() => Album()),
'List<AlbumArtifact>': TypeInfo(TypeOf.Class, create:() => <AlbumArtifact>[]),
'UpdateAlbum': TypeInfo(TypeOf.Class, create:() => UpdateAlbum()),
});
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/UpdateAlbum HTTP/1.1
Host: blazordiffusion.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<UpdateAlbum xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BlazorDiffusion.ServiceModel">
<AddArtifactIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:int>0</d2p1:int>
</AddArtifactIds>
<Description>String</Description>
<Id>0</Id>
<Name>String</Name>
<PrimaryArtifactId>0</PrimaryArtifactId>
<RemoveArtifactIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:int>0</d2p1:int>
</RemoveArtifactIds>
<Slug>String</Slug>
<Tags xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</Tags>
<UnpinPrimaryArtifact>false</UnpinPrimaryArtifact>
</UpdateAlbum>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <Album xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BlazorDiffusion.ServiceModel"> <CreatedDate xmlns="http://schemas.servicestack.net/types">0001-01-01T00:00:00</CreatedDate> <CreatedBy xmlns="http://schemas.servicestack.net/types">String</CreatedBy> <ModifiedDate xmlns="http://schemas.servicestack.net/types">0001-01-01T00:00:00</ModifiedDate> <ModifiedBy xmlns="http://schemas.servicestack.net/types">String</ModifiedBy> <DeletedDate xmlns="http://schemas.servicestack.net/types">0001-01-01T00:00:00</DeletedDate> <DeletedBy xmlns="http://schemas.servicestack.net/types">String</DeletedBy> <Artifacts> <AlbumArtifact> <AlbumId>0</AlbumId> <Artifact> <CreatedDate xmlns="http://schemas.servicestack.net/types">0001-01-01T00:00:00</CreatedDate> <CreatedBy xmlns="http://schemas.servicestack.net/types">String</CreatedBy> <ModifiedDate xmlns="http://schemas.servicestack.net/types">0001-01-01T00:00:00</ModifiedDate> <ModifiedBy xmlns="http://schemas.servicestack.net/types">String</ModifiedBy> <DeletedDate xmlns="http://schemas.servicestack.net/types">0001-01-01T00:00:00</DeletedDate> <DeletedBy xmlns="http://schemas.servicestack.net/types">String</DeletedBy> <AlbumsCount>0</AlbumsCount> <AverageHash>0</AverageHash> <Background>String</Background> <ContentLength>0</ContentLength> <ContentType>String</ContentType> <CreativeId>0</CreativeId> <DifferenceHash>0</DifferenceHash> <DownloadsCount>0</DownloadsCount> <FileName>String</FileName> <FilePath>String</FilePath> <Height>0</Height> <Id>0</Id> <LikesCount>0</LikesCount> <Lqip>String</Lqip> <Nsfw>false</Nsfw> <PerceptualHash>0</PerceptualHash> <Prompt>String</Prompt> <Quality>0</Quality> <Rank>0</Rank> <RefId>String</RefId> <Score>0</Score> <SearchCount>0</SearchCount> <Seed>0</Seed> <TemporalScore>0</TemporalScore> <Versions xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d5p1:KeyValueOfstringstring> <d5p1:Key>String</d5p1:Key> <d5p1:Value>String</d5p1:Value> </d5p1:KeyValueOfstringstring> </Versions> <Width>0</Width> </Artifact> <ArtifactId>0</ArtifactId> <CreatedDate>0001-01-01T00:00:00</CreatedDate> <Description>String</Description> <Id>0</Id> <ModifiedDate>0001-01-01T00:00:00</ModifiedDate> </AlbumArtifact> </Artifacts> <Description>String</Description> <DownloadsCount>0</DownloadsCount> <Id>0</Id> <LikesCount>0</LikesCount> <Name>String</Name> <OwnerId>0</OwnerId> <OwnerRef>String</OwnerRef> <PrefColumns>0</PrefColumns> <PrimaryArtifactId>0</PrimaryArtifactId> <Private>false</Private> <Rank>0</Rank> <Rating>0</Rating> <RefId>String</RefId> <Score>0</Score> <SearchCount>0</SearchCount> <Slug>String</Slug> <Tags xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:string>String</d2p1:string> </Tags> </Album>