| Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
| GET | /voss/targetGroups | Get all Voss target groups | Returns every target group in the Voss tenant (all pages). |
|---|
import 'package:servicestack/servicestack.dart';
// @DataContract(Name="TargetGroupConfigurationResult")
class TargetGroupConfigurationResult implements IConvertible
{
// @DataMember(Name="id", IsRequired=true)
String id = "";
// @DataMember(Name="organizationNumberRequired")
bool organizationNumberRequired;
// @DataMember(Name="organizationNumberUnique")
bool organizationNumberUnique;
// @DataMember(Name="customerNumberRequired")
bool customerNumberRequired;
// @DataMember(Name="customerAddressRequired")
bool customerAddressRequired;
// @DataMember(Name="contactPersonRequired")
bool contactPersonRequired;
// @DataMember(Name="expiryDateRequired")
bool expiryDateRequired;
// @DataMember(Name="excludeCustomerFromInvoiceFile")
bool excludeCustomerFromInvoiceFile;
TargetGroupConfigurationResult({this.id,this.organizationNumberRequired,this.organizationNumberUnique,this.customerNumberRequired,this.customerAddressRequired,this.contactPersonRequired,this.expiryDateRequired,this.excludeCustomerFromInvoiceFile});
TargetGroupConfigurationResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['Id'];
organizationNumberRequired = json['OrganizationNumberRequired'];
organizationNumberUnique = json['OrganizationNumberUnique'];
customerNumberRequired = json['CustomerNumberRequired'];
customerAddressRequired = json['CustomerAddressRequired'];
contactPersonRequired = json['ContactPersonRequired'];
expiryDateRequired = json['ExpiryDateRequired'];
excludeCustomerFromInvoiceFile = json['ExcludeCustomerFromInvoiceFile'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'organizationNumberRequired': organizationNumberRequired,
'organizationNumberUnique': organizationNumberUnique,
'customerNumberRequired': customerNumberRequired,
'customerAddressRequired': customerAddressRequired,
'contactPersonRequired': contactPersonRequired,
'expiryDateRequired': expiryDateRequired,
'excludeCustomerFromInvoiceFile': excludeCustomerFromInvoiceFile
};
getTypeName() => "TargetGroupConfigurationResult";
TypeContext? context = _ctx;
}
enum TypeEnum
{
Exclusivity,
}
// @DataContract(Name="TargetGroupTagDto")
class TargetGroupTagDto implements IConvertible
{
// @DataMember(Name="type", IsRequired=true)
TypeEnum type;
// @DataMember(Name="tag", IsRequired=true)
String tag = "";
TargetGroupTagDto({this.type,this.tag});
TargetGroupTagDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
type = JsonConverters.fromJson(json['Type'],'TypeEnum',context!);
tag = json['Tag'];
return this;
}
Map<String, dynamic> toJson() => {
'type': JsonConverters.toJson(type,'TypeEnum',context!),
'tag': tag
};
getTypeName() => "TargetGroupTagDto";
TypeContext? context = _ctx;
}
// @DataContract(Name="TargetGroupResult")
class TargetGroupResult implements IConvertible
{
// @DataMember(Name="id", IsRequired=true)
String id = "";
// @DataMember(Name="name", IsRequired=true)
String name = "";
// @DataMember(Name="isDefault")
bool isDefault;
// @DataMember(Name="externalId")
String externalId = "";
// @DataMember(Name="configuration", EmitDefaultValue=false)
TargetGroupConfigurationResult configuration;
// @DataMember(Name="tags", EmitDefaultValue=false)
List<TargetGroupTagDto> tags = [];
TargetGroupResult({this.id,this.name,this.isDefault,this.externalId,this.configuration,this.tags});
TargetGroupResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['Id'];
name = json['Name'];
isDefault = json['IsDefault'];
externalId = json['ExternalId'];
configuration = JsonConverters.fromJson(json['VarConfiguration'],'TargetGroupConfigurationResult',context!);
tags = JsonConverters.fromJson(json['Tags'],'List<TargetGroupTagDto>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'name': name,
'isDefault': isDefault,
'externalId': externalId,
'configuration': JsonConverters.toJson(configuration,'TargetGroupConfigurationResult',context!),
'tags': JsonConverters.toJson(tags,'List<TargetGroupTagDto>',context!)
};
getTypeName() => "TargetGroupResult";
TypeContext? context = _ctx;
}
class GetVossTargetGroupsResponse implements IConvertible
{
int TotalCount = 0;
List<TargetGroupResult> Items = [];
GetVossTargetGroupsResponse({this.TotalCount,this.Items});
GetVossTargetGroupsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
TotalCount = json['TotalCount'];
Items = JsonConverters.fromJson(json['Items'],'List<TargetGroupResult>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'TotalCount': TotalCount,
'Items': JsonConverters.toJson(Items,'List<TargetGroupResult>',context!)
};
getTypeName() => "GetVossTargetGroupsResponse";
TypeContext? context = _ctx;
}
// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
class GetVossTargetGroups implements IConvertible
{
GetVossTargetGroups();
GetVossTargetGroups.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "GetVossTargetGroups";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'testapi.bokamera.se', types: <String, TypeInfo> {
'TargetGroupConfigurationResult': TypeInfo(TypeOf.Class, create:() => TargetGroupConfigurationResult()),
'TypeEnum': TypeInfo(TypeOf.Enum, enumValues:TypeEnum.values),
'TargetGroupTagDto': TypeInfo(TypeOf.Class, create:() => TargetGroupTagDto()),
'TargetGroupResult': TypeInfo(TypeOf.Class, create:() => TargetGroupResult()),
'List<TargetGroupTagDto>': TypeInfo(TypeOf.Class, create:() => <TargetGroupTagDto>[]),
'GetVossTargetGroupsResponse': TypeInfo(TypeOf.Class, create:() => GetVossTargetGroupsResponse()),
'List<TargetGroupResult>': TypeInfo(TypeOf.Class, create:() => <TargetGroupResult>[]),
'GetVossTargetGroups': TypeInfo(TypeOf.Class, create:() => GetVossTargetGroups()),
});
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.
GET /voss/targetGroups HTTP/1.1 Host: testapi.bokamera.se Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
TotalCount: 0,
Items:
[
{
}
]
}