createLayout method

Future<CreateLayoutResponse> createLayout({
  1. required LayoutContent content,
  2. required String domainId,
  3. required String name,
})

Creates a layout in the Cases domain. Layouts define the following configuration in the top section and More Info tab of the Cases user interface:

  • Fields to display to the users
  • Field ordering

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter content : Information about which fields will be present in the layout, and information about the order of the fields.

Parameter domainId : The unique identifier of the Cases domain.

Parameter name : The name of the layout. It must be unique for the Cases domain.

Implementation

Future<CreateLayoutResponse> createLayout({
  required LayoutContent content,
  required String domainId,
  required String name,
}) async {
  final $payload = <String, dynamic>{
    'content': content,
    'name': name,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/domains/${Uri.encodeComponent(domainId)}/layouts',
    exceptionFnMap: _exceptionFns,
  );
  return CreateLayoutResponse.fromJson(response);
}