R/challenge_services_api.R

#' Synapse REST API
#'
#' No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
#'
#' The version of the OpenAPI document: v1
#' Generated by: https://openapi-generator.tech
#'
#' @docType class
#' @title ChallengeServices operations
#' @description ChallengeServicesApi
#' @format An \code{R6Class} generator object
#' @field api_client Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ DeleteRepoV1ChallengeChallengeId } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } challenge_id numeric
#'
#'
#' \item status code : 200 | Void
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ DeleteRepoV1ChallengeTeamChallengeTeamId } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } challenge_team_id numeric
#'
#'
#' \item status code : 200 | Void
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1Challenge } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } participant_id numeric
#' \item \emph{ @param } limit numeric
#' \item \emph{ @param } offset numeric
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelChallengePagedResults} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelChallengePagedResults
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1ChallengeChallengeId } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } challenge_id numeric
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelChallenge} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelChallenge
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1ChallengeChallengeIdChallengeTeam } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } challenge_id numeric
#' \item \emph{ @param } limit numeric
#' \item \emph{ @param } offset numeric
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelChallengeTeamPagedResults} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelChallengeTeamPagedResults
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1ChallengeChallengeIdParticipant } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } challenge_id numeric
#' \item \emph{ @param } affiliated character
#' \item \emph{ @param } limit numeric
#' \item \emph{ @param } offset numeric
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelPaginatedIds} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelPaginatedIds
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1ChallengeChallengeIdRegistratableTeam } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } challenge_id numeric
#' \item \emph{ @param } limit numeric
#' \item \emph{ @param } offset numeric
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelPaginatedIds} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelPaginatedIds
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1ChallengeChallengeIdSubmissionTeams } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } challenge_id numeric
#' \item \emph{ @param } limit numeric
#' \item \emph{ @param } offset numeric
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelPaginatedIds} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelPaginatedIds
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdChallenge } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelChallenge} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelChallenge
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PostRepoV1Challenge } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } org_sagebionetworks_repo_model_challenge \link{OrgSagebionetworksRepoModelChallenge}
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelChallenge} \cr
#'
#'
#' \item status code : 201 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelChallenge
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PostRepoV1ChallengeChallengeIdChallengeTeam } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } challenge_id numeric
#' \item \emph{ @param } org_sagebionetworks_repo_model_challenge_team \link{OrgSagebionetworksRepoModelChallengeTeam}
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelChallengeTeam} \cr
#'
#'
#' \item status code : 201 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelChallengeTeam
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PutRepoV1ChallengeChallengeId } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } challenge_id numeric
#' \item \emph{ @param } org_sagebionetworks_repo_model_challenge \link{OrgSagebionetworksRepoModelChallenge}
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelChallenge} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelChallenge
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PutRepoV1ChallengeChallengeIdChallengeTeamChallengeTeamId } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } challenge_id numeric
#' \item \emph{ @param } challenge_team_id numeric
#' \item \emph{ @param } org_sagebionetworks_repo_model_challenge_team \link{OrgSagebionetworksRepoModelChallengeTeam}
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelChallengeTeam} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelChallengeTeam
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' ####################  DeleteRepoV1ChallengeChallengeId  ####################
#'
#' library(synclient)
#' var_challenge_id <- 3.4 # numeric | 
#'
#' api_instance <- ChallengeServicesApi$new()
#'
#' # Configure HTTP bearer authorization: bearerAuth
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
#'
#' api_instance$DeleteRepoV1ChallengeChallengeId(var_challenge_id)
#'
#'
#' ####################  DeleteRepoV1ChallengeTeamChallengeTeamId  ####################
#'
#' library(synclient)
#' var_challenge_team_id <- 3.4 # numeric | 
#'
#' api_instance <- ChallengeServicesApi$new()
#'
#' # Configure HTTP bearer authorization: bearerAuth
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
#'
#' api_instance$DeleteRepoV1ChallengeTeamChallengeTeamId(var_challenge_team_id)
#'
#'
#' ####################  GetRepoV1Challenge  ####################
#'
#' library(synclient)
#' var_participant_id <- 3.4 # numeric | 
#' var_limit <- 3.4 # numeric |  (Optional)
#' var_offset <- 3.4 # numeric |  (Optional)
#'
#' api_instance <- ChallengeServicesApi$new()
#'
#' # Configure HTTP bearer authorization: bearerAuth
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
#'
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
#' # result <- api_instance$GetRepoV1Challenge(var_participant_id, limit = var_limit, offset = var_offsetdata_file = "result.txt")
#' result <- api_instance$GetRepoV1Challenge(var_participant_id, limit = var_limit, offset = var_offset)
#' dput(result)
#'
#'
#' ####################  GetRepoV1ChallengeChallengeId  ####################
#'
#' library(synclient)
#' var_challenge_id <- 3.4 # numeric | 
#'
#' api_instance <- ChallengeServicesApi$new()
#'
#' # Configure HTTP bearer authorization: bearerAuth
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
#'
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
#' # result <- api_instance$GetRepoV1ChallengeChallengeId(var_challenge_iddata_file = "result.txt")
#' result <- api_instance$GetRepoV1ChallengeChallengeId(var_challenge_id)
#' dput(result)
#'
#'
#' ####################  GetRepoV1ChallengeChallengeIdChallengeTeam  ####################
#'
#' library(synclient)
#' var_challenge_id <- 3.4 # numeric | 
#' var_limit <- 3.4 # numeric |  (Optional)
#' var_offset <- 3.4 # numeric |  (Optional)
#'
#' api_instance <- ChallengeServicesApi$new()
#'
#' # Configure HTTP bearer authorization: bearerAuth
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
#'
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
#' # result <- api_instance$GetRepoV1ChallengeChallengeIdChallengeTeam(var_challenge_id, limit = var_limit, offset = var_offsetdata_file = "result.txt")
#' result <- api_instance$GetRepoV1ChallengeChallengeIdChallengeTeam(var_challenge_id, limit = var_limit, offset = var_offset)
#' dput(result)
#'
#'
#' ####################  GetRepoV1ChallengeChallengeIdParticipant  ####################
#'
#' library(synclient)
#' var_challenge_id <- 3.4 # numeric | 
#' var_affiliated <- "affiliated_example" # character | If affiliated=true, return just participants affiliated with some   registered Team.  If false, return those not affiliated with any registered Team.    If omitted return all participants. (Optional)
#' var_limit <- 3.4 # numeric |  (Optional)
#' var_offset <- 3.4 # numeric |  (Optional)
#'
#' api_instance <- ChallengeServicesApi$new()
#'
#' # Configure HTTP bearer authorization: bearerAuth
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
#'
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
#' # result <- api_instance$GetRepoV1ChallengeChallengeIdParticipant(var_challenge_id, affiliated = var_affiliated, limit = var_limit, offset = var_offsetdata_file = "result.txt")
#' result <- api_instance$GetRepoV1ChallengeChallengeIdParticipant(var_challenge_id, affiliated = var_affiliated, limit = var_limit, offset = var_offset)
#' dput(result)
#'
#'
#' ####################  GetRepoV1ChallengeChallengeIdRegistratableTeam  ####################
#'
#' library(synclient)
#' var_challenge_id <- 3.4 # numeric | 
#' var_limit <- 3.4 # numeric |  (Optional)
#' var_offset <- 3.4 # numeric |  (Optional)
#'
#' api_instance <- ChallengeServicesApi$new()
#'
#' # Configure HTTP bearer authorization: bearerAuth
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
#'
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
#' # result <- api_instance$GetRepoV1ChallengeChallengeIdRegistratableTeam(var_challenge_id, limit = var_limit, offset = var_offsetdata_file = "result.txt")
#' result <- api_instance$GetRepoV1ChallengeChallengeIdRegistratableTeam(var_challenge_id, limit = var_limit, offset = var_offset)
#' dput(result)
#'
#'
#' ####################  GetRepoV1ChallengeChallengeIdSubmissionTeams  ####################
#'
#' library(synclient)
#' var_challenge_id <- 3.4 # numeric | 
#' var_limit <- 3.4 # numeric |  (Optional)
#' var_offset <- 3.4 # numeric |  (Optional)
#'
#' api_instance <- ChallengeServicesApi$new()
#'
#' # Configure HTTP bearer authorization: bearerAuth
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
#'
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
#' # result <- api_instance$GetRepoV1ChallengeChallengeIdSubmissionTeams(var_challenge_id, limit = var_limit, offset = var_offsetdata_file = "result.txt")
#' result <- api_instance$GetRepoV1ChallengeChallengeIdSubmissionTeams(var_challenge_id, limit = var_limit, offset = var_offset)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdChallenge  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | 
#'
#' api_instance <- ChallengeServicesApi$new()
#'
#' # Configure HTTP bearer authorization: bearerAuth
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
#'
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
#' # result <- api_instance$GetRepoV1EntityIdChallenge(var_iddata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdChallenge(var_id)
#' dput(result)
#'
#'
#' ####################  PostRepoV1Challenge  ####################
#'
#' library(synclient)
#' var_org_sagebionetworks_repo_model_challenge <- org.sagebionetworks.repo.model.Challenge$new("id_example", "etag_example", "projectId_example", "participantTeamId_example") # OrgSagebionetworksRepoModelChallenge | 
#'
#' api_instance <- ChallengeServicesApi$new()
#'
#' # Configure HTTP bearer authorization: bearerAuth
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
#'
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
#' # result <- api_instance$PostRepoV1Challenge(var_org_sagebionetworks_repo_model_challengedata_file = "result.txt")
#' result <- api_instance$PostRepoV1Challenge(var_org_sagebionetworks_repo_model_challenge)
#' dput(result)
#'
#'
#' ####################  PostRepoV1ChallengeChallengeIdChallengeTeam  ####################
#'
#' library(synclient)
#' var_challenge_id <- 3.4 # numeric | 
#' var_org_sagebionetworks_repo_model_challenge_team <- org.sagebionetworks.repo.model.ChallengeTeam$new("id_example", "etag_example", "challengeId_example", "teamId_example", "message_example") # OrgSagebionetworksRepoModelChallengeTeam | 
#'
#' api_instance <- ChallengeServicesApi$new()
#'
#' # Configure HTTP bearer authorization: bearerAuth
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
#'
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
#' # result <- api_instance$PostRepoV1ChallengeChallengeIdChallengeTeam(var_challenge_id, var_org_sagebionetworks_repo_model_challenge_teamdata_file = "result.txt")
#' result <- api_instance$PostRepoV1ChallengeChallengeIdChallengeTeam(var_challenge_id, var_org_sagebionetworks_repo_model_challenge_team)
#' dput(result)
#'
#'
#' ####################  PutRepoV1ChallengeChallengeId  ####################
#'
#' library(synclient)
#' var_challenge_id <- 3.4 # numeric | 
#' var_org_sagebionetworks_repo_model_challenge <- org.sagebionetworks.repo.model.Challenge$new("id_example", "etag_example", "projectId_example", "participantTeamId_example") # OrgSagebionetworksRepoModelChallenge | 
#'
#' api_instance <- ChallengeServicesApi$new()
#'
#' # Configure HTTP bearer authorization: bearerAuth
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
#'
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
#' # result <- api_instance$PutRepoV1ChallengeChallengeId(var_challenge_id, var_org_sagebionetworks_repo_model_challengedata_file = "result.txt")
#' result <- api_instance$PutRepoV1ChallengeChallengeId(var_challenge_id, var_org_sagebionetworks_repo_model_challenge)
#' dput(result)
#'
#'
#' ####################  PutRepoV1ChallengeChallengeIdChallengeTeamChallengeTeamId  ####################
#'
#' library(synclient)
#' var_challenge_id <- 3.4 # numeric | 
#' var_challenge_team_id <- 3.4 # numeric | 
#' var_org_sagebionetworks_repo_model_challenge_team <- org.sagebionetworks.repo.model.ChallengeTeam$new("id_example", "etag_example", "challengeId_example", "teamId_example", "message_example") # OrgSagebionetworksRepoModelChallengeTeam | 
#'
#' api_instance <- ChallengeServicesApi$new()
#'
#' # Configure HTTP bearer authorization: bearerAuth
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
#'
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
#' # result <- api_instance$PutRepoV1ChallengeChallengeIdChallengeTeamChallengeTeamId(var_challenge_id, var_challenge_team_id, var_org_sagebionetworks_repo_model_challenge_teamdata_file = "result.txt")
#' result <- api_instance$PutRepoV1ChallengeChallengeIdChallengeTeamChallengeTeamId(var_challenge_id, var_challenge_team_id, var_org_sagebionetworks_repo_model_challenge_team)
#' dput(result)
#'
#'
#' }
#' @importFrom R6 R6Class
#' @importFrom base64enc base64encode
#' @export
ChallengeServicesApi <- R6::R6Class(
  "ChallengeServicesApi",
  public = list(
    api_client = NULL,
    #' Initialize a new ChallengeServicesApi.
    #'
    #' @description
    #' Initialize a new ChallengeServicesApi.
    #'
    #' @param api_client An instance of API client.
    #' @export
    initialize = function(api_client) {
      if (!missing(api_client)) {
        self$api_client <- api_client
      } else {
        self$api_client <- ApiClient$new()
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param challenge_id 
    #' @param ... Other optional arguments
    #' @return void
    #' @export
    DeleteRepoV1ChallengeChallengeId = function(challenge_id, ...) {
      local_var_response <- self$DeleteRepoV1ChallengeChallengeIdWithHttpInfo(challenge_id, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param challenge_id 
    #' @param ... Other optional arguments
    #' @return API response (void) with additional information such as HTTP status code, headers
    #' @export
    DeleteRepoV1ChallengeChallengeIdWithHttpInfo = function(challenge_id, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

      if (missing(`challenge_id`)) {
        stop("Missing required parameter `challenge_id`.")
      }


      local_var_url_path <- "/repo/v1/challenge/{challengeId}"
      if (!missing(`challenge_id`)) {
        local_var_url_path <- gsub("\\{challengeId\\}", URLencode(as.character(`challenge_id`), reserved = TRUE), local_var_url_path)
      }

      # Bearer token
      if (!is.null(self$api_client$bearer_token)) {
        header_params["Authorization"] <- paste("Bearer", self$api_client$bearer_token, sep = " ")
      }

      # The Accept request HTTP header
      local_var_accepts <- list()

      # The Content-Type representation header
      local_var_content_types <- list()

      local_var_resp <- self$api_client$CallApi(url = paste0(self$api_client$base_path, local_var_url_path),
                                 method = "DELETE",
                                 query_params = query_params,
                                 header_params = header_params,
                                 form_params = form_params,
                                 file_params = file_params,
                                 accepts = local_var_accepts,
                                 content_types = local_var_content_types,
                                 body = local_var_body,
                                 is_oauth = is_oauth,
                                 oauth_scopes = oauth_scopes,
                                 ...)

      if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) {
        local_var_resp$content <- NULL
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param challenge_team_id 
    #' @param ... Other optional arguments
    #' @return void
    #' @export
    DeleteRepoV1ChallengeTeamChallengeTeamId = function(challenge_team_id, ...) {
      local_var_response <- self$DeleteRepoV1ChallengeTeamChallengeTeamIdWithHttpInfo(challenge_team_id, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param challenge_team_id 
    #' @param ... Other optional arguments
    #' @return API response (void) with additional information such as HTTP status code, headers
    #' @export
    DeleteRepoV1ChallengeTeamChallengeTeamIdWithHttpInfo = function(challenge_team_id, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

      if (missing(`challenge_team_id`)) {
        stop("Missing required parameter `challenge_team_id`.")
      }


      local_var_url_path <- "/repo/v1/challengeTeam/{challengeTeamId}"
      if (!missing(`challenge_team_id`)) {
        local_var_url_path <- gsub("\\{challengeTeamId\\}", URLencode(as.character(`challenge_team_id`), reserved = TRUE), local_var_url_path)
      }

      # Bearer token
      if (!is.null(self$api_client$bearer_token)) {
        header_params["Authorization"] <- paste("Bearer", self$api_client$bearer_token, sep = " ")
      }

      # The Accept request HTTP header
      local_var_accepts <- list()

      # The Content-Type representation header
      local_var_content_types <- list()

      local_var_resp <- self$api_client$CallApi(url = paste0(self$api_client$base_path, local_var_url_path),
                                 method = "DELETE",
                                 query_params = query_params,
                                 header_params = header_params,
                                 form_params = form_params,
                                 file_params = file_params,
                                 accepts = local_var_accepts,
                                 content_types = local_var_content_types,
                                 body = local_var_body,
                                 is_oauth = is_oauth,
                                 oauth_scopes = oauth_scopes,
                                 ...)

      if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) {
        local_var_resp$content <- NULL
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param participant_id 
    #' @param limit (optional) No description
    #' @param offset (optional) No description
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelChallengePagedResults
    #' @export
    GetRepoV1Challenge = function(participant_id, limit = NULL, offset = NULL, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1ChallengeWithHttpInfo(participant_id, limit, offset, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param participant_id 
    #' @param limit (optional) No description
    #' @param offset (optional) No description
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelChallengePagedResults) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1ChallengeWithHttpInfo = function(participant_id, limit = NULL, offset = NULL, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

      if (missing(`participant_id`)) {
        stop("Missing required parameter `participant_id`.")
      }




      query_params[["participantId"]] <- `participant_id`

      query_params[["limit"]] <- `limit`

      query_params[["offset"]] <- `offset`

      local_var_url_path <- "/repo/v1/challenge"
      # Bearer token
      if (!is.null(self$api_client$bearer_token)) {
        header_params["Authorization"] <- paste("Bearer", self$api_client$bearer_token, sep = " ")
      }

      # The Accept request HTTP header
      local_var_accepts <- list("application/json")

      # The Content-Type representation header
      local_var_content_types <- list()

      local_var_resp <- self$api_client$CallApi(url = paste0(self$api_client$base_path, local_var_url_path),
                                 method = "GET",
                                 query_params = query_params,
                                 header_params = header_params,
                                 form_params = form_params,
                                 file_params = file_params,
                                 accepts = local_var_accepts,
                                 content_types = local_var_content_types,
                                 body = local_var_body,
                                 is_oauth = is_oauth,
                                 oauth_scopes = oauth_scopes,
                                 ...)

      if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) {
        # save response in a file
        if (!is.null(data_file)) {
          write(local_var_resp$response, data_file)
        }

        deserialized_resp_obj <- tryCatch(
          self$api_client$deserialize(local_var_resp$response_as_text(), "OrgSagebionetworksRepoModelChallengePagedResults", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param challenge_id 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelChallenge
    #' @export
    GetRepoV1ChallengeChallengeId = function(challenge_id, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1ChallengeChallengeIdWithHttpInfo(challenge_id, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param challenge_id 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelChallenge) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1ChallengeChallengeIdWithHttpInfo = function(challenge_id, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

      if (missing(`challenge_id`)) {
        stop("Missing required parameter `challenge_id`.")
      }


      local_var_url_path <- "/repo/v1/challenge/{challengeId}"
      if (!missing(`challenge_id`)) {
        local_var_url_path <- gsub("\\{challengeId\\}", URLencode(as.character(`challenge_id`), reserved = TRUE), local_var_url_path)
      }

      # Bearer token
      if (!is.null(self$api_client$bearer_token)) {
        header_params["Authorization"] <- paste("Bearer", self$api_client$bearer_token, sep = " ")
      }

      # The Accept request HTTP header
      local_var_accepts <- list("application/json")

      # The Content-Type representation header
      local_var_content_types <- list()

      local_var_resp <- self$api_client$CallApi(url = paste0(self$api_client$base_path, local_var_url_path),
                                 method = "GET",
                                 query_params = query_params,
                                 header_params = header_params,
                                 form_params = form_params,
                                 file_params = file_params,
                                 accepts = local_var_accepts,
                                 content_types = local_var_content_types,
                                 body = local_var_body,
                                 is_oauth = is_oauth,
                                 oauth_scopes = oauth_scopes,
                                 ...)

      if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) {
        # save response in a file
        if (!is.null(data_file)) {
          write(local_var_resp$response, data_file)
        }

        deserialized_resp_obj <- tryCatch(
          self$api_client$deserialize(local_var_resp$response_as_text(), "OrgSagebionetworksRepoModelChallenge", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param challenge_id 
    #' @param limit (optional) No description
    #' @param offset (optional) No description
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelChallengeTeamPagedResults
    #' @export
    GetRepoV1ChallengeChallengeIdChallengeTeam = function(challenge_id, limit = NULL, offset = NULL, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1ChallengeChallengeIdChallengeTeamWithHttpInfo(challenge_id, limit, offset, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param challenge_id 
    #' @param limit (optional) No description
    #' @param offset (optional) No description
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelChallengeTeamPagedResults) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1ChallengeChallengeIdChallengeTeamWithHttpInfo = function(challenge_id, limit = NULL, offset = NULL, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

      if (missing(`challenge_id`)) {
        stop("Missing required parameter `challenge_id`.")
      }




      query_params[["limit"]] <- `limit`

      query_params[["offset"]] <- `offset`

      local_var_url_path <- "/repo/v1/challenge/{challengeId}/challengeTeam"
      if (!missing(`challenge_id`)) {
        local_var_url_path <- gsub("\\{challengeId\\}", URLencode(as.character(`challenge_id`), reserved = TRUE), local_var_url_path)
      }

      # Bearer token
      if (!is.null(self$api_client$bearer_token)) {
        header_params["Authorization"] <- paste("Bearer", self$api_client$bearer_token, sep = " ")
      }

      # The Accept request HTTP header
      local_var_accepts <- list("application/json")

      # The Content-Type representation header
      local_var_content_types <- list()

      local_var_resp <- self$api_client$CallApi(url = paste0(self$api_client$base_path, local_var_url_path),
                                 method = "GET",
                                 query_params = query_params,
                                 header_params = header_params,
                                 form_params = form_params,
                                 file_params = file_params,
                                 accepts = local_var_accepts,
                                 content_types = local_var_content_types,
                                 body = local_var_body,
                                 is_oauth = is_oauth,
                                 oauth_scopes = oauth_scopes,
                                 ...)

      if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) {
        # save response in a file
        if (!is.null(data_file)) {
          write(local_var_resp$response, data_file)
        }

        deserialized_resp_obj <- tryCatch(
          self$api_client$deserialize(local_var_resp$response_as_text(), "OrgSagebionetworksRepoModelChallengeTeamPagedResults", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param challenge_id 
    #' @param affiliated (optional) If affiliated=true, return just participants affiliated with some   registered Team.  If false, return those not affiliated with any registered Team.    If omitted return all participants.
    #' @param limit (optional) No description
    #' @param offset (optional) No description
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelPaginatedIds
    #' @export
    GetRepoV1ChallengeChallengeIdParticipant = function(challenge_id, affiliated = NULL, limit = NULL, offset = NULL, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1ChallengeChallengeIdParticipantWithHttpInfo(challenge_id, affiliated, limit, offset, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param challenge_id 
    #' @param affiliated (optional) If affiliated=true, return just participants affiliated with some   registered Team.  If false, return those not affiliated with any registered Team.    If omitted return all participants.
    #' @param limit (optional) No description
    #' @param offset (optional) No description
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelPaginatedIds) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1ChallengeChallengeIdParticipantWithHttpInfo = function(challenge_id, affiliated = NULL, limit = NULL, offset = NULL, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

      if (missing(`challenge_id`)) {
        stop("Missing required parameter `challenge_id`.")
      }





      query_params[["affiliated"]] <- `affiliated`

      query_params[["limit"]] <- `limit`

      query_params[["offset"]] <- `offset`

      local_var_url_path <- "/repo/v1/challenge/{challengeId}/participant"
      if (!missing(`challenge_id`)) {
        local_var_url_path <- gsub("\\{challengeId\\}", URLencode(as.character(`challenge_id`), reserved = TRUE), local_var_url_path)
      }

      # Bearer token
      if (!is.null(self$api_client$bearer_token)) {
        header_params["Authorization"] <- paste("Bearer", self$api_client$bearer_token, sep = " ")
      }

      # The Accept request HTTP header
      local_var_accepts <- list("application/json")

      # The Content-Type representation header
      local_var_content_types <- list()

      local_var_resp <- self$api_client$CallApi(url = paste0(self$api_client$base_path, local_var_url_path),
                                 method = "GET",
                                 query_params = query_params,
                                 header_params = header_params,
                                 form_params = form_params,
                                 file_params = file_params,
                                 accepts = local_var_accepts,
                                 content_types = local_var_content_types,
                                 body = local_var_body,
                                 is_oauth = is_oauth,
                                 oauth_scopes = oauth_scopes,
                                 ...)

      if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) {
        # save response in a file
        if (!is.null(data_file)) {
          write(local_var_resp$response, data_file)
        }

        deserialized_resp_obj <- tryCatch(
          self$api_client$deserialize(local_var_resp$response_as_text(), "OrgSagebionetworksRepoModelPaginatedIds", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param challenge_id 
    #' @param limit (optional) No description
    #' @param offset (optional) No description
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelPaginatedIds
    #' @export
    GetRepoV1ChallengeChallengeIdRegistratableTeam = function(challenge_id, limit = NULL, offset = NULL, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1ChallengeChallengeIdRegistratableTeamWithHttpInfo(challenge_id, limit, offset, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param challenge_id 
    #' @param limit (optional) No description
    #' @param offset (optional) No description
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelPaginatedIds) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1ChallengeChallengeIdRegistratableTeamWithHttpInfo = function(challenge_id, limit = NULL, offset = NULL, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

      if (missing(`challenge_id`)) {
        stop("Missing required parameter `challenge_id`.")
      }




      query_params[["limit"]] <- `limit`

      query_params[["offset"]] <- `offset`

      local_var_url_path <- "/repo/v1/challenge/{challengeId}/registratableTeam"
      if (!missing(`challenge_id`)) {
        local_var_url_path <- gsub("\\{challengeId\\}", URLencode(as.character(`challenge_id`), reserved = TRUE), local_var_url_path)
      }

      # Bearer token
      if (!is.null(self$api_client$bearer_token)) {
        header_params["Authorization"] <- paste("Bearer", self$api_client$bearer_token, sep = " ")
      }

      # The Accept request HTTP header
      local_var_accepts <- list("application/json")

      # The Content-Type representation header
      local_var_content_types <- list()

      local_var_resp <- self$api_client$CallApi(url = paste0(self$api_client$base_path, local_var_url_path),
                                 method = "GET",
                                 query_params = query_params,
                                 header_params = header_params,
                                 form_params = form_params,
                                 file_params = file_params,
                                 accepts = local_var_accepts,
                                 content_types = local_var_content_types,
                                 body = local_var_body,
                                 is_oauth = is_oauth,
                                 oauth_scopes = oauth_scopes,
                                 ...)

      if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) {
        # save response in a file
        if (!is.null(data_file)) {
          write(local_var_resp$response, data_file)
        }

        deserialized_resp_obj <- tryCatch(
          self$api_client$deserialize(local_var_resp$response_as_text(), "OrgSagebionetworksRepoModelPaginatedIds", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param challenge_id 
    #' @param limit (optional) No description
    #' @param offset (optional) No description
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelPaginatedIds
    #' @export
    GetRepoV1ChallengeChallengeIdSubmissionTeams = function(challenge_id, limit = NULL, offset = NULL, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1ChallengeChallengeIdSubmissionTeamsWithHttpInfo(challenge_id, limit, offset, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param challenge_id 
    #' @param limit (optional) No description
    #' @param offset (optional) No description
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelPaginatedIds) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1ChallengeChallengeIdSubmissionTeamsWithHttpInfo = function(challenge_id, limit = NULL, offset = NULL, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

      if (missing(`challenge_id`)) {
        stop("Missing required parameter `challenge_id`.")
      }




      query_params[["limit"]] <- `limit`

      query_params[["offset"]] <- `offset`

      local_var_url_path <- "/repo/v1/challenge/{challengeId}/submissionTeams"
      if (!missing(`challenge_id`)) {
        local_var_url_path <- gsub("\\{challengeId\\}", URLencode(as.character(`challenge_id`), reserved = TRUE), local_var_url_path)
      }

      # Bearer token
      if (!is.null(self$api_client$bearer_token)) {
        header_params["Authorization"] <- paste("Bearer", self$api_client$bearer_token, sep = " ")
      }

      # The Accept request HTTP header
      local_var_accepts <- list("application/json")

      # The Content-Type representation header
      local_var_content_types <- list()

      local_var_resp <- self$api_client$CallApi(url = paste0(self$api_client$base_path, local_var_url_path),
                                 method = "GET",
                                 query_params = query_params,
                                 header_params = header_params,
                                 form_params = form_params,
                                 file_params = file_params,
                                 accepts = local_var_accepts,
                                 content_types = local_var_content_types,
                                 body = local_var_body,
                                 is_oauth = is_oauth,
                                 oauth_scopes = oauth_scopes,
                                 ...)

      if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) {
        # save response in a file
        if (!is.null(data_file)) {
          write(local_var_resp$response, data_file)
        }

        deserialized_resp_obj <- tryCatch(
          self$api_client$deserialize(local_var_resp$response_as_text(), "OrgSagebionetworksRepoModelPaginatedIds", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelChallenge
    #' @export
    GetRepoV1EntityIdChallenge = function(id, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1EntityIdChallengeWithHttpInfo(id, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelChallenge) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1EntityIdChallengeWithHttpInfo = function(id, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

      if (missing(`id`)) {
        stop("Missing required parameter `id`.")
      }


      local_var_url_path <- "/repo/v1/entity/{id}/challenge"
      if (!missing(`id`)) {
        local_var_url_path <- gsub("\\{id\\}", URLencode(as.character(`id`), reserved = TRUE), local_var_url_path)
      }

      # Bearer token
      if (!is.null(self$api_client$bearer_token)) {
        header_params["Authorization"] <- paste("Bearer", self$api_client$bearer_token, sep = " ")
      }

      # The Accept request HTTP header
      local_var_accepts <- list("application/json")

      # The Content-Type representation header
      local_var_content_types <- list()

      local_var_resp <- self$api_client$CallApi(url = paste0(self$api_client$base_path, local_var_url_path),
                                 method = "GET",
                                 query_params = query_params,
                                 header_params = header_params,
                                 form_params = form_params,
                                 file_params = file_params,
                                 accepts = local_var_accepts,
                                 content_types = local_var_content_types,
                                 body = local_var_body,
                                 is_oauth = is_oauth,
                                 oauth_scopes = oauth_scopes,
                                 ...)

      if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) {
        # save response in a file
        if (!is.null(data_file)) {
          write(local_var_resp$response, data_file)
        }

        deserialized_resp_obj <- tryCatch(
          self$api_client$deserialize(local_var_resp$response_as_text(), "OrgSagebionetworksRepoModelChallenge", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param org_sagebionetworks_repo_model_challenge 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelChallenge
    #' @export
    PostRepoV1Challenge = function(org_sagebionetworks_repo_model_challenge, data_file = NULL, ...) {
      local_var_response <- self$PostRepoV1ChallengeWithHttpInfo(org_sagebionetworks_repo_model_challenge, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param org_sagebionetworks_repo_model_challenge 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelChallenge) with additional information such as HTTP status code, headers
    #' @export
    PostRepoV1ChallengeWithHttpInfo = function(org_sagebionetworks_repo_model_challenge, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

      if (missing(`org_sagebionetworks_repo_model_challenge`)) {
        stop("Missing required parameter `org_sagebionetworks_repo_model_challenge`.")
      }


      if (!is.null(`org_sagebionetworks_repo_model_challenge`)) {
        local_var_body <- `org_sagebionetworks_repo_model_challenge`$toJSONString()
      } else {
        body <- NULL
      }

      local_var_url_path <- "/repo/v1/challenge"
      # Bearer token
      if (!is.null(self$api_client$bearer_token)) {
        header_params["Authorization"] <- paste("Bearer", self$api_client$bearer_token, sep = " ")
      }

      # The Accept request HTTP header
      local_var_accepts <- list("application/json")

      # The Content-Type representation header
      local_var_content_types <- list("application/json")

      local_var_resp <- self$api_client$CallApi(url = paste0(self$api_client$base_path, local_var_url_path),
                                 method = "POST",
                                 query_params = query_params,
                                 header_params = header_params,
                                 form_params = form_params,
                                 file_params = file_params,
                                 accepts = local_var_accepts,
                                 content_types = local_var_content_types,
                                 body = local_var_body,
                                 is_oauth = is_oauth,
                                 oauth_scopes = oauth_scopes,
                                 ...)

      if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) {
        # save response in a file
        if (!is.null(data_file)) {
          write(local_var_resp$response, data_file)
        }

        deserialized_resp_obj <- tryCatch(
          self$api_client$deserialize(local_var_resp$response_as_text(), "OrgSagebionetworksRepoModelChallenge", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param challenge_id 
    #' @param org_sagebionetworks_repo_model_challenge_team 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelChallengeTeam
    #' @export
    PostRepoV1ChallengeChallengeIdChallengeTeam = function(challenge_id, org_sagebionetworks_repo_model_challenge_team, data_file = NULL, ...) {
      local_var_response <- self$PostRepoV1ChallengeChallengeIdChallengeTeamWithHttpInfo(challenge_id, org_sagebionetworks_repo_model_challenge_team, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param challenge_id 
    #' @param org_sagebionetworks_repo_model_challenge_team 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelChallengeTeam) with additional information such as HTTP status code, headers
    #' @export
    PostRepoV1ChallengeChallengeIdChallengeTeamWithHttpInfo = function(challenge_id, org_sagebionetworks_repo_model_challenge_team, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

      if (missing(`challenge_id`)) {
        stop("Missing required parameter `challenge_id`.")
      }

      if (missing(`org_sagebionetworks_repo_model_challenge_team`)) {
        stop("Missing required parameter `org_sagebionetworks_repo_model_challenge_team`.")
      }



      if (!is.null(`org_sagebionetworks_repo_model_challenge_team`)) {
        local_var_body <- `org_sagebionetworks_repo_model_challenge_team`$toJSONString()
      } else {
        body <- NULL
      }

      local_var_url_path <- "/repo/v1/challenge/{challengeId}/challengeTeam"
      if (!missing(`challenge_id`)) {
        local_var_url_path <- gsub("\\{challengeId\\}", URLencode(as.character(`challenge_id`), reserved = TRUE), local_var_url_path)
      }

      # Bearer token
      if (!is.null(self$api_client$bearer_token)) {
        header_params["Authorization"] <- paste("Bearer", self$api_client$bearer_token, sep = " ")
      }

      # The Accept request HTTP header
      local_var_accepts <- list("application/json")

      # The Content-Type representation header
      local_var_content_types <- list("application/json")

      local_var_resp <- self$api_client$CallApi(url = paste0(self$api_client$base_path, local_var_url_path),
                                 method = "POST",
                                 query_params = query_params,
                                 header_params = header_params,
                                 form_params = form_params,
                                 file_params = file_params,
                                 accepts = local_var_accepts,
                                 content_types = local_var_content_types,
                                 body = local_var_body,
                                 is_oauth = is_oauth,
                                 oauth_scopes = oauth_scopes,
                                 ...)

      if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) {
        # save response in a file
        if (!is.null(data_file)) {
          write(local_var_resp$response, data_file)
        }

        deserialized_resp_obj <- tryCatch(
          self$api_client$deserialize(local_var_resp$response_as_text(), "OrgSagebionetworksRepoModelChallengeTeam", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param challenge_id 
    #' @param org_sagebionetworks_repo_model_challenge 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelChallenge
    #' @export
    PutRepoV1ChallengeChallengeId = function(challenge_id, org_sagebionetworks_repo_model_challenge, data_file = NULL, ...) {
      local_var_response <- self$PutRepoV1ChallengeChallengeIdWithHttpInfo(challenge_id, org_sagebionetworks_repo_model_challenge, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param challenge_id 
    #' @param org_sagebionetworks_repo_model_challenge 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelChallenge) with additional information such as HTTP status code, headers
    #' @export
    PutRepoV1ChallengeChallengeIdWithHttpInfo = function(challenge_id, org_sagebionetworks_repo_model_challenge, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

      if (missing(`challenge_id`)) {
        stop("Missing required parameter `challenge_id`.")
      }

      if (missing(`org_sagebionetworks_repo_model_challenge`)) {
        stop("Missing required parameter `org_sagebionetworks_repo_model_challenge`.")
      }



      if (!is.null(`org_sagebionetworks_repo_model_challenge`)) {
        local_var_body <- `org_sagebionetworks_repo_model_challenge`$toJSONString()
      } else {
        body <- NULL
      }

      local_var_url_path <- "/repo/v1/challenge/{challengeId}"
      if (!missing(`challenge_id`)) {
        local_var_url_path <- gsub("\\{challengeId\\}", URLencode(as.character(`challenge_id`), reserved = TRUE), local_var_url_path)
      }

      # Bearer token
      if (!is.null(self$api_client$bearer_token)) {
        header_params["Authorization"] <- paste("Bearer", self$api_client$bearer_token, sep = " ")
      }

      # The Accept request HTTP header
      local_var_accepts <- list("application/json")

      # The Content-Type representation header
      local_var_content_types <- list("application/json")

      local_var_resp <- self$api_client$CallApi(url = paste0(self$api_client$base_path, local_var_url_path),
                                 method = "PUT",
                                 query_params = query_params,
                                 header_params = header_params,
                                 form_params = form_params,
                                 file_params = file_params,
                                 accepts = local_var_accepts,
                                 content_types = local_var_content_types,
                                 body = local_var_body,
                                 is_oauth = is_oauth,
                                 oauth_scopes = oauth_scopes,
                                 ...)

      if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) {
        # save response in a file
        if (!is.null(data_file)) {
          write(local_var_resp$response, data_file)
        }

        deserialized_resp_obj <- tryCatch(
          self$api_client$deserialize(local_var_resp$response_as_text(), "OrgSagebionetworksRepoModelChallenge", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param challenge_id 
    #' @param challenge_team_id 
    #' @param org_sagebionetworks_repo_model_challenge_team 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelChallengeTeam
    #' @export
    PutRepoV1ChallengeChallengeIdChallengeTeamChallengeTeamId = function(challenge_id, challenge_team_id, org_sagebionetworks_repo_model_challenge_team, data_file = NULL, ...) {
      local_var_response <- self$PutRepoV1ChallengeChallengeIdChallengeTeamChallengeTeamIdWithHttpInfo(challenge_id, challenge_team_id, org_sagebionetworks_repo_model_challenge_team, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param challenge_id 
    #' @param challenge_team_id 
    #' @param org_sagebionetworks_repo_model_challenge_team 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelChallengeTeam) with additional information such as HTTP status code, headers
    #' @export
    PutRepoV1ChallengeChallengeIdChallengeTeamChallengeTeamIdWithHttpInfo = function(challenge_id, challenge_team_id, org_sagebionetworks_repo_model_challenge_team, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

      if (missing(`challenge_id`)) {
        stop("Missing required parameter `challenge_id`.")
      }

      if (missing(`challenge_team_id`)) {
        stop("Missing required parameter `challenge_team_id`.")
      }

      if (missing(`org_sagebionetworks_repo_model_challenge_team`)) {
        stop("Missing required parameter `org_sagebionetworks_repo_model_challenge_team`.")
      }




      if (!is.null(`org_sagebionetworks_repo_model_challenge_team`)) {
        local_var_body <- `org_sagebionetworks_repo_model_challenge_team`$toJSONString()
      } else {
        body <- NULL
      }

      local_var_url_path <- "/repo/v1/challenge/{challengeId}/challengeTeam/{challengeTeamId}"
      if (!missing(`challenge_id`)) {
        local_var_url_path <- gsub("\\{challengeId\\}", URLencode(as.character(`challenge_id`), reserved = TRUE), local_var_url_path)
      }

      if (!missing(`challenge_team_id`)) {
        local_var_url_path <- gsub("\\{challengeTeamId\\}", URLencode(as.character(`challenge_team_id`), reserved = TRUE), local_var_url_path)
      }

      # Bearer token
      if (!is.null(self$api_client$bearer_token)) {
        header_params["Authorization"] <- paste("Bearer", self$api_client$bearer_token, sep = " ")
      }

      # The Accept request HTTP header
      local_var_accepts <- list("application/json")

      # The Content-Type representation header
      local_var_content_types <- list("application/json")

      local_var_resp <- self$api_client$CallApi(url = paste0(self$api_client$base_path, local_var_url_path),
                                 method = "PUT",
                                 query_params = query_params,
                                 header_params = header_params,
                                 form_params = form_params,
                                 file_params = file_params,
                                 accepts = local_var_accepts,
                                 content_types = local_var_content_types,
                                 body = local_var_body,
                                 is_oauth = is_oauth,
                                 oauth_scopes = oauth_scopes,
                                 ...)

      if (local_var_resp$status_code >= 200 && local_var_resp$status_code <= 299) {
        # save response in a file
        if (!is.null(data_file)) {
          write(local_var_resp$response, data_file)
        }

        deserialized_resp_obj <- tryCatch(
          self$api_client$deserialize(local_var_resp$response_as_text(), "OrgSagebionetworksRepoModelChallengeTeam", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    }
  )
)
thomasyu888/synr-sdk-client documentation built on Dec. 31, 2024, 11:29 a.m.