| POST | /v4/short-links/migrate |
|---|
import 'package:servicestack/servicestack.dart';
// @DataContract
class MigrateShortLinksResponse implements IConvertible
{
// @DataMember(Name="linksMigrated")
int? linksMigrated;
// @DataMember(Name="responseStatus")
ResponseStatus? responseStatus;
MigrateShortLinksResponse({this.linksMigrated,this.responseStatus});
MigrateShortLinksResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
linksMigrated = json['linksMigrated'];
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'linksMigrated': linksMigrated,
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
};
getTypeName() => "MigrateShortLinksResponse";
TypeContext? context = _ctx;
}
// @DataContract
class MigrateShortLinksRequest implements IConvertible
{
// @DataMember(Name="sourceUsername")
String? sourceUsername;
// @DataMember(Name="targetUsername")
String? targetUsername;
// @DataMember(Name="sourceGroupId")
int? sourceGroupId;
// @DataMember(Name="targetGroupId")
int? targetGroupId;
MigrateShortLinksRequest({this.sourceUsername,this.targetUsername,this.sourceGroupId,this.targetGroupId});
MigrateShortLinksRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
sourceUsername = json['sourceUsername'];
targetUsername = json['targetUsername'];
sourceGroupId = json['sourceGroupId'];
targetGroupId = json['targetGroupId'];
return this;
}
Map<String, dynamic> toJson() => {
'sourceUsername': sourceUsername,
'targetUsername': targetUsername,
'sourceGroupId': sourceGroupId,
'targetGroupId': targetGroupId
};
getTypeName() => "MigrateShortLinksRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'shortlinks_api.qa.platform.georiot.com', types: <String, TypeInfo> {
'MigrateShortLinksResponse': TypeInfo(TypeOf.Class, create:() => MigrateShortLinksResponse()),
'MigrateShortLinksRequest': TypeInfo(TypeOf.Class, create:() => MigrateShortLinksRequest()),
});
Dart MigrateShortLinksRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v4/short-links/migrate HTTP/1.1
Host: shortlinks-api.qa.platform.georiot.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
sourceUsername: String,
targetUsername: String,
sourceGroupId: 0,
targetGroupId: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
linksMigrated: 0,
responseStatus:
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
}
}