PUT | /orgs/{OrganizationId}/subscribe |
---|
import 'package:servicestack/servicestack.dart';
enum PostType
{
Announcement,
Post,
Showcase,
Question,
Request,
}
enum Frequency
{
Daily,
Weekly,
Monthly,
Quarterly,
}
class SubscribeToOrganization implements IPut, IConvertible
{
int? organizationId;
List<PostType>? postTypes;
Frequency? frequency;
SubscribeToOrganization({this.organizationId,this.postTypes,this.frequency});
SubscribeToOrganization.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
organizationId = json['organizationId'];
postTypes = JsonConverters.fromJson(json['postTypes'],'List<PostType>',context!);
frequency = JsonConverters.fromJson(json['frequency'],'Frequency',context!);
return this;
}
Map<String, dynamic> toJson() => {
'organizationId': organizationId,
'postTypes': JsonConverters.toJson(postTypes,'List<PostType>',context!),
'frequency': JsonConverters.toJson(frequency,'Frequency',context!)
};
getTypeName() => "SubscribeToOrganization";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'techstacks.io', types: <String, TypeInfo> {
'PostType': TypeInfo(TypeOf.Enum, enumValues:PostType.values),
'Frequency': TypeInfo(TypeOf.Enum, enumValues:Frequency.values),
'SubscribeToOrganization': TypeInfo(TypeOf.Class, create:() => SubscribeToOrganization()),
'List<PostType>': TypeInfo(TypeOf.Class, create:() => <PostType>[]),
});
Dart SubscribeToOrganization DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /orgs/{OrganizationId}/subscribe HTTP/1.1
Host: techstacks.io
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"organizationId":0,"postTypes":["Announcement"],"frequency":"0"}