createEntityType method

Future<ClientResponse<EntityTypeResponse, Errors>> createEntityType(
  1. String entityTypeId,
  2. EntityTypeRequest request
)

Creates a Entity Type. You can optionally specify an Id for the Entity Type, if not provided one will be generated.

@param {String} entityTypeId (Optional) The Id for the Entity Type. If not provided a secure random UUID will be generated. @param {EntityTypeRequest} request The request object that contains all the information used to create the Entity Type. @returns {Promise<ClientResponse

Implementation

Future<ClientResponse<EntityTypeResponse, Errors>> createEntityType(
    String entityTypeId, EntityTypeRequest request) {
  return _start<EntityTypeResponse, Errors>()
      .withUri('/api/entity/type')
      .withUriSegment(entityTypeId)
      .withJSONBody(request)
      .withMethod('POST')
      .withResponseHandler(defaultResponseHandlerBuilder(
          (d) => EntityTypeResponse.fromJson(d)))
      .go();
}