Skip to content

Commit 40f1735

Browse files
Rename PullRequestPayload into CreatePullRequestPayload
1 parent 73aaa85 commit 40f1735

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

modules/core/src/main/scala/org/scalasteward/core/forge/github/PullRequestPayload.scala renamed to modules/core/src/main/scala/org/scalasteward/core/forge/github/CreatePullRequestPayload.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ import io.circe.generic.semiauto.deriveEncoder
2121
import org.scalasteward.core.forge.data.NewPullRequestData
2222
import org.scalasteward.core.git.Branch
2323

24-
final case class PullRequestPayload(
24+
final case class CreatePullRequestPayload(
2525
title: String,
2626
body: String,
2727
head: String,
2828
base: Branch,
2929
draft: Boolean
3030
)
31-
object PullRequestPayload {
32-
implicit val encoder: Encoder[PullRequestPayload] = deriveEncoder
31+
object CreatePullRequestPayload {
32+
implicit val encoder: Encoder[CreatePullRequestPayload] = deriveEncoder
3333

34-
def from(newPullRequestData: NewPullRequestData): PullRequestPayload =
35-
PullRequestPayload(
34+
def from(newPullRequestData: NewPullRequestData): CreatePullRequestPayload =
35+
CreatePullRequestPayload(
3636
title = newPullRequestData.title,
3737
body = newPullRequestData.body,
3838
head = newPullRequestData.head,

modules/core/src/main/scala/org/scalasteward/core/forge/github/GitHubApiAlg.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,13 @@ final class GitHubApiAlg[F[_]](
4646

4747
/** https://developer.github.com/v3/pulls/#create-a-pull-request */
4848
override def createPullRequest(repo: Repo, data: NewPullRequestData): F[PullRequestOut] = {
49-
val payload = PullRequestPayload.from(data)
49+
val payload = CreatePullRequestPayload.from(data)
5050
val create = client
51-
.postWithBody[PullRequestOut, PullRequestPayload](url.pulls(repo), payload, modify(repo))
51+
.postWithBody[PullRequestOut, CreatePullRequestPayload](
52+
uri = url.pulls(repo),
53+
body = payload,
54+
modify = modify(repo)
55+
)
5256
.adaptErr(SecondaryRateLimitExceeded.fromThrowable)
5357

5458
for {

modules/core/src/test/scala/org/scalasteward/core/forge/github/JsonCodecTest.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class JsonCodecTest extends FunSuite {
3838
assertEquals(reviewers, expected)
3939
}
4040

41-
test("PullRequestPayload") {
42-
val payload = PullRequestPayload(
41+
test("CreatePullRequestPayload") {
42+
val payload = CreatePullRequestPayload(
4343
title = "Update logback-classic to 1.2.3",
4444
body = "Updates ch.qos.logback:logback-classic from 1.2.0 to 1.2.3",
4545
head = "scala-steward:update/logback-classic-1.2.3",

0 commit comments

Comments
 (0)