Blazor Diffusion

<back to all web services

AdminUpdateArtifactCommentReport

Admin
Requires Authentication
Required role:Admin
import 'package:servicestack/servicestack.dart';

enum PostReport
{
    Offensive,
    Spam,
    Nudity,
    Illegal,
    Other,
}

class ArtifactCommentReport implements IConvertible
{
    int? id;
    // @References(typeof(ArtifactComment))
    int? artifactCommentId;

    int? appUserId;
    PostReport? postReport;
    String? description;
    DateTime? createdDate;

    ArtifactCommentReport({this.id,this.artifactCommentId,this.appUserId,this.postReport,this.description,this.createdDate});
    ArtifactCommentReport.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        artifactCommentId = json['artifactCommentId'];
        appUserId = json['appUserId'];
        postReport = JsonConverters.fromJson(json['postReport'],'PostReport',context!);
        description = json['description'];
        createdDate = JsonConverters.fromJson(json['createdDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'artifactCommentId': artifactCommentId,
        'appUserId': appUserId,
        'postReport': JsonConverters.toJson(postReport,'PostReport',context!),
        'description': description,
        'createdDate': JsonConverters.toJson(createdDate,'DateTime',context!)
    };

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

// @ValidateRequest(Validator="IsAdmin")
class AdminUpdateArtifactCommentReport implements IPatchDb<ArtifactCommentReport>, IConvertible
{
    int? id;
    PostReport? postReport;
    String? description;

    AdminUpdateArtifactCommentReport({this.id,this.postReport,this.description});
    AdminUpdateArtifactCommentReport.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        postReport = JsonConverters.fromJson(json['postReport'],'PostReport',context!);
        description = json['description'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'postReport': JsonConverters.toJson(postReport,'PostReport',context!),
        'description': description
    };

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

TypeContext _ctx = TypeContext(library: 'blazordiffusion.com', types: <String, TypeInfo> {
    'PostReport': TypeInfo(TypeOf.Enum, enumValues:PostReport.values),
    'ArtifactCommentReport': TypeInfo(TypeOf.Class, create:() => ArtifactCommentReport()),
    'AdminUpdateArtifactCommentReport': TypeInfo(TypeOf.Class, create:() => AdminUpdateArtifactCommentReport()),
});

Dart AdminUpdateArtifactCommentReport 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/AdminUpdateArtifactCommentReport HTTP/1.1 
Host: blazordiffusion.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<AdminUpdateArtifactCommentReport xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BlazorDiffusion.ServiceModel">
  <Description>String</Description>
  <Id>0</Id>
  <PostReport>Offensive</PostReport>
</AdminUpdateArtifactCommentReport>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ArtifactCommentReport xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BlazorDiffusion.ServiceModel">
  <AppUserId>0</AppUserId>
  <ArtifactCommentId>0</ArtifactCommentId>
  <CreatedDate>0001-01-01T00:00:00</CreatedDate>
  <Description>String</Description>
  <Id>0</Id>
  <PostReport>Offensive</PostReport>
</ArtifactCommentReport>