createScanlationGroupResponse method

Future<Response> createScanlationGroupResponse(
  1. String name,
  2. String website,
  3. String ircServer,
  4. String ircChannel,
  5. String discord,
  6. String contactEmail,
  7. String description,
  8. String twitter,
  9. String mangaUpdates,
  10. bool inactive,
  11. String publishDelay,
  12. String sessionToken,
)
inherited

Endpoint used: POST /group

Creates a Scanlation Group managed by the user identified by it's sessionToken or UUID and returns an http response containing the group's information after being created.

Implementation

Future<http.Response> createScanlationGroupResponse(
  String name,
  String website,
  String ircServer,
  String ircChannel,
  String discord,
  String contactEmail,
  String description,
  String twitter,
  String mangaUpdates,
  bool inactive,
  String publishDelay,
  String sessionToken,
) {
  var unencodedPath = '/group';
  var uri = 'https://$AUTHORITY$unencodedPath';
  return http.post(Uri.parse(uri), headers: {
    'name': name,
    'website': website,
    'ircServer': ircServer,
    'ircChannel': ircChannel,
    'discord': discord,
    'contactEmail': contactEmail,
    'description': description,
    'twitter': twitter,
    'mangaUpdates': mangaUpdates,
    'inactive': inactive.toString(),
    'publishDelay': publishDelay,
    HttpHeaders.contentTypeHeader: 'application/json',
    HttpHeaders.authorizationHeader: 'Bearer $sessionToken'
  });
}