Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
PUT | /services/prices/mappings | Update price mappings for service prices | Update price mappings for service prices |
---|
import 'package:servicestack/servicestack.dart';
class ServicePriceMappingResponse implements IConvertible
{
/**
* The company id
*/
// @ApiMember(Description="The company id")
String? CompanyId;
String? Id;
/**
* The price id
*/
// @ApiMember(Description="The price id")
int? PriceId;
/**
* The external reference
*/
// @ApiMember(Description="The external reference")
String? ExternalReference;
/**
* The Reference Type
*/
// @ApiMember(Description="The Reference Type")
String? ReferenceType;
ServicePriceMappingResponse({this.CompanyId,this.Id,this.PriceId,this.ExternalReference,this.ReferenceType});
ServicePriceMappingResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CompanyId = json['CompanyId'];
Id = json['Id'];
PriceId = json['PriceId'];
ExternalReference = json['ExternalReference'];
ReferenceType = json['ReferenceType'];
return this;
}
Map<String, dynamic> toJson() => {
'CompanyId': CompanyId,
'Id': Id,
'PriceId': PriceId,
'ExternalReference': ExternalReference,
'ReferenceType': ReferenceType
};
getTypeName() => "ServicePriceMappingResponse";
TypeContext? context = _ctx;
}
class ServicePriceMapping implements IConvertible
{
/**
* The id
*/
// @ApiMember(Description="The id")
String? Id;
/**
* The price id
*/
// @ApiMember(Description="The price id")
int? PriceId;
/**
* The Reference Type
*/
// @ApiMember(Description="The Reference Type")
String? ReferenceType;
/**
* The external reference; Values for e-accounting; EAccountingCustomerId, EAccountingArticle, EAccountingInvoice, EAccountingDraftInvoice
*/
// @ApiMember(Description="The external reference; Values for e-accounting; EAccountingCustomerId, EAccountingArticle, EAccountingInvoice, EAccountingDraftInvoice")
String? ExternalReference;
ServicePriceMapping({this.Id,this.PriceId,this.ReferenceType,this.ExternalReference});
ServicePriceMapping.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
PriceId = json['PriceId'];
ReferenceType = json['ReferenceType'];
ExternalReference = json['ExternalReference'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'PriceId': PriceId,
'ReferenceType': ReferenceType,
'ExternalReference': ExternalReference
};
getTypeName() => "ServicePriceMapping";
TypeContext? context = _ctx;
}
// @ValidateRequest(Validator="IsAuthenticated")
class UpdateServicePricesMapping implements ICompany, IConvertible
{
/**
* Company to show services for
*/
// @ApiMember(Description="Company to show services for")
String? CompanyId;
List<ServicePriceMapping>? ServicePriceMappings;
UpdateServicePricesMapping({this.CompanyId,this.ServicePriceMappings});
UpdateServicePricesMapping.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CompanyId = json['CompanyId'];
ServicePriceMappings = JsonConverters.fromJson(json['ServicePriceMappings'],'List<ServicePriceMapping>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'CompanyId': CompanyId,
'ServicePriceMappings': JsonConverters.toJson(ServicePriceMappings,'List<ServicePriceMapping>',context!)
};
getTypeName() => "UpdateServicePricesMapping";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
'ServicePriceMappingResponse': TypeInfo(TypeOf.Class, create:() => ServicePriceMappingResponse()),
'ServicePriceMapping': TypeInfo(TypeOf.Class, create:() => ServicePriceMapping()),
'UpdateServicePricesMapping': TypeInfo(TypeOf.Class, create:() => UpdateServicePricesMapping()),
'List<ServicePriceMapping>': TypeInfo(TypeOf.Class, create:() => <ServicePriceMapping>[]),
});
Dart UpdateServicePricesMapping 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.
PUT /services/prices/mappings HTTP/1.1
Host: api.bokamera.se
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<UpdateServicePricesMapping xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<ServicePriceMappings>
<ServicePriceMapping>
<ExternalReference>String</ExternalReference>
<Id>00000000-0000-0000-0000-000000000000</Id>
<PriceId>0</PriceId>
<ReferenceType>String</ReferenceType>
</ServicePriceMapping>
</ServicePriceMappings>
</UpdateServicePricesMapping>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ServicePriceMappingResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId> <ExternalReference>String</ExternalReference> <Id>00000000-0000-0000-0000-000000000000</Id> <PriceId>0</PriceId> <ReferenceType>String</ReferenceType> </ServicePriceMappingResponse>