Blazor Diffusion

<back to all web services

CreateCreativeModifier

Creatives
Requires Authentication
Required role:Moderator
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 Modifier extends AuditBase implements IConvertible
{
    int? id;
    String? name;
    String? category;
    String? description;
    int? score;
    int? rank;

    Modifier({this.id,this.name,this.category,this.description,this.score,this.rank});
    Modifier.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        id = json['id'];
        name = json['name'];
        category = json['category'];
        description = json['description'];
        score = json['score'];
        rank = json['rank'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'id': id,
        'name': name,
        'category': category,
        'description': description,
        'score': score,
        'rank': rank
    });

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

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

    // @References(typeof(Modifier))
    int? modifierId;

    Modifier? modifier;

    CreativeModifier({this.id,this.creativeId,this.modifierId,this.modifier});
    CreativeModifier.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        creativeId = json['creativeId'];
        modifierId = json['modifierId'];
        modifier = JsonConverters.fromJson(json['modifier'],'Modifier',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'creativeId': creativeId,
        'modifierId': modifierId,
        'modifier': JsonConverters.toJson(modifier,'Modifier',context!)
    };

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

// @ValidateRequest(Validator="HasRole(`Moderator`)")
class CreateCreativeModifier implements ICreateDb<CreativeModifier>, IConvertible
{
    // @Validate(Validator="GreaterThan(0)")
    int? creativeId;

    // @Validate(Validator="GreaterThan(0)")
    int? modifierId;

    CreateCreativeModifier({this.creativeId,this.modifierId});
    CreateCreativeModifier.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        creativeId = json['creativeId'];
        modifierId = json['modifierId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'creativeId': creativeId,
        'modifierId': modifierId
    };

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

TypeContext _ctx = TypeContext(library: 'blazordiffusion.com', types: <String, TypeInfo> {
    'Modifier': TypeInfo(TypeOf.Class, create:() => Modifier()),
    'CreativeModifier': TypeInfo(TypeOf.Class, create:() => CreativeModifier()),
    'CreateCreativeModifier': TypeInfo(TypeOf.Class, create:() => CreateCreativeModifier()),
});

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

<CreateCreativeModifier xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BlazorDiffusion.ServiceModel">
  <CreativeId>0</CreativeId>
  <ModifierId>0</ModifierId>
</CreateCreativeModifier>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CreativeModifier xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BlazorDiffusion.ServiceModel">
  <CreativeId>0</CreativeId>
  <Id>0</Id>
  <Modifier>
    <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>
    <Category>String</Category>
    <Description>String</Description>
    <Id>0</Id>
    <Name>String</Name>
    <Rank>0</Rank>
    <Score>0</Score>
  </Modifier>
  <ModifierId>0</ModifierId>
</CreativeModifier>