R/data_access_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 DataAccessServices operations
#' @description DataAccessServicesApi
#' @format An \code{R6Class} generator object
#' @field api_client Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ DeleteRepoV1DataAccessSubmissionSubmissionId } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } submission_id character
#'
#'
#' \item status code : 200 | Void
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1AccessRequirementRequirementIdDataAccessRequestForUpdate } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } requirement_id character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelDataaccessRequestInterface} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelDataaccessRequestInterface
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1AccessRequirementRequirementIdResearchProjectForUpdate } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } requirement_id character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelDataaccessResearchProject} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelDataaccessResearchProject
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1AccessRequirementRequirementIdStatus } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } requirement_id character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelDataaccessAccessRequirementStatus} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelDataaccessAccessRequirementStatus
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1DataAccessSubmissionOpenSubmissions } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } next_page_token character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelDataaccessOpenSubmissionPage} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelDataaccessOpenSubmissionPage
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1DataAccessSubmissionSubmissionId } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } submission_id character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelDataaccessSubmission} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelDataaccessSubmission
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PostRepoV1AccessRequirementRequirementIdApprovedSubmissionInfo } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } requirement_id character
#' \item \emph{ @param } org_sagebionetworks_repo_model_dataaccess_submission_info_page_request \link{OrgSagebionetworksRepoModelDataaccessSubmissionInfoPageRequest}
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelDataaccessSubmissionInfoPage} \cr
#'
#'
#' \item status code : 200 | in order of modifiedOn, ascending
#'
#' \item return type : OrgSagebionetworksRepoModelDataaccessSubmissionInfoPage
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PostRepoV1AccessRequirementRequirementIdSubmissions } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } requirement_id character
#' \item \emph{ @param } org_sagebionetworks_repo_model_dataaccess_submission_page_request \link{OrgSagebionetworksRepoModelDataaccessSubmissionPageRequest}
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelDataaccessSubmissionPage} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelDataaccessSubmissionPage
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PostRepoV1DataAccessRequest } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } org_sagebionetworks_repo_model_dataaccess_request_interface \link{OrgSagebionetworksRepoModelDataaccessRequestInterface}
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelDataaccessRequestInterface} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelDataaccessRequestInterface
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PostRepoV1DataAccessRequestRequestIdSubmission } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } request_id character
#' \item \emph{ @param } org_sagebionetworks_repo_model_dataaccess_create_submission_request \link{OrgSagebionetworksRepoModelDataaccessCreateSubmissionRequest}
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelDataaccessSubmissionStatus} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelDataaccessSubmissionStatus
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PostRepoV1DataAccessSubmissionSearch } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } org_sagebionetworks_repo_model_dataaccess_submission_search_request \link{OrgSagebionetworksRepoModelDataaccessSubmissionSearchRequest}
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelDataaccessSubmissionSearchResponse} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelDataaccessSubmissionSearchResponse
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PostRepoV1ResearchProject } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } org_sagebionetworks_repo_model_dataaccess_research_project \link{OrgSagebionetworksRepoModelDataaccessResearchProject}
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelDataaccessResearchProject} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelDataaccessResearchProject
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PostRepoV1RestrictionInformation } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } org_sagebionetworks_repo_model_restriction_information_request \link{OrgSagebionetworksRepoModelRestrictionInformationRequest}
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelRestrictionInformationResponse} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelRestrictionInformationResponse
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PutRepoV1DataAccessSubmissionSubmissionId } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } submission_id character
#' \item \emph{ @param } org_sagebionetworks_repo_model_dataaccess_submission_state_change_request \link{OrgSagebionetworksRepoModelDataaccessSubmissionStateChangeRequest}
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelDataaccessSubmission} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelDataaccessSubmission
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PutRepoV1DataAccessSubmissionSubmissionIdCancellation } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } submission_id character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelDataaccessSubmissionStatus} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelDataaccessSubmissionStatus
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' ####################  DeleteRepoV1DataAccessSubmissionSubmissionId  ####################
#'
#' library(synclient)
#' var_submission_id <- "submission_id_example" # character | 
#'
#' api_instance <- DataAccessServicesApi$new()
#'
#' # Configure HTTP bearer authorization: bearerAuth
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
#'
#' api_instance$DeleteRepoV1DataAccessSubmissionSubmissionId(var_submission_id)
#'
#'
#' ####################  GetRepoV1AccessRequirementRequirementIdDataAccessRequestForUpdate  ####################
#'
#' library(synclient)
#' var_requirement_id <- "requirement_id_example" # character | 
#'
#' api_instance <- DataAccessServicesApi$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$GetRepoV1AccessRequirementRequirementIdDataAccessRequestForUpdate(var_requirement_iddata_file = "result.txt")
#' result <- api_instance$GetRepoV1AccessRequirementRequirementIdDataAccessRequestForUpdate(var_requirement_id)
#' dput(result)
#'
#'
#' ####################  GetRepoV1AccessRequirementRequirementIdResearchProjectForUpdate  ####################
#'
#' library(synclient)
#' var_requirement_id <- "requirement_id_example" # character | 
#'
#' api_instance <- DataAccessServicesApi$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$GetRepoV1AccessRequirementRequirementIdResearchProjectForUpdate(var_requirement_iddata_file = "result.txt")
#' result <- api_instance$GetRepoV1AccessRequirementRequirementIdResearchProjectForUpdate(var_requirement_id)
#' dput(result)
#'
#'
#' ####################  GetRepoV1AccessRequirementRequirementIdStatus  ####################
#'
#' library(synclient)
#' var_requirement_id <- "requirement_id_example" # character | 
#'
#' api_instance <- DataAccessServicesApi$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$GetRepoV1AccessRequirementRequirementIdStatus(var_requirement_iddata_file = "result.txt")
#' result <- api_instance$GetRepoV1AccessRequirementRequirementIdStatus(var_requirement_id)
#' dput(result)
#'
#'
#' ####################  GetRepoV1DataAccessSubmissionOpenSubmissions  ####################
#'
#' library(synclient)
#' var_next_page_token <- "next_page_token_example" # character |  (Optional)
#'
#' api_instance <- DataAccessServicesApi$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$GetRepoV1DataAccessSubmissionOpenSubmissions(next_page_token = var_next_page_tokendata_file = "result.txt")
#' result <- api_instance$GetRepoV1DataAccessSubmissionOpenSubmissions(next_page_token = var_next_page_token)
#' dput(result)
#'
#'
#' ####################  GetRepoV1DataAccessSubmissionSubmissionId  ####################
#'
#' library(synclient)
#' var_submission_id <- "submission_id_example" # character | 
#'
#' api_instance <- DataAccessServicesApi$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$GetRepoV1DataAccessSubmissionSubmissionId(var_submission_iddata_file = "result.txt")
#' result <- api_instance$GetRepoV1DataAccessSubmissionSubmissionId(var_submission_id)
#' dput(result)
#'
#'
#' ####################  PostRepoV1AccessRequirementRequirementIdApprovedSubmissionInfo  ####################
#'
#' library(synclient)
#' var_requirement_id <- "requirement_id_example" # character | 
#' var_org_sagebionetworks_repo_model_dataaccess_submission_info_page_request <- org.sagebionetworks.repo.model.dataaccess.SubmissionInfoPageRequest$new("accessRequirementId_example", "nextPageToken_example") # OrgSagebionetworksRepoModelDataaccessSubmissionInfoPageRequest | 
#'
#' api_instance <- DataAccessServicesApi$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$PostRepoV1AccessRequirementRequirementIdApprovedSubmissionInfo(var_requirement_id, var_org_sagebionetworks_repo_model_dataaccess_submission_info_page_requestdata_file = "result.txt")
#' result <- api_instance$PostRepoV1AccessRequirementRequirementIdApprovedSubmissionInfo(var_requirement_id, var_org_sagebionetworks_repo_model_dataaccess_submission_info_page_request)
#' dput(result)
#'
#'
#' ####################  PostRepoV1AccessRequirementRequirementIdSubmissions  ####################
#'
#' library(synclient)
#' var_requirement_id <- "requirement_id_example" # character | 
#' var_org_sagebionetworks_repo_model_dataaccess_submission_page_request <- org.sagebionetworks.repo.model.dataaccess.SubmissionPageRequest$new("accessRequirementId_example", "nextPageToken_example", "filterBy_example", "accessorId_example", "orderBy_example", "isAscending_example") # OrgSagebionetworksRepoModelDataaccessSubmissionPageRequest | 
#'
#' api_instance <- DataAccessServicesApi$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$PostRepoV1AccessRequirementRequirementIdSubmissions(var_requirement_id, var_org_sagebionetworks_repo_model_dataaccess_submission_page_requestdata_file = "result.txt")
#' result <- api_instance$PostRepoV1AccessRequirementRequirementIdSubmissions(var_requirement_id, var_org_sagebionetworks_repo_model_dataaccess_submission_page_request)
#' dput(result)
#'
#'
#' ####################  PostRepoV1DataAccessRequest  ####################
#'
#' library(synclient)
#' var_org_sagebionetworks_repo_model_dataaccess_request_interface <- org.sagebionetworks.repo.model.dataaccess.RequestInterface$new("id_example", "accessRequirementId_example", "researchProjectId_example", "createdOn_example", "modifiedOn_example", "createdBy_example", "modifiedBy_example", "ducFileHandleId_example", "irbFileHandleId_example", c("attachments_example"), c(org.sagebionetworks.repo.model.dataaccess.AccessorChange$new("userId_example", "type_example")), "etag_example", "concreteType_example", "publication_example", "summaryOfUse_example") # OrgSagebionetworksRepoModelDataaccessRequestInterface | 
#'
#' api_instance <- DataAccessServicesApi$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$PostRepoV1DataAccessRequest(var_org_sagebionetworks_repo_model_dataaccess_request_interfacedata_file = "result.txt")
#' result <- api_instance$PostRepoV1DataAccessRequest(var_org_sagebionetworks_repo_model_dataaccess_request_interface)
#' dput(result)
#'
#'
#' ####################  PostRepoV1DataAccessRequestRequestIdSubmission  ####################
#'
#' library(synclient)
#' var_request_id <- "request_id_example" # character | - The ID of the request object.
#' var_org_sagebionetworks_repo_model_dataaccess_create_submission_request <- org.sagebionetworks.repo.model.dataaccess.CreateSubmissionRequest$new("requestId_example", "requestEtag_example", "subjectId_example", "subjectType_example") # OrgSagebionetworksRepoModelDataaccessCreateSubmissionRequest | 
#'
#' api_instance <- DataAccessServicesApi$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$PostRepoV1DataAccessRequestRequestIdSubmission(var_request_id, var_org_sagebionetworks_repo_model_dataaccess_create_submission_requestdata_file = "result.txt")
#' result <- api_instance$PostRepoV1DataAccessRequestRequestIdSubmission(var_request_id, var_org_sagebionetworks_repo_model_dataaccess_create_submission_request)
#' dput(result)
#'
#'
#' ####################  PostRepoV1DataAccessSubmissionSearch  ####################
#'
#' library(synclient)
#' var_org_sagebionetworks_repo_model_dataaccess_submission_search_request <- org.sagebionetworks.repo.model.dataaccess.SubmissionSearchRequest$new("accessorId_example", "accessRequirementId_example", "submissionState_example", "reviewerId_example", "reviewerFilterType_example", c(org.sagebionetworks.repo.model.dataaccess.SubmissionSearchSort$new("field_example", "direction_example")), "nextPageToken_example") # OrgSagebionetworksRepoModelDataaccessSubmissionSearchRequest | 
#'
#' api_instance <- DataAccessServicesApi$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$PostRepoV1DataAccessSubmissionSearch(var_org_sagebionetworks_repo_model_dataaccess_submission_search_requestdata_file = "result.txt")
#' result <- api_instance$PostRepoV1DataAccessSubmissionSearch(var_org_sagebionetworks_repo_model_dataaccess_submission_search_request)
#' dput(result)
#'
#'
#' ####################  PostRepoV1ResearchProject  ####################
#'
#' library(synclient)
#' var_org_sagebionetworks_repo_model_dataaccess_research_project <- org.sagebionetworks.repo.model.dataaccess.ResearchProject$new("id_example", "accessRequirementId_example", "institution_example", "projectLead_example", "intendedDataUseStatement_example", "createdOn_example", "modifiedOn_example", "createdBy_example", "modifiedBy_example", "etag_example") # OrgSagebionetworksRepoModelDataaccessResearchProject | 
#'
#' api_instance <- DataAccessServicesApi$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$PostRepoV1ResearchProject(var_org_sagebionetworks_repo_model_dataaccess_research_projectdata_file = "result.txt")
#' result <- api_instance$PostRepoV1ResearchProject(var_org_sagebionetworks_repo_model_dataaccess_research_project)
#' dput(result)
#'
#'
#' ####################  PostRepoV1RestrictionInformation  ####################
#'
#' library(synclient)
#' var_org_sagebionetworks_repo_model_restriction_information_request <- org.sagebionetworks.repo.model.RestrictionInformationRequest$new("restrictableObjectType_example", "objectId_example") # OrgSagebionetworksRepoModelRestrictionInformationRequest | 
#'
#' api_instance <- DataAccessServicesApi$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$PostRepoV1RestrictionInformation(var_org_sagebionetworks_repo_model_restriction_information_requestdata_file = "result.txt")
#' result <- api_instance$PostRepoV1RestrictionInformation(var_org_sagebionetworks_repo_model_restriction_information_request)
#' dput(result)
#'
#'
#' ####################  PutRepoV1DataAccessSubmissionSubmissionId  ####################
#'
#' library(synclient)
#' var_submission_id <- "submission_id_example" # character | 
#' var_org_sagebionetworks_repo_model_dataaccess_submission_state_change_request <- org.sagebionetworks.repo.model.dataaccess.SubmissionStateChangeRequest$new("submissionId_example", "newState_example", "rejectedReason_example") # OrgSagebionetworksRepoModelDataaccessSubmissionStateChangeRequest | 
#'
#' api_instance <- DataAccessServicesApi$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$PutRepoV1DataAccessSubmissionSubmissionId(var_submission_id, var_org_sagebionetworks_repo_model_dataaccess_submission_state_change_requestdata_file = "result.txt")
#' result <- api_instance$PutRepoV1DataAccessSubmissionSubmissionId(var_submission_id, var_org_sagebionetworks_repo_model_dataaccess_submission_state_change_request)
#' dput(result)
#'
#'
#' ####################  PutRepoV1DataAccessSubmissionSubmissionIdCancellation  ####################
#'
#' library(synclient)
#' var_submission_id <- "submission_id_example" # character | - The ID of the submission to cancel.
#'
#' api_instance <- DataAccessServicesApi$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$PutRepoV1DataAccessSubmissionSubmissionIdCancellation(var_submission_iddata_file = "result.txt")
#' result <- api_instance$PutRepoV1DataAccessSubmissionSubmissionIdCancellation(var_submission_id)
#' dput(result)
#'
#'
#' }
#' @importFrom R6 R6Class
#' @importFrom base64enc base64encode
#' @export
DataAccessServicesApi <- R6::R6Class(
  "DataAccessServicesApi",
  public = list(
    api_client = NULL,
    #' Initialize a new DataAccessServicesApi.
    #'
    #' @description
    #' Initialize a new DataAccessServicesApi.
    #'
    #' @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 submission_id 
    #' @param ... Other optional arguments
    #' @return void
    #' @export
    DeleteRepoV1DataAccessSubmissionSubmissionId = function(submission_id, ...) {
      local_var_response <- self$DeleteRepoV1DataAccessSubmissionSubmissionIdWithHttpInfo(submission_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 submission_id 
    #' @param ... Other optional arguments
    #' @return API response (void) with additional information such as HTTP status code, headers
    #' @export
    DeleteRepoV1DataAccessSubmissionSubmissionIdWithHttpInfo = function(submission_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(`submission_id`)) {
        stop("Missing required parameter `submission_id`.")
      }


      local_var_url_path <- "/repo/v1/dataAccessSubmission/{submissionId}"
      if (!missing(`submission_id`)) {
        local_var_url_path <- gsub("\\{submissionId\\}", URLencode(as.character(`submission_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 requirement_id 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelDataaccessRequestInterface
    #' @export
    GetRepoV1AccessRequirementRequirementIdDataAccessRequestForUpdate = function(requirement_id, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1AccessRequirementRequirementIdDataAccessRequestForUpdateWithHttpInfo(requirement_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 requirement_id 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelDataaccessRequestInterface) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1AccessRequirementRequirementIdDataAccessRequestForUpdateWithHttpInfo = function(requirement_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(`requirement_id`)) {
        stop("Missing required parameter `requirement_id`.")
      }


      local_var_url_path <- "/repo/v1/accessRequirement/{requirementId}/dataAccessRequestForUpdate"
      if (!missing(`requirement_id`)) {
        local_var_url_path <- gsub("\\{requirementId\\}", URLencode(as.character(`requirement_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(), "OrgSagebionetworksRepoModelDataaccessRequestInterface", 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 requirement_id 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelDataaccessResearchProject
    #' @export
    GetRepoV1AccessRequirementRequirementIdResearchProjectForUpdate = function(requirement_id, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1AccessRequirementRequirementIdResearchProjectForUpdateWithHttpInfo(requirement_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 requirement_id 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelDataaccessResearchProject) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1AccessRequirementRequirementIdResearchProjectForUpdateWithHttpInfo = function(requirement_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(`requirement_id`)) {
        stop("Missing required parameter `requirement_id`.")
      }


      local_var_url_path <- "/repo/v1/accessRequirement/{requirementId}/researchProjectForUpdate"
      if (!missing(`requirement_id`)) {
        local_var_url_path <- gsub("\\{requirementId\\}", URLencode(as.character(`requirement_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(), "OrgSagebionetworksRepoModelDataaccessResearchProject", 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 requirement_id 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelDataaccessAccessRequirementStatus
    #' @export
    GetRepoV1AccessRequirementRequirementIdStatus = function(requirement_id, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1AccessRequirementRequirementIdStatusWithHttpInfo(requirement_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 requirement_id 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelDataaccessAccessRequirementStatus) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1AccessRequirementRequirementIdStatusWithHttpInfo = function(requirement_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(`requirement_id`)) {
        stop("Missing required parameter `requirement_id`.")
      }


      local_var_url_path <- "/repo/v1/accessRequirement/{requirementId}/status"
      if (!missing(`requirement_id`)) {
        local_var_url_path <- gsub("\\{requirementId\\}", URLencode(as.character(`requirement_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(), "OrgSagebionetworksRepoModelDataaccessAccessRequirementStatus", 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 next_page_token (optional) No description
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelDataaccessOpenSubmissionPage
    #' @export
    GetRepoV1DataAccessSubmissionOpenSubmissions = function(next_page_token = NULL, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1DataAccessSubmissionOpenSubmissionsWithHttpInfo(next_page_token, 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 next_page_token (optional) No description
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelDataaccessOpenSubmissionPage) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1DataAccessSubmissionOpenSubmissionsWithHttpInfo = function(next_page_token = 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


      query_params[["nextPageToken"]] <- `next_page_token`

      local_var_url_path <- "/repo/v1/dataAccessSubmission/openSubmissions"
      # 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(), "OrgSagebionetworksRepoModelDataaccessOpenSubmissionPage", 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 submission_id 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelDataaccessSubmission
    #' @export
    GetRepoV1DataAccessSubmissionSubmissionId = function(submission_id, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1DataAccessSubmissionSubmissionIdWithHttpInfo(submission_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 submission_id 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelDataaccessSubmission) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1DataAccessSubmissionSubmissionIdWithHttpInfo = function(submission_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(`submission_id`)) {
        stop("Missing required parameter `submission_id`.")
      }


      local_var_url_path <- "/repo/v1/dataAccessSubmission/{submissionId}"
      if (!missing(`submission_id`)) {
        local_var_url_path <- gsub("\\{submissionId\\}", URLencode(as.character(`submission_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(), "OrgSagebionetworksRepoModelDataaccessSubmission", 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 requirement_id 
    #' @param org_sagebionetworks_repo_model_dataaccess_submission_info_page_request 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelDataaccessSubmissionInfoPage
    #' @export
    PostRepoV1AccessRequirementRequirementIdApprovedSubmissionInfo = function(requirement_id, org_sagebionetworks_repo_model_dataaccess_submission_info_page_request, data_file = NULL, ...) {
      local_var_response <- self$PostRepoV1AccessRequirementRequirementIdApprovedSubmissionInfoWithHttpInfo(requirement_id, org_sagebionetworks_repo_model_dataaccess_submission_info_page_request, 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 requirement_id 
    #' @param org_sagebionetworks_repo_model_dataaccess_submission_info_page_request 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelDataaccessSubmissionInfoPage) with additional information such as HTTP status code, headers
    #' @export
    PostRepoV1AccessRequirementRequirementIdApprovedSubmissionInfoWithHttpInfo = function(requirement_id, org_sagebionetworks_repo_model_dataaccess_submission_info_page_request, 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(`requirement_id`)) {
        stop("Missing required parameter `requirement_id`.")
      }

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



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

      local_var_url_path <- "/repo/v1/accessRequirement/{requirementId}/approvedSubmissionInfo"
      if (!missing(`requirement_id`)) {
        local_var_url_path <- gsub("\\{requirementId\\}", URLencode(as.character(`requirement_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(), "OrgSagebionetworksRepoModelDataaccessSubmissionInfoPage", 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 requirement_id 
    #' @param org_sagebionetworks_repo_model_dataaccess_submission_page_request 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelDataaccessSubmissionPage
    #' @export
    PostRepoV1AccessRequirementRequirementIdSubmissions = function(requirement_id, org_sagebionetworks_repo_model_dataaccess_submission_page_request, data_file = NULL, ...) {
      local_var_response <- self$PostRepoV1AccessRequirementRequirementIdSubmissionsWithHttpInfo(requirement_id, org_sagebionetworks_repo_model_dataaccess_submission_page_request, 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 requirement_id 
    #' @param org_sagebionetworks_repo_model_dataaccess_submission_page_request 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelDataaccessSubmissionPage) with additional information such as HTTP status code, headers
    #' @export
    PostRepoV1AccessRequirementRequirementIdSubmissionsWithHttpInfo = function(requirement_id, org_sagebionetworks_repo_model_dataaccess_submission_page_request, 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(`requirement_id`)) {
        stop("Missing required parameter `requirement_id`.")
      }

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



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

      local_var_url_path <- "/repo/v1/accessRequirement/{requirementId}/submissions"
      if (!missing(`requirement_id`)) {
        local_var_url_path <- gsub("\\{requirementId\\}", URLencode(as.character(`requirement_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(), "OrgSagebionetworksRepoModelDataaccessSubmissionPage", 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_dataaccess_request_interface 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelDataaccessRequestInterface
    #' @export
    PostRepoV1DataAccessRequest = function(org_sagebionetworks_repo_model_dataaccess_request_interface, data_file = NULL, ...) {
      local_var_response <- self$PostRepoV1DataAccessRequestWithHttpInfo(org_sagebionetworks_repo_model_dataaccess_request_interface, 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_dataaccess_request_interface 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelDataaccessRequestInterface) with additional information such as HTTP status code, headers
    #' @export
    PostRepoV1DataAccessRequestWithHttpInfo = function(org_sagebionetworks_repo_model_dataaccess_request_interface, 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_dataaccess_request_interface`)) {
        stop("Missing required parameter `org_sagebionetworks_repo_model_dataaccess_request_interface`.")
      }


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

      local_var_url_path <- "/repo/v1/dataAccessRequest"
      # 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(), "OrgSagebionetworksRepoModelDataaccessRequestInterface", 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 request_id - The ID of the request object.
    #' @param org_sagebionetworks_repo_model_dataaccess_create_submission_request 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelDataaccessSubmissionStatus
    #' @export
    PostRepoV1DataAccessRequestRequestIdSubmission = function(request_id, org_sagebionetworks_repo_model_dataaccess_create_submission_request, data_file = NULL, ...) {
      local_var_response <- self$PostRepoV1DataAccessRequestRequestIdSubmissionWithHttpInfo(request_id, org_sagebionetworks_repo_model_dataaccess_create_submission_request, 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 request_id - The ID of the request object.
    #' @param org_sagebionetworks_repo_model_dataaccess_create_submission_request 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelDataaccessSubmissionStatus) with additional information such as HTTP status code, headers
    #' @export
    PostRepoV1DataAccessRequestRequestIdSubmissionWithHttpInfo = function(request_id, org_sagebionetworks_repo_model_dataaccess_create_submission_request, 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(`request_id`)) {
        stop("Missing required parameter `request_id`.")
      }

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



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

      local_var_url_path <- "/repo/v1/dataAccessRequest/{requestId}/submission"
      if (!missing(`request_id`)) {
        local_var_url_path <- gsub("\\{requestId\\}", URLencode(as.character(`request_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(), "OrgSagebionetworksRepoModelDataaccessSubmissionStatus", 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_dataaccess_submission_search_request 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelDataaccessSubmissionSearchResponse
    #' @export
    PostRepoV1DataAccessSubmissionSearch = function(org_sagebionetworks_repo_model_dataaccess_submission_search_request, data_file = NULL, ...) {
      local_var_response <- self$PostRepoV1DataAccessSubmissionSearchWithHttpInfo(org_sagebionetworks_repo_model_dataaccess_submission_search_request, 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_dataaccess_submission_search_request 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelDataaccessSubmissionSearchResponse) with additional information such as HTTP status code, headers
    #' @export
    PostRepoV1DataAccessSubmissionSearchWithHttpInfo = function(org_sagebionetworks_repo_model_dataaccess_submission_search_request, 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_dataaccess_submission_search_request`)) {
        stop("Missing required parameter `org_sagebionetworks_repo_model_dataaccess_submission_search_request`.")
      }


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

      local_var_url_path <- "/repo/v1/dataAccessSubmission/search"
      # 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(), "OrgSagebionetworksRepoModelDataaccessSubmissionSearchResponse", 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_dataaccess_research_project 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelDataaccessResearchProject
    #' @export
    PostRepoV1ResearchProject = function(org_sagebionetworks_repo_model_dataaccess_research_project, data_file = NULL, ...) {
      local_var_response <- self$PostRepoV1ResearchProjectWithHttpInfo(org_sagebionetworks_repo_model_dataaccess_research_project, 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_dataaccess_research_project 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelDataaccessResearchProject) with additional information such as HTTP status code, headers
    #' @export
    PostRepoV1ResearchProjectWithHttpInfo = function(org_sagebionetworks_repo_model_dataaccess_research_project, 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_dataaccess_research_project`)) {
        stop("Missing required parameter `org_sagebionetworks_repo_model_dataaccess_research_project`.")
      }


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

      local_var_url_path <- "/repo/v1/researchProject"
      # 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(), "OrgSagebionetworksRepoModelDataaccessResearchProject", 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_restriction_information_request 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelRestrictionInformationResponse
    #' @export
    PostRepoV1RestrictionInformation = function(org_sagebionetworks_repo_model_restriction_information_request, data_file = NULL, ...) {
      local_var_response <- self$PostRepoV1RestrictionInformationWithHttpInfo(org_sagebionetworks_repo_model_restriction_information_request, 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_restriction_information_request 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelRestrictionInformationResponse) with additional information such as HTTP status code, headers
    #' @export
    PostRepoV1RestrictionInformationWithHttpInfo = function(org_sagebionetworks_repo_model_restriction_information_request, 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_restriction_information_request`)) {
        stop("Missing required parameter `org_sagebionetworks_repo_model_restriction_information_request`.")
      }


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

      local_var_url_path <- "/repo/v1/restrictionInformation"
      # 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(), "OrgSagebionetworksRepoModelRestrictionInformationResponse", 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 submission_id 
    #' @param org_sagebionetworks_repo_model_dataaccess_submission_state_change_request 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelDataaccessSubmission
    #' @export
    PutRepoV1DataAccessSubmissionSubmissionId = function(submission_id, org_sagebionetworks_repo_model_dataaccess_submission_state_change_request, data_file = NULL, ...) {
      local_var_response <- self$PutRepoV1DataAccessSubmissionSubmissionIdWithHttpInfo(submission_id, org_sagebionetworks_repo_model_dataaccess_submission_state_change_request, 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 submission_id 
    #' @param org_sagebionetworks_repo_model_dataaccess_submission_state_change_request 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelDataaccessSubmission) with additional information such as HTTP status code, headers
    #' @export
    PutRepoV1DataAccessSubmissionSubmissionIdWithHttpInfo = function(submission_id, org_sagebionetworks_repo_model_dataaccess_submission_state_change_request, 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(`submission_id`)) {
        stop("Missing required parameter `submission_id`.")
      }

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



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

      local_var_url_path <- "/repo/v1/dataAccessSubmission/{submissionId}"
      if (!missing(`submission_id`)) {
        local_var_url_path <- gsub("\\{submissionId\\}", URLencode(as.character(`submission_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(), "OrgSagebionetworksRepoModelDataaccessSubmission", 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 submission_id - The ID of the submission to cancel.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelDataaccessSubmissionStatus
    #' @export
    PutRepoV1DataAccessSubmissionSubmissionIdCancellation = function(submission_id, data_file = NULL, ...) {
      local_var_response <- self$PutRepoV1DataAccessSubmissionSubmissionIdCancellationWithHttpInfo(submission_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 submission_id - The ID of the submission to cancel.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelDataaccessSubmissionStatus) with additional information such as HTTP status code, headers
    #' @export
    PutRepoV1DataAccessSubmissionSubmissionIdCancellationWithHttpInfo = function(submission_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(`submission_id`)) {
        stop("Missing required parameter `submission_id`.")
      }


      local_var_url_path <- "/repo/v1/dataAccessSubmission/{submissionId}/cancellation"
      if (!missing(`submission_id`)) {
        local_var_url_path <- gsub("\\{submissionId\\}", URLencode(as.character(`submission_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 = "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(), "OrgSagebionetworksRepoModelDataaccessSubmissionStatus", 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.