createTenant method

Future<ClientResponse<TenantResponse, Errors>> createTenant(
  1. String tenantId,
  2. TenantRequest request
)

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

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

Implementation

Future<ClientResponse<TenantResponse, Errors>> createTenant(
    String tenantId, TenantRequest request) {
  return _start<TenantResponse, Errors>()
      .withUri('/api/tenant')
      .withUriSegment(tenantId)
      .withJSONBody(request)
      .withMethod('POST')
      .withResponseHandler(
          defaultResponseHandlerBuilder((d) => TenantResponse.fromJson(d)))
      .go();
}