
scala.googleapis.bigquery.RowAccessPoliciesClient.scala Maven / Gradle / Ivy
package googleapis.bigquery
import cats.effect.Concurrent
import org.http4s._
import org.http4s.implicits._
import org.http4s.client.Client
class RowAccessPoliciesClient[F[_]: Concurrent](client: Client[F])
extends AbstractClient[F](client) {
val baseUri = uri"https://bigquery.googleapis.com/bigquery/v2"
def getIamPolicy(
/** REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
*/
resource: String
)(input: GetIamPolicyRequest): F[Policy] =
expectJson[Policy](requestWithBody(method = Method.POST, uri = baseUri / s"${resource}")(input))
def list(
/** Required. Project ID of the row access policies to list.
*/
projectId: String,
/** Required. Dataset ID of row access policies to list.
*/
datasetId: String,
/** Required. Table ID of the table to list row access policies.
*/
tableId: String,
query: RowAccessPoliciesClient.ListParams = RowAccessPoliciesClient.ListParams(),
): F[ListRowAccessPoliciesResponse] = expectJson[ListRowAccessPoliciesResponse](
request(
method = Method.GET,
uri =
(baseUri / "projects" / s"${projectId}" / "datasets" / s"${datasetId}" / "tables" / s"${tableId}" / "rowAccessPolicies")
.copy(query =
Query.fromVector(
Vector(
List("pageSize" -> query.pageSize.map(s => QueryParamEncoder[Int].encode(s).value))
.flatMap { case (k, v) => v.map(vv => k -> Option(vv)) },
List("pageToken" -> query.pageToken).flatMap { case (k, v) =>
v.map(vv => k -> Option(vv))
},
).flatten
)
),
)
)
def testIamPermissions(
/** REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
*/
resource: String
)(input: TestIamPermissionsRequest): F[TestIamPermissionsResponse] =
expectJson[TestIamPermissionsResponse](
requestWithBody(method = Method.POST, uri = baseUri / s"${resource}")(input)
)
}
object RowAccessPoliciesClient {
final case class ListParams(
/** The maximum number of results to return in a single response page. Leverage the page tokens to iterate through the entire collection.
*/
pageSize: Option[Int] = None,
/** Page token, returned by a previous call, to request the next page of results.
*/
pageToken: Option[String] = None,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy