/// <summary>Try and get the API enumeration type by CLR type.</summary>
        /// <typeparam name="TEnumeration">CLR type to lookup the API enumeration type by.</typeparam>
        /// <param name="apiEnumerationType">The API enumeration type if it exists in the API schema, null otherwise.</param>
        /// <returns>True if API enumeration type exists in the API schema, false otherwise.</returns>
        public static bool TryGetApiEnumerationType <TEnumeration>(this IApiSchema apiSchema, out IApiEnumerationType apiEnumerationType)
        {
            Contract.Requires(apiSchema != null);

            var clrType = typeof(TEnumeration);

            return(apiSchema.TryGetApiEnumerationType(clrType, out apiEnumerationType));
        }
        /// <summary>Get the API enumeration type by API type name.</summary>
        /// <param name="apiName">API type name to lookup the API enumeration type by.</param>
        /// <returns>The API enumeration type in the API schema, otherwise an exception is thrown.</returns>
        /// <exception cref="ApiSchemaException"></exception>
        public static IApiEnumerationType GetApiEnumerationType(this IApiSchema apiSchema, string apiName)
        {
            Contract.Requires(apiSchema != null);
            Contract.Requires(apiName.SafeHasContent());

            if (apiSchema.TryGetApiEnumerationType(apiName, out var apiEnumerationType))
            {
                return(apiEnumerationType);
            }

            // Unable to get API enumeration type by the given API name.
            var message = $"Unable to get API enumeration type [apiName={apiName}] in the API schema, API enumeration type was not configured.";

            throw new ApiSchemaException(message);
        }
        /// <summary>Get the API enumeration type by CLR type object.</summary>
        /// <param name="clrType">CLR type object to lookup the API enumeration type by.</param>
        /// <returns>The API enumeration type in the API schema, otherwise an exception is thrown.</returns>
        /// <exception cref="ApiSchemaException"></exception>
        public static IApiEnumerationType GetApiEnumerationType(this IApiSchema apiSchema, Type clrType)
        {
            Contract.Requires(apiSchema != null);
            Contract.Requires(clrType != null);

            if (apiSchema.TryGetApiEnumerationType(clrType, out var apiEnumerationType))
            {
                return(apiEnumerationType);
            }

            // Unable to get API enumeration type by the given CLR type.
            var message = $"Unable to get API enumeration type [clrType={clrType.Name}] in the API schema, API enumeration type was not configured.";

            throw new ApiSchemaException(message);
        }