/** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.4.67 * User agent: apibuilder app.apibuilder.io/flow/github/0.4.67/http4s_0_20 */ package io.flow.github.v0.mock { class Client[F[_]: cats.Applicative] extends io.flow.github.v0.interfaces.Client[F] { val baseUrl: org.http4s.Uri = org.http4s.Uri.unsafeFromString("http://mock.localhost") override def blobs: io.flow.github.v0.Blobs[F] = new MockBlobs[F] override def commits: io.flow.github.v0.Commits[F] = new MockCommits[F] override def contents: io.flow.github.v0.Contents[F] = new MockContents[F] override def hooks: io.flow.github.v0.Hooks[F] = new MockHooks[F] override def pullRequests: io.flow.github.v0.PullRequests[F] = new MockPullRequests[F] override def refs: io.flow.github.v0.Refs[F] = new MockRefs[F] override def repositories: io.flow.github.v0.Repositories[F] = new MockRepositories[F] override def tags: io.flow.github.v0.Tags[F] = new MockTags[F] override def trees: io.flow.github.v0.Trees[F] = new MockTrees[F] override def users: io.flow.github.v0.Users[F] = new MockUsers[F] override def userEmails: io.flow.github.v0.UserEmails[F] = new MockUserEmails[F] } class MockBlobs[F[_]: cats.Applicative] extends io.flow.github.v0.Blobs[F] { def getBySha( owner: String, repo: String, sha: String, requestHeaders: Seq[(String, String)] = Nil ): F[io.flow.github.v0.models.Blob] = cats.Applicative[F].pure { io.flow.github.v0.mock.Factories.makeBlob() } def post( owner: String, repo: String, blobForm: io.flow.github.v0.models.BlobForm, requestHeaders: Seq[(String, String)] = Nil ): F[io.flow.github.v0.models.BlobCreated] = cats.Applicative[F].pure { io.flow.github.v0.mock.Factories.makeBlobCreated() } } class MockCommits[F[_]: cats.Applicative] extends io.flow.github.v0.Commits[F] { def getBySha( owner: String, repo: String, sha: String, requestHeaders: Seq[(String, String)] = Nil ): F[io.flow.github.v0.models.Commit] = cats.Applicative[F].pure { io.flow.github.v0.mock.Factories.makeCommit() } def post( owner: String, repo: String, commitForm: io.flow.github.v0.models.CommitForm, requestHeaders: Seq[(String, String)] = Nil ): F[io.flow.github.v0.models.CommitResponse] = cats.Applicative[F].pure { io.flow.github.v0.mock.Factories.makeCommitResponse() } } class MockContents[F[_]: cats.Applicative] extends io.flow.github.v0.Contents[F] { def getReadme( owner: String, repo: String, ref: String = "main", requestHeaders: Seq[(String, String)] = Nil ): F[io.flow.github.v0.models.Contents] = cats.Applicative[F].pure { io.flow.github.v0.mock.Factories.makeContents() } def getContentsByPath( owner: String, repo: String, path: String, ref: String = "main", requestHeaders: Seq[(String, String)] = Nil ): F[io.flow.github.v0.models.Contents] = cats.Applicative[F].pure { io.flow.github.v0.mock.Factories.makeContents() } } class MockHooks[F[_]: cats.Applicative] extends io.flow.github.v0.Hooks[F] { def get( owner: String, repo: String, requestHeaders: Seq[(String, String)] = Nil ): F[Seq[io.flow.github.v0.models.Hook]] = cats.Applicative[F].pure { Nil } def getById( owner: String, repo: String, id: Long, requestHeaders: Seq[(String, String)] = Nil ): F[io.flow.github.v0.models.Hook] = cats.Applicative[F].pure { io.flow.github.v0.mock.Factories.makeHook() } def post( owner: String, repo: String, hookForm: io.flow.github.v0.models.HookForm, requestHeaders: Seq[(String, String)] = Nil ): F[io.flow.github.v0.models.Hook] = cats.Applicative[F].pure { io.flow.github.v0.mock.Factories.makeHook() } def deleteById( owner: String, repo: String, id: Long, requestHeaders: Seq[(String, String)] = Nil ): F[Unit] = cats.Applicative[F].pure { // unit type } } class MockPullRequests[F[_]: cats.Applicative] extends io.flow.github.v0.PullRequests[F] { def post( owner: String, repo: String, pullRequestForm: io.flow.github.v0.models.PullRequestForm, requestHeaders: Seq[(String, String)] = Nil ): F[io.flow.github.v0.models.PullRequest] = cats.Applicative[F].pure { io.flow.github.v0.mock.Factories.makePullRequest() } def get( owner: String, repo: String, page: Long = 1L, requestHeaders: Seq[(String, String)] = Nil ): F[Seq[io.flow.github.v0.models.PullRequest]] = cats.Applicative[F].pure { Nil } } class MockRefs[F[_]: cats.Applicative] extends io.flow.github.v0.Refs[F] { def get( owner: String, repo: String, requestHeaders: Seq[(String, String)] = Nil ): F[Seq[io.flow.github.v0.models.Ref]] = cats.Applicative[F].pure { Nil } def getByRef( owner: String, repo: String, ref: String, requestHeaders: Seq[(String, String)] = Nil ): F[io.flow.github.v0.models.Ref] = cats.Applicative[F].pure { io.flow.github.v0.mock.Factories.makeRef() } def post( owner: String, repo: String, refForm: io.flow.github.v0.models.RefForm, requestHeaders: Seq[(String, String)] = Nil ): F[io.flow.github.v0.models.Ref] = cats.Applicative[F].pure { io.flow.github.v0.mock.Factories.makeRef() } def putByRef( owner: String, repo: String, ref: String, refUpdateForm: io.flow.github.v0.models.RefUpdateForm, requestHeaders: Seq[(String, String)] = Nil ): F[io.flow.github.v0.models.Ref] = cats.Applicative[F].pure { io.flow.github.v0.mock.Factories.makeRef() } } class MockRepositories[F[_]: cats.Applicative] extends io.flow.github.v0.Repositories[F] { def getUserAndRepos( page: Long = 1L, visibility: io.flow.github.v0.models.Visibility = io.flow.github.v0.models.Visibility.All, affiliation: _root_.scala.Option[String] = None, `type`: _root_.scala.Option[String] = None, sort: String = "full_name", direction: String = "asc", requestHeaders: Seq[(String, String)] = Nil ): F[Seq[io.flow.github.v0.models.Repository]] = cats.Applicative[F].pure { Nil } /** * List public repositories for the specified user. */ def getUsersAndReposByUsername( username: String, page: Long = 1L, `type`: String = "owner", sort: String = "full_name", direction: String = "asc", requestHeaders: Seq[(String, String)] = Nil ): F[Seq[io.flow.github.v0.models.Repository]] = cats.Applicative[F].pure { Nil } /** * List repositories for the specified org. */ def getOrgsAndReposByOrg( org: String, page: Long = 1L, `type`: String = "all", sort: String = "full_name", direction: String = "asc", requestHeaders: Seq[(String, String)] = Nil ): F[Seq[io.flow.github.v0.models.Repository]] = cats.Applicative[F].pure { Nil } } class MockTags[F[_]: cats.Applicative] extends io.flow.github.v0.Tags[F] { def getTags( owner: String, repo: String, page: Long = 1L, perPage: Long = 30L, requestHeaders: Seq[(String, String)] = Nil ): F[Seq[io.flow.github.v0.models.TagSummary]] = cats.Applicative[F].pure { Nil } def getTagsBySha( owner: String, repo: String, sha: String, requestHeaders: Seq[(String, String)] = Nil ): F[io.flow.github.v0.models.Tag] = cats.Applicative[F].pure { io.flow.github.v0.mock.Factories.makeTag() } def postGitAndTags( owner: String, repo: String, tagForm: io.flow.github.v0.models.TagForm, requestHeaders: Seq[(String, String)] = Nil ): F[io.flow.github.v0.models.Tag] = cats.Applicative[F].pure { io.flow.github.v0.mock.Factories.makeTag() } } class MockTrees[F[_]: cats.Applicative] extends io.flow.github.v0.Trees[F] { def post( owner: String, repo: String, createTreeForm: io.flow.github.v0.models.CreateTreeForm, requestHeaders: Seq[(String, String)] = Nil ): F[io.flow.github.v0.models.CreateTreeResponse] = cats.Applicative[F].pure { io.flow.github.v0.mock.Factories.makeCreateTreeResponse() } } class MockUsers[F[_]: cats.Applicative] extends io.flow.github.v0.Users[F] { def getUser( requestHeaders: Seq[(String, String)] = Nil ): F[io.flow.github.v0.models.User] = cats.Applicative[F].pure { io.flow.github.v0.mock.Factories.makeUser() } def getUserAndOrgs( page: Long = 1L, perPage: _root_.scala.Option[Long] = None, requestHeaders: Seq[(String, String)] = Nil ): F[Seq[io.flow.github.v0.models.UserOrg]] = cats.Applicative[F].pure { Nil } } class MockUserEmails[F[_]: cats.Applicative] extends io.flow.github.v0.UserEmails[F] { def get( requestHeaders: Seq[(String, String)] = Nil ): F[Seq[io.flow.github.v0.models.UserEmail]] = cats.Applicative[F].pure { Nil } } object Factories { def randomString(length: Int = 24): String = { _root_.scala.util.Random.alphanumeric.take(length).mkString } def makeContentsType(): io.flow.github.v0.models.ContentsType = io.flow.github.v0.models.ContentsType.File def makeEncoding(): io.flow.github.v0.models.Encoding = io.flow.github.v0.models.Encoding.Base64 def makeHookEvent(): io.flow.github.v0.models.HookEvent = io.flow.github.v0.models.HookEvent.Push def makeNodeType(): io.flow.github.v0.models.NodeType = io.flow.github.v0.models.NodeType.Blob def makeOwnerType(): io.flow.github.v0.models.OwnerType = io.flow.github.v0.models.OwnerType.User def makeVisibility(): io.flow.github.v0.models.Visibility = io.flow.github.v0.models.Visibility.All def makeBlob(): io.flow.github.v0.models.Blob = io.flow.github.v0.models.Blob( content = Factories.randomString(24), encoding = io.flow.github.v0.mock.Factories.makeEncoding(), url = Factories.randomString(24), sha = Factories.randomString(24), size = 1L ) def makeBlobCreated(): io.flow.github.v0.models.BlobCreated = io.flow.github.v0.models.BlobCreated( url = Factories.randomString(24), sha = Factories.randomString(24) ) def makeBlobForm(): io.flow.github.v0.models.BlobForm = io.flow.github.v0.models.BlobForm( content = Factories.randomString(24), encoding = io.flow.github.v0.mock.Factories.makeEncoding() ) def makeCommit(): io.flow.github.v0.models.Commit = io.flow.github.v0.models.Commit( sha = Factories.randomString(24), url = Factories.randomString(24), htmlUrl = Factories.randomString(24), author = io.flow.github.v0.mock.Factories.makePerson(), committer = io.flow.github.v0.mock.Factories.makePerson(), tree = io.flow.github.v0.mock.Factories.makeTreeSummary(), message = Factories.randomString(24), parents = Nil ) def makeCommitForm(): io.flow.github.v0.models.CommitForm = io.flow.github.v0.models.CommitForm( message = Factories.randomString(24), tree = Factories.randomString(24), parents = Nil, author = io.flow.github.v0.mock.Factories.makePerson(), committer = io.flow.github.v0.mock.Factories.makePerson() ) def makeCommitResponse(): io.flow.github.v0.models.CommitResponse = io.flow.github.v0.models.CommitResponse( sha = Factories.randomString(24), url = Factories.randomString(24), author = io.flow.github.v0.mock.Factories.makePerson(), committer = io.flow.github.v0.mock.Factories.makePerson(), message = Factories.randomString(24), tree = io.flow.github.v0.mock.Factories.makeTreeSummary(), parents = Nil ) def makeCommitSummary(): io.flow.github.v0.models.CommitSummary = io.flow.github.v0.models.CommitSummary( sha = Factories.randomString(24), url = Factories.randomString(24) ) def makeContents(): io.flow.github.v0.models.Contents = io.flow.github.v0.models.Contents( `type` = io.flow.github.v0.mock.Factories.makeContentsType(), encoding = io.flow.github.v0.mock.Factories.makeEncoding(), size = 1L, name = Factories.randomString(24), path = Factories.randomString(24), content = None, sha = Factories.randomString(24), url = Factories.randomString(24), gitUrl = Factories.randomString(24), htmlUrl = Factories.randomString(24), downloadUrl = Factories.randomString(24) ) def makeCreateTreeForm(): io.flow.github.v0.models.CreateTreeForm = io.flow.github.v0.models.CreateTreeForm( baseTree = Factories.randomString(24), tree = Nil ) def makeCreateTreeResponse(): io.flow.github.v0.models.CreateTreeResponse = io.flow.github.v0.models.CreateTreeResponse( sha = Factories.randomString(24), url = Factories.randomString(24), treeResult = io.flow.github.v0.mock.Factories.makeTree() ) def makeError(): io.flow.github.v0.models.Error = io.flow.github.v0.models.Error( resource = Factories.randomString(24), field = Factories.randomString(24), code = Factories.randomString(24) ) def makeGithubObject(): io.flow.github.v0.models.GithubObject = io.flow.github.v0.models.GithubObject( `type` = Factories.randomString(24), sha = Factories.randomString(24), url = Factories.randomString(24) ) def makeHook(): io.flow.github.v0.models.Hook = io.flow.github.v0.models.Hook( id = 1L, url = Factories.randomString(24), testUrl = Factories.randomString(24), pingUrl = Factories.randomString(24), name = Factories.randomString(24), events = Nil, active = true, config = io.flow.github.v0.mock.Factories.makeHookConfig(), updatedAt = _root_.java.time.Instant.now, createdAt = _root_.java.time.Instant.now ) def makeHookConfig(): io.flow.github.v0.models.HookConfig = io.flow.github.v0.models.HookConfig( url = None, contentType = None ) def makeHookForm(): io.flow.github.v0.models.HookForm = io.flow.github.v0.models.HookForm( name = Factories.randomString(24), config = io.flow.github.v0.mock.Factories.makeHookConfig(), events = Nil, active = true ) def makeNode(): io.flow.github.v0.models.Node = io.flow.github.v0.models.Node( path = Factories.randomString(24), mode = Factories.randomString(24), `type` = io.flow.github.v0.mock.Factories.makeNodeType(), size = 1L, sha = Factories.randomString(24), url = Factories.randomString(24) ) def makeNodeForm(): io.flow.github.v0.models.NodeForm = io.flow.github.v0.models.NodeForm( path = Factories.randomString(24), mode = Factories.randomString(24), `type` = io.flow.github.v0.mock.Factories.makeNodeType(), sha = Factories.randomString(24) ) def makePerson(): io.flow.github.v0.models.Person = io.flow.github.v0.models.Person( name = Factories.randomString(24), email = Factories.randomString(24), date = _root_.java.time.Instant.now ) def makePullRequest(): io.flow.github.v0.models.PullRequest = io.flow.github.v0.models.PullRequest( id = 1L, url = Factories.randomString(24), number = 1L, htmlUrl = Factories.randomString(24), head = io.flow.github.v0.mock.Factories.makePullRequestHead() ) def makePullRequestForm(): io.flow.github.v0.models.PullRequestForm = io.flow.github.v0.models.PullRequestForm( title = Factories.randomString(24), head = Factories.randomString(24), base = Factories.randomString(24), body = None ) def makePullRequestHead(): io.flow.github.v0.models.PullRequestHead = io.flow.github.v0.models.PullRequestHead( ref = Factories.randomString(24) ) def makeRef(): io.flow.github.v0.models.Ref = io.flow.github.v0.models.Ref( ref = Factories.randomString(24), url = Factories.randomString(24), `object` = io.flow.github.v0.mock.Factories.makeGithubObject() ) def makeRefForm(): io.flow.github.v0.models.RefForm = io.flow.github.v0.models.RefForm( ref = Factories.randomString(24), sha = Factories.randomString(24) ) def makeRefUpdateForm(): io.flow.github.v0.models.RefUpdateForm = io.flow.github.v0.models.RefUpdateForm( sha = Factories.randomString(24) ) def makeRepository(): io.flow.github.v0.models.Repository = io.flow.github.v0.models.Repository( id = 1L, owner = io.flow.github.v0.mock.Factories.makeUser(), name = Factories.randomString(24), fullName = Factories.randomString(24), `private` = true, description = None, url = Factories.randomString(24), htmlUrl = Factories.randomString(24), defaultBranch = Factories.randomString(24) ) def makeTag(): io.flow.github.v0.models.Tag = io.flow.github.v0.models.Tag( tag = Factories.randomString(24), sha = Factories.randomString(24), url = Factories.randomString(24), message = Factories.randomString(24), tagger = io.flow.github.v0.mock.Factories.makeTagger(), `object` = io.flow.github.v0.mock.Factories.makeGithubObject() ) def makeTagForm(): io.flow.github.v0.models.TagForm = io.flow.github.v0.models.TagForm( tag = Factories.randomString(24), message = Factories.randomString(24), `object` = Factories.randomString(24), `type` = Factories.randomString(24), tagger = io.flow.github.v0.mock.Factories.makeTagger() ) def makeTagSummary(): io.flow.github.v0.models.TagSummary = io.flow.github.v0.models.TagSummary( name = Factories.randomString(24), commit = io.flow.github.v0.mock.Factories.makeCommitSummary() ) def makeTagger(): io.flow.github.v0.models.Tagger = io.flow.github.v0.models.Tagger( name = Factories.randomString(24), email = Factories.randomString(24), date = _root_.java.time.Instant.now ) def makeTree(): io.flow.github.v0.models.Tree = io.flow.github.v0.models.Tree( sha = Factories.randomString(24), url = Factories.randomString(24), truncated = true, tree = Nil ) def makeTreeForm(): io.flow.github.v0.models.TreeForm = io.flow.github.v0.models.TreeForm( path = Factories.randomString(24), mode = Factories.randomString(24), `type` = io.flow.github.v0.mock.Factories.makeNodeType(), sha = None, content = None ) def makeTreeResult(): io.flow.github.v0.models.TreeResult = io.flow.github.v0.models.TreeResult( path = Factories.randomString(24), mode = Factories.randomString(24), `type` = io.flow.github.v0.mock.Factories.makeNodeType(), size = 1L, sha = Factories.randomString(24), url = Factories.randomString(24) ) def makeTreeSummary(): io.flow.github.v0.models.TreeSummary = io.flow.github.v0.models.TreeSummary( url = Factories.randomString(24), sha = Factories.randomString(24) ) def makeUnprocessableEntity(): io.flow.github.v0.models.UnprocessableEntity = io.flow.github.v0.models.UnprocessableEntity( message = Factories.randomString(24), errors = None ) def makeUser(): io.flow.github.v0.models.User = io.flow.github.v0.models.User( id = 1L, login = Factories.randomString(24), name = None, email = None, avatarUrl = None, gravatarId = None, url = Factories.randomString(24), htmlUrl = Factories.randomString(24), `type` = io.flow.github.v0.mock.Factories.makeOwnerType() ) def makeUserEmail(): io.flow.github.v0.models.UserEmail = io.flow.github.v0.models.UserEmail( email = Factories.randomString(24), verified = true, primary = true ) def makeUserOrg(): io.flow.github.v0.models.UserOrg = io.flow.github.v0.models.UserOrg( login = Factories.randomString(24) ) } }