-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #220 from nrkno/jobname-deprecation
BQJobName is insufficient
- Loading branch information
Showing
12 changed files
with
126 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* Copyright 2020 NRK | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
package no.nrk.bigquery | ||
|
||
final case class BQClientDefaults(projectId: ProjectId, locationId: LocationId) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright 2020 NRK | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
package no.nrk.bigquery | ||
|
||
final case class BQJobId(projectId: Option[ProjectId], locationId: Option[LocationId], name: BQJobName) { | ||
def withProjectId(projectId: ProjectId) = copy(projectId = Some(projectId)) | ||
def withLocationId(locationId: LocationId) = copy(locationId = Some(locationId)) | ||
private[bigquery] def withDefaults(defaults: Option[BQClientDefaults]) = | ||
if (projectId.isEmpty && locationId.isEmpty) { | ||
copy(projectId = defaults.map(_.projectId), locationId = defaults.map(_.locationId)) | ||
} else this | ||
|
||
def +(str: String): BQJobId = copy(name = name + str) | ||
} | ||
|
||
object BQJobId { | ||
def auto(implicit enclosing: sourcecode.Enclosing) = | ||
BQJobId(None, None, BQJobName(enclosing.value)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.