# FireCloud
#
# FireCloud API
#
# The version of the OpenAPI document: 0.1
#
# Generated by: https://openapi-generator.tech
#' @docType class
#' @title CromIAMWorkflowsForJobManager operations
#' @description openapi.CromIAMWorkflowsForJobManager
#' @format An \code{R6Class} generator object
#' @field apiClient Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ ApiWorkflowsVersionIdAbortPost } \emph{ Abort a workflow based on workflow id }
#'
#'
#' \itemize{
#' \item \emph{ @param } version character
#' \item \emph{ @param } id character
#' \item \emph{ @returnType } \link{WorkflowStatusResponse} \cr
#'
#'
#' \item status code : 200 | Successful Request
#'
#' \item return type : WorkflowStatusResponse
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Malformed Workflow ID
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | Workflow in terminal status
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Workflow ID Not Found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | Internal Error
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ ApiWorkflowsVersionIdBackendMetadataBackendIdGet } \emph{ Get backend (e.g. PAPI) metadata for a job }
#'
#'
#' \itemize{
#' \item \emph{ @param } version character
#' \item \emph{ @param } id character
#' \item \emph{ @param } backend.id character
#'
#'
#' \item status code : 200 | Successful Request, format is backend dependent
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Workflow or Backend ID Not Found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | Internal Error
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ ApiWorkflowsVersionIdLabelsPatch } \emph{ Add new labels or update values for existing label keys by workflow id. }
#'
#'
#' \itemize{
#' \item \emph{ @param } version character
#' \item \emph{ @param } id character
#' \item \emph{ @param } labels object
#' \item \emph{ @returnType } \link{LabelsResponse} \cr
#'
#'
#' \item status code : 200 | Successful Request
#'
#' \item return type : LabelsResponse
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Malformed Workflow ID
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Workflow ID Not Found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | Internal Error
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ ApiWorkflowsVersionIdMetadataGet } \emph{ Query for workflow and call-level metadata for a specified workflow }
#'
#'
#' \itemize{
#' \item \emph{ @param } version character
#' \item \emph{ @param } id character
#' \item \emph{ @param } include.key list( character )
#' \item \emph{ @param } exclude.key list( character )
#' \item \emph{ @param } expand.sub.workflows character
#' \item \emph{ @returnType } \link{WorkflowMetadataResponse} \cr
#'
#'
#' \item status code : 200 | Successful Request
#'
#' \item return type : WorkflowMetadataResponse
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Malformed Workflow ID
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Workflow ID Not Found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | Internal Error
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ ApiWorkflowsVersionQueryGet } \emph{ Query workflows by start dates, end dates, names, ids, or statuses. }
#'
#'
#' \itemize{
#' \item \emph{ @param } version character
#' \item \emph{ @param } start character
#' \item \emph{ @param } end character
#' \item \emph{ @param } status Enum < [Submitted, Running, Aborting, Failed, Succeeded, Aborted] >
#' \item \emph{ @param } name list( character )
#' \item \emph{ @param } id list( character )
#' \item \emph{ @returnType } \link{WorkflowQueryResponse} \cr
#'
#'
#' \item status code : 200 | Successful Request
#'
#' \item return type : WorkflowQueryResponse
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | Malformed Request
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | Internal Error
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ ApiWorkflowsVersionQueryPost } \emph{ Query workflows by start dates, end dates, names, ids, or statuses. }
#'
#'
#' \itemize{
#' \item \emph{ @param } version character
#' \item \emph{ @param } parameters list( \link{WorkflowQueryParameter} )
#' \item \emph{ @returnType } \link{WorkflowQueryResponse} \cr
#'
#'
#' \item status code : 200 | Successful Request
#'
#' \item return type : WorkflowQueryResponse
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Malformed Request
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | Internal Error
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' #################### ApiWorkflowsVersionIdAbortPost ####################
#'
#' library(openapi)
#' var.version <- 'v1' # character | API Version
#' var.id <- 'id_example' # character | Workflow ID
#'
#' #Abort a workflow based on workflow id
#' api.instance <- CromIAMWorkflowsForJobManagerApi$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$ApiWorkflowsVersionIdAbortPost(var.version, var.id)
#'
#'
#' #################### ApiWorkflowsVersionIdBackendMetadataBackendIdGet ####################
#'
#' library(openapi)
#' var.version <- 'v1' # character | API Version
#' var.id <- 'id_example' # character | Workflow ID
#' var.backend.id <- 'backend.id_example' # character | Backend ID, must be a job that is part of the workflow
#'
#' #Get backend (e.g. PAPI) metadata for a job
#' api.instance <- CromIAMWorkflowsForJobManagerApi$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$ApiWorkflowsVersionIdBackendMetadataBackendIdGet(var.version, var.id, var.backend.id)
#'
#'
#' #################### ApiWorkflowsVersionIdLabelsPatch ####################
#'
#' library(openapi)
#' var.version <- 'v1' # character | API Version
#' var.id <- 'id_example' # character | Workflow ID
#' var.labels <- NULL # object | Custom labels submitted as JSON. Example: {\"key-1\":\"value-1\",\"key-2\":\"value-2\"}
#'
#' #Add new labels or update values for existing label keys by workflow id.
#' api.instance <- CromIAMWorkflowsForJobManagerApi$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$ApiWorkflowsVersionIdLabelsPatch(var.version, var.id, var.labels)
#'
#'
#' #################### ApiWorkflowsVersionIdMetadataGet ####################
#'
#' library(openapi)
#' var.version <- 'v1' # character | API Version
#' var.id <- 'id_example' # character | Workflow ID
#' var.include.key <- ['include.key_example'] # array[character] | When specified key(s) to include from the metadata. Matches any key starting with the value. May not be used with excludeKey.
#' var.exclude.key <- ['exclude.key_example'] # array[character] | When specified key(s) to exclude from the metadata. Matches any key starting with the value. May not be used with includeKey.
#' var.expand.sub.workflows <- FALSE # character | When true, metadata for sub workflows will be fetched and inserted automatically in the metadata response.
#'
#' #Query for workflow and call-level metadata for a specified workflow
#' api.instance <- CromIAMWorkflowsForJobManagerApi$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$ApiWorkflowsVersionIdMetadataGet(var.version, var.id, include.key=var.include.key, exclude.key=var.exclude.key, expand.sub.workflows=var.expand.sub.workflows)
#'
#'
#' #################### ApiWorkflowsVersionQueryGet ####################
#'
#' library(openapi)
#' var.version <- 'v1' # character | API Version
#' var.start <- 'start_example' # character | Returns only workflows with an equal or later start datetime. Can be specified at most once. If both start and end date are specified, start date must be before or equal to end date.
#' var.end <- 'end_example' # character | Returns only workflows with an equal or earlier end datetime. Can be specified at most once. If both start and end date are specified, start date must be before or equal to end date.
#' var.status <- ['status_example'] # array[character] | Returns only workflows with the specified status. If specified multiple times, returns workflows in any of the specified statuses.
#' var.name <- ['name_example'] # array[character] | Returns only workflows with the specified name. If specified multiple times, returns workflows with any of the specified names.
#' var.id <- ['id_example'] # array[character] | Returns only workflows with the specified workflow id. If specified multiple times, returns workflows with any of the specified workflow ids.
#'
#' #Query workflows by start dates, end dates, names, ids, or statuses.
#' api.instance <- CromIAMWorkflowsForJobManagerApi$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$ApiWorkflowsVersionQueryGet(var.version, start=var.start, end=var.end, status=var.status, name=var.name, id=var.id)
#'
#'
#' #################### ApiWorkflowsVersionQueryPost ####################
#'
#' library(openapi)
#' var.version <- 'v1' # character | API version
#' var.parameters <- [WorkflowQueryParameter$new()] # array[WorkflowQueryParameter] | Same query parameters as GET /query endpoint, submitted as a json list. Example: [{\"status\":\"Success\"},{\"status\":\"Failed\"}]
#'
#' #Query workflows by start dates, end dates, names, ids, or statuses.
#' api.instance <- CromIAMWorkflowsForJobManagerApi$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$ApiWorkflowsVersionQueryPost(var.version, var.parameters)
#'
#'
#' }
#' @importFrom R6 R6Class
#' @importFrom base64enc base64encode
#' @export
CromIAMWorkflowsForJobManagerApi <- R6::R6Class(
'CromIAMWorkflowsForJobManagerApi',
public = list(
apiClient = NULL,
initialize = function(apiClient){
if (!missing(apiClient)) {
self$apiClient <- apiClient
}
else {
self$apiClient <- ApiClient$new()
}
},
ApiWorkflowsVersionIdAbortPost = function(version, id, ...){
apiResponse <- self$ApiWorkflowsVersionIdAbortPostWithHttpInfo(version, 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
}
},
ApiWorkflowsVersionIdAbortPostWithHttpInfo = function(version, id, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`version`)) {
stop("Missing required parameter `version`.")
}
if (missing(`id`)) {
stop("Missing required parameter `id`.")
}
body <- NULL
urlPath <- "/api/workflows/{version}/{id}/abort"
if (!missing(`version`)) {
urlPath <- gsub(paste0("\\{", "version", "\\}"), URLencode(as.character(`version`), reserved = TRUE), urlPath)
}
if (!missing(`id`)) {
urlPath <- gsub(paste0("\\{", "id", "\\}"), URLencode(as.character(`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 = "POST",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "WorkflowStatusResponse", 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)
}
},
ApiWorkflowsVersionIdBackendMetadataBackendIdGet = function(version, id, backend.id, ...){
apiResponse <- self$ApiWorkflowsVersionIdBackendMetadataBackendIdGetWithHttpInfo(version, id, backend.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
}
},
ApiWorkflowsVersionIdBackendMetadataBackendIdGetWithHttpInfo = function(version, id, backend.id, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`version`)) {
stop("Missing required parameter `version`.")
}
if (missing(`id`)) {
stop("Missing required parameter `id`.")
}
if (missing(`backend.id`)) {
stop("Missing required parameter `backend.id`.")
}
body <- NULL
urlPath <- "/api/workflows/{version}/{id}/backend/metadata/{backendId}"
if (!missing(`version`)) {
urlPath <- gsub(paste0("\\{", "version", "\\}"), URLencode(as.character(`version`), reserved = TRUE), urlPath)
}
if (!missing(`id`)) {
urlPath <- gsub(paste0("\\{", "id", "\\}"), URLencode(as.character(`id`), reserved = TRUE), urlPath)
}
if (!missing(`backend.id`)) {
urlPath <- gsub(paste0("\\{", "backendId", "\\}"), URLencode(as.character(`backend.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) {
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)
}
},
ApiWorkflowsVersionIdLabelsPatch = function(version, id, labels, ...){
apiResponse <- self$ApiWorkflowsVersionIdLabelsPatchWithHttpInfo(version, id, labels, ...)
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
}
},
ApiWorkflowsVersionIdLabelsPatchWithHttpInfo = function(version, id, labels, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`version`)) {
stop("Missing required parameter `version`.")
}
if (missing(`id`)) {
stop("Missing required parameter `id`.")
}
if (missing(`labels`)) {
stop("Missing required parameter `labels`.")
}
if (!missing(`labels`)) {
body <- `labels`$toJSONString()
} else {
body <- NULL
}
urlPath <- "/api/workflows/{version}/{id}/labels"
if (!missing(`version`)) {
urlPath <- gsub(paste0("\\{", "version", "\\}"), URLencode(as.character(`version`), reserved = TRUE), urlPath)
}
if (!missing(`id`)) {
urlPath <- gsub(paste0("\\{", "id", "\\}"), URLencode(as.character(`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 = "PATCH",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "LabelsResponse", 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)
}
},
ApiWorkflowsVersionIdMetadataGet = function(version, id, include.key=NULL, exclude.key=NULL, expand.sub.workflows=FALSE, ...){
apiResponse <- self$ApiWorkflowsVersionIdMetadataGetWithHttpInfo(version, id, include.key, exclude.key, expand.sub.workflows, ...)
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
}
},
ApiWorkflowsVersionIdMetadataGetWithHttpInfo = function(version, id, include.key=NULL, exclude.key=NULL, expand.sub.workflows=FALSE, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`version`)) {
stop("Missing required parameter `version`.")
}
if (missing(`id`)) {
stop("Missing required parameter `id`.")
}
queryParams['includeKey'] <- include.key
queryParams['excludeKey'] <- exclude.key
queryParams['expandSubWorkflows'] <- expand.sub.workflows
body <- NULL
urlPath <- "/api/workflows/{version}/{id}/metadata"
if (!missing(`version`)) {
urlPath <- gsub(paste0("\\{", "version", "\\}"), URLencode(as.character(`version`), reserved = TRUE), urlPath)
}
if (!missing(`id`)) {
urlPath <- gsub(paste0("\\{", "id", "\\}"), URLencode(as.character(`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, "WorkflowMetadataResponse", 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)
}
},
ApiWorkflowsVersionQueryGet = function(version, start=NULL, end=NULL, status=NULL, name=NULL, id=NULL, ...){
apiResponse <- self$ApiWorkflowsVersionQueryGetWithHttpInfo(version, start, end, status, name, 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
}
},
ApiWorkflowsVersionQueryGetWithHttpInfo = function(version, start=NULL, end=NULL, status=NULL, name=NULL, id=NULL, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`version`)) {
stop("Missing required parameter `version`.")
}
queryParams['start'] <- start
queryParams['end'] <- end
queryParams['status'] <- status
queryParams['name'] <- name
queryParams['id'] <- id
body <- NULL
urlPath <- "/api/workflows/{version}/query"
if (!missing(`version`)) {
urlPath <- gsub(paste0("\\{", "version", "\\}"), URLencode(as.character(`version`), 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, "WorkflowQueryResponse", 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)
}
},
ApiWorkflowsVersionQueryPost = function(version, parameters, ...){
apiResponse <- self$ApiWorkflowsVersionQueryPostWithHttpInfo(version, parameters, ...)
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
}
},
ApiWorkflowsVersionQueryPostWithHttpInfo = function(version, parameters, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`version`)) {
stop("Missing required parameter `version`.")
}
if (missing(`parameters`)) {
stop("Missing required parameter `parameters`.")
}
if (!missing(`parameters`)) {
body.items = paste(unlist(lapply(parameters, function(param){param$toJSONString()})), collapse = ",")
body <- paste0('[', body.items, ']')
} else {
body <- NULL
}
urlPath <- "/api/workflows/{version}/query"
if (!missing(`version`)) {
urlPath <- gsub(paste0("\\{", "version", "\\}"), URLencode(as.character(`version`), reserved = TRUE), urlPath)
}
# 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) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "WorkflowQueryResponse", 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)
}
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.