regis

<back to all web services

SectionDocumentsRequest

Requires Authentication
Required role:REGISUserRole
The following routes are available for this service:
POST/Sections/{uuid}/Documents
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

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 SectionDocumentsResponse implements IConvertible
{
    String? uuid;
    String? course_name;
    String? title;
    String? term;
    String? reporting_term;
    List<DocumentResponse>? assigned_documents;
    List<DocumentResponse>? available_documents;

    SectionDocumentsResponse({this.uuid,this.course_name,this.title,this.term,this.reporting_term,this.assigned_documents,this.available_documents});
    SectionDocumentsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        uuid = json['uuid'];
        course_name = json['course_name'];
        title = json['title'];
        term = json['term'];
        reporting_term = json['reporting_term'];
        assigned_documents = JsonConverters.fromJson(json['assigned_documents'],'List<DocumentResponse>',context!);
        available_documents = JsonConverters.fromJson(json['available_documents'],'List<DocumentResponse>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'uuid': uuid,
        'course_name': course_name,
        'title': title,
        'term': term,
        'reporting_term': reporting_term,
        'assigned_documents': JsonConverters.toJson(assigned_documents,'List<DocumentResponse>',context!),
        'available_documents': JsonConverters.toJson(available_documents,'List<DocumentResponse>',context!)
    };

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

class SectionDocumentsRequest implements IConvertible
{
    String? uuid;

    SectionDocumentsRequest({this.uuid});
    SectionDocumentsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'uuid': uuid
    };

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

TypeContext _ctx = TypeContext(library: 'data.regent_college.edu', types: <String, TypeInfo> {
    'DocumentResponse': TypeInfo(TypeOf.Class, create:() => DocumentResponse()),
    'SectionDocumentsResponse': TypeInfo(TypeOf.Class, create:() => SectionDocumentsResponse()),
    'List<DocumentResponse>': TypeInfo(TypeOf.Class, create:() => <DocumentResponse>[]),
    'SectionDocumentsRequest': TypeInfo(TypeOf.Class, create:() => SectionDocumentsRequest()),
});

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

POST /Sections/{uuid}/Documents HTTP/1.1 
Host: data.regent-college.edu 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"uuid":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"uuid":"String","course_name":"String","title":"String","term":"String","reporting_term":"String","assigned_documents":[{"code":"String","document_name":"String","document_description":"String"}],"available_documents":[{"code":"String","document_name":"String","document_description":"String"}]}