github4s.modules.GithubAPIsV3.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of github4s_2.12 Show documentation
Show all versions of github4s_2.12 Show documentation
Github API wrapper written in Scala
The newest version!
/*
* Copyright 2016-2024 47 Degrees Open Source
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package github4s.modules
import cats.effect.Concurrent
import github4s.GithubConfig
import github4s.algebras._
import github4s.http.HttpClient
import github4s.interpreters._
import org.http4s.client.Client
class GithubAPIsV3[F[_]: Concurrent](
client: Client[F],
config: GithubConfig,
accessHeader: AccessHeader[F]
) extends GithubAPIs[F] {
implicit val httpClient: HttpClient[F] = HttpClient[F](client, config, accessHeader)
override val users: Users[F] = new UsersInterpreter[F]
override val repos: Repositories[F] = new RepositoriesInterpreter[F]
override val auth: Auth[F] = new AuthInterpreter[F]
override val gists: Gists[F] = new GistsInterpreter[F]
override val issues: Issues[F] = new IssuesInterpreter[F]
override val activities: Activities[F] = new ActivitiesInterpreter[F]
override val gitData: GitData[F] = new GitDataInterpreter[F]
override val pullRequests: PullRequests[F] = new PullRequestsInterpreter[F]
override val organizations: Organizations[F] = new OrganizationsInterpreter[F]
override val teams: Teams[F] = new TeamsInterpreter[F]
override val projects: Projects[F] = new ProjectsInterpreter[F]
override val search: Search[F] = new SearchInterpreter[F]
}
object GithubAPIsV3 {
def noAuth[F[_]: Concurrent](client: Client[F], config: GithubConfig): GithubAPIsV3[F] =
new GithubAPIsV3[F](client, config, StaticAccessHeader.noHeader)
}