# FireCloud
#
# FireCloud API
#
# The version of the OpenAPI document: 0.1
#
# Generated by: https://openapi-generator.tech
#' @docType class
#' @title BillingV2 operations
#' @description openapi.BillingV2
#' @format An \code{R6Class} generator object
#' @field apiClient Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ AddUserToBillingProject } \emph{ add user or group to billing project the caller owns }
#' add user or group to billing project the caller owns
#'
#' \itemize{
#' \item \emph{ @param } project.id character
#' \item \emph{ @param } workbench.role Enum < [user, owner] >
#' \item \emph{ @param } email character
#'
#'
#' \item status code : 200 | Successfully Added User/Group To Billing Project
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | You must be a project owner to add a user to a billing project
#'
#' \item return type : ErrorReport
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | User not found
#'
#' \item return type : ErrorReport
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | FireCloud Internal Error
#'
#' \item return type : ErrorReport
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ CreateBillingProjectFullV2 } \emph{ create billing project in rawls }
#' create new billing project in rawls
#'
#' \itemize{
#' \item \emph{ @param } create.project.request \link{CreateRawlsBillingProjectFullRequest}
#'
#'
#' \item status code : 201 | Successfully Created Billing Project in FireCloud
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | both you and firecloud billing user must be a user of the billing account
#'
#' \item return type : ErrorReport
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 409 | project already exists in rawls
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | FireCloud Internal Error
#'
#' \item return type : ErrorReport
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ DeleteBillingProject } \emph{ delete billing project }
#' delete billing project
#'
#' \itemize{
#' \item \emph{ @param } project.id character
#'
#'
#' \item status code : 204 | OK
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Project Not Found
#'
#' \item return type : ErrorReport
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | Internal Server Error
#'
#' \item return type : ErrorReport
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetBillingProject } \emph{ get billing project }
#' get billing project
#'
#' \itemize{
#' \item \emph{ @param } project.id character
#' \item \emph{ @returnType } \link{BillingProjectResponse} \cr
#'
#'
#' \item status code : 200 | OK
#'
#' \item return type : BillingProjectResponse
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Project Not Found
#'
#' \item return type : ErrorReport
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | Internal Server Error
#'
#' \item return type : ErrorReport
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ ListBillingProjectMembers } \emph{ list members of billing project the caller owns }
#' list members of billing project the caller owns
#'
#' \itemize{
#' \item \emph{ @param } project.id character
#' \item \emph{ @returnType } list( \link{BillingProjectMember} ) \cr
#'
#'
#' \item status code : 200 | Success
#'
#' \item return type : array[BillingProjectMember]
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | You must be a project owner to view the members of a project
#'
#' \item return type : ErrorReport
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | FireCloud Internal Error
#'
#' \item return type : ErrorReport
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ RemoveUserFromBillingProject } \emph{ remove user or group from billing project the caller owns }
#' remove user or group from billing project the caller owns
#'
#' \itemize{
#' \item \emph{ @param } project.id character
#' \item \emph{ @param } workbench.role Enum < [user, owner] >
#' \item \emph{ @param } email character
#'
#'
#' \item status code : 200 | Successfully Removed User From Billing Project
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | You must be a project owner to add a user to a billing project
#'
#' \item return type : ErrorReport
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | User not found
#'
#' \item return type : ErrorReport
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | FireCloud Internal Error
#'
#' \item return type : ErrorReport
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' #################### AddUserToBillingProject ####################
#'
#' library(openapi)
#' var.project.id <- 'project.id_example' # character | Project ID
#' var.workbench.role <- 'workbench.role_example' # character | role of user for project
#' var.email <- 'email_example' # character | email of user or group to add
#'
#' #add user or group to billing project the caller owns
#' api.instance <- BillingV2Api$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$AddUserToBillingProject(var.project.id, var.workbench.role, var.email)
#'
#'
#' #################### CreateBillingProjectFullV2 ####################
#'
#' library(openapi)
#' var.create.project.request <- CreateRawlsBillingProjectFullRequest$new() # CreateRawlsBillingProjectFullRequest | create project request
#'
#' #create billing project in rawls
#' api.instance <- BillingV2Api$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$CreateBillingProjectFullV2(var.create.project.request)
#'
#'
#' #################### DeleteBillingProject ####################
#'
#' library(openapi)
#' var.project.id <- 'project.id_example' # character | Id of the billing project
#'
#' #delete billing project
#' api.instance <- BillingV2Api$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$DeleteBillingProject(var.project.id)
#'
#'
#' #################### GetBillingProject ####################
#'
#' library(openapi)
#' var.project.id <- 'project.id_example' # character | Id of the billing project
#'
#' #get billing project
#' api.instance <- BillingV2Api$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$GetBillingProject(var.project.id)
#'
#'
#' #################### ListBillingProjectMembers ####################
#'
#' library(openapi)
#' var.project.id <- 'project.id_example' # character | Project ID
#'
#' #list members of billing project the caller owns
#' api.instance <- BillingV2Api$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$ListBillingProjectMembers(var.project.id)
#'
#'
#' #################### RemoveUserFromBillingProject ####################
#'
#' library(openapi)
#' var.project.id <- 'project.id_example' # character | Project ID
#' var.workbench.role <- 'workbench.role_example' # character | role of user for project
#' var.email <- 'email_example' # character | email of user or group to remove
#'
#' #remove user or group from billing project the caller owns
#' api.instance <- BillingV2Api$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$RemoveUserFromBillingProject(var.project.id, var.workbench.role, var.email)
#'
#'
#' }
#' @importFrom R6 R6Class
#' @importFrom base64enc base64encode
#' @export
BillingV2Api <- R6::R6Class(
'BillingV2Api',
public = list(
apiClient = NULL,
initialize = function(apiClient){
if (!missing(apiClient)) {
self$apiClient <- apiClient
}
else {
self$apiClient <- ApiClient$new()
}
},
AddUserToBillingProject = function(project.id, workbench.role, email, ...){
apiResponse <- self$AddUserToBillingProjectWithHttpInfo(project.id, workbench.role, email, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
AddUserToBillingProjectWithHttpInfo = function(project.id, workbench.role, email, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`project.id`)) {
stop("Missing required parameter `project.id`.")
}
if (missing(`workbench.role`)) {
stop("Missing required parameter `workbench.role`.")
}
if (missing(`email`)) {
stop("Missing required parameter `email`.")
}
body <- NULL
urlPath <- "/api/billing/v2/{projectId}/members/{workbenchRole}/{email}"
if (!missing(`project.id`)) {
urlPath <- gsub(paste0("\\{", "projectId", "\\}"), URLencode(as.character(`project.id`), reserved = TRUE), urlPath)
}
if (!missing(`workbench.role`)) {
urlPath <- gsub(paste0("\\{", "workbenchRole", "\\}"), URLencode(as.character(`workbench.role`), reserved = TRUE), urlPath)
}
if (!missing(`email`)) {
urlPath <- gsub(paste0("\\{", "email", "\\}"), URLencode(as.character(`email`), reserved = TRUE), urlPath)
}
# OAuth token
headerParams['Authorization'] <- paste("Bearer", self$apiClient$accessToken, sep=" ")
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "PUT",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
ApiResponse$new(NULL, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
CreateBillingProjectFullV2 = function(create.project.request, ...){
apiResponse <- self$CreateBillingProjectFullV2WithHttpInfo(create.project.request, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
CreateBillingProjectFullV2WithHttpInfo = function(create.project.request, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`create.project.request`)) {
stop("Missing required parameter `create.project.request`.")
}
if (!missing(`create.project.request`)) {
body <- `create.project.request`$toJSONString()
} else {
body <- NULL
}
urlPath <- "/api/billing/v2"
# OAuth token
headerParams['Authorization'] <- paste("Bearer", self$apiClient$accessToken, sep=" ")
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "POST",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
ApiResponse$new(NULL, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
DeleteBillingProject = function(project.id, ...){
apiResponse <- self$DeleteBillingProjectWithHttpInfo(project.id, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
DeleteBillingProjectWithHttpInfo = function(project.id, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`project.id`)) {
stop("Missing required parameter `project.id`.")
}
body <- NULL
urlPath <- "/api/billing/v2/{projectId}"
if (!missing(`project.id`)) {
urlPath <- gsub(paste0("\\{", "projectId", "\\}"), URLencode(as.character(`project.id`), reserved = TRUE), urlPath)
}
# OAuth token
headerParams['Authorization'] <- paste("Bearer", self$apiClient$accessToken, sep=" ")
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "DELETE",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
ApiResponse$new(NULL, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
GetBillingProject = function(project.id, ...){
apiResponse <- self$GetBillingProjectWithHttpInfo(project.id, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
GetBillingProjectWithHttpInfo = function(project.id, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`project.id`)) {
stop("Missing required parameter `project.id`.")
}
body <- NULL
urlPath <- "/api/billing/v2/{projectId}"
if (!missing(`project.id`)) {
urlPath <- gsub(paste0("\\{", "projectId", "\\}"), URLencode(as.character(`project.id`), reserved = TRUE), urlPath)
}
# OAuth token
headerParams['Authorization'] <- paste("Bearer", self$apiClient$accessToken, sep=" ")
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "BillingProjectResponse", loadNamespace("openapi")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
ListBillingProjectMembers = function(project.id, ...){
apiResponse <- self$ListBillingProjectMembersWithHttpInfo(project.id, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
ListBillingProjectMembersWithHttpInfo = function(project.id, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`project.id`)) {
stop("Missing required parameter `project.id`.")
}
body <- NULL
urlPath <- "/api/billing/v2/{projectId}/members"
if (!missing(`project.id`)) {
urlPath <- gsub(paste0("\\{", "projectId", "\\}"), URLencode(as.character(`project.id`), reserved = TRUE), urlPath)
}
# OAuth token
headerParams['Authorization'] <- paste("Bearer", self$apiClient$accessToken, sep=" ")
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "array[BillingProjectMember]", loadNamespace("openapi")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
RemoveUserFromBillingProject = function(project.id, workbench.role, email, ...){
apiResponse <- self$RemoveUserFromBillingProjectWithHttpInfo(project.id, workbench.role, email, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
RemoveUserFromBillingProjectWithHttpInfo = function(project.id, workbench.role, email, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`project.id`)) {
stop("Missing required parameter `project.id`.")
}
if (missing(`workbench.role`)) {
stop("Missing required parameter `workbench.role`.")
}
if (missing(`email`)) {
stop("Missing required parameter `email`.")
}
body <- NULL
urlPath <- "/api/billing/v2/{projectId}/members/{workbenchRole}/{email}"
if (!missing(`project.id`)) {
urlPath <- gsub(paste0("\\{", "projectId", "\\}"), URLencode(as.character(`project.id`), reserved = TRUE), urlPath)
}
if (!missing(`workbench.role`)) {
urlPath <- gsub(paste0("\\{", "workbenchRole", "\\}"), URLencode(as.character(`workbench.role`), reserved = TRUE), urlPath)
}
if (!missing(`email`)) {
urlPath <- gsub(paste0("\\{", "email", "\\}"), URLencode(as.character(`email`), reserved = TRUE), urlPath)
}
# OAuth token
headerParams['Authorization'] <- paste("Bearer", self$apiClient$accessToken, sep=" ")
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "DELETE",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
ApiResponse$new(NULL, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.