R/method_configurations_api.R

# FireCloud
#
# FireCloud API 
#
# The version of the OpenAPI document: 0.1
# 
# Generated by: https://openapi-generator.tech

#' @docType class
#' @title MethodConfigurations operations
#' @description openapi.MethodConfigurations
#' @format An \code{R6Class} generator object
#' @field apiClient Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ CopyFromMethodRepo } \emph{ Copy a Method Repository Configuration into a workspace }
#' 
#'
#' \itemize{
#' \item \emph{ @param } workspace.namespace character
#' \item \emph{ @param } workspace.name character
#' \item \emph{ @param } config.to.copy \link{CopyConfigurationIngest}
#'
#'
#' \item status code : 201 | Successful request
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Source method configuration does not exist
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 409 | Destination method configuration by that name already exists
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 422 | Error parsing source method configuration
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | Internal Server Error
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ CopyToMethodRepo } \emph{ Copy a Method Config in a workspace to the Method Repository }
#' 
#'
#' \itemize{
#' \item \emph{ @param } workspace.namespace character
#' \item \emph{ @param } workspace.name character
#' \item \emph{ @param } config.to.copy \link{PublishConfigurationIngest}
#'
#'
#' \item status code : 201 | Successful request
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Source method configuration does not exist
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 409 | Destination method configuration by that name already exists
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 422 | Error parsing source method configuration
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | Internal Server Error
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ DeleteWorkspaceMethodConfig } \emph{ Delete a method configuration in a workspace }
#' 
#'
#' \itemize{
#' \item \emph{ @param } workspace.namespace character
#' \item \emph{ @param } workspace.name character
#' \item \emph{ @param } config.namespace character
#' \item \emph{ @param } config.name character
#'
#'
#' \item status code : 200 | Successful request
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Workspace or Method Configuration not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | Internal Server Error
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetWorkspaceMethodConfig } \emph{ Get a method configuration in a workspace }
#' 
#'
#' \itemize{
#' \item \emph{ @param } workspace.namespace character
#' \item \emph{ @param } workspace.name character
#' \item \emph{ @param } config.namespace character
#' \item \emph{ @param } config.name character
#'
#'
#' \item status code : 200 | Successful
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Workspace or Method Configuration not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | Internal Server Error
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ ImportStatus } \emph{ Check the user's ability to import a method config into a workspace }
#' 
#'
#' \itemize{
#' \item \emph{ @returnType } \link{UserImportPermission} \cr
#'
#'
#' \item status code : 200 | OK
#'
#' \item return type : UserImportPermission 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | Internal Server Error
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ ListWorkspaceMethodConfigs } \emph{ List method configurations in a workspace }
#' List method configurations in a workspace. By default, only Agora method configs are returned. To return configs for all repos, specify `allRepos` to be `true`.  #### Expanded discussion on the methodRepoMethod field  This endpoint returns method references to Agora in the format ``` \"methodRepoMethod\": {   \"methodNamespace\": \"namespace\",   \"methodName\": \"name\",   \"methodVersion\": 1,   \"sourceRepo\": \"agora\",   \"methodUri\": \"agora://namespace/name/1\" } ``` and for Dockstore in the format ``` \"methodRepoMethod\": {   \"methodPath\": \"path\",   \"methodVersion\": \"version\",   \"sourceRepo\": \"agora\",   \"methodUri\": \"dockstore://path/version\" } ``` If you are only working with Agora methods, the fields `\"sourceRepo\"` and `\"methodUri\"` can be considered informational and do not need to be round-tripped (see the corresponding `POST /api/workspaces/{workspaceNamespace}/{workspaceName}/methodconfigs` for more details). 
#'
#' \itemize{
#' \item \emph{ @param } workspace.namespace character
#' \item \emph{ @param } workspace.name character
#' \item \emph{ @param } all.repos character
#'
#'
#' \item status code : 200 | List of Method Configurations
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Workspace does not exist
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | Internal Server Error
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ OverwriteWorkspaceMethodConfig } \emph{ Add or overwrite a method configuration in a workspace }
#' Add or overwrite a method configuration in a workspace. The method configuration name and namespace in the URI must match the values in the JSON. 
#'
#' \itemize{
#' \item \emph{ @param } workspace.namespace character
#' \item \emph{ @param } workspace.name character
#' \item \emph{ @param } config.namespace character
#' \item \emph{ @param } config.name character
#' \item \emph{ @param } body \link{ConfigurationIngest}
#'
#'
#' \item status code : 200 | Successful
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Method configuration name and namespace in URI do not match those in JSON body
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Workspace or Method Configuration not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | Internal Server Error
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PostWorkspaceMethodConfig } \emph{ Create a Method Configuration in a workspace }
#' Create method configurations. #### Expanded discussion on the methodRepoMethod field To create a method config for an Agora method, `\"sourceRepo\": \"agora\"` is optional; the following is sufficient: ``` \"methodRepoMethod\": {   \"methodNamespace\": \"namespace\",   \"methodName\": \"name\",   \"methodVersion\": 1 } ``` To create a method config for a Dockstore method, `\"sourceRepo\": \"dockstore\"` is required: ``` \"methodRepoMethod\": {   \"sourceRepo\": \"dockstore\",   \"methodPath\": \"path\",   \"methodVersion\": \"version\" } ``` You may also use the URI on its own to create a config referencing any supported repo (currently Agora and Dockstore): ``` \"methodRepoMethod\": {   \"methodUri\": \"agora://namespace/name/1\" } ``` ``` \"methodRepoMethod\": {   \"methodUri\": \"dockstore://path/version\" } ``` The system is specified to check for a URI first before falling back to the legacy fields. Unsupported repos will return a 400 Bad Request. 
#'
#' \itemize{
#' \item \emph{ @param } workspace.namespace character
#' \item \emph{ @param } workspace.name character
#' \item \emph{ @param } method.config.json \link{NewMethodConfigIngest}
#'
#'
#' \item status code : 201 | Successful Request
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Workspace not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 409 | Method Configuration already exists
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | Internal Server Error
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ RenameWorkspaceMethodConfig } \emph{ Rename a method configuration in a workspace }
#' 
#'
#' \itemize{
#' \item \emph{ @param } workspace.namespace character
#' \item \emph{ @param } workspace.name character
#' \item \emph{ @param } config.namespace character
#' \item \emph{ @param } config.name character
#' \item \emph{ @param } rename \link{MethodConfigRename}
#'
#'
#' \item status code : 204 | Successful request
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 400 | Workspace details in payload don't match the URI
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Workspace or Method Configuration not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 409 | Method Configuration with that name already exists
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | Internal Server Error
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ UpdateWorkspaceMethodConfig } \emph{ Update a method configuration in a workspace }
#' Update method configuration. Updates and moves the method configuration at the URI to the location in the request body. The location in the URI may be the same as the location in the request body. If the location in the request body matches the location in the URI, it is overwritten. If the location in the request body is different to the location in the URI, and there is a method config already at that location, 409 is returned. 
#'
#' \itemize{
#' \item \emph{ @param } workspace.namespace character
#' \item \emph{ @param } workspace.name character
#' \item \emph{ @param } config.namespace character
#' \item \emph{ @param } config.name character
#' \item \emph{ @param } body \link{ConfigurationIngest}
#'
#'
#' \item status code : 200 | Successful
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | Invalid attribute namespace(s) in outputs
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Workspace or Method Configuration not found
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 409 | Method configuration with the new name already exists in the workspace
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | Internal Server Error
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ ValidateMethodConfiguration } \emph{ get syntax validation information for a method configuration }
#' 
#'
#' \itemize{
#' \item \emph{ @param } workspace.namespace character
#' \item \emph{ @param } workspace.name character
#' \item \emph{ @param } config.namespace character
#' \item \emph{ @param } config.name character
#' \item \emph{ @returnType } \link{ValidatedMethodConfiguration} \cr
#'
#'
#' \item status code : 200 | Successful Request
#'
#' \item return type : ValidatedMethodConfiguration 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Workspace or Method Configuration does not exist
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | Rawls Internal Error
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ WorkspacePermissionReport } \emph{ Retrieve user permissions for the workspace and the workspace's method references }
#' 
#'
#' \itemize{
#' \item \emph{ @param } workspace.namespace character
#' \item \emph{ @param } workspace.name character
#' \item \emph{ @param } report.input \link{PermissionReportRequest}
#' \item \emph{ @returnType } \link{PermissionReport} \cr
#'
#'
#' \item status code : 200 | Permission Report
#'
#' \item return type : PermissionReport 
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 404 | Workspace does not exist
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 500 | Internal Server Error
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' ####################  CopyFromMethodRepo  ####################
#'
#' library(openapi)
#' var.workspace.namespace <- 'workspace.namespace_example' # character | Workspace Namespace
#' var.workspace.name <- 'workspace.name_example' # character | Workspace Name
#' var.config.to.copy <- CopyConfigurationIngest$new() # CopyConfigurationIngest | Method Configuration to Copy
#'
#' #Copy a Method Repository Configuration into a workspace
#' api.instance <- MethodConfigurationsApi$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$CopyFromMethodRepo(var.workspace.namespace, var.workspace.name, var.config.to.copy)
#'
#'
#' ####################  CopyToMethodRepo  ####################
#'
#' library(openapi)
#' var.workspace.namespace <- 'workspace.namespace_example' # character | Workspace Namespace
#' var.workspace.name <- 'workspace.name_example' # character | Workspace Name
#' var.config.to.copy <- PublishConfigurationIngest$new() # PublishConfigurationIngest | Method Configuration to Copy
#'
#' #Copy a Method Config in a workspace to the Method Repository
#' api.instance <- MethodConfigurationsApi$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$CopyToMethodRepo(var.workspace.namespace, var.workspace.name, var.config.to.copy)
#'
#'
#' ####################  DeleteWorkspaceMethodConfig  ####################
#'
#' library(openapi)
#' var.workspace.namespace <- 'workspace.namespace_example' # character | Workspace Namespace
#' var.workspace.name <- 'workspace.name_example' # character | Workspace Name
#' var.config.namespace <- 'config.namespace_example' # character | Configuration Namespace
#' var.config.name <- 'config.name_example' # character | Configuration Name
#'
#' #Delete a method configuration in a workspace
#' api.instance <- MethodConfigurationsApi$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$DeleteWorkspaceMethodConfig(var.workspace.namespace, var.workspace.name, var.config.namespace, var.config.name)
#'
#'
#' ####################  GetWorkspaceMethodConfig  ####################
#'
#' library(openapi)
#' var.workspace.namespace <- 'workspace.namespace_example' # character | Workspace Namespace
#' var.workspace.name <- 'workspace.name_example' # character | Workspace Name
#' var.config.namespace <- 'config.namespace_example' # character | Configuration Namespace
#' var.config.name <- 'config.name_example' # character | Configuration Name
#'
#' #Get a method configuration in a workspace
#' api.instance <- MethodConfigurationsApi$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$GetWorkspaceMethodConfig(var.workspace.namespace, var.workspace.name, var.config.namespace, var.config.name)
#'
#'
#' ####################  ImportStatus  ####################
#'
#' library(openapi)
#'
#' #Check the user's ability to import a method config into a workspace
#' api.instance <- MethodConfigurationsApi$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$ImportStatus()
#'
#'
#' ####################  ListWorkspaceMethodConfigs  ####################
#'
#' library(openapi)
#' var.workspace.namespace <- 'workspace.namespace_example' # character | Workspace Namespace
#' var.workspace.name <- 'workspace.name_example' # character | Workspace Name
#' var.all.repos <- FALSE # character | Configs for all repos, not just Agora
#'
#' #List method configurations in a workspace
#' api.instance <- MethodConfigurationsApi$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$ListWorkspaceMethodConfigs(var.workspace.namespace, var.workspace.name, all.repos=var.all.repos)
#'
#'
#' ####################  OverwriteWorkspaceMethodConfig  ####################
#'
#' library(openapi)
#' var.workspace.namespace <- 'workspace.namespace_example' # character | Workspace Namespace
#' var.workspace.name <- 'workspace.name_example' # character | Workspace Name
#' var.config.namespace <- 'config.namespace_example' # character | Configuration Namespace
#' var.config.name <- 'config.name_example' # character | Configuration Name
#' var.body <- ConfigurationIngest$new() # ConfigurationIngest | Method Config to Update
#'
#' #Add or overwrite a method configuration in a workspace
#' api.instance <- MethodConfigurationsApi$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$OverwriteWorkspaceMethodConfig(var.workspace.namespace, var.workspace.name, var.config.namespace, var.config.name, var.body)
#'
#'
#' ####################  PostWorkspaceMethodConfig  ####################
#'
#' library(openapi)
#' var.workspace.namespace <- 'workspace.namespace_example' # character | Workspace Namespace
#' var.workspace.name <- 'workspace.name_example' # character | Workspace Name
#' var.method.config.json <- NewMethodConfigIngest$new() # NewMethodConfigIngest | Method Configuration contents
#'
#' #Create a Method Configuration in a workspace
#' api.instance <- MethodConfigurationsApi$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$PostWorkspaceMethodConfig(var.workspace.namespace, var.workspace.name, var.method.config.json)
#'
#'
#' ####################  RenameWorkspaceMethodConfig  ####################
#'
#' library(openapi)
#' var.workspace.namespace <- 'workspace.namespace_example' # character | Workspace Namespace
#' var.workspace.name <- 'workspace.name_example' # character | Workspace Name
#' var.config.namespace <- 'config.namespace_example' # character | Configuration Namespace
#' var.config.name <- 'config.name_example' # character | Configuration Name
#' var.rename <- MethodConfigRename$new() # MethodConfigRename | Method Config Rename
#'
#' #Rename a method configuration in a workspace
#' api.instance <- MethodConfigurationsApi$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$RenameWorkspaceMethodConfig(var.workspace.namespace, var.workspace.name, var.config.namespace, var.config.name, var.rename)
#'
#'
#' ####################  UpdateWorkspaceMethodConfig  ####################
#'
#' library(openapi)
#' var.workspace.namespace <- 'workspace.namespace_example' # character | Workspace Namespace
#' var.workspace.name <- 'workspace.name_example' # character | Workspace Name
#' var.config.namespace <- 'config.namespace_example' # character | Configuration Namespace
#' var.config.name <- 'config.name_example' # character | Configuration Name
#' var.body <- ConfigurationIngest$new() # ConfigurationIngest | Method Config to Update
#'
#' #Update a method configuration in a workspace
#' api.instance <- MethodConfigurationsApi$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$UpdateWorkspaceMethodConfig(var.workspace.namespace, var.workspace.name, var.config.namespace, var.config.name, var.body)
#'
#'
#' ####################  ValidateMethodConfiguration  ####################
#'
#' library(openapi)
#' var.workspace.namespace <- 'workspace.namespace_example' # character | Workspace Namespace
#' var.workspace.name <- 'workspace.name_example' # character | Workspace Name
#' var.config.namespace <- 'config.namespace_example' # character | Method Configuration Namespace
#' var.config.name <- 'config.name_example' # character | Method Configuration Name
#'
#' #get syntax validation information for a method configuration
#' api.instance <- MethodConfigurationsApi$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$ValidateMethodConfiguration(var.workspace.namespace, var.workspace.name, var.config.namespace, var.config.name)
#'
#'
#' ####################  WorkspacePermissionReport  ####################
#'
#' library(openapi)
#' var.workspace.namespace <- 'workspace.namespace_example' # character | Workspace Namespace
#' var.workspace.name <- 'workspace.name_example' # character | Workspace Name
#' var.report.input <- PermissionReportRequest$new() # PermissionReportRequest | Users and/or configs on which to report, both optional
#'
#' #Retrieve user permissions for the workspace and the workspace's method references
#' api.instance <- MethodConfigurationsApi$new()
#'
#' # Configure OAuth2 access token for authorization: googleoauth
#' api.instance$apiClient$accessToken <- 'TODO_YOUR_ACCESS_TOKEN';
#'
#' result <- api.instance$WorkspacePermissionReport(var.workspace.namespace, var.workspace.name, var.report.input)
#'
#'
#' }
#' @importFrom R6 R6Class
#' @importFrom base64enc base64encode
#' @export
MethodConfigurationsApi <- R6::R6Class(
  'MethodConfigurationsApi',
  public = list(
    apiClient = NULL,
    initialize = function(apiClient){
      if (!missing(apiClient)) {
        self$apiClient <- apiClient
      }
      else {
        self$apiClient <- ApiClient$new()
      }
    },
    CopyFromMethodRepo = function(workspace.namespace, workspace.name, config.to.copy, ...){
      apiResponse <- self$CopyFromMethodRepoWithHttpInfo(workspace.namespace, workspace.name, config.to.copy, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    CopyFromMethodRepoWithHttpInfo = function(workspace.namespace, workspace.name, config.to.copy, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

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

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

      if (missing(`config.to.copy`)) {
        stop("Missing required parameter `config.to.copy`.")
      }

      if (!missing(`config.to.copy`)) {
        body <- `config.to.copy`$toJSONString()
      } else {
        body <- NULL
      }

      urlPath <- "/api/workspaces/{workspaceNamespace}/{workspaceName}/method_configs/copyFromMethodRepo"
      if (!missing(`workspace.namespace`)) {
        urlPath <- gsub(paste0("\\{", "workspaceNamespace", "\\}"), URLencode(as.character(`workspace.namespace`), reserved = TRUE), urlPath)
      }

      if (!missing(`workspace.name`)) {
        urlPath <- gsub(paste0("\\{", "workspaceName", "\\}"), URLencode(as.character(`workspace.name`), reserved = TRUE), urlPath)
      }

      # OAuth token
      headerParams['Authorization'] <- paste("Bearer", self$apiClient$accessToken, sep=" ")

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "POST",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        ApiResponse$new(NULL, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    CopyToMethodRepo = function(workspace.namespace, workspace.name, config.to.copy, ...){
      apiResponse <- self$CopyToMethodRepoWithHttpInfo(workspace.namespace, workspace.name, config.to.copy, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    CopyToMethodRepoWithHttpInfo = function(workspace.namespace, workspace.name, config.to.copy, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

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

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

      if (missing(`config.to.copy`)) {
        stop("Missing required parameter `config.to.copy`.")
      }

      if (!missing(`config.to.copy`)) {
        body <- `config.to.copy`$toJSONString()
      } else {
        body <- NULL
      }

      urlPath <- "/api/workspaces/{workspaceNamespace}/{workspaceName}/method_configs/copyToMethodRepo"
      if (!missing(`workspace.namespace`)) {
        urlPath <- gsub(paste0("\\{", "workspaceNamespace", "\\}"), URLencode(as.character(`workspace.namespace`), reserved = TRUE), urlPath)
      }

      if (!missing(`workspace.name`)) {
        urlPath <- gsub(paste0("\\{", "workspaceName", "\\}"), URLencode(as.character(`workspace.name`), reserved = TRUE), urlPath)
      }

      # OAuth token
      headerParams['Authorization'] <- paste("Bearer", self$apiClient$accessToken, sep=" ")

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "POST",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        ApiResponse$new(NULL, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    DeleteWorkspaceMethodConfig = function(workspace.namespace, workspace.name, config.namespace, config.name, ...){
      apiResponse <- self$DeleteWorkspaceMethodConfigWithHttpInfo(workspace.namespace, workspace.name, config.namespace, config.name, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    DeleteWorkspaceMethodConfigWithHttpInfo = function(workspace.namespace, workspace.name, config.namespace, config.name, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

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

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

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

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

      body <- NULL
      urlPath <- "/api/workspaces/{workspaceNamespace}/{workspaceName}/method_configs/{configNamespace}/{configName}"
      if (!missing(`workspace.namespace`)) {
        urlPath <- gsub(paste0("\\{", "workspaceNamespace", "\\}"), URLencode(as.character(`workspace.namespace`), reserved = TRUE), urlPath)
      }

      if (!missing(`workspace.name`)) {
        urlPath <- gsub(paste0("\\{", "workspaceName", "\\}"), URLencode(as.character(`workspace.name`), reserved = TRUE), urlPath)
      }

      if (!missing(`config.namespace`)) {
        urlPath <- gsub(paste0("\\{", "configNamespace", "\\}"), URLencode(as.character(`config.namespace`), reserved = TRUE), urlPath)
      }

      if (!missing(`config.name`)) {
        urlPath <- gsub(paste0("\\{", "configName", "\\}"), URLencode(as.character(`config.name`), reserved = TRUE), urlPath)
      }

      # OAuth token
      headerParams['Authorization'] <- paste("Bearer", self$apiClient$accessToken, sep=" ")

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "DELETE",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        ApiResponse$new(NULL, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    GetWorkspaceMethodConfig = function(workspace.namespace, workspace.name, config.namespace, config.name, ...){
      apiResponse <- self$GetWorkspaceMethodConfigWithHttpInfo(workspace.namespace, workspace.name, config.namespace, config.name, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    GetWorkspaceMethodConfigWithHttpInfo = function(workspace.namespace, workspace.name, config.namespace, config.name, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

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

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

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

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

      body <- NULL
      urlPath <- "/api/workspaces/{workspaceNamespace}/{workspaceName}/method_configs/{configNamespace}/{configName}"
      if (!missing(`workspace.namespace`)) {
        urlPath <- gsub(paste0("\\{", "workspaceNamespace", "\\}"), URLencode(as.character(`workspace.namespace`), reserved = TRUE), urlPath)
      }

      if (!missing(`workspace.name`)) {
        urlPath <- gsub(paste0("\\{", "workspaceName", "\\}"), URLencode(as.character(`workspace.name`), reserved = TRUE), urlPath)
      }

      if (!missing(`config.namespace`)) {
        urlPath <- gsub(paste0("\\{", "configNamespace", "\\}"), URLencode(as.character(`config.namespace`), reserved = TRUE), urlPath)
      }

      if (!missing(`config.name`)) {
        urlPath <- gsub(paste0("\\{", "configName", "\\}"), URLencode(as.character(`config.name`), reserved = TRUE), urlPath)
      }

      # OAuth token
      headerParams['Authorization'] <- paste("Bearer", self$apiClient$accessToken, sep=" ")

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "GET",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        ApiResponse$new(NULL, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    ImportStatus = function(...){
      apiResponse <- self$ImportStatusWithHttpInfo(...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    ImportStatusWithHttpInfo = function(...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

      body <- NULL
      urlPath <- "/api/profile/importstatus"
      # OAuth token
      headerParams['Authorization'] <- paste("Bearer", self$apiClient$accessToken, sep=" ")

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "GET",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "UserImportPermission", loadNamespace("openapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    ListWorkspaceMethodConfigs = function(workspace.namespace, workspace.name, all.repos=FALSE, ...){
      apiResponse <- self$ListWorkspaceMethodConfigsWithHttpInfo(workspace.namespace, workspace.name, all.repos, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    ListWorkspaceMethodConfigsWithHttpInfo = function(workspace.namespace, workspace.name, all.repos=FALSE, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

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

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

      queryParams['allRepos'] <- all.repos

      body <- NULL
      urlPath <- "/api/workspaces/{workspaceNamespace}/{workspaceName}/methodconfigs"
      if (!missing(`workspace.namespace`)) {
        urlPath <- gsub(paste0("\\{", "workspaceNamespace", "\\}"), URLencode(as.character(`workspace.namespace`), reserved = TRUE), urlPath)
      }

      if (!missing(`workspace.name`)) {
        urlPath <- gsub(paste0("\\{", "workspaceName", "\\}"), URLencode(as.character(`workspace.name`), reserved = TRUE), urlPath)
      }

      # OAuth token
      headerParams['Authorization'] <- paste("Bearer", self$apiClient$accessToken, sep=" ")

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "GET",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        ApiResponse$new(NULL, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    OverwriteWorkspaceMethodConfig = function(workspace.namespace, workspace.name, config.namespace, config.name, body, ...){
      apiResponse <- self$OverwriteWorkspaceMethodConfigWithHttpInfo(workspace.namespace, workspace.name, config.namespace, config.name, body, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    OverwriteWorkspaceMethodConfigWithHttpInfo = function(workspace.namespace, workspace.name, config.namespace, config.name, body, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

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

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

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

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

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

      if (!missing(`body`)) {
        body <- `body`$toJSONString()
      } else {
        body <- NULL
      }

      urlPath <- "/api/workspaces/{workspaceNamespace}/{workspaceName}/method_configs/{configNamespace}/{configName}"
      if (!missing(`workspace.namespace`)) {
        urlPath <- gsub(paste0("\\{", "workspaceNamespace", "\\}"), URLencode(as.character(`workspace.namespace`), reserved = TRUE), urlPath)
      }

      if (!missing(`workspace.name`)) {
        urlPath <- gsub(paste0("\\{", "workspaceName", "\\}"), URLencode(as.character(`workspace.name`), reserved = TRUE), urlPath)
      }

      if (!missing(`config.namespace`)) {
        urlPath <- gsub(paste0("\\{", "configNamespace", "\\}"), URLencode(as.character(`config.namespace`), reserved = TRUE), urlPath)
      }

      if (!missing(`config.name`)) {
        urlPath <- gsub(paste0("\\{", "configName", "\\}"), URLencode(as.character(`config.name`), reserved = TRUE), urlPath)
      }

      # OAuth token
      headerParams['Authorization'] <- paste("Bearer", self$apiClient$accessToken, sep=" ")

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "PUT",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        ApiResponse$new(NULL, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    PostWorkspaceMethodConfig = function(workspace.namespace, workspace.name, method.config.json, ...){
      apiResponse <- self$PostWorkspaceMethodConfigWithHttpInfo(workspace.namespace, workspace.name, method.config.json, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    PostWorkspaceMethodConfigWithHttpInfo = function(workspace.namespace, workspace.name, method.config.json, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

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

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

      if (missing(`method.config.json`)) {
        stop("Missing required parameter `method.config.json`.")
      }

      if (!missing(`method.config.json`)) {
        body <- `method.config.json`$toJSONString()
      } else {
        body <- NULL
      }

      urlPath <- "/api/workspaces/{workspaceNamespace}/{workspaceName}/methodconfigs"
      if (!missing(`workspace.namespace`)) {
        urlPath <- gsub(paste0("\\{", "workspaceNamespace", "\\}"), URLencode(as.character(`workspace.namespace`), reserved = TRUE), urlPath)
      }

      if (!missing(`workspace.name`)) {
        urlPath <- gsub(paste0("\\{", "workspaceName", "\\}"), URLencode(as.character(`workspace.name`), reserved = TRUE), urlPath)
      }

      # OAuth token
      headerParams['Authorization'] <- paste("Bearer", self$apiClient$accessToken, sep=" ")

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "POST",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        ApiResponse$new(NULL, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    RenameWorkspaceMethodConfig = function(workspace.namespace, workspace.name, config.namespace, config.name, rename, ...){
      apiResponse <- self$RenameWorkspaceMethodConfigWithHttpInfo(workspace.namespace, workspace.name, config.namespace, config.name, rename, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    RenameWorkspaceMethodConfigWithHttpInfo = function(workspace.namespace, workspace.name, config.namespace, config.name, rename, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

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

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

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

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

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

      if (!missing(`rename`)) {
        body <- `rename`$toJSONString()
      } else {
        body <- NULL
      }

      urlPath <- "/api/workspaces/{workspaceNamespace}/{workspaceName}/method_configs/{configNamespace}/{configName}/rename"
      if (!missing(`workspace.namespace`)) {
        urlPath <- gsub(paste0("\\{", "workspaceNamespace", "\\}"), URLencode(as.character(`workspace.namespace`), reserved = TRUE), urlPath)
      }

      if (!missing(`workspace.name`)) {
        urlPath <- gsub(paste0("\\{", "workspaceName", "\\}"), URLencode(as.character(`workspace.name`), reserved = TRUE), urlPath)
      }

      if (!missing(`config.namespace`)) {
        urlPath <- gsub(paste0("\\{", "configNamespace", "\\}"), URLencode(as.character(`config.namespace`), reserved = TRUE), urlPath)
      }

      if (!missing(`config.name`)) {
        urlPath <- gsub(paste0("\\{", "configName", "\\}"), URLencode(as.character(`config.name`), reserved = TRUE), urlPath)
      }

      # OAuth token
      headerParams['Authorization'] <- paste("Bearer", self$apiClient$accessToken, sep=" ")

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "POST",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        ApiResponse$new(NULL, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    UpdateWorkspaceMethodConfig = function(workspace.namespace, workspace.name, config.namespace, config.name, body, ...){
      apiResponse <- self$UpdateWorkspaceMethodConfigWithHttpInfo(workspace.namespace, workspace.name, config.namespace, config.name, body, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    UpdateWorkspaceMethodConfigWithHttpInfo = function(workspace.namespace, workspace.name, config.namespace, config.name, body, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

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

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

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

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

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

      if (!missing(`body`)) {
        body <- `body`$toJSONString()
      } else {
        body <- NULL
      }

      urlPath <- "/api/workspaces/{workspaceNamespace}/{workspaceName}/method_configs/{configNamespace}/{configName}"
      if (!missing(`workspace.namespace`)) {
        urlPath <- gsub(paste0("\\{", "workspaceNamespace", "\\}"), URLencode(as.character(`workspace.namespace`), reserved = TRUE), urlPath)
      }

      if (!missing(`workspace.name`)) {
        urlPath <- gsub(paste0("\\{", "workspaceName", "\\}"), URLencode(as.character(`workspace.name`), reserved = TRUE), urlPath)
      }

      if (!missing(`config.namespace`)) {
        urlPath <- gsub(paste0("\\{", "configNamespace", "\\}"), URLencode(as.character(`config.namespace`), reserved = TRUE), urlPath)
      }

      if (!missing(`config.name`)) {
        urlPath <- gsub(paste0("\\{", "configName", "\\}"), URLencode(as.character(`config.name`), reserved = TRUE), urlPath)
      }

      # OAuth token
      headerParams['Authorization'] <- paste("Bearer", self$apiClient$accessToken, sep=" ")

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "POST",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        ApiResponse$new(NULL, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    ValidateMethodConfiguration = function(workspace.namespace, workspace.name, config.namespace, config.name, ...){
      apiResponse <- self$ValidateMethodConfigurationWithHttpInfo(workspace.namespace, workspace.name, config.namespace, config.name, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    ValidateMethodConfigurationWithHttpInfo = function(workspace.namespace, workspace.name, config.namespace, config.name, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

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

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

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

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

      body <- NULL
      urlPath <- "/api/workspaces/{workspaceNamespace}/{workspaceName}/method_configs/{configNamespace}/{configName}/validate"
      if (!missing(`workspace.namespace`)) {
        urlPath <- gsub(paste0("\\{", "workspaceNamespace", "\\}"), URLencode(as.character(`workspace.namespace`), reserved = TRUE), urlPath)
      }

      if (!missing(`workspace.name`)) {
        urlPath <- gsub(paste0("\\{", "workspaceName", "\\}"), URLencode(as.character(`workspace.name`), reserved = TRUE), urlPath)
      }

      if (!missing(`config.namespace`)) {
        urlPath <- gsub(paste0("\\{", "configNamespace", "\\}"), URLencode(as.character(`config.namespace`), reserved = TRUE), urlPath)
      }

      if (!missing(`config.name`)) {
        urlPath <- gsub(paste0("\\{", "configName", "\\}"), URLencode(as.character(`config.name`), reserved = TRUE), urlPath)
      }

      # OAuth token
      headerParams['Authorization'] <- paste("Bearer", self$apiClient$accessToken, sep=" ")

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "GET",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "ValidatedMethodConfiguration", loadNamespace("openapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    },
    WorkspacePermissionReport = function(workspace.namespace, workspace.name, report.input, ...){
      apiResponse <- self$WorkspacePermissionReportWithHttpInfo(workspace.namespace, workspace.name, report.input, ...)
      resp <- apiResponse$response
      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        apiResponse$content
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        apiResponse
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        apiResponse
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        apiResponse
      }
    },

    WorkspacePermissionReportWithHttpInfo = function(workspace.namespace, workspace.name, report.input, ...){
      args <- list(...)
      queryParams <- list()
      headerParams <- c()

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

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

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

      if (!missing(`report.input`)) {
        body <- `report.input`$toJSONString()
      } else {
        body <- NULL
      }

      urlPath <- "/api/workspaces/{workspaceNamespace}/{workspaceName}/permissionReport"
      if (!missing(`workspace.namespace`)) {
        urlPath <- gsub(paste0("\\{", "workspaceNamespace", "\\}"), URLencode(as.character(`workspace.namespace`), reserved = TRUE), urlPath)
      }

      if (!missing(`workspace.name`)) {
        urlPath <- gsub(paste0("\\{", "workspaceName", "\\}"), URLencode(as.character(`workspace.name`), reserved = TRUE), urlPath)
      }

      # OAuth token
      headerParams['Authorization'] <- paste("Bearer", self$apiClient$accessToken, sep=" ")

      resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
                                 method = "POST",
                                 queryParams = queryParams,
                                 headerParams = headerParams,
                                 body = body,
                                 ...)

      if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
        deserializedRespObj <- tryCatch(
          self$apiClient$deserialize(resp, "PermissionReport", loadNamespace("openapi")),
          error = function(e){
             stop("Failed to deserialize response")
          }
        )
        ApiResponse$new(deserializedRespObj, resp)
      } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
        ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
      } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
        ApiResponse$new("API client error", resp)
      } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
        ApiResponse$new("API server error", resp)
      }
    }
  )
)
vjcitn/terraClientR documentation built on Dec. 23, 2021, 4:07 p.m.