Required role: | REGISUserRole |
POST | /Sections/Admin/{reporting_term}/Create |
---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class InstructorResponse implements IConvertible
{
ResponseStatus? responseStatus;
int? regent_id;
String? regent_login;
String? preferred_name;
String? first_name;
String? last_name;
String? full_name;
String? email;
String? image_base64;
InstructorResponse({this.responseStatus,this.regent_id,this.regent_login,this.preferred_name,this.first_name,this.last_name,this.full_name,this.email,this.image_base64});
InstructorResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
regent_id = json['regent_id'];
regent_login = json['regent_login'];
preferred_name = json['preferred_name'];
first_name = json['first_name'];
last_name = json['last_name'];
full_name = json['full_name'];
email = json['email'];
image_base64 = json['image_base64'];
return this;
}
Map<String, dynamic> toJson() => {
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!),
'regent_id': regent_id,
'regent_login': regent_login,
'preferred_name': preferred_name,
'first_name': first_name,
'last_name': last_name,
'full_name': full_name,
'email': email,
'image_base64': image_base64
};
getTypeName() => "InstructorResponse";
TypeContext? context = _ctx;
}
class DocumentResponse implements IConvertible
{
String? code;
String? document_name;
String? document_description;
DocumentResponse({this.code,this.document_name,this.document_description});
DocumentResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
code = json['code'];
document_name = json['document_name'];
document_description = json['document_description'];
return this;
}
Map<String, dynamic> toJson() => {
'code': code,
'document_name': document_name,
'document_description': document_description
};
getTypeName() => "DocumentResponse";
TypeContext? context = _ctx;
}
class SectionResponse implements IConvertible
{
ResponseStatus? responseStatus;
String? secUUID;
String? course_name;
String? section_code;
String? course_title;
String? course_short_title;
String? course_description;
String? crosslist_description;
String? crosslist_course_name;
String? location_long_name;
String? room;
List<InstructorResponse>? instructors;
List<DocumentResponse>? required_documents;
DateTime? start_date;
DateTime? end_date;
DateTime? first_meeting_date;
DateTime? last_meeting_date;
String? meeting_days;
List<String>? start_times;
List<String>? end_times;
bool? is_online_only;
bool? is_weekend;
bool? is_weekday;
bool? is_evening;
bool? is_waitlist;
bool? has_special_requirements;
String? special_requirements;
bool? is_unlisted;
List<double>? credit_amounts;
List<double>? audit_amounts;
String? audits_short_name;
String? audits_long_name;
String? credits_short_name;
String? credits_long_name;
String? distance_ed_materials;
String? prerequisites;
String? corequisites;
int? capacity;
double? flat_fee_amount;
double? additional_fee_amount;
int? registered_students;
int? three_credit_plus;
int? two_credit;
int? one_credit;
int? three_audit_plus;
int? two_audit;
int? one_audit;
int? crosslist_registered_students;
int? grades_received;
int? crosslist_grades_received;
DateTime? registration_start_date;
DateTime? registration_end_date;
DateTime? add_start_date;
DateTime? add_end_date;
DateTime? drop_start_date;
DateTime? drop_end_date;
DateTime? grading_end_date;
String? term;
String? reporting_term;
int? reporting_year;
String? current_status;
String? added_by;
DateTime? added_date;
String? changed_by;
DateTime? changed_date;
DateTime? timestamp;
SectionResponse({this.responseStatus,this.secUUID,this.course_name,this.section_code,this.course_title,this.course_short_title,this.course_description,this.crosslist_description,this.crosslist_course_name,this.location_long_name,this.room,this.instructors,this.required_documents,this.start_date,this.end_date,this.first_meeting_date,this.last_meeting_date,this.meeting_days,this.start_times,this.end_times,this.is_online_only,this.is_weekend,this.is_weekday,this.is_evening,this.is_waitlist,this.has_special_requirements,this.special_requirements,this.is_unlisted,this.credit_amounts,this.audit_amounts,this.audits_short_name,this.audits_long_name,this.credits_short_name,this.credits_long_name,this.distance_ed_materials,this.prerequisites,this.corequisites,this.capacity,this.flat_fee_amount,this.additional_fee_amount,this.registered_students,this.three_credit_plus,this.two_credit,this.one_credit,this.three_audit_plus,this.two_audit,this.one_audit,this.crosslist_registered_students,this.grades_received,this.crosslist_grades_received,this.registration_start_date,this.registration_end_date,this.add_start_date,this.add_end_date,this.drop_start_date,this.drop_end_date,this.grading_end_date,this.term,this.reporting_term,this.reporting_year,this.current_status,this.added_by,this.added_date,this.changed_by,this.changed_date,this.timestamp});
SectionResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
secUUID = json['secUUID'];
course_name = json['course_name'];
section_code = json['section_code'];
course_title = json['course_title'];
course_short_title = json['course_short_title'];
course_description = json['course_description'];
crosslist_description = json['crosslist_description'];
crosslist_course_name = json['crosslist_course_name'];
location_long_name = json['location_long_name'];
room = json['room'];
instructors = JsonConverters.fromJson(json['instructors'],'List<InstructorResponse>',context!);
required_documents = JsonConverters.fromJson(json['required_documents'],'List<DocumentResponse>',context!);
start_date = JsonConverters.fromJson(json['start_date'],'DateTime',context!);
end_date = JsonConverters.fromJson(json['end_date'],'DateTime',context!);
first_meeting_date = JsonConverters.fromJson(json['first_meeting_date'],'DateTime',context!);
last_meeting_date = JsonConverters.fromJson(json['last_meeting_date'],'DateTime',context!);
meeting_days = json['meeting_days'];
start_times = JsonConverters.fromJson(json['start_times'],'List<String>',context!);
end_times = JsonConverters.fromJson(json['end_times'],'List<String>',context!);
is_online_only = json['is_online_only'];
is_weekend = json['is_weekend'];
is_weekday = json['is_weekday'];
is_evening = json['is_evening'];
is_waitlist = json['is_waitlist'];
has_special_requirements = json['has_special_requirements'];
special_requirements = json['special_requirements'];
is_unlisted = json['is_unlisted'];
credit_amounts = JsonConverters.fromJson(json['credit_amounts'],'List<double>',context!);
audit_amounts = JsonConverters.fromJson(json['audit_amounts'],'List<double>',context!);
audits_short_name = json['audits_short_name'];
audits_long_name = json['audits_long_name'];
credits_short_name = json['credits_short_name'];
credits_long_name = json['credits_long_name'];
distance_ed_materials = json['distance_ed_materials'];
prerequisites = json['prerequisites'];
corequisites = json['corequisites'];
capacity = json['capacity'];
flat_fee_amount = JsonConverters.toDouble(json['flat_fee_amount']);
additional_fee_amount = JsonConverters.toDouble(json['additional_fee_amount']);
registered_students = json['registered_students'];
three_credit_plus = json['three_credit_plus'];
two_credit = json['two_credit'];
one_credit = json['one_credit'];
three_audit_plus = json['three_audit_plus'];
two_audit = json['two_audit'];
one_audit = json['one_audit'];
crosslist_registered_students = json['crosslist_registered_students'];
grades_received = json['grades_received'];
crosslist_grades_received = json['crosslist_grades_received'];
registration_start_date = JsonConverters.fromJson(json['registration_start_date'],'DateTime',context!);
registration_end_date = JsonConverters.fromJson(json['registration_end_date'],'DateTime',context!);
add_start_date = JsonConverters.fromJson(json['add_start_date'],'DateTime',context!);
add_end_date = JsonConverters.fromJson(json['add_end_date'],'DateTime',context!);
drop_start_date = JsonConverters.fromJson(json['drop_start_date'],'DateTime',context!);
drop_end_date = JsonConverters.fromJson(json['drop_end_date'],'DateTime',context!);
grading_end_date = JsonConverters.fromJson(json['grading_end_date'],'DateTime',context!);
term = json['term'];
reporting_term = json['reporting_term'];
reporting_year = json['reporting_year'];
current_status = json['current_status'];
added_by = json['added_by'];
added_date = JsonConverters.fromJson(json['added_date'],'DateTime',context!);
changed_by = json['changed_by'];
changed_date = JsonConverters.fromJson(json['changed_date'],'DateTime',context!);
timestamp = JsonConverters.fromJson(json['timestamp'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!),
'secUUID': secUUID,
'course_name': course_name,
'section_code': section_code,
'course_title': course_title,
'course_short_title': course_short_title,
'course_description': course_description,
'crosslist_description': crosslist_description,
'crosslist_course_name': crosslist_course_name,
'location_long_name': location_long_name,
'room': room,
'instructors': JsonConverters.toJson(instructors,'List<InstructorResponse>',context!),
'required_documents': JsonConverters.toJson(required_documents,'List<DocumentResponse>',context!),
'start_date': JsonConverters.toJson(start_date,'DateTime',context!),
'end_date': JsonConverters.toJson(end_date,'DateTime',context!),
'first_meeting_date': JsonConverters.toJson(first_meeting_date,'DateTime',context!),
'last_meeting_date': JsonConverters.toJson(last_meeting_date,'DateTime',context!),
'meeting_days': meeting_days,
'start_times': JsonConverters.toJson(start_times,'List<String>',context!),
'end_times': JsonConverters.toJson(end_times,'List<String>',context!),
'is_online_only': is_online_only,
'is_weekend': is_weekend,
'is_weekday': is_weekday,
'is_evening': is_evening,
'is_waitlist': is_waitlist,
'has_special_requirements': has_special_requirements,
'special_requirements': special_requirements,
'is_unlisted': is_unlisted,
'credit_amounts': JsonConverters.toJson(credit_amounts,'List<double>',context!),
'audit_amounts': JsonConverters.toJson(audit_amounts,'List<double>',context!),
'audits_short_name': audits_short_name,
'audits_long_name': audits_long_name,
'credits_short_name': credits_short_name,
'credits_long_name': credits_long_name,
'distance_ed_materials': distance_ed_materials,
'prerequisites': prerequisites,
'corequisites': corequisites,
'capacity': capacity,
'flat_fee_amount': flat_fee_amount,
'additional_fee_amount': additional_fee_amount,
'registered_students': registered_students,
'three_credit_plus': three_credit_plus,
'two_credit': two_credit,
'one_credit': one_credit,
'three_audit_plus': three_audit_plus,
'two_audit': two_audit,
'one_audit': one_audit,
'crosslist_registered_students': crosslist_registered_students,
'grades_received': grades_received,
'crosslist_grades_received': crosslist_grades_received,
'registration_start_date': JsonConverters.toJson(registration_start_date,'DateTime',context!),
'registration_end_date': JsonConverters.toJson(registration_end_date,'DateTime',context!),
'add_start_date': JsonConverters.toJson(add_start_date,'DateTime',context!),
'add_end_date': JsonConverters.toJson(add_end_date,'DateTime',context!),
'drop_start_date': JsonConverters.toJson(drop_start_date,'DateTime',context!),
'drop_end_date': JsonConverters.toJson(drop_end_date,'DateTime',context!),
'grading_end_date': JsonConverters.toJson(grading_end_date,'DateTime',context!),
'term': term,
'reporting_term': reporting_term,
'reporting_year': reporting_year,
'current_status': current_status,
'added_by': added_by,
'added_date': JsonConverters.toJson(added_date,'DateTime',context!),
'changed_by': changed_by,
'changed_date': JsonConverters.toJson(changed_date,'DateTime',context!),
'timestamp': JsonConverters.toJson(timestamp,'DateTime',context!)
};
getTypeName() => "SectionResponse";
TypeContext? context = _ctx;
}
class SectionCreateRequest implements IConvertible
{
int? course_id;
String? course_name;
double? min_credits;
double? max_credits;
double? credit_increments;
double? min_audits;
double? max_audits;
double? audit_increments;
String? section_code;
String? title;
String? pretty_title;
String? override_course_description;
String? current_status;
String? location;
String? room;
bool? is_audio;
bool? is_oncampus;
String? distance_ed_materials;
DateTime? start_date;
DateTime? end_date;
DateTime? first_meeting_date;
DateTime? last_meeting_date;
String? start_times;
String? end_times;
String? meeting_days;
bool? is_pass_fail;
bool? is_waitlist;
bool? has_special_requirements;
String? special_requirements;
bool? is_unlisted;
int? capacity;
double? flat_fee_amount;
double? additional_fee_amount;
DateTime? override_registration_start_date;
DateTime? override_registration_end_date;
DateTime? override_add_start_date;
DateTime? override_add_end_date;
DateTime? override_drop_start_date;
DateTime? override_drop_end_date;
DateTime? override_grading_end_date;
String? term;
String? reporting_term;
String? authorizing_uuid;
SectionCreateRequest({this.course_id,this.course_name,this.min_credits,this.max_credits,this.credit_increments,this.min_audits,this.max_audits,this.audit_increments,this.section_code,this.title,this.pretty_title,this.override_course_description,this.current_status,this.location,this.room,this.is_audio,this.is_oncampus,this.distance_ed_materials,this.start_date,this.end_date,this.first_meeting_date,this.last_meeting_date,this.start_times,this.end_times,this.meeting_days,this.is_pass_fail,this.is_waitlist,this.has_special_requirements,this.special_requirements,this.is_unlisted,this.capacity,this.flat_fee_amount,this.additional_fee_amount,this.override_registration_start_date,this.override_registration_end_date,this.override_add_start_date,this.override_add_end_date,this.override_drop_start_date,this.override_drop_end_date,this.override_grading_end_date,this.term,this.reporting_term,this.authorizing_uuid});
SectionCreateRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
course_id = json['course_id'];
course_name = json['course_name'];
min_credits = JsonConverters.toDouble(json['min_credits']);
max_credits = JsonConverters.toDouble(json['max_credits']);
credit_increments = JsonConverters.toDouble(json['credit_increments']);
min_audits = JsonConverters.toDouble(json['min_audits']);
max_audits = JsonConverters.toDouble(json['max_audits']);
audit_increments = JsonConverters.toDouble(json['audit_increments']);
section_code = json['section_code'];
title = json['title'];
pretty_title = json['pretty_title'];
override_course_description = json['override_course_description'];
current_status = json['current_status'];
location = json['location'];
room = json['room'];
is_audio = json['is_audio'];
is_oncampus = json['is_oncampus'];
distance_ed_materials = json['distance_ed_materials'];
start_date = JsonConverters.fromJson(json['start_date'],'DateTime',context!);
end_date = JsonConverters.fromJson(json['end_date'],'DateTime',context!);
first_meeting_date = JsonConverters.fromJson(json['first_meeting_date'],'DateTime',context!);
last_meeting_date = JsonConverters.fromJson(json['last_meeting_date'],'DateTime',context!);
start_times = json['start_times'];
end_times = json['end_times'];
meeting_days = json['meeting_days'];
is_pass_fail = json['is_pass_fail'];
is_waitlist = json['is_waitlist'];
has_special_requirements = json['has_special_requirements'];
special_requirements = json['special_requirements'];
is_unlisted = json['is_unlisted'];
capacity = json['capacity'];
flat_fee_amount = JsonConverters.toDouble(json['flat_fee_amount']);
additional_fee_amount = JsonConverters.toDouble(json['additional_fee_amount']);
override_registration_start_date = JsonConverters.fromJson(json['override_registration_start_date'],'DateTime',context!);
override_registration_end_date = JsonConverters.fromJson(json['override_registration_end_date'],'DateTime',context!);
override_add_start_date = JsonConverters.fromJson(json['override_add_start_date'],'DateTime',context!);
override_add_end_date = JsonConverters.fromJson(json['override_add_end_date'],'DateTime',context!);
override_drop_start_date = JsonConverters.fromJson(json['override_drop_start_date'],'DateTime',context!);
override_drop_end_date = JsonConverters.fromJson(json['override_drop_end_date'],'DateTime',context!);
override_grading_end_date = JsonConverters.fromJson(json['override_grading_end_date'],'DateTime',context!);
term = json['term'];
reporting_term = json['reporting_term'];
authorizing_uuid = json['authorizing_uuid'];
return this;
}
Map<String, dynamic> toJson() => {
'course_id': course_id,
'course_name': course_name,
'min_credits': min_credits,
'max_credits': max_credits,
'credit_increments': credit_increments,
'min_audits': min_audits,
'max_audits': max_audits,
'audit_increments': audit_increments,
'section_code': section_code,
'title': title,
'pretty_title': pretty_title,
'override_course_description': override_course_description,
'current_status': current_status,
'location': location,
'room': room,
'is_audio': is_audio,
'is_oncampus': is_oncampus,
'distance_ed_materials': distance_ed_materials,
'start_date': JsonConverters.toJson(start_date,'DateTime',context!),
'end_date': JsonConverters.toJson(end_date,'DateTime',context!),
'first_meeting_date': JsonConverters.toJson(first_meeting_date,'DateTime',context!),
'last_meeting_date': JsonConverters.toJson(last_meeting_date,'DateTime',context!),
'start_times': start_times,
'end_times': end_times,
'meeting_days': meeting_days,
'is_pass_fail': is_pass_fail,
'is_waitlist': is_waitlist,
'has_special_requirements': has_special_requirements,
'special_requirements': special_requirements,
'is_unlisted': is_unlisted,
'capacity': capacity,
'flat_fee_amount': flat_fee_amount,
'additional_fee_amount': additional_fee_amount,
'override_registration_start_date': JsonConverters.toJson(override_registration_start_date,'DateTime',context!),
'override_registration_end_date': JsonConverters.toJson(override_registration_end_date,'DateTime',context!),
'override_add_start_date': JsonConverters.toJson(override_add_start_date,'DateTime',context!),
'override_add_end_date': JsonConverters.toJson(override_add_end_date,'DateTime',context!),
'override_drop_start_date': JsonConverters.toJson(override_drop_start_date,'DateTime',context!),
'override_drop_end_date': JsonConverters.toJson(override_drop_end_date,'DateTime',context!),
'override_grading_end_date': JsonConverters.toJson(override_grading_end_date,'DateTime',context!),
'term': term,
'reporting_term': reporting_term,
'authorizing_uuid': authorizing_uuid
};
getTypeName() => "SectionCreateRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'data.regent_college.edu', types: <String, TypeInfo> {
'InstructorResponse': TypeInfo(TypeOf.Class, create:() => InstructorResponse()),
'DocumentResponse': TypeInfo(TypeOf.Class, create:() => DocumentResponse()),
'SectionResponse': TypeInfo(TypeOf.Class, create:() => SectionResponse()),
'List<InstructorResponse>': TypeInfo(TypeOf.Class, create:() => <InstructorResponse>[]),
'List<DocumentResponse>': TypeInfo(TypeOf.Class, create:() => <DocumentResponse>[]),
'SectionCreateRequest': TypeInfo(TypeOf.Class, create:() => SectionCreateRequest()),
});
Dart SectionCreateRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /Sections/Admin/{reporting_term}/Create HTTP/1.1
Host: data.regent-college.edu
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
course_id: 0,
course_name: String,
min_credits: 0,
max_credits: 0,
credit_increments: 0,
min_audits: 0,
max_audits: 0,
audit_increments: 0,
section_code: String,
title: String,
pretty_title: String,
override_course_description: String,
current_status: String,
location: String,
room: String,
is_audio: False,
is_oncampus: False,
distance_ed_materials: String,
start_date: 0001-01-01,
end_date: 0001-01-01,
first_meeting_date: 0001-01-01,
last_meeting_date: 0001-01-01,
start_times: String,
end_times: String,
meeting_days: String,
is_pass_fail: False,
is_waitlist: False,
has_special_requirements: False,
special_requirements: String,
is_unlisted: False,
capacity: 0,
flat_fee_amount: 0,
additional_fee_amount: 0,
override_registration_start_date: 0001-01-01,
override_registration_end_date: 0001-01-01,
override_add_start_date: 0001-01-01,
override_add_end_date: 0001-01-01,
override_drop_start_date: 0001-01-01,
override_drop_end_date: 0001-01-01,
override_grading_end_date: 0001-01-01,
term: String,
reporting_term: String,
authorizing_uuid: String
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { responseStatus: { errorCode: String, message: String, stackTrace: String, errors: [ { errorCode: String, fieldName: String, message: String, meta: { String: String } } ], meta: { String: String } }, secUUID: String, course_name: String, section_code: String, course_title: String, course_short_title: String, course_description: String, crosslist_description: String, crosslist_course_name: String, location_long_name: String, room: String, instructors: [ { responseStatus: { errorCode: String, message: String, stackTrace: String, errors: [ { errorCode: String, fieldName: String, message: String, meta: { String: String } } ], meta: { String: String } }, regent_id: 0, regent_login: String, preferred_name: String, first_name: String, last_name: String, full_name: String, email: String, image_base64: String } ], required_documents: [ { code: String, document_name: String, document_description: String } ], start_date: 0001-01-01, end_date: 0001-01-01, first_meeting_date: 0001-01-01, last_meeting_date: 0001-01-01, meeting_days: String, start_times: [ String ], end_times: [ String ], is_online_only: False, is_weekend: False, is_weekday: False, is_evening: False, is_waitlist: False, has_special_requirements: False, special_requirements: String, is_unlisted: False, credit_amounts: [ 0 ], audit_amounts: [ 0 ], audits_short_name: String, audits_long_name: String, credits_short_name: String, credits_long_name: String, distance_ed_materials: String, prerequisites: String, corequisites: String, capacity: 0, flat_fee_amount: 0, additional_fee_amount: 0, registered_students: 0, three_credit_plus: 0, two_credit: 0, one_credit: 0, three_audit_plus: 0, two_audit: 0, one_audit: 0, crosslist_registered_students: 0, grades_received: 0, crosslist_grades_received: 0, registration_start_date: 0001-01-01, registration_end_date: 0001-01-01, add_start_date: 0001-01-01, add_end_date: 0001-01-01, drop_start_date: 0001-01-01, drop_end_date: 0001-01-01, grading_end_date: 0001-01-01, term: String, reporting_term: String, reporting_year: 0, current_status: String, added_by: String, added_date: 0001-01-01, changed_by: String, changed_date: 0001-01-01, timestamp: 0001-01-01 }