Trendsic Platform Service

<back to all web services

CalendarRequest

The following routes are available for this service:
GET,OPTIONS/v1/Calendar/{CalendarId}
GET,OPTIONS/v1/Calendar/Project/{ProjectId}
GET,OPTIONS/v1/Calendar/Location/{LocationId}
GET,OPTIONS/v1/Calendar/Agent/{AgentId}
GET,OPTIONS/v1/Calendar/Project/{ProjectId}/{StartDate}/{EndDate}
GET,OPTIONS/v1/Calendar/Project/{ProjectId}/CalendarEventId/{CalendarEventId}
GET,OPTIONS/v1/Calendar/{CalendarId}/{StartDate}/{EndDate}
GET,OPTIONS/v1/Calendar/Project/{StartDate}/{EndDate}
GET,OPTIONS/v1/Calendar/Project/ExpandRecurring/{ProjectId}
GET,OPTIONS/v1/Calendar/CrewMember/Availability/{ContactId}/{StartDate}/{EndDate}
GET,OPTIONS/v1/Calendar/Project/ExpandRecurring/{ProjectId}/{StartDate}/{EndDate}
GET,OPTIONS/v1/Calendar/Project/ExpandRecurring/{ProjectId}/CalendarEventId/{CalendarEventId}
GET,OPTIONS/v1/Calendar/Project/ExpandRecurring/ExpandAll/{ProjectId}/{StartDate}/{EndDate}
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

enum CalendarType
{
    All,
    Pera,
    Google,
}

enum CalendarFormat
{
    Standard,
    ICS,
}

class CalendarRequest implements IConvertible
{
    String? CalendarId;
    int? CalendarEventId;
    CalendarType? CalendarType;
    CalendarFormat? CalendarFormat;
    int? ContactId;
    DateTime? StartDate;
    DateTime? EndDate;
    int? ProjectId;
    String? LocationId;
    int? AgentId;
    bool? ExpandRecurringEvents;
    bool? ExpandAll;

    CalendarRequest({this.CalendarId,this.CalendarEventId,this.CalendarType,this.CalendarFormat,this.ContactId,this.StartDate,this.EndDate,this.ProjectId,this.LocationId,this.AgentId,this.ExpandRecurringEvents,this.ExpandAll});
    CalendarRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CalendarId = json['CalendarId'];
        CalendarEventId = json['CalendarEventId'];
        CalendarType = JsonConverters.fromJson(json['CalendarType'],'CalendarType',context!);
        CalendarFormat = JsonConverters.fromJson(json['CalendarFormat'],'CalendarFormat',context!);
        ContactId = json['ContactId'];
        StartDate = JsonConverters.fromJson(json['StartDate'],'DateTime',context!);
        EndDate = JsonConverters.fromJson(json['EndDate'],'DateTime',context!);
        ProjectId = json['ProjectId'];
        LocationId = json['LocationId'];
        AgentId = json['AgentId'];
        ExpandRecurringEvents = json['ExpandRecurringEvents'];
        ExpandAll = json['ExpandAll'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CalendarId': CalendarId,
        'CalendarEventId': CalendarEventId,
        'CalendarType': JsonConverters.toJson(CalendarType,'CalendarType',context!),
        'CalendarFormat': JsonConverters.toJson(CalendarFormat,'CalendarFormat',context!),
        'ContactId': ContactId,
        'StartDate': JsonConverters.toJson(StartDate,'DateTime',context!),
        'EndDate': JsonConverters.toJson(EndDate,'DateTime',context!),
        'ProjectId': ProjectId,
        'LocationId': LocationId,
        'AgentId': AgentId,
        'ExpandRecurringEvents': ExpandRecurringEvents,
        'ExpandAll': ExpandAll
    };

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'CalendarType': TypeInfo(TypeOf.Enum, enumValues:CalendarType.values),
    'CalendarFormat': TypeInfo(TypeOf.Enum, enumValues:CalendarFormat.values),
    'CalendarRequest': TypeInfo(TypeOf.Class, create:() => CalendarRequest()),
});

Dart CalendarRequest 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.

GET /v1/Calendar/{CalendarId} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsonl