tvpl.api

<back to all web services

CreateProviderRequest

Requires Authentication
The following routes are available for this service:
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 .other suffix or ?format=other

HTTP + OTHER

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: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"name":"String","taxCode":"String","address":"String","email":"String","additionalInfo":"String","providerType":0}
HTTP/1.1 200 OK
Content-Type: text/jsonl
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}