TechStacks!

<back to all web services

SubscribeToOrganization

User
Requires Authentication
The following routes are available for this service:
PUT/orgs/{OrganizationId}/subscribe
import 'package:servicestack/servicestack.dart';

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;
}

enum PostType
{
    Announcement,
    Post,
    Showcase,
    Question,
    Request,
}

TypeContext _ctx = TypeContext(library: 'techstacks.io', types: <String, TypeInfo> {
    'Frequency': TypeInfo(TypeOf.Enum, enumValues:Frequency.values),
    'SubscribeToOrganization': TypeInfo(TypeOf.Class, create:() => SubscribeToOrganization()),
    'List<PostType>': TypeInfo(TypeOf.Class, create:() => <PostType>[]),
    'PostType': TypeInfo(TypeOf.Class, create:() => PostType()),
});

Dart SubscribeToOrganization DTOs

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

HTTP + CSV

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

{"organizationId":0,"postTypes":["Announcement"],"frequency":"0"}