cgetDocumentsByPlace method
Future<Response<DocumentPagination> >
cgetDocumentsByPlace({
- required String xKeyclicApp,
- required String place,
- String? acceptLanguage,
- DateTime? xDateTime,
- String? xKeyclicAppPlatform,
- String? xKeyclicAppVersion,
- List<
String> ? orderLeftSquareBracketRightSquareBracket, - DateTime? after,
- DateTime? before,
- String? organization,
- List<
String> ? organizationsLeftSquareBracketRightSquareBracket, - String? state,
- List<
String> ? statesLeftSquareBracketRightSquareBracket, - int? page,
- int? limit,
- CancelToken? cancelToken,
- Map<
String, dynamic> ? headers, - Map<
String, dynamic> ? extra, - ValidateStatus? validateStatus,
- ProgressCallback? onSendProgress,
- ProgressCallback? onReceiveProgress,
Retrieve all Document resources.
Parameters:
xKeyclicApp
place
- The identifier of the resource.acceptLanguage
xDateTime
xKeyclicAppPlatform
xKeyclicAppVersion
orderLeftSquareBracketRightSquareBracket
after
before
organization
organizationsLeftSquareBracketRightSquareBracket
state
statesLeftSquareBracketRightSquareBracket
page
- Page of the overview.limit
- Page of the overview.cancelToken
- ACancelToken
that can be used to cancel the operationheaders
- Can be used to add additional headers to the requestextras
- Can be used to add flags to the requestvalidateStatus
- AValidateStatus
callback that can be used to determine request success based on the HTTP status of the responseonSendProgress
- AProgressCallback
that can be used to get the send progressonReceiveProgress
- AProgressCallback
that can be used to get the receive progress
Returns a Future containing a Response
with a DocumentPagination as data
Throws DioError
if API call or serialization fails
Keyclic API documentation.
Also see Retrieve all Document resources. Documentation
Implementation
Future<Response<DocumentPagination>> cgetDocumentsByPlace({
required String xKeyclicApp,
required String place,
String? acceptLanguage,
DateTime? xDateTime,
String? xKeyclicAppPlatform,
String? xKeyclicAppVersion,
List<String>? orderLeftSquareBracketRightSquareBracket,
DateTime? after,
DateTime? before,
String? organization,
List<String>? organizationsLeftSquareBracketRightSquareBracket,
String? state,
List<String>? statesLeftSquareBracketRightSquareBracket,
int? page,
int? limit,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final String path = r'/places/{place}/documents'
.replaceAll('{' r'place' '}', place.toString());
final options = Options(
method: r'GET',
headers: <String, dynamic>{
// to string ??
if (acceptLanguage != null) r'accept-language': acceptLanguage,
if (xDateTime != null) r'x-date-time': xDateTime,
r'x-keyclic-app': xKeyclicApp,
if (xKeyclicAppPlatform != null)
r'x-keyclic-app-platform': xKeyclicAppPlatform,
if (xKeyclicAppVersion != null)
r'x-keyclic-app-version': xKeyclicAppVersion,
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'apiKey',
'name': 'bearer',
'keyName': 'Authorization',
'where': 'header',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final queryParameters = <String, dynamic>{
if (orderLeftSquareBracketRightSquareBracket != null)
r'order[]': encodeCollectionQueryParameter(
orderLeftSquareBracketRightSquareBracket,
format: ListFormat.multi),
if (after != null) r'after': encodeQueryParameter(after),
if (before != null) r'before': encodeQueryParameter(before),
if (organization != null)
r'organization': encodeQueryParameter(organization),
if (organizationsLeftSquareBracketRightSquareBracket != null)
r'organizations[]': encodeCollectionQueryParameter(
organizationsLeftSquareBracketRightSquareBracket,
format: ListFormat.multi),
if (state != null) r'state': encodeQueryParameter(state),
if (statesLeftSquareBracketRightSquareBracket != null)
r'states[]': encodeCollectionQueryParameter(
statesLeftSquareBracketRightSquareBracket,
format: ListFormat.multi),
if (page != null) r'page': encodeQueryParameter(page),
if (limit != null) r'limit': encodeQueryParameter(limit),
};
final response = await _apiClient.dio.request<Object>(
path,
options: options,
queryParameters: queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
DocumentPagination responseData;
try {
responseData = await _apiClient.deserializeAsync<DocumentPagination>(
response.data!, 'DocumentPagination');
} catch (error, stackTrace) {
throw DioError(
requestOptions: response.requestOptions,
response: response,
type: DioErrorType.other,
error: error,
)..stackTrace = stackTrace;
}
return Response<DocumentPagination>(
data: responseData,
headers: response.headers,
isRedirect: response.isRedirect,
requestOptions: response.requestOptions,
redirects: response.redirects,
statusCode: response.statusCode,
statusMessage: response.statusMessage,
extra: response.extra,
);
}