DigiOffice Gateway Web Services

<back to all web services

GetUsersAndGroups

Requires Authentication
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

abstract class UserOrGroup
{
    int? ID;
    String? Title;
    bool? IsChecked;
    String? Image;

    UserOrGroup({this.ID,this.Title,this.IsChecked,this.Image});
    UserOrGroup.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ID = json['ID'];
        Title = json['Title'];
        IsChecked = json['IsChecked'];
        Image = json['Image'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ID': ID,
        'Title': Title,
        'IsChecked': IsChecked,
        'Image': Image
    };

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

class QuickAddOption implements IConvertible
{
    String? Name;
    String? EntityType;

    QuickAddOption({this.Name,this.EntityType});
    QuickAddOption.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class UsersOrGroupsResponse implements IBaseQuickLookupResponse, IConvertible
{
    int? NumberOfAllRecords;
    List<UserOrGroup>? UsersOrGroups;
    List<QuickAddOption>? QuickAddOptions;

    UsersOrGroupsResponse({this.NumberOfAllRecords,this.UsersOrGroups,this.QuickAddOptions});
    UsersOrGroupsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        NumberOfAllRecords = json['NumberOfAllRecords'];
        UsersOrGroups = JsonConverters.fromJson(json['UsersOrGroups'],'List<UserOrGroup>',context!);
        QuickAddOptions = JsonConverters.fromJson(json['QuickAddOptions'],'List<QuickAddOption>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'NumberOfAllRecords': NumberOfAllRecords,
        'UsersOrGroups': JsonConverters.toJson(UsersOrGroups,'List<UserOrGroup>',context!),
        'QuickAddOptions': JsonConverters.toJson(QuickAddOptions,'List<QuickAddOption>',context!)
    };

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

class GetUsersAndGroups implements IConvertible
{
    int? UserEnvironment;
    int? PageSize;
    int? PageNumber;
    String? SearchCriteria;
    List<int>? SelectedUserIDs;
    List<int>? SelectedGroupIDs;

    GetUsersAndGroups({this.UserEnvironment,this.PageSize,this.PageNumber,this.SearchCriteria,this.SelectedUserIDs,this.SelectedGroupIDs});
    GetUsersAndGroups.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        UserEnvironment = json['UserEnvironment'];
        PageSize = json['PageSize'];
        PageNumber = json['PageNumber'];
        SearchCriteria = json['SearchCriteria'];
        SelectedUserIDs = JsonConverters.fromJson(json['SelectedUserIDs'],'List<int>',context!);
        SelectedGroupIDs = JsonConverters.fromJson(json['SelectedGroupIDs'],'List<int>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'UserEnvironment': UserEnvironment,
        'PageSize': PageSize,
        'PageNumber': PageNumber,
        'SearchCriteria': SearchCriteria,
        'SelectedUserIDs': JsonConverters.toJson(SelectedUserIDs,'List<int>',context!),
        'SelectedGroupIDs': JsonConverters.toJson(SelectedGroupIDs,'List<int>',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'digiofficeapigateway.deltares.nl', types: <String, TypeInfo> {
    'UserOrGroup': TypeInfo(TypeOf.AbstractClass),
    'QuickAddOption': TypeInfo(TypeOf.Class, create:() => QuickAddOption()),
    'UsersOrGroupsResponse': TypeInfo(TypeOf.Class, create:() => UsersOrGroupsResponse()),
    'List<UserOrGroup>': TypeInfo(TypeOf.Class, create:() => <UserOrGroup>[]),
    'List<QuickAddOption>': TypeInfo(TypeOf.Class, create:() => <QuickAddOption>[]),
    'GetUsersAndGroups': TypeInfo(TypeOf.Class, create:() => GetUsersAndGroups()),
});

Dart GetUsersAndGroups 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 /xml/reply/GetUsersAndGroups HTTP/1.1 
Host: digiofficeapigateway.deltares.nl 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<GetUsersAndGroups xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.UserInformation.Operations">
  <PageNumber>0</PageNumber>
  <PageSize>0</PageSize>
  <SearchCriteria>String</SearchCriteria>
  <SelectedGroupIDs xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:int>0</d2p1:int>
  </SelectedGroupIDs>
  <SelectedUserIDs xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:int>0</d2p1:int>
  </SelectedUserIDs>
  <UserEnvironment>0</UserEnvironment>
</GetUsersAndGroups>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<UsersOrGroupsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.UserInformation">
  <NumberOfAllRecords>0</NumberOfAllRecords>
  <QuickAddOptions xmlns:d2p1="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Controls.QuickLookup">
    <d2p1:QuickAddOption>
      <d2p1:EntityType>String</d2p1:EntityType>
      <d2p1:Name>String</d2p1:Name>
    </d2p1:QuickAddOption>
  </QuickAddOptions>
  <UsersOrGroups xmlns:d2p1="http://schemas.datacontract.org/2004/07/IDB.API.DTO">
    <d2p1:UserOrGroup i:nil="true" />
  </UsersOrGroups>
</UsersOrGroupsResponse>