tvpl.api

<back to all web services

UpdateAppConfigsBySection

Requires Authentication
Required role:super-admin
The following routes are available for this service:
POST/app-configs/{Section}
import 'package:servicestack/servicestack.dart';

enum AppConfigSection
{
    AppInfo,
    Smtp,
    Keycloak,
}

class AppConfigItem implements IConvertible
{
    String? key;
    String? value;
    String? description;

    AppConfigItem({this.key,this.value,this.description});
    AppConfigItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        key = json['key'];
        value = json['value'];
        description = json['description'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'key': key,
        'value': value,
        'description': description
    };

    getTypeName() => "AppConfigItem";
    TypeContext? context = _ctx;
}

class UpdateAppConfigsBySection implements IConvertible
{
    AppConfigSection? section;
    List<AppConfigItem>? items;

    UpdateAppConfigsBySection({this.section,this.items});
    UpdateAppConfigsBySection.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        section = JsonConverters.fromJson(json['section'],'AppConfigSection',context!);
        items = JsonConverters.fromJson(json['items'],'List<AppConfigItem>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'section': JsonConverters.toJson(section,'AppConfigSection',context!),
        'items': JsonConverters.toJson(items,'List<AppConfigItem>',context!)
    };

    getTypeName() => "UpdateAppConfigsBySection";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'etc_api.vsmlab.vn', types: <String, TypeInfo> {
    'AppConfigSection': TypeInfo(TypeOf.Enum, enumValues:AppConfigSection.values),
    'AppConfigItem': TypeInfo(TypeOf.Class, create:() => AppConfigItem()),
    'UpdateAppConfigsBySection': TypeInfo(TypeOf.Class, create:() => UpdateAppConfigsBySection()),
    'List<AppConfigItem>': TypeInfo(TypeOf.Class, create:() => <AppConfigItem>[]),
});

Dart UpdateAppConfigsBySection DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /app-configs/{Section} HTTP/1.1 
Host: etc-api.vsmlab.vn 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"section":"AppInfo","items":[{"key":"String","value":"String","description":"String"}]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{}