digitaluapi

<back to all web services

SegmentsAdd

Requires Authentication
Requires any of the roles:Client, Admin, Partner
The following routes are available for this service:
POST/segments
import 'package:servicestack/servicestack.dart';

class SegmentsAddResponse implements IConvertible
{
    // @DataMember(Order=2)
    int? TenantsId;

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

    // @DataMember(Order=4)
    bool? IsCustom;

    // @DataMember(Order=6)
    ResponseStatus? ResponseStatus;

    SegmentsAddResponse({this.TenantsId,this.Name,this.IsCustom,this.ResponseStatus});
    SegmentsAddResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        TenantsId = json['TenantsId'];
        Name = json['Name'];
        IsCustom = json['IsCustom'];
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'TenantsId': TenantsId,
        'Name': Name,
        'IsCustom': IsCustom,
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

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

// @DataContract
class SegmentsAdd implements IConvertible
{
    // @DataMember(Order=2)
    // @Validate(Validator="NotNull")
    int? TenantsId;

    // @DataMember(Order=3)
    // @Validate(Validator="NotNull")
    String? Name;

    // @DataMember(Order=4)
    bool? IsCustom;

    SegmentsAdd({this.TenantsId,this.Name,this.IsCustom});
    SegmentsAdd.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        TenantsId = json['TenantsId'];
        Name = json['Name'];
        IsCustom = json['IsCustom'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'TenantsId': TenantsId,
        'Name': Name,
        'IsCustom': IsCustom
    };

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

TypeContext _ctx = TypeContext(library: 'duengageapi.uat.scadsoftware.com', types: <String, TypeInfo> {
    'SegmentsAddResponse': TypeInfo(TypeOf.Class, create:() => SegmentsAddResponse()),
    'SegmentsAdd': TypeInfo(TypeOf.Class, create:() => SegmentsAdd()),
});

Dart SegmentsAdd DTOs

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

HTTP + JSV

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

POST /segments HTTP/1.1 
Host: duengageapi.uat.scadsoftware.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	TenantsId: 0,
	Name: String,
	IsCustom: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	TenantsId: 0,
	Name: String,
	IsCustom: False,
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}