## Creates two comparable builds `builds().compare(BuildCompareParamsparams, RequestOptionsrequestOptions = RequestOptions.none()) : BuildCompareResponse` **post** `/v0/builds/compare` Create two builds whose outputs can be directly compared with each other. Created builds _modify_ their project branches so that their latest sets of config files point to the ones specified by the input revision. This endpoint is useful because a build has more inputs than the set of config files it uses, so comparing two builds directly may return spurious differences. Builds made via this endpoint are guaranteed to have differences arising from the set of config files, and any custom code. ### Parameters - `params: BuildCompareParams` - `base: Base` Parameters for the base build - `branch: String` Branch to use. When using a branch name as revision, this must match or be omitted. - `revision: Revision` Specifies what to build: a branch name, a commit SHA, or file contents. - `String` - `class UnionMember1:` File contents to commit directly - `Content` - `content: String` File content - `Url` - `url: String` URL to fetch file content from - `commitMessage: Optional` Optional commit message to use when creating a new commit. - `head: Head` Parameters for the head build - `branch: String` Branch to use. When using a branch name as revision, this must match or be omitted. - `revision: Revision` Specifies what to build: a branch name, a commit SHA, or file contents. - `String` - `class UnionMember1:` File contents to commit directly - `Content` - `Url` - `commitMessage: Optional` Optional commit message to use when creating a new commit. - `project: String` Project name - `targets: Optional>` Optional list of SDK targets to build. If not specified, all configured targets will be built. - `NODE("node")` - `TYPESCRIPT("typescript")` - `PYTHON("python")` - `GO("go")` - `JAVA("java")` - `KOTLIN("kotlin")` - `RUBY("ruby")` - `TERRAFORM("terraform")` - `CLI("cli")` - `PHP("php")` - `CSHARP("csharp")` - `SQL("sql")` - `OPENAPI("openapi")` ### Returns - `class BuildCompareResponse:` - `base: Build` - `id: String` Build ID - `configCommit: String` - `createdAt: LocalDateTime` - `documentedSpec: Optional` - `class UnionMember0:` - `content: String` - `type: Type` - `CONTENT("content")` - `class UnionMember1:` - `expires: LocalDateTime` - `type: Type` - `URL("url")` - `url: String` - `object_: Object` - `BUILD("build")` - `org: String` - `project: String` - `targets: Targets` - `cli: Optional` - `commit: Commit` - `JsonValue;` - `status: JsonValue; "not_started"constant` - `NOT_STARTED("not_started")` - `JsonValue;` - `status: JsonValue; "queued"constant` - `QUEUED("queued")` - `JsonValue;` - `status: JsonValue; "in_progress"constant` - `IN_PROGRESS("in_progress")` - `class Completed:` - `commit: Optional` - `repo: Repo` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: Optional` - `additions: Long` - `deletions: Long` - `total: Long` - `treeOid: Optional` - `completed: InnerCompleted` deprecated - `commit: Optional` - `completedAt: LocalDateTime` - `conclusion: Conclusion` - `ERROR("error")` - `WARNING("warning")` - `NOTE("note")` - `SUCCESS("success")` - `MERGE_CONFLICT("merge_conflict")` - `UPSTREAM_MERGE_CONFLICT("upstream_merge_conflict")` - `FATAL("fatal")` - `PAYMENT_REQUIRED("payment_required")` - `CANCELLED("cancelled")` - `TIMED_OUT("timed_out")` - `NOOP("noop")` - `VERSION_BUMP("version_bump")` - `mergeConflictPr: Optional` - `number: Double` - `repo: Repo` - `host: String` - `name: String` - `owner: String` - `completedAt: LocalDateTime` - `conclusion: Conclusion` - `ERROR("error")` - `WARNING("warning")` - `NOTE("note")` - `SUCCESS("success")` - `MERGE_CONFLICT("merge_conflict")` - `UPSTREAM_MERGE_CONFLICT("upstream_merge_conflict")` - `FATAL("fatal")` - `PAYMENT_REQUIRED("payment_required")` - `CANCELLED("cancelled")` - `TIMED_OUT("timed_out")` - `NOOP("noop")` - `VERSION_BUMP("version_bump")` - `mergeConflictPr: Optional` - `number: Double` - `repo: Repo` - `host: String` - `name: String` - `owner: String` - `status: JsonValue; "completed"constant` - `COMPLETED("completed")` - `installUrl: Optional` - `object_: Object` - `BUILD_TARGET("build_target")` - `status: Status` - `NOT_STARTED("not_started")` - `CODEGEN("codegen")` - `POSTGEN("postgen")` - `COMPLETED("completed")` - `build: Optional` - `JsonValue;` - `status: JsonValue; "not_started"constant` - `NOT_STARTED("not_started")` - `Queued` - `status: JsonValue; "queued"constant` - `QUEUED("queued")` - `url: Optional` - `InProgress` - `status: JsonValue; "in_progress"constant` - `IN_PROGRESS("in_progress")` - `url: Optional` - `Completed` - `completed: InnerCompleted` deprecated - `conclusion: Conclusion` - `SUCCESS("success")` - `FAILURE("failure")` - `SKIPPED("skipped")` - `CANCELLED("cancelled")` - `ACTION_REQUIRED("action_required")` - `NEUTRAL("neutral")` - `TIMED_OUT("timed_out")` - `url: Optional` - `conclusion: Conclusion` - `SUCCESS("success")` - `FAILURE("failure")` - `SKIPPED("skipped")` - `CANCELLED("cancelled")` - `ACTION_REQUIRED("action_required")` - `NEUTRAL("neutral")` - `TIMED_OUT("timed_out")` - `status: JsonValue; "completed"constant` - `COMPLETED("completed")` - `url: Optional` - `lint: Optional` - `test: Optional` - `csharp: Optional` - `go: Optional` - `java: Optional` - `kotlin: Optional` - `node: Optional` - `openAPI: Optional` - `php: Optional` - `python: Optional` - `ruby: Optional` - `sql: Optional` - `terraform: Optional` - `typescript: Optional` - `updatedAt: LocalDateTime` - `head: Build` ### Example ```kotlin package com.configure_me_stainless_v0.api.example import com.configure_me_stainless_v0.api.client.StainlessClient import com.configure_me_stainless_v0.api.client.okhttp.StainlessOkHttpClient import com.configure_me_stainless_v0.api.models.builds.BuildCompareParams import com.configure_me_stainless_v0.api.models.builds.BuildCompareResponse fun main() { val client: StainlessClient = StainlessOkHttpClient.fromEnv() val params: BuildCompareParams = BuildCompareParams.builder() .base(BuildCompareParams.Base.builder() .branch("branch") .revision("string") .build()) .head(BuildCompareParams.Head.builder() .branch("branch") .revision("string") .build()) .project("project") .build() val response: BuildCompareResponse = client.builds().compare(params) } ``` #### Response ```json { "base": { "id": "id", "config_commit": "config_commit", "created_at": "2019-12-27T18:11:19.117Z", "documented_spec": { "content": "content", "type": "content" }, "object": "build", "org": "org", "project": "project", "targets": { "cli": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "csharp": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "go": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "java": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "kotlin": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "node": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "openapi": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "php": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "python": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "ruby": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "sql": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "terraform": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "typescript": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } } }, "updated_at": "2019-12-27T18:11:19.117Z" }, "head": { "id": "id", "config_commit": "config_commit", "created_at": "2019-12-27T18:11:19.117Z", "documented_spec": { "content": "content", "type": "content" }, "object": "build", "org": "org", "project": "project", "targets": { "cli": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "csharp": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "go": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "java": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "kotlin": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "node": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "openapi": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "php": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "python": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "ruby": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "sql": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "terraform": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "typescript": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } } }, "updated_at": "2019-12-27T18:11:19.117Z" } } ```