| GET | /v1/shortlink/metadata |
|---|
import 'package:servicestack/servicestack.dart';
// @DataContract
class ProductMetadata extends ProductMetadata implements IConvertible
{
ProductMetadata();
ProductMetadata.fromJson(Map<String, dynamic> json) : super.fromJson(json);
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
return this;
}
Map<String, dynamic> toJson() => super.toJson();
getTypeName() => "ProductMetadata";
TypeContext? context = _ctx;
}
// @DataContract
class Destination implements IConvertible
{
// @DataMember(Name="isSuggestion")
bool? isSuggestion;
// @DataMember(Name="isAutoSuggestion")
bool? isAutoSuggestion;
// @DataMember(Name="destinationUrl")
String? destinationUrl;
// @DataMember(Name="replacementButton")
String? replacementButton;
Destination({this.isSuggestion,this.isAutoSuggestion,this.destinationUrl,this.replacementButton});
Destination.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
isSuggestion = json['isSuggestion'];
isAutoSuggestion = json['isAutoSuggestion'];
destinationUrl = json['destinationUrl'];
replacementButton = json['replacementButton'];
return this;
}
Map<String, dynamic> toJson() => {
'isSuggestion': isSuggestion,
'isAutoSuggestion': isAutoSuggestion,
'destinationUrl': destinationUrl,
'replacementButton': replacementButton
};
getTypeName() => "Destination";
TypeContext? context = _ctx;
}
// @DataContract
class GetShortLinkMetadataResponse implements IConvertible
{
// @DataMember(Name="baseCode")
String? baseCode;
// @DataMember(Name="domain")
String? domain;
// @DataMember(Name="code")
String? code;
// @DataMember(Name="productMetadata")
ProductMetadata? productMetadata;
// @DataMember(Name="destinations")
List<Destination>? destinations;
// @DataMember(Name="responseStatus")
ResponseStatus? responseStatus;
GetShortLinkMetadataResponse({this.baseCode,this.domain,this.code,this.productMetadata,this.destinations,this.responseStatus});
GetShortLinkMetadataResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
baseCode = json['baseCode'];
domain = json['domain'];
code = json['code'];
productMetadata = JsonConverters.fromJson(json['productMetadata'],'ProductMetadata',context!);
destinations = JsonConverters.fromJson(json['destinations'],'List<Destination>',context!);
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'baseCode': baseCode,
'domain': domain,
'code': code,
'productMetadata': JsonConverters.toJson(productMetadata,'ProductMetadata',context!),
'destinations': JsonConverters.toJson(destinations,'List<Destination>',context!),
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
};
getTypeName() => "GetShortLinkMetadataResponse";
TypeContext? context = _ctx;
}
// @DataContract
class GetShortLinkMetadataRequest implements IConvertible
{
// @DataMember(Name="domain")
String? domain;
// @DataMember(Name="code")
String? code;
GetShortLinkMetadataRequest({this.domain,this.code});
GetShortLinkMetadataRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
domain = json['aliasDomain'];
code = json['aliasCode'];
return this;
}
Map<String, dynamic> toJson() => {
'domain': domain,
'code': code
};
getTypeName() => "GetShortLinkMetadataRequest";
TypeContext? context = _ctx;
}
// @DataContract
abstract class ProductMetadata
{
// @DataMember(Name="title")
String? title;
// @DataMember(Name="author")
String? author;
// @DataMember(Name="url")
Uri? url;
// @DataMember(Name="description")
String? description;
// @DataMember(Name="retailer")
String? retailer;
// @DataMember(Name="productImages")
Map<String,Uri?>? productImages;
ProductMetadata({this.title,this.author,this.url,this.description,this.retailer,this.productImages});
ProductMetadata.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
title = json['title'];
author = json['author'];
url = JsonConverters.fromJson(json['url'],'Uri',context!);
description = json['description'];
retailer = json['retailer'];
productImages = JsonConverters.fromJson(json['productImages'],'Map<String,Uri?>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'title': title,
'author': author,
'url': JsonConverters.toJson(url,'Uri',context!),
'description': description,
'retailer': retailer,
'productImages': JsonConverters.toJson(productImages,'Map<String,Uri?>',context!)
};
getTypeName() => "ProductMetadata";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.booklinker.com', types: <String, TypeInfo> {
'ProductMetadata': TypeInfo(TypeOf.Class, create:() => ProductMetadata()),
'Destination': TypeInfo(TypeOf.Class, create:() => Destination()),
'GetShortLinkMetadataResponse': TypeInfo(TypeOf.Class, create:() => GetShortLinkMetadataResponse()),
'List<Destination>': TypeInfo(TypeOf.Class, create:() => <Destination>[]),
'GetShortLinkMetadataRequest': TypeInfo(TypeOf.Class, create:() => GetShortLinkMetadataRequest()),
'Uri': TypeInfo(TypeOf.Class, create:() => Uri()),
'Map<String,Uri?>': TypeInfo(TypeOf.Class, create:() => Map<String,Uri?>()),
});
Dart GetShortLinkMetadataRequest DTOs
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.
GET /v1/shortlink/metadata HTTP/1.1 Host: api.booklinker.com Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetShortLinkMetadataResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Booklinker.API.ServiceModel.V1.Responses">
<baseCode>String</baseCode>
<code>String</code>
<destinations xmlns:d2p1="http://schemas.datacontract.org/2004/07/Booklinker.API.ServiceModel.DTOs.Shortlinks.ChoicePage">
<d2p1:Destination>
<d2p1:destinationUrl>String</d2p1:destinationUrl>
<d2p1:isAutoSuggestion>false</d2p1:isAutoSuggestion>
<d2p1:isSuggestion>false</d2p1:isSuggestion>
<d2p1:replacementButton>String</d2p1:replacementButton>
</d2p1:Destination>
</destinations>
<domain>String</domain>
<productMetadata xmlns:d2p1="http://schemas.datacontract.org/2004/07/Booklinker.API.ServiceModel.V1.DTOs">
<author xmlns="http://schemas.datacontract.org/2004/07/ProductAPI.Contracts.V1.DTOs">String</author>
<description xmlns="http://schemas.datacontract.org/2004/07/ProductAPI.Contracts.V1.DTOs">String</description>
<productImages xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/ProductAPI.Contracts.V1.DTOs" />
<retailer xmlns="http://schemas.datacontract.org/2004/07/ProductAPI.Contracts.V1.DTOs">String</retailer>
<title xmlns="http://schemas.datacontract.org/2004/07/ProductAPI.Contracts.V1.DTOs">String</title>
<url i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/ProductAPI.Contracts.V1.DTOs" />
</productMetadata>
<responseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</responseStatus>
</GetShortLinkMetadataResponse>