| Required role: | super-admin |
| PUT | /provider/{Id} |
|---|
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 UpdateProviderRequest implements IConvertible
{
int? id;
String? name;
String? taxCode;
String? address;
String? email;
String? additionalInfo;
int? providerType;
UpdateProviderRequest({this.id,this.name,this.taxCode,this.address,this.email,this.additionalInfo,this.providerType});
UpdateProviderRequest.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'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'name': name,
'taxCode': taxCode,
'address': address,
'email': email,
'additionalInfo': additionalInfo,
'providerType': providerType
};
getTypeName() => "UpdateProviderRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'etc_api.vsmlab.vn', types: <String, TypeInfo> {
'Provider': TypeInfo(TypeOf.Class, create:() => Provider()),
'UpdateProviderRequest': TypeInfo(TypeOf.Class, create:() => UpdateProviderRequest()),
});
Dart UpdateProviderRequest 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.
PUT /provider/{Id} HTTP/1.1
Host: etc-api.vsmlab.vn
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
id: 0,
name: String,
taxCode: String,
address: String,
email: String,
additionalInfo: String,
providerType: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
id: 0,
name: String,
taxCode: String,
address: String,
email: String,
additionalInfo: String,
providerType: 0,
createdAt: "0001-01-01T00:00:00.0000000+07:06",
createdBy: 0
}