parameterToString function

String parameterToString(
  1. dynamic value
)

Format the given parameter object into a String.

Implementation

String parameterToString(dynamic value) {
  if (value == null) {
    return '';
  }
  if (value is DateTime) {
    return value.toUtc().toIso8601String();
  }
  if (value is APIStatus) {
    return APIStatusTypeTransformer().encode(value).toString();
  }
  if (value is AggregateTimeBucket) {
    return AggregateTimeBucketTypeTransformer().encode(value).toString();
  }
  if (value is AggregationOpType) {
    return AggregationOpTypeTypeTransformer().encode(value).toString();
  }
  if (value is BannedUserMatchType) {
    return BannedUserMatchTypeTypeTransformer().encode(value).toString();
  }
  if (value is CommentHTMLRenderingMode) {
    return CommentHTMLRenderingModeTypeTransformer().encode(value).toString();
  }
  if (value is CommentLogType) {
    return CommentLogTypeTypeTransformer().encode(value).toString();
  }
  if (value is CommentQuestionResultsRenderingType) {
    return CommentQuestionResultsRenderingTypeTypeTransformer().encode(value).toString();
  }
  if (value is CommentQuestionsRequired) {
    return CommentQuestionsRequiredTypeTransformer().encode(value).toString();
  }
  if (value is CommentThreadDeletionMode) {
    return CommentThreadDeletionModeTypeTransformer().encode(value).toString();
  }
  if (value is CommenterNameFormats) {
    return CommenterNameFormatsTypeTransformer().encode(value).toString();
  }
  if (value is DeleteCommentAction) {
    return DeleteCommentActionTypeTransformer().encode(value).toString();
  }
  if (value is DigestEmailFrequency) {
    return DigestEmailFrequencyTypeTransformer().encode(value).toString();
  }
  if (value is GifRating) {
    return GifRatingTypeTransformer().encode(value).toString();
  }
  if (value is ImageContentProfanityLevel) {
    return ImageContentProfanityLevelTypeTransformer().encode(value).toString();
  }
  if (value is ImportedAgentApprovalNotificationFrequency) {
    return ImportedAgentApprovalNotificationFrequencyTypeTransformer().encode(value).toString();
  }
  if (value is ImportedSiteType) {
    return ImportedSiteTypeTypeTransformer().encode(value).toString();
  }
  if (value is LiveEventType) {
    return LiveEventTypeTypeTransformer().encode(value).toString();
  }
  if (value is MentionAutoCompleteMode) {
    return MentionAutoCompleteModeTypeTransformer().encode(value).toString();
  }
  if (value is NotificationObjectType) {
    return NotificationObjectTypeTypeTransformer().encode(value).toString();
  }
  if (value is NotificationType) {
    return NotificationTypeTypeTransformer().encode(value).toString();
  }
  if (value is PagesSortBy) {
    return PagesSortByTypeTransformer().encode(value).toString();
  }
  if (value is QuestionRenderingType) {
    return QuestionRenderingTypeTypeTransformer().encode(value).toString();
  }
  if (value is QuestionSubQuestionVisibility) {
    return QuestionSubQuestionVisibilityTypeTransformer().encode(value).toString();
  }
  if (value is QuestionWhenSave) {
    return QuestionWhenSaveTypeTransformer().encode(value).toString();
  }
  if (value is RepeatCommentCheckIgnoredReason) {
    return RepeatCommentCheckIgnoredReasonTypeTransformer().encode(value).toString();
  }
  if (value is RepeatCommentHandlingAction) {
    return RepeatCommentHandlingActionTypeTransformer().encode(value).toString();
  }
  if (value is SORTDIR) {
    return SORTDIRTypeTransformer().encode(value).toString();
  }
  if (value is SSOSecurityLevel) {
    return SSOSecurityLevelTypeTransformer().encode(value).toString();
  }
  if (value is SizePreset) {
    return SizePresetTypeTransformer().encode(value).toString();
  }
  if (value is SortDirections) {
    return SortDirectionsTypeTransformer().encode(value).toString();
  }
  if (value is UserSearchSection) {
    return UserSearchSectionTypeTransformer().encode(value).toString();
  }
  if (value is UsersListLocation) {
    return UsersListLocationTypeTransformer().encode(value).toString();
  }
  if (value is VoteStyle) {
    return VoteStyleTypeTransformer().encode(value).toString();
  }
  return value.toString();
}