| POST | /provider |
|---|
import 'package:servicestack/servicestack.dart';
class Provider implements IConvertible
{
int? id;
String? name;
String? taxCode;
String? address;
String? email;
String? additionalInfo;
int? providerType;
DateTime? createdAt;
int? createdBy;
Provider({this.id,this.name,this.taxCode,this.address,this.email,this.additionalInfo,this.providerType,this.createdAt,this.createdBy});
Provider.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
taxCode = json['taxCode'];
address = json['address'];
email = json['email'];
additionalInfo = json['additionalInfo'];
providerType = json['providerType'];
createdAt = JsonConverters.fromJson(json['createdAt'],'DateTime',context!);
createdBy = json['createdBy'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'name': name,
'taxCode': taxCode,
'address': address,
'email': email,
'additionalInfo': additionalInfo,
'providerType': providerType,
'createdAt': JsonConverters.toJson(createdAt,'DateTime',context!),
'createdBy': createdBy
};
getTypeName() => "Provider";
TypeContext? context = _ctx;
}
class CreateProviderRequest implements IConvertible
{
String? name;
String? taxCode;
String? address;
String? email;
String? additionalInfo;
int? providerType;
CreateProviderRequest({this.name,this.taxCode,this.address,this.email,this.additionalInfo,this.providerType});
CreateProviderRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
name = json['name'];
taxCode = json['taxCode'];
address = json['address'];
email = json['email'];
additionalInfo = json['additionalInfo'];
providerType = json['providerType'];
return this;
}
Map<String, dynamic> toJson() => {
'name': name,
'taxCode': taxCode,
'address': address,
'email': email,
'additionalInfo': additionalInfo,
'providerType': providerType
};
getTypeName() => "CreateProviderRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'etc_api.vsmlab.vn', types: <String, TypeInfo> {
'Provider': TypeInfo(TypeOf.Class, create:() => Provider()),
'CreateProviderRequest': TypeInfo(TypeOf.Class, create:() => CreateProviderRequest()),
});
Dart CreateProviderRequest 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.
POST /provider HTTP/1.1
Host: etc-api.vsmlab.vn
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CreateProviderRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/tvpl.api.ServiceModel">
<AdditionalInfo>String</AdditionalInfo>
<Address>String</Address>
<Email>String</Email>
<Name>String</Name>
<ProviderType>0</ProviderType>
<TaxCode>String</TaxCode>
</CreateProviderRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <Provider xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models"> <AdditionalInfo>String</AdditionalInfo> <Address>String</Address> <CreatedAt>0001-01-01T00:00:00</CreatedAt> <CreatedBy>0</CreatedBy> <DeletedAt>0001-01-01T00:00:00</DeletedAt> <DeletedBy>0</DeletedBy> <Email>String</Email> <Id>0</Id> <IsDeleted>false</IsDeleted> <Name>String</Name> <ProviderType>0</ProviderType> <TaxCode>String</TaxCode> </Provider>