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 .xml suffix or ?format=xml

HTTP + XML

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: application/xml
Content-Type: application/xml
Content-Length: length

<SectionDocumentsRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/regis.ClassLibrary.Requests">
  <uuid>String</uuid>
</SectionDocumentsRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<SectionDocumentsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/regis.ClassLibrary.Responses">
  <assigned_documents>
    <DocumentResponse>
      <code>String</code>
      <document_description>String</document_description>
      <document_name>String</document_name>
    </DocumentResponse>
  </assigned_documents>
  <available_documents>
    <DocumentResponse>
      <code>String</code>
      <document_description>String</document_description>
      <document_name>String</document_name>
    </DocumentResponse>
  </available_documents>
  <course_name>String</course_name>
  <reporting_term>String</reporting_term>
  <term>String</term>
  <title>String</title>
  <uuid>String</uuid>
</SectionDocumentsResponse>