"""
Social Media Replies
Get replies to social media posts, comments, or other replies.
"""
name = "social-media/replies"
version = "1.0.1"

"""
Get Post Replies
Get replies (comments) on a social media post, comment, or a reply.
"""
usecase GetPostReplies safe {
  input {
    """
    Parent ID
    Identifier of the parent post to get replies for.
    """
    parentId! string!
    """
    Page
    Pagination cursor (obtained from `previousPage` or `nextPage`).
    """
    page string
  }

  result {
    """
    Previous page
    Previous page cursor.
    """
    previousPage string
    """
    Next page
    Next page cursor.
    """
    nextPage string
    """
    Replies
    List of replies under the post.
    """
    replies [Reply]
  }
  
  error {
    """
    Title
    A short, human-readable summary of the problem type.
    """
    title!

    """
    A human-readable explanation specific to this occurrence of the problem.
    """
    detail
  }

  example success {
      input {
          parentId = "be7cdc05-4264-4d47-bc1f-af704d6abf32"
      }

      result {
          replies = [
            {
                id = "123"
                createdAt = "2022-06-09T13:29:11+02:00"
                authorId = "@alberteinstein"
                authorName = "Albert Einstein"
                text = "Hello, World!"
            },
            {
                id = "124"
                createdAt = "2022-06-09T16:29:11+02:00"
                authorId = "@newton"
                authorName = "Isaac Newton"
                lastModifiedAt = "2022-06-09T16:32:42+02:00"
                text = "(deleted.)"
            }
        ]
      }
  }
}

model Reply {
    """
    ID
    Identifier of the reply.
    """
    id! string!

    """
    Created at
    Timestamp of the reply creation in ISO 8601 format.
    """
    createdAt string

    """
    Author ID
    Identificator of the author.
    """
    authorId string

    """
    Author name
    Human-friendly name of the author.
    """
    authorName string

    """
    Last modified
    Timestamp of the last known reply modification in ISO 8601 format.
    """
    lastModifiedAt string

    """
    Text
    Textual content of the reply.
    """
    text string
}