R/entity_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 EntityServices operations
#' @description EntityServicesApi
#' @format An \code{R6Class} generator object
#' @field api_client Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ DeleteRepoV1EntityId } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } skip_trash_can character
#'
#'
#' \item status code : 204 | Void
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ DeleteRepoV1EntityIdAcl } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#'
#'
#' \item status code : 204 | Void
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ DeleteRepoV1EntityIdGeneratedBy } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#'
#'
#' \item status code : 204 | The requested Activity if it exists.
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ DeleteRepoV1EntityIdSchemaBinding } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#'
#'
#' \item status code : 204 | Void
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ DeleteRepoV1EntityIdVersionVersionNumber } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } version_number numeric
#'
#'
#' \item status code : 204 | Void
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityAliasAlias } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } alias character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelEntityId} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelEntityId
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityDockerRepoId } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } repository_name character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelEntityId} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelEntityId
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityId } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelEntity} \cr
#'
#'
#' \item status code : 200 | The requested Entity if it exists.
#'
#' \item return type : OrgSagebionetworksRepoModelEntity
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdAccess } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } access_type character
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : character
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdAcl } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelAccessControlList} \cr
#'
#'
#' \item status code : 200 | The entity ACL.
#'
#' \item return type : OrgSagebionetworksRepoModelAccessControlList
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdActionsDownload } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelDownloadActionRequiredList} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelDownloadActionRequiredList
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdAnnotations2 } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } include_derived character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelAnnotationV2Annotations} \cr
#'
#'
#' \item status code : 200 | The annotations for the given entity.
#'
#' \item return type : OrgSagebionetworksRepoModelAnnotationV2Annotations
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdBenefactor } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelEntityHeader} \cr
#'
#'
#' \item status code : 200 | The entity ACL.
#'
#' \item return type : OrgSagebionetworksRepoModelEntityHeader
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdDerivedKeys } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelAnnotationV2Keys} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelAnnotationV2Keys
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdFilehandles } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelFileFileHandleResults} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelFileFileHandleResults
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdFilepreview } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } redirect character
#' \item \emph{ @returnType } \link{AnyType} \cr
#'
#'
#' \item status code : 200 | Status 200 will be returned if the 'redirect' boolean param is false
#'
#' \item return type : AnyType
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 307 | Status 307 will be returned if the 'redirect' boolean param is true or null
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdGeneratedBy } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelProvenanceActivity} \cr
#'
#'
#' \item status code : 200 | The requested Activity if it exists.
#'
#' \item return type : OrgSagebionetworksRepoModelProvenanceActivity
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdJson } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } include_derived_annotations character
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : object
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdPath } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelEntityPath} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelEntityPath
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdPermissions } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelAuthUserEntityPermissions} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelAuthUserEntityPermissions
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdSchemaBinding } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelSchemaJsonSchemaObjectBinding} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelSchemaJsonSchemaObjectBinding
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdSchemaValidation } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelSchemaValidationResults} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelSchemaValidationResults
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdSchemaValidationStatistics } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelSchemaValidationSummaryStatistics} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelSchemaValidationSummaryStatistics
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdSts } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } permission \link{OrgSagebionetworksRepoModelStsStsPermission}
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelStsStsCredentials} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelStsStsCredentials
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdType } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelEntityHeader} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelEntityHeader
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdVersion } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } offset integer
#' \item \emph{ @param } limit integer
#' \item \emph{ @returnType } \link{PaginatedResultsOfVersionInfo} \cr
#'
#'
#' \item status code : 200 | A paginated list of results.
#'
#' \item return type : PaginatedResultsOfVersionInfo
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdVersionVersionNumber } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } version_number numeric
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelEntity} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelEntity
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdVersionVersionNumberAnnotations2 } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } version_number numeric
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelAnnotationV2Annotations} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelAnnotationV2Annotations
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdVersionVersionNumberFilehandles } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } version_number numeric
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelFileFileHandleResults} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelFileFileHandleResults
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdVersionVersionNumberFilepreview } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } version_number numeric
#' \item \emph{ @param } redirect character
#' \item \emph{ @returnType } \link{AnyType} \cr
#'
#'
#' \item status code : 200 | Status 200 will be returned if the 'redirect' boolean param is false
#'
#' \item return type : AnyType
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 307 | Status 307 will be returned if the 'redirect' boolean param is true or null
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdVersionVersionNumberGeneratedBy } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } version_number numeric
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelProvenanceActivity} \cr
#'
#'
#' \item status code : 200 | The requested Activity if it exists.
#'
#' \item return type : OrgSagebionetworksRepoModelProvenanceActivity
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityIdVersionVersionNumberJson } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } version_number numeric
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : object
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityMd5Md5 } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } md5 character
#' \item \emph{ @returnType } \link{PaginatedResultsOfEntityHeader} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : PaginatedResultsOfEntityHeader
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1EntityType } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } batch character
#' \item \emph{ @returnType } \link{PaginatedResultsOfEntityHeader} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : PaginatedResultsOfEntityHeader
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1RESTResources } \emph{  }
#'
#' \itemize{
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelRestResourceList} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelRestResourceList
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1RESTResourcesEffectiveSchema } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } resource_id character
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : object
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GetRepoV1RESTResourcesSchema } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } resource_id character
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : object
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PostRepoV1Entity } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } org_sagebionetworks_repo_model_entity \link{OrgSagebionetworksRepoModelEntity}
#' \item \emph{ @param } generated_by character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelEntity} \cr
#'
#'
#' \item status code : 201 | The new entity with an etag, id, and type specific metadata.
#'
#' \item return type : OrgSagebionetworksRepoModelEntity
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PostRepoV1EntityChild } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } org_sagebionetworks_repo_model_entity_entity_lookup_request \link{OrgSagebionetworksRepoModelEntityEntityLookupRequest}
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelEntityId} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelEntityId
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PostRepoV1EntityChildren } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } org_sagebionetworks_repo_model_entity_children_request \link{OrgSagebionetworksRepoModelEntityChildrenRequest}
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelEntityChildrenResponse} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelEntityChildrenResponse
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PostRepoV1EntityHeader } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } org_sagebionetworks_repo_model_request_reference_list \link{OrgSagebionetworksRepoModelRequestReferenceList}
#' \item \emph{ @returnType } \link{PaginatedResultsOfEntityHeader} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : PaginatedResultsOfEntityHeader
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PostRepoV1EntityIdAcl } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } org_sagebionetworks_repo_model_access_control_list \link{OrgSagebionetworksRepoModelAccessControlList}
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelAccessControlList} \cr
#'
#'
#' \item status code : 201 | The new ACL, which includes the id of the affected entity
#'
#' \item return type : OrgSagebionetworksRepoModelAccessControlList
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PostRepoV1EntityIdSchemaValidationInvalid } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } org_sagebionetworks_repo_model_schema_list_validation_results_request \link{OrgSagebionetworksRepoModelSchemaListValidationResultsRequest}
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelSchemaListValidationResultsResponse} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelSchemaListValidationResultsResponse
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PutRepoV1EntityId } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } org_sagebionetworks_repo_model_entity \link{OrgSagebionetworksRepoModelEntity}
#' \item \emph{ @param } generated_by character
#' \item \emph{ @param } new_version character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelEntity} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelEntity
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PutRepoV1EntityIdAcl } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } org_sagebionetworks_repo_model_access_control_list \link{OrgSagebionetworksRepoModelAccessControlList}
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelAccessControlList} \cr
#'
#'
#' \item status code : 200 | the accessControlList
#'
#' \item return type : OrgSagebionetworksRepoModelAccessControlList
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PutRepoV1EntityIdAnnotations2 } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } org_sagebionetworks_repo_model_annotation_v2_annotations \link{OrgSagebionetworksRepoModelAnnotationV2Annotations}
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelAnnotationV2Annotations} \cr
#'
#'
#' \item status code : 200 | the updated annotations
#'
#' \item return type : OrgSagebionetworksRepoModelAnnotationV2Annotations
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PutRepoV1EntityIdDatatype } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } type \link{OrgSagebionetworksRepoModelDataType}
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelDataTypeResponse} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelDataTypeResponse
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PutRepoV1EntityIdGeneratedBy } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } generated_by character
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelProvenanceActivity} \cr
#'
#'
#' \item status code : 200 | The requested Activity if it exists.
#'
#' \item return type : OrgSagebionetworksRepoModelProvenanceActivity
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PutRepoV1EntityIdJson } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } body object
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : object
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PutRepoV1EntityIdSchemaBinding } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } org_sagebionetworks_repo_model_entity_bind_schema_to_entity_request \link{OrgSagebionetworksRepoModelEntityBindSchemaToEntityRequest}
#' \item \emph{ @returnType } \link{OrgSagebionetworksRepoModelSchemaJsonSchemaObjectBinding} \cr
#'
#'
#' \item status code : 200 | Auto-generated description
#'
#' \item return type : OrgSagebionetworksRepoModelSchemaJsonSchemaObjectBinding
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ PutRepoV1EntityIdVersionVersionNumberFilehandle } \emph{  }
#'
#' \itemize{
#' \item \emph{ @param } id character
#' \item \emph{ @param } version_number numeric
#' \item \emph{ @param } org_sagebionetworks_repo_model_entity_file_handle_update_request \link{OrgSagebionetworksRepoModelEntityFileHandleUpdateRequest}
#'
#'
#' \item status code : 200 | Void
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' ####################  DeleteRepoV1EntityId  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the Entity to delete.
#' var_skip_trash_can <- "skip_trash_can_example" # character | If true the entity will be flag for priority purge and                      deleted as soon as possible (Optional)
#'
#' api_instance <- EntityServicesApi$new()
#'
#' # Configure HTTP bearer authorization: bearerAuth
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
#'
#' api_instance$DeleteRepoV1EntityId(var_id, skip_trash_can = var_skip_trash_can)
#'
#'
#' ####################  DeleteRepoV1EntityIdAcl  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the Entity that should have its ACL deleted.
#'
#' api_instance <- EntityServicesApi$new()
#'
#' # Configure HTTP bearer authorization: bearerAuth
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
#'
#' api_instance$DeleteRepoV1EntityIdAcl(var_id)
#'
#'
#' ####################  DeleteRepoV1EntityIdGeneratedBy  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | - The ID of the activity to fetch.
#'
#' api_instance <- EntityServicesApi$new()
#'
#' # Configure HTTP bearer authorization: bearerAuth
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
#'
#' api_instance$DeleteRepoV1EntityIdGeneratedBy(var_id)
#'
#'
#' ####################  DeleteRepoV1EntityIdSchemaBinding  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | 
#'
#' api_instance <- EntityServicesApi$new()
#'
#' # Configure HTTP bearer authorization: bearerAuth
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
#'
#' api_instance$DeleteRepoV1EntityIdSchemaBinding(var_id)
#'
#'
#' ####################  DeleteRepoV1EntityIdVersionVersionNumber  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the Entity
#' var_version_number <- 3.4 # numeric | The version number of the Entity to delete.
#'
#' api_instance <- EntityServicesApi$new()
#'
#' # Configure HTTP bearer authorization: bearerAuth
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
#'
#' api_instance$DeleteRepoV1EntityIdVersionVersionNumber(var_id, var_version_number)
#'
#'
#' ####################  GetRepoV1EntityAliasAlias  ####################
#'
#' library(synclient)
#' var_alias <- "alias_example" # character | 
#'
#' api_instance <- EntityServicesApi$new()
#'
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
#' # result <- api_instance$GetRepoV1EntityAliasAlias(var_aliasdata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityAliasAlias(var_alias)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityDockerRepoId  ####################
#'
#' library(synclient)
#' var_repository_name <- "repository_name_example" # character | The name of a managed docker repository
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityDockerRepoId(var_repository_namedata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityDockerRepoId(var_repository_name)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityId  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the entity to fetch.
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityId(var_iddata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityId(var_id)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdAccess  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the Entity to check the permission on.
#' var_access_type <- "access_type_example" # character | The permission to check. Must be from:                    ,<a href=\"${org.sagebionetworks.repo.model.ACCESS_TYPE}\">,ACCESS_TYPE,</a>
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdAccess(var_id, var_access_typedata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdAccess(var_id, var_access_type)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdAcl  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the Entity to get the ACL for.
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdAcl(var_iddata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdAcl(var_id)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdActionsDownload  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | 
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdActionsDownload(var_iddata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdActionsDownload(var_id)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdAnnotations2  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | - The id of the entity to update.
#' var_include_derived <- "include_derived_example" # character | - When set to 'true', the derived annotations will be                        included in the results. Default value 'false'.
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdAnnotations2(var_id, var_include_deriveddata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdAnnotations2(var_id, var_include_derived)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdBenefactor  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the entity to get the benefactor for.
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdBenefactor(var_iddata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdBenefactor(var_id)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdDerivedKeys  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | 
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdDerivedKeys(var_iddata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdDerivedKeys(var_id)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdFilehandles  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the FileEntity to get.
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdFilehandles(var_iddata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdFilehandles(var_id)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdFilepreview  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the FileEntity to get.
#' var_redirect <- "redirect_example" # character | When set to false, the URL will be returned as text/plain                  instead of redirecting. (Optional)
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdFilepreview(var_id, redirect = var_redirectdata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdFilepreview(var_id, redirect = var_redirect)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdGeneratedBy  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the activity to fetch.
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdGeneratedBy(var_iddata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdGeneratedBy(var_id)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdJson  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | 
#' var_include_derived_annotations <- "include_derived_annotations_example" # character | true if annotations that are derived from a                                   bound schema should be included in the                                   response, false otherwise (default false)
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdJson(var_id, var_include_derived_annotationsdata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdJson(var_id, var_include_derived_annotations)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdPath  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the Entity to get the full path for.
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdPath(var_iddata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdPath(var_id)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdPermissions  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the Entity to get permissions for.
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdPermissions(var_iddata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdPermissions(var_id)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdSchemaBinding  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the entity.
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdSchemaBinding(var_iddata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdSchemaBinding(var_id)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdSchemaValidation  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the Entity.
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdSchemaValidation(var_iddata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdSchemaValidation(var_id)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdSchemaValidationStatistics  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the container Entity.
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdSchemaValidationStatistics(var_iddata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdSchemaValidationStatistics(var_id)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdSts  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the entity to get credentials. This must be a                    folder with an STS-enabled storage location.
#' var_permission <- org.sagebionetworks.repo.model.sts.StsPermission$new() # OrgSagebionetworksRepoModelStsStsPermission | Read-only or read-write permissions. See ,<a href=\"${org.sagebionetworks.repo.model.sts.StsPermission}\">,StsPermission,</a>,.
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdSts(var_id, var_permissiondata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdSts(var_id, var_permission)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdType  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the Entity to get the EntityHeader for.
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdType(var_iddata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdType(var_id)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdVersion  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the Entity to get all versions for.
#' var_offset <- 56 # integer | The offset index determines where this page will start                      from. When null it will default to 0. (Optional)
#' var_limit <- 56 # integer | Limits the number of entities that will be fetched for                      this page. When null it will default to 10. (Optional)
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdVersion(var_id, offset = var_offset, limit = var_limitdata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdVersion(var_id, offset = var_offset, limit = var_limit)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdVersionVersionNumber  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the Entity.
#' var_version_number <- 3.4 # numeric | The version number of the Entity to get.
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdVersionVersionNumber(var_id, var_version_numberdata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdVersionVersionNumber(var_id, var_version_number)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdVersionVersionNumberAnnotations2  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the Entity.
#' var_version_number <- 3.4 # numeric | The version number of the Entity.
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdVersionVersionNumberAnnotations2(var_id, var_version_numberdata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdVersionVersionNumberAnnotations2(var_id, var_version_number)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdVersionVersionNumberFilehandles  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the FileEntity to get.
#' var_version_number <- 3.4 # numeric | The version number of the FileEntity to get
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdVersionVersionNumberFilehandles(var_id, var_version_numberdata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdVersionVersionNumberFilehandles(var_id, var_version_number)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdVersionVersionNumberFilepreview  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the FileEntity to get.
#' var_version_number <- 3.4 # numeric | The version number of the FileEntity to get.
#' var_redirect <- "redirect_example" # character | When set to false, the URL will be returned as                       text/plain instead of redirecting. (Optional)
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdVersionVersionNumberFilepreview(var_id, var_version_number, redirect = var_redirectdata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdVersionVersionNumberFilepreview(var_id, var_version_number, redirect = var_redirect)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdVersionVersionNumberGeneratedBy  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the entity to fetch.
#' var_version_number <- 3.4 # numeric | the version of the entity
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdVersionVersionNumberGeneratedBy(var_id, var_version_numberdata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdVersionVersionNumberGeneratedBy(var_id, var_version_number)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityIdVersionVersionNumberJson  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | 
#' var_version_number <- 3.4 # numeric | 
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityIdVersionVersionNumberJson(var_id, var_version_numberdata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityIdVersionVersionNumberJson(var_id, var_version_number)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityMd5Md5  ####################
#'
#' library(synclient)
#' var_md5 <- "md5_example" # character | 
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityMd5Md5(var_md5data_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityMd5Md5(var_md5)
#' dput(result)
#'
#'
#' ####################  GetRepoV1EntityType  ####################
#'
#' library(synclient)
#' var_batch <- "batch_example" # character | A comma separated list of Entity IDs to get EntityHeaders                      for.
#'
#' api_instance <- EntityServicesApi$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$GetRepoV1EntityType(var_batchdata_file = "result.txt")
#' result <- api_instance$GetRepoV1EntityType(var_batch)
#' dput(result)
#'
#'
#' ####################  GetRepoV1RESTResources  ####################
#'
#' library(synclient)
#'
#' api_instance <- EntityServicesApi$new()
#'
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
#' # result <- api_instance$GetRepoV1RESTResources(data_file = "result.txt")
#' result <- api_instance$GetRepoV1RESTResources()
#' dput(result)
#'
#'
#' ####################  GetRepoV1RESTResourcesEffectiveSchema  ####################
#'
#' library(synclient)
#' var_resource_id <- "resource_id_example" # character | The full name of the resource (see                    ,<a href=\"${GET.REST.resources}\">,GET /REST/resources,</a>, for                    the full list of names).
#'
#' api_instance <- EntityServicesApi$new()
#'
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
#' # result <- api_instance$GetRepoV1RESTResourcesEffectiveSchema(var_resource_iddata_file = "result.txt")
#' result <- api_instance$GetRepoV1RESTResourcesEffectiveSchema(var_resource_id)
#' dput(result)
#'
#'
#' ####################  GetRepoV1RESTResourcesSchema  ####################
#'
#' library(synclient)
#' var_resource_id <- "resource_id_example" # character | The full name of the resource (see                    ,<a href=\"${GET.REST.resources}\">,GET /REST/resources,</a>, for                    the full list of names).
#'
#' api_instance <- EntityServicesApi$new()
#'
#' # to save the result into a file, simply add the optional `data_file` parameter, e.g.
#' # result <- api_instance$GetRepoV1RESTResourcesSchema(var_resource_iddata_file = "result.txt")
#' result <- api_instance$GetRepoV1RESTResourcesSchema(var_resource_id)
#' dput(result)
#'
#'
#' ####################  PostRepoV1Entity  ####################
#'
#' library(synclient)
#' var_org_sagebionetworks_repo_model_entity <- org.sagebionetworks.repo.model.Entity$new("name_example", "description_example", "id_example", "etag_example", "createdOn_example", "modifiedOn_example", "createdBy_example", "modifiedBy_example", "parentId_example", "concreteType_example", "repositoryName_example", "isManaged_example", 123, "versionLabel_example", "versionComment_example", "isLatestVersion_example", c("columnIds_example"), "isSearchEnabled_example", c(org.sagebionetworks.repo.model.EntityRef$new("entityId_example", 123)), 123, "type_example", c("scopeIds_example"), "definingSQL_example", org.sagebionetworks.repo.model.Reference$new("targetId_example", 123), "linksToClassName_example", "previewString_example", c("headers_example"), c(org.sagebionetworks.repo.model.Row$new(c("cells_example"))), "dataFileHandleId_example", "fileNameOverride_example", "alias_example", 123, "checksum_example", 123, "singleString_example", c("stringList_example"), "singleDate_example", c("dateList_example"), 123, c(123), 123, c(123), "concept_example", "someEnum_example", c(org.sagebionetworks.repo.model.Reference$new("targetId_example", 123)), c(org.sagebionetworks.repo.model.EnvironmentDescriptor$new("type_example", "name_example", "quantifier_example"))) # OrgSagebionetworksRepoModelEntity | 
#' var_generated_by <- "generated_by_example" # character | To track the Provenance of an Entity create, include the                     ID of the ,<a href=\"${org.sagebionetworks.repo.model.provenance.Activity}\">,Activity,</a>, that was created to track the change. For                     more information see: ,<a href=\"${POST.activity}\">,POST                     /activity,</a>,. You must be the creator of the ,<a href=\"${org.sagebionetworks.repo.model.provenance.Activity}\">,Activity,</a>, used here. (Optional)
#'
#' api_instance <- EntityServicesApi$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$PostRepoV1Entity(var_org_sagebionetworks_repo_model_entity, generated_by = var_generated_bydata_file = "result.txt")
#' result <- api_instance$PostRepoV1Entity(var_org_sagebionetworks_repo_model_entity, generated_by = var_generated_by)
#' dput(result)
#'
#'
#' ####################  PostRepoV1EntityChild  ####################
#'
#' library(synclient)
#' var_org_sagebionetworks_repo_model_entity_entity_lookup_request <- org.sagebionetworks.repo.model.entity.EntityLookupRequest$new("parentId_example", "entityName_example") # OrgSagebionetworksRepoModelEntityEntityLookupRequest | 
#'
#' api_instance <- EntityServicesApi$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$PostRepoV1EntityChild(var_org_sagebionetworks_repo_model_entity_entity_lookup_requestdata_file = "result.txt")
#' result <- api_instance$PostRepoV1EntityChild(var_org_sagebionetworks_repo_model_entity_entity_lookup_request)
#' dput(result)
#'
#'
#' ####################  PostRepoV1EntityChildren  ####################
#'
#' library(synclient)
#' var_org_sagebionetworks_repo_model_entity_children_request <- org.sagebionetworks.repo.model.EntityChildrenRequest$new("parentId_example", "nextPageToken_example", c("includeTypes_example"), "sortBy_example", "sortDirection_example", "includeTotalChildCount_example", "includeSumFileSizes_example") # OrgSagebionetworksRepoModelEntityChildrenRequest | 
#'
#' api_instance <- EntityServicesApi$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$PostRepoV1EntityChildren(var_org_sagebionetworks_repo_model_entity_children_requestdata_file = "result.txt")
#' result <- api_instance$PostRepoV1EntityChildren(var_org_sagebionetworks_repo_model_entity_children_request)
#' dput(result)
#'
#'
#' ####################  PostRepoV1EntityHeader  ####################
#'
#' library(synclient)
#' var_org_sagebionetworks_repo_model_request_reference_list <- org.sagebionetworks.repo.model.request.ReferenceList$new(c(org.sagebionetworks.repo.model.Reference$new("targetId_example", 123))) # OrgSagebionetworksRepoModelRequestReferenceList | 
#'
#' api_instance <- EntityServicesApi$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$PostRepoV1EntityHeader(var_org_sagebionetworks_repo_model_request_reference_listdata_file = "result.txt")
#' result <- api_instance$PostRepoV1EntityHeader(var_org_sagebionetworks_repo_model_request_reference_list)
#' dput(result)
#'
#'
#' ####################  PostRepoV1EntityIdAcl  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the Entity to create an ACL for.
#' var_org_sagebionetworks_repo_model_access_control_list <- org.sagebionetworks.repo.model.AccessControlList$new("id_example", "createdBy_example", "creationDate_example", "modifiedBy_example", "modifiedOn_example", "etag_example", c(org.sagebionetworks.repo.model.ResourceAccess$new(123, c("accessType_example")))) # OrgSagebionetworksRepoModelAccessControlList | 
#'
#' api_instance <- EntityServicesApi$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$PostRepoV1EntityIdAcl(var_id, var_org_sagebionetworks_repo_model_access_control_listdata_file = "result.txt")
#' result <- api_instance$PostRepoV1EntityIdAcl(var_id, var_org_sagebionetworks_repo_model_access_control_list)
#' dput(result)
#'
#'
#' ####################  PostRepoV1EntityIdSchemaValidationInvalid  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the container Entity.
#' var_org_sagebionetworks_repo_model_schema_list_validation_results_request <- org.sagebionetworks.repo.model.schema.ListValidationResultsRequest$new("containerId_example", "nextPageToken_example") # OrgSagebionetworksRepoModelSchemaListValidationResultsRequest | 
#'
#' api_instance <- EntityServicesApi$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$PostRepoV1EntityIdSchemaValidationInvalid(var_id, var_org_sagebionetworks_repo_model_schema_list_validation_results_requestdata_file = "result.txt")
#' result <- api_instance$PostRepoV1EntityIdSchemaValidationInvalid(var_id, var_org_sagebionetworks_repo_model_schema_list_validation_results_request)
#' dput(result)
#'
#'
#' ####################  PutRepoV1EntityId  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the entity to update. This ID must match the ID                     of the passed Entity in the request body.
#' var_org_sagebionetworks_repo_model_entity <- org.sagebionetworks.repo.model.Entity$new("name_example", "description_example", "id_example", "etag_example", "createdOn_example", "modifiedOn_example", "createdBy_example", "modifiedBy_example", "parentId_example", "concreteType_example", "repositoryName_example", "isManaged_example", 123, "versionLabel_example", "versionComment_example", "isLatestVersion_example", c("columnIds_example"), "isSearchEnabled_example", c(org.sagebionetworks.repo.model.EntityRef$new("entityId_example", 123)), 123, "type_example", c("scopeIds_example"), "definingSQL_example", org.sagebionetworks.repo.model.Reference$new("targetId_example", 123), "linksToClassName_example", "previewString_example", c("headers_example"), c(org.sagebionetworks.repo.model.Row$new(c("cells_example"))), "dataFileHandleId_example", "fileNameOverride_example", "alias_example", 123, "checksum_example", 123, "singleString_example", c("stringList_example"), "singleDate_example", c("dateList_example"), 123, c(123), 123, c(123), "concept_example", "someEnum_example", c(org.sagebionetworks.repo.model.Reference$new("targetId_example", 123)), c(org.sagebionetworks.repo.model.EnvironmentDescriptor$new("type_example", "name_example", "quantifier_example"))) # OrgSagebionetworksRepoModelEntity | 
#' var_generated_by <- "generated_by_example" # character | To track the Provenance of an Entity update, include the                     ID of the ,<a href=\"${org.sagebionetworks.repo.model.provenance.Activity}\">,Activity,</a>, that was created to track the change. For                     more information see: ,<a href=\"${POST.activity}\">,POST                     /activity,</a>,. You must be the creator of the ,<a href=\"${org.sagebionetworks.repo.model.provenance.Activity}\">,Activity,</a>, used here. (Optional)
#' var_new_version <- "new_version_example" # character | To force the creation of a new version for a ,<a href=\"${org.sagebionetworks.repo.model.VersionableEntity}\">,versionable,</a>,                     entity such as a ,<a href=\"${org.sagebionetworks.repo.model.FileEntity}\">,FileEntity,</a>,,                     include this optional parameter with a value set to true                     (i.e. newVersion=true). This parameter is ignored for                     entities of type ,<a href=\"${org.sagebionetworks.repo.model.table.Table}\">,Table,</a>,                     (See ,<a href=\"${POST.entity.id.table.snapshot}\">,POST                     /entity/{id}/table/snapshot,</a>, instead) (Optional)
#'
#' api_instance <- EntityServicesApi$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$PutRepoV1EntityId(var_id, var_org_sagebionetworks_repo_model_entity, generated_by = var_generated_by, new_version = var_new_versiondata_file = "result.txt")
#' result <- api_instance$PutRepoV1EntityId(var_id, var_org_sagebionetworks_repo_model_entity, generated_by = var_generated_by, new_version = var_new_version)
#' dput(result)
#'
#'
#' ####################  PutRepoV1EntityIdAcl  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the Entity to create an ACL for.
#' var_org_sagebionetworks_repo_model_access_control_list <- org.sagebionetworks.repo.model.AccessControlList$new("id_example", "createdBy_example", "creationDate_example", "modifiedBy_example", "modifiedOn_example", "etag_example", c(org.sagebionetworks.repo.model.ResourceAccess$new(123, c("accessType_example")))) # OrgSagebionetworksRepoModelAccessControlList | 
#'
#' api_instance <- EntityServicesApi$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$PutRepoV1EntityIdAcl(var_id, var_org_sagebionetworks_repo_model_access_control_listdata_file = "result.txt")
#' result <- api_instance$PutRepoV1EntityIdAcl(var_id, var_org_sagebionetworks_repo_model_access_control_list)
#' dput(result)
#'
#'
#' ####################  PutRepoV1EntityIdAnnotations2  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | - The id of the entity to update.
#' var_org_sagebionetworks_repo_model_annotation_v2_annotations <- org.sagebionetworks.repo.model.annotation.v2.Annotations$new("id_example", "etag_example", c(key = org.sagebionetworks.repo.model.annotation.v2.AnnotationsValue$new("type_example", c("value_example")))) # OrgSagebionetworksRepoModelAnnotationV2Annotations | 
#'
#' api_instance <- EntityServicesApi$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$PutRepoV1EntityIdAnnotations2(var_id, var_org_sagebionetworks_repo_model_annotation_v2_annotationsdata_file = "result.txt")
#' result <- api_instance$PutRepoV1EntityIdAnnotations2(var_id, var_org_sagebionetworks_repo_model_annotation_v2_annotations)
#' dput(result)
#'
#'
#' ####################  PutRepoV1EntityIdDatatype  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | 
#' var_type <- org.sagebionetworks.repo.model.DataType$new() # OrgSagebionetworksRepoModelDataType | 
#'
#' api_instance <- EntityServicesApi$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$PutRepoV1EntityIdDatatype(var_id, var_typedata_file = "result.txt")
#' result <- api_instance$PutRepoV1EntityIdDatatype(var_id, var_type)
#' dput(result)
#'
#'
#' ####################  PutRepoV1EntityIdGeneratedBy  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The ID of the entity to update.
#' var_generated_by <- "generated_by_example" # character | The id of the activity to connect to the entity. You must                     be the creator of the ,<a href=\"${org.sagebionetworks.repo.model.provenance.Activity}\">,Activity,</a>, used here.
#'
#' api_instance <- EntityServicesApi$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$PutRepoV1EntityIdGeneratedBy(var_id, var_generated_bydata_file = "result.txt")
#' result <- api_instance$PutRepoV1EntityIdGeneratedBy(var_id, var_generated_by)
#' dput(result)
#'
#'
#' ####################  PutRepoV1EntityIdJson  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | 
#' var_body <- c(key = TODO) # object | 
#'
#' api_instance <- EntityServicesApi$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$PutRepoV1EntityIdJson(var_id, var_bodydata_file = "result.txt")
#' result <- api_instance$PutRepoV1EntityIdJson(var_id, var_body)
#' dput(result)
#'
#'
#' ####################  PutRepoV1EntityIdSchemaBinding  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The syn ID of the entity to bind.
#' var_org_sagebionetworks_repo_model_entity_bind_schema_to_entity_request <- org.sagebionetworks.repo.model.entity.BindSchemaToEntityRequest$new("entityId_example", "schema$id_example", "enableDerivedAnnotations_example") # OrgSagebionetworksRepoModelEntityBindSchemaToEntityRequest | 
#'
#' api_instance <- EntityServicesApi$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$PutRepoV1EntityIdSchemaBinding(var_id, var_org_sagebionetworks_repo_model_entity_bind_schema_to_entity_requestdata_file = "result.txt")
#' result <- api_instance$PutRepoV1EntityIdSchemaBinding(var_id, var_org_sagebionetworks_repo_model_entity_bind_schema_to_entity_request)
#' dput(result)
#'
#'
#' ####################  PutRepoV1EntityIdVersionVersionNumberFilehandle  ####################
#'
#' library(synclient)
#' var_id <- "id_example" # character | The id of the file entity
#' var_version_number <- 3.4 # numeric | The entity version
#' var_org_sagebionetworks_repo_model_entity_file_handle_update_request <- org.sagebionetworks.repo.model.entity.FileHandleUpdateRequest$new("oldFileHandleId_example", "newFileHandleId_example") # OrgSagebionetworksRepoModelEntityFileHandleUpdateRequest | 
#'
#' api_instance <- EntityServicesApi$new()
#'
#' # Configure HTTP bearer authorization: bearerAuth
#' api_instance$api_client$bearer_token <- Sys.getenv("BEARER_TOKEN")
#'
#' api_instance$PutRepoV1EntityIdVersionVersionNumberFilehandle(var_id, var_version_number, var_org_sagebionetworks_repo_model_entity_file_handle_update_request)
#'
#'
#' }
#' @importFrom R6 R6Class
#' @importFrom base64enc base64encode
#' @export
EntityServicesApi <- R6::R6Class(
  "EntityServicesApi",
  public = list(
    api_client = NULL,
    #' Initialize a new EntityServicesApi.
    #'
    #' @description
    #' Initialize a new EntityServicesApi.
    #'
    #' @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 id The ID of the Entity to delete.
    #' @param skip_trash_can (optional) If true the entity will be flag for priority purge and                      deleted as soon as possible
    #' @param ... Other optional arguments
    #' @return void
    #' @export
    DeleteRepoV1EntityId = function(id, skip_trash_can = NULL, ...) {
      local_var_response <- self$DeleteRepoV1EntityIdWithHttpInfo(id, skip_trash_can, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the Entity to delete.
    #' @param skip_trash_can (optional) If true the entity will be flag for priority purge and                      deleted as soon as possible
    #' @param ... Other optional arguments
    #' @return API response (void) with additional information such as HTTP status code, headers
    #' @export
    DeleteRepoV1EntityIdWithHttpInfo = function(id, skip_trash_can = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

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



      query_params[["skipTrashCan"]] <- `skip_trash_can`

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

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

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

      # 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 id The ID of the Entity that should have its ACL deleted.
    #' @param ... Other optional arguments
    #' @return void
    #' @export
    DeleteRepoV1EntityIdAcl = function(id, ...) {
      local_var_response <- self$DeleteRepoV1EntityIdAclWithHttpInfo(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 id The ID of the Entity that should have its ACL deleted.
    #' @param ... Other optional arguments
    #' @return API response (void) with additional information such as HTTP status code, headers
    #' @export
    DeleteRepoV1EntityIdAclWithHttpInfo = function(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(`id`)) {
        stop("Missing required parameter `id`.")
      }


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

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

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

      # 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 id - The ID of the activity to fetch.
    #' @param ... Other optional arguments
    #' @return void
    #' @export
    DeleteRepoV1EntityIdGeneratedBy = function(id, ...) {
      local_var_response <- self$DeleteRepoV1EntityIdGeneratedByWithHttpInfo(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 id - The ID of the activity to fetch.
    #' @param ... Other optional arguments
    #' @return API response (void) with additional information such as HTTP status code, headers
    #' @export
    DeleteRepoV1EntityIdGeneratedByWithHttpInfo = function(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(`id`)) {
        stop("Missing required parameter `id`.")
      }


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

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

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

      # 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 id 
    #' @param ... Other optional arguments
    #' @return void
    #' @export
    DeleteRepoV1EntityIdSchemaBinding = function(id, ...) {
      local_var_response <- self$DeleteRepoV1EntityIdSchemaBindingWithHttpInfo(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 id 
    #' @param ... Other optional arguments
    #' @return API response (void) with additional information such as HTTP status code, headers
    #' @export
    DeleteRepoV1EntityIdSchemaBindingWithHttpInfo = function(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(`id`)) {
        stop("Missing required parameter `id`.")
      }


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

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

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

      # 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 id The ID of the Entity
    #' @param version_number The version number of the Entity to delete.
    #' @param ... Other optional arguments
    #' @return void
    #' @export
    DeleteRepoV1EntityIdVersionVersionNumber = function(id, version_number, ...) {
      local_var_response <- self$DeleteRepoV1EntityIdVersionVersionNumberWithHttpInfo(id, version_number, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the Entity
    #' @param version_number The version number of the Entity to delete.
    #' @param ... Other optional arguments
    #' @return API response (void) with additional information such as HTTP status code, headers
    #' @export
    DeleteRepoV1EntityIdVersionVersionNumberWithHttpInfo = function(id, version_number, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

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

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



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

      if (!missing(`version_number`)) {
        local_var_url_path <- gsub("\\{versionNumber\\}", URLencode(as.character(`version_number`), 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 alias 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelEntityId
    #' @export
    GetRepoV1EntityAliasAlias = function(alias, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1EntityAliasAliasWithHttpInfo(alias, 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 alias 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelEntityId) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1EntityAliasAliasWithHttpInfo = function(alias, 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(`alias`)) {
        stop("Missing required parameter `alias`.")
      }


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


      # 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(), "OrgSagebionetworksRepoModelEntityId", 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 repository_name The name of a managed docker repository
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelEntityId
    #' @export
    GetRepoV1EntityDockerRepoId = function(repository_name, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1EntityDockerRepoIdWithHttpInfo(repository_name, 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 repository_name The name of a managed docker repository
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelEntityId) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1EntityDockerRepoIdWithHttpInfo = function(repository_name, 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(`repository_name`)) {
        stop("Missing required parameter `repository_name`.")
      }


      query_params[["repositoryName"]] <- `repository_name`

      local_var_url_path <- "/repo/v1/entity/dockerRepo/id"
      # 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(), "OrgSagebionetworksRepoModelEntityId", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the entity to fetch.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelEntity
    #' @export
    GetRepoV1EntityId = function(id, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1EntityIdWithHttpInfo(id, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the entity to fetch.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelEntity) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1EntityIdWithHttpInfo = function(id, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

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


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

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

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

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

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

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

        deserialized_resp_obj <- tryCatch(
          self$api_client$deserialize(local_var_resp$response_as_text(), "OrgSagebionetworksRepoModelEntity", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the Entity to check the permission on.
    #' @param access_type The permission to check. Must be from:                    ,<a href=\"${org.sagebionetworks.repo.model.ACCESS_TYPE}\">,ACCESS_TYPE,</a>
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return character
    #' @export
    GetRepoV1EntityIdAccess = function(id, access_type, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1EntityIdAccessWithHttpInfo(id, access_type, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the Entity to check the permission on.
    #' @param access_type The permission to check. Must be from:                    ,<a href=\"${org.sagebionetworks.repo.model.ACCESS_TYPE}\">,ACCESS_TYPE,</a>
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (character) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1EntityIdAccessWithHttpInfo = function(id, access_type, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

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

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



      query_params[["accessType"]] <- `access_type`

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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


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

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

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

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

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

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

        deserialized_resp_obj <- tryCatch(
          self$api_client$deserialize(local_var_resp$response_as_text(), "OrgSagebionetworksRepoModelDownloadActionRequiredList", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id - The id of the entity to update.
    #' @param include_derived - When set to 'true', the derived annotations will be                        included in the results. Default value 'false'.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelAnnotationV2Annotations
    #' @export
    GetRepoV1EntityIdAnnotations2 = function(id, include_derived, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1EntityIdAnnotations2WithHttpInfo(id, include_derived, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id - The id of the entity to update.
    #' @param include_derived - When set to 'true', the derived annotations will be                        included in the results. Default value 'false'.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelAnnotationV2Annotations) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1EntityIdAnnotations2WithHttpInfo = function(id, include_derived, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

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

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



      query_params[["includeDerived"]] <- `include_derived`

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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


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

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

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

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

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

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

        deserialized_resp_obj <- tryCatch(
          self$api_client$deserialize(local_var_resp$response_as_text(), "OrgSagebionetworksRepoModelFileFileHandleResults", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the FileEntity to get.
    #' @param redirect (optional) When set to false, the URL will be returned as text/plain                  instead of redirecting.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return AnyType
    #' @export
    GetRepoV1EntityIdFilepreview = function(id, redirect = NULL, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1EntityIdFilepreviewWithHttpInfo(id, redirect, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the FileEntity to get.
    #' @param redirect (optional) When set to false, the URL will be returned as text/plain                  instead of redirecting.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (AnyType) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1EntityIdFilepreviewWithHttpInfo = function(id, redirect = NULL, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

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



      query_params[["redirect"]] <- `redirect`

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

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

      # The Accept request HTTP header
      local_var_accepts <- list("text/plain")

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

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


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

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

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

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

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

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

        deserialized_resp_obj <- tryCatch(
          self$api_client$deserialize(local_var_resp$response_as_text(), "OrgSagebionetworksRepoModelProvenanceActivity", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id 
    #' @param include_derived_annotations true if annotations that are derived from a                                   bound schema should be included in the                                   response, false otherwise (default false)
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return object
    #' @export
    GetRepoV1EntityIdJson = function(id, include_derived_annotations, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1EntityIdJsonWithHttpInfo(id, include_derived_annotations, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id 
    #' @param include_derived_annotations true if annotations that are derived from a                                   bound schema should be included in the                                   response, false otherwise (default false)
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (object) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1EntityIdJsonWithHttpInfo = function(id, include_derived_annotations, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

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

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



      query_params[["includeDerivedAnnotations"]] <- `include_derived_annotations`

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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


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

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

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

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

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

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

        deserialized_resp_obj <- tryCatch(
          self$api_client$deserialize(local_var_resp$response_as_text(), "OrgSagebionetworksRepoModelSchemaValidationSummaryStatistics", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the entity to get credentials. This must be a                    folder with an STS-enabled storage location.
    #' @param permission Read-only or read-write permissions. See ,<a href=\"${org.sagebionetworks.repo.model.sts.StsPermission}\">,StsPermission,</a>,.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelStsStsCredentials
    #' @export
    GetRepoV1EntityIdSts = function(id, permission, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1EntityIdStsWithHttpInfo(id, permission, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the entity to get credentials. This must be a                    folder with an STS-enabled storage location.
    #' @param permission Read-only or read-write permissions. See ,<a href=\"${org.sagebionetworks.repo.model.sts.StsPermission}\">,StsPermission,</a>,.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelStsStsCredentials) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1EntityIdStsWithHttpInfo = function(id, permission, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

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

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



      query_params[["permission"]] <- `permission`

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

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

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

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

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

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

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

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


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

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

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

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

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

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

        deserialized_resp_obj <- tryCatch(
          self$api_client$deserialize(local_var_resp$response_as_text(), "OrgSagebionetworksRepoModelEntityHeader", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the Entity to get all versions for.
    #' @param offset (optional) The offset index determines where this page will start                      from. When null it will default to 0.
    #' @param limit (optional) Limits the number of entities that will be fetched for                      this page. When null it will default to 10.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return PaginatedResultsOfVersionInfo
    #' @export
    GetRepoV1EntityIdVersion = function(id, offset = NULL, limit = NULL, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1EntityIdVersionWithHttpInfo(id, offset, limit, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the Entity to get all versions for.
    #' @param offset (optional) The offset index determines where this page will start                      from. When null it will default to 0.
    #' @param limit (optional) Limits the number of entities that will be fetched for                      this page. When null it will default to 10.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (PaginatedResultsOfVersionInfo) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1EntityIdVersionWithHttpInfo = function(id, offset = NULL, limit = NULL, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

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




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

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

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

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

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

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

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

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

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

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

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



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

      if (!missing(`version_number`)) {
        local_var_url_path <- gsub("\\{versionNumber\\}", URLencode(as.character(`version_number`), 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(), "OrgSagebionetworksRepoModelEntity", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the Entity.
    #' @param version_number The version number of the Entity.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelAnnotationV2Annotations
    #' @export
    GetRepoV1EntityIdVersionVersionNumberAnnotations2 = function(id, version_number, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1EntityIdVersionVersionNumberAnnotations2WithHttpInfo(id, version_number, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the Entity.
    #' @param version_number The version number of the Entity.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelAnnotationV2Annotations) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1EntityIdVersionVersionNumberAnnotations2WithHttpInfo = function(id, version_number, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

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

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



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

      if (!missing(`version_number`)) {
        local_var_url_path <- gsub("\\{versionNumber\\}", URLencode(as.character(`version_number`), 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(), "OrgSagebionetworksRepoModelAnnotationV2Annotations", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the FileEntity to get.
    #' @param version_number The version number of the FileEntity to get
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelFileFileHandleResults
    #' @export
    GetRepoV1EntityIdVersionVersionNumberFilehandles = function(id, version_number, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1EntityIdVersionVersionNumberFilehandlesWithHttpInfo(id, version_number, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the FileEntity to get.
    #' @param version_number The version number of the FileEntity to get
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelFileFileHandleResults) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1EntityIdVersionVersionNumberFilehandlesWithHttpInfo = function(id, version_number, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

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

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



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

      if (!missing(`version_number`)) {
        local_var_url_path <- gsub("\\{versionNumber\\}", URLencode(as.character(`version_number`), 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(), "OrgSagebionetworksRepoModelFileFileHandleResults", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the FileEntity to get.
    #' @param version_number The version number of the FileEntity to get.
    #' @param redirect (optional) When set to false, the URL will be returned as                       text/plain instead of redirecting.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return AnyType
    #' @export
    GetRepoV1EntityIdVersionVersionNumberFilepreview = function(id, version_number, redirect = NULL, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1EntityIdVersionVersionNumberFilepreviewWithHttpInfo(id, version_number, redirect, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the FileEntity to get.
    #' @param version_number The version number of the FileEntity to get.
    #' @param redirect (optional) When set to false, the URL will be returned as                       text/plain instead of redirecting.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (AnyType) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1EntityIdVersionVersionNumberFilepreviewWithHttpInfo = function(id, version_number, redirect = NULL, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

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

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




      query_params[["redirect"]] <- `redirect`

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

      if (!missing(`version_number`)) {
        local_var_url_path <- gsub("\\{versionNumber\\}", URLencode(as.character(`version_number`), 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("text/plain")

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

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

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



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

      if (!missing(`version_number`)) {
        local_var_url_path <- gsub("\\{versionNumber\\}", URLencode(as.character(`version_number`), 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(), "OrgSagebionetworksRepoModelProvenanceActivity", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id 
    #' @param version_number 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return object
    #' @export
    GetRepoV1EntityIdVersionVersionNumberJson = function(id, version_number, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1EntityIdVersionVersionNumberJsonWithHttpInfo(id, version_number, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id 
    #' @param version_number 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (object) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1EntityIdVersionVersionNumberJsonWithHttpInfo = function(id, version_number, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

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

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



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

      if (!missing(`version_number`)) {
        local_var_url_path <- gsub("\\{versionNumber\\}", URLencode(as.character(`version_number`), 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(), "object", 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 md5 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return PaginatedResultsOfEntityHeader
    #' @export
    GetRepoV1EntityMd5Md5 = function(md5, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1EntityMd5Md5WithHttpInfo(md5, 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 md5 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (PaginatedResultsOfEntityHeader) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1EntityMd5Md5WithHttpInfo = function(md5, 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(`md5`)) {
        stop("Missing required parameter `md5`.")
      }


      local_var_url_path <- "/repo/v1/entity/md5/{md5}"
      if (!missing(`md5`)) {
        local_var_url_path <- gsub("\\{md5\\}", URLencode(as.character(`md5`), 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(), "PaginatedResultsOfEntityHeader", 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 batch A comma separated list of Entity IDs to get EntityHeaders                      for.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return PaginatedResultsOfEntityHeader
    #' @export
    GetRepoV1EntityType = function(batch, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1EntityTypeWithHttpInfo(batch, 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 batch A comma separated list of Entity IDs to get EntityHeaders                      for.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (PaginatedResultsOfEntityHeader) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1EntityTypeWithHttpInfo = function(batch, 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(`batch`)) {
        stop("Missing required parameter `batch`.")
      }


      query_params[["batch"]] <- `batch`

      local_var_url_path <- "/repo/v1/entity/type"
      # 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(), "PaginatedResultsOfEntityHeader", 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 data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelRestResourceList
    #' @export
    GetRepoV1RESTResources = function(data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1RESTResourcesWithHttpInfo(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 data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelRestResourceList) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1RESTResourcesWithHttpInfo = function(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

      local_var_url_path <- "/repo/v1/REST/resources"

      # 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(), "OrgSagebionetworksRepoModelRestResourceList", 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 resource_id The full name of the resource (see                    ,<a href=\"${GET.REST.resources}\">,GET /REST/resources,</a>, for                    the full list of names).
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return object
    #' @export
    GetRepoV1RESTResourcesEffectiveSchema = function(resource_id, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1RESTResourcesEffectiveSchemaWithHttpInfo(resource_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 resource_id The full name of the resource (see                    ,<a href=\"${GET.REST.resources}\">,GET /REST/resources,</a>, for                    the full list of names).
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (object) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1RESTResourcesEffectiveSchemaWithHttpInfo = function(resource_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(`resource_id`)) {
        stop("Missing required parameter `resource_id`.")
      }


      query_params[["resourceId"]] <- `resource_id`

      local_var_url_path <- "/repo/v1/REST/resources/effectiveSchema"

      # 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(), "object", 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 resource_id The full name of the resource (see                    ,<a href=\"${GET.REST.resources}\">,GET /REST/resources,</a>, for                    the full list of names).
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return object
    #' @export
    GetRepoV1RESTResourcesSchema = function(resource_id, data_file = NULL, ...) {
      local_var_response <- self$GetRepoV1RESTResourcesSchemaWithHttpInfo(resource_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 resource_id The full name of the resource (see                    ,<a href=\"${GET.REST.resources}\">,GET /REST/resources,</a>, for                    the full list of names).
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (object) with additional information such as HTTP status code, headers
    #' @export
    GetRepoV1RESTResourcesSchemaWithHttpInfo = function(resource_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(`resource_id`)) {
        stop("Missing required parameter `resource_id`.")
      }


      query_params[["resourceId"]] <- `resource_id`

      local_var_url_path <- "/repo/v1/REST/resources/schema"

      # 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(), "object", 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_entity 
    #' @param generated_by (optional) To track the Provenance of an Entity create, include the                     ID of the ,<a href=\"${org.sagebionetworks.repo.model.provenance.Activity}\">,Activity,</a>, that was created to track the change. For                     more information see: ,<a href=\"${POST.activity}\">,POST                     /activity,</a>,. You must be the creator of the ,<a href=\"${org.sagebionetworks.repo.model.provenance.Activity}\">,Activity,</a>, used here.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelEntity
    #' @export
    PostRepoV1Entity = function(org_sagebionetworks_repo_model_entity, generated_by = NULL, data_file = NULL, ...) {
      local_var_response <- self$PostRepoV1EntityWithHttpInfo(org_sagebionetworks_repo_model_entity, generated_by, 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_entity 
    #' @param generated_by (optional) To track the Provenance of an Entity create, include the                     ID of the ,<a href=\"${org.sagebionetworks.repo.model.provenance.Activity}\">,Activity,</a>, that was created to track the change. For                     more information see: ,<a href=\"${POST.activity}\">,POST                     /activity,</a>,. You must be the creator of the ,<a href=\"${org.sagebionetworks.repo.model.provenance.Activity}\">,Activity,</a>, used here.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelEntity) with additional information such as HTTP status code, headers
    #' @export
    PostRepoV1EntityWithHttpInfo = function(org_sagebionetworks_repo_model_entity, generated_by = NULL, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

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



      query_params[["generatedBy"]] <- `generated_by`

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

      local_var_url_path <- "/repo/v1/entity"
      # 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(), "OrgSagebionetworksRepoModelEntity", 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_entity_entity_lookup_request 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelEntityId
    #' @export
    PostRepoV1EntityChild = function(org_sagebionetworks_repo_model_entity_entity_lookup_request, data_file = NULL, ...) {
      local_var_response <- self$PostRepoV1EntityChildWithHttpInfo(org_sagebionetworks_repo_model_entity_entity_lookup_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_entity_entity_lookup_request 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelEntityId) with additional information such as HTTP status code, headers
    #' @export
    PostRepoV1EntityChildWithHttpInfo = function(org_sagebionetworks_repo_model_entity_entity_lookup_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_entity_entity_lookup_request`)) {
        stop("Missing required parameter `org_sagebionetworks_repo_model_entity_entity_lookup_request`.")
      }


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

      local_var_url_path <- "/repo/v1/entity/child"
      # 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(), "OrgSagebionetworksRepoModelEntityId", 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_entity_children_request 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelEntityChildrenResponse
    #' @export
    PostRepoV1EntityChildren = function(org_sagebionetworks_repo_model_entity_children_request, data_file = NULL, ...) {
      local_var_response <- self$PostRepoV1EntityChildrenWithHttpInfo(org_sagebionetworks_repo_model_entity_children_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_entity_children_request 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelEntityChildrenResponse) with additional information such as HTTP status code, headers
    #' @export
    PostRepoV1EntityChildrenWithHttpInfo = function(org_sagebionetworks_repo_model_entity_children_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_entity_children_request`)) {
        stop("Missing required parameter `org_sagebionetworks_repo_model_entity_children_request`.")
      }


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

      local_var_url_path <- "/repo/v1/entity/children"
      # 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(), "OrgSagebionetworksRepoModelEntityChildrenResponse", 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_request_reference_list 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return PaginatedResultsOfEntityHeader
    #' @export
    PostRepoV1EntityHeader = function(org_sagebionetworks_repo_model_request_reference_list, data_file = NULL, ...) {
      local_var_response <- self$PostRepoV1EntityHeaderWithHttpInfo(org_sagebionetworks_repo_model_request_reference_list, 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_request_reference_list 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (PaginatedResultsOfEntityHeader) with additional information such as HTTP status code, headers
    #' @export
    PostRepoV1EntityHeaderWithHttpInfo = function(org_sagebionetworks_repo_model_request_reference_list, 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_request_reference_list`)) {
        stop("Missing required parameter `org_sagebionetworks_repo_model_request_reference_list`.")
      }


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

      local_var_url_path <- "/repo/v1/entity/header"
      # 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(), "PaginatedResultsOfEntityHeader", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the Entity to create an ACL for.
    #' @param org_sagebionetworks_repo_model_access_control_list 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelAccessControlList
    #' @export
    PostRepoV1EntityIdAcl = function(id, org_sagebionetworks_repo_model_access_control_list, data_file = NULL, ...) {
      local_var_response <- self$PostRepoV1EntityIdAclWithHttpInfo(id, org_sagebionetworks_repo_model_access_control_list, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the Entity to create an ACL for.
    #' @param org_sagebionetworks_repo_model_access_control_list 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelAccessControlList) with additional information such as HTTP status code, headers
    #' @export
    PostRepoV1EntityIdAclWithHttpInfo = function(id, org_sagebionetworks_repo_model_access_control_list, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

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

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



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

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

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

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

      # The Content-Type representation header
      local_var_content_types <- list("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(), "OrgSagebionetworksRepoModelAccessControlList", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the container Entity.
    #' @param org_sagebionetworks_repo_model_schema_list_validation_results_request 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelSchemaListValidationResultsResponse
    #' @export
    PostRepoV1EntityIdSchemaValidationInvalid = function(id, org_sagebionetworks_repo_model_schema_list_validation_results_request, data_file = NULL, ...) {
      local_var_response <- self$PostRepoV1EntityIdSchemaValidationInvalidWithHttpInfo(id, org_sagebionetworks_repo_model_schema_list_validation_results_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 id The ID of the container Entity.
    #' @param org_sagebionetworks_repo_model_schema_list_validation_results_request 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelSchemaListValidationResultsResponse) with additional information such as HTTP status code, headers
    #' @export
    PostRepoV1EntityIdSchemaValidationInvalidWithHttpInfo = function(id, org_sagebionetworks_repo_model_schema_list_validation_results_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(`id`)) {
        stop("Missing required parameter `id`.")
      }

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



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

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

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

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

      # The Content-Type representation header
      local_var_content_types <- list("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(), "OrgSagebionetworksRepoModelSchemaListValidationResultsResponse", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the entity to update. This ID must match the ID                     of the passed Entity in the request body.
    #' @param org_sagebionetworks_repo_model_entity 
    #' @param generated_by (optional) To track the Provenance of an Entity update, include the                     ID of the ,<a href=\"${org.sagebionetworks.repo.model.provenance.Activity}\">,Activity,</a>, that was created to track the change. For                     more information see: ,<a href=\"${POST.activity}\">,POST                     /activity,</a>,. You must be the creator of the ,<a href=\"${org.sagebionetworks.repo.model.provenance.Activity}\">,Activity,</a>, used here.
    #' @param new_version (optional) To force the creation of a new version for a ,<a href=\"${org.sagebionetworks.repo.model.VersionableEntity}\">,versionable,</a>,                     entity such as a ,<a href=\"${org.sagebionetworks.repo.model.FileEntity}\">,FileEntity,</a>,,                     include this optional parameter with a value set to true                     (i.e. newVersion=true). This parameter is ignored for                     entities of type ,<a href=\"${org.sagebionetworks.repo.model.table.Table}\">,Table,</a>,                     (See ,<a href=\"${POST.entity.id.table.snapshot}\">,POST                     /entity/{id}/table/snapshot,</a>, instead)
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelEntity
    #' @export
    PutRepoV1EntityId = function(id, org_sagebionetworks_repo_model_entity, generated_by = NULL, new_version = NULL, data_file = NULL, ...) {
      local_var_response <- self$PutRepoV1EntityIdWithHttpInfo(id, org_sagebionetworks_repo_model_entity, generated_by, new_version, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the entity to update. This ID must match the ID                     of the passed Entity in the request body.
    #' @param org_sagebionetworks_repo_model_entity 
    #' @param generated_by (optional) To track the Provenance of an Entity update, include the                     ID of the ,<a href=\"${org.sagebionetworks.repo.model.provenance.Activity}\">,Activity,</a>, that was created to track the change. For                     more information see: ,<a href=\"${POST.activity}\">,POST                     /activity,</a>,. You must be the creator of the ,<a href=\"${org.sagebionetworks.repo.model.provenance.Activity}\">,Activity,</a>, used here.
    #' @param new_version (optional) To force the creation of a new version for a ,<a href=\"${org.sagebionetworks.repo.model.VersionableEntity}\">,versionable,</a>,                     entity such as a ,<a href=\"${org.sagebionetworks.repo.model.FileEntity}\">,FileEntity,</a>,,                     include this optional parameter with a value set to true                     (i.e. newVersion=true). This parameter is ignored for                     entities of type ,<a href=\"${org.sagebionetworks.repo.model.table.Table}\">,Table,</a>,                     (See ,<a href=\"${POST.entity.id.table.snapshot}\">,POST                     /entity/{id}/table/snapshot,</a>, instead)
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelEntity) with additional information such as HTTP status code, headers
    #' @export
    PutRepoV1EntityIdWithHttpInfo = function(id, org_sagebionetworks_repo_model_entity, generated_by = NULL, new_version = NULL, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

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

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





      query_params[["generatedBy"]] <- `generated_by`

      query_params[["newVersion"]] <- `new_version`

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

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

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

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

      # The Content-Type representation header
      local_var_content_types <- list("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(), "OrgSagebionetworksRepoModelEntity", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the Entity to create an ACL for.
    #' @param org_sagebionetworks_repo_model_access_control_list 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelAccessControlList
    #' @export
    PutRepoV1EntityIdAcl = function(id, org_sagebionetworks_repo_model_access_control_list, data_file = NULL, ...) {
      local_var_response <- self$PutRepoV1EntityIdAclWithHttpInfo(id, org_sagebionetworks_repo_model_access_control_list, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the Entity to create an ACL for.
    #' @param org_sagebionetworks_repo_model_access_control_list 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelAccessControlList) with additional information such as HTTP status code, headers
    #' @export
    PutRepoV1EntityIdAclWithHttpInfo = function(id, org_sagebionetworks_repo_model_access_control_list, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

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

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



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

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

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

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

      # The Content-Type representation header
      local_var_content_types <- list("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(), "OrgSagebionetworksRepoModelAccessControlList", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id - The id of the entity to update.
    #' @param org_sagebionetworks_repo_model_annotation_v2_annotations 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelAnnotationV2Annotations
    #' @export
    PutRepoV1EntityIdAnnotations2 = function(id, org_sagebionetworks_repo_model_annotation_v2_annotations, data_file = NULL, ...) {
      local_var_response <- self$PutRepoV1EntityIdAnnotations2WithHttpInfo(id, org_sagebionetworks_repo_model_annotation_v2_annotations, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id - The id of the entity to update.
    #' @param org_sagebionetworks_repo_model_annotation_v2_annotations 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelAnnotationV2Annotations) with additional information such as HTTP status code, headers
    #' @export
    PutRepoV1EntityIdAnnotations2WithHttpInfo = function(id, org_sagebionetworks_repo_model_annotation_v2_annotations, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

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

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



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

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

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

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

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

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

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



      query_params[["type"]] <- `type`

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

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

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

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

      local_var_resp <- self$api_client$CallApi(url = paste0(self$api_client$base_path, local_var_url_path),
                                 method = "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(), "OrgSagebionetworksRepoModelDataTypeResponse", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the entity to update.
    #' @param generated_by The id of the activity to connect to the entity. You must                     be the creator of the ,<a href=\"${org.sagebionetworks.repo.model.provenance.Activity}\">,Activity,</a>, used here.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelProvenanceActivity
    #' @export
    PutRepoV1EntityIdGeneratedBy = function(id, generated_by, data_file = NULL, ...) {
      local_var_response <- self$PutRepoV1EntityIdGeneratedByWithHttpInfo(id, generated_by, data_file = data_file, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The ID of the entity to update.
    #' @param generated_by The id of the activity to connect to the entity. You must                     be the creator of the ,<a href=\"${org.sagebionetworks.repo.model.provenance.Activity}\">,Activity,</a>, used here.
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelProvenanceActivity) with additional information such as HTTP status code, headers
    #' @export
    PutRepoV1EntityIdGeneratedByWithHttpInfo = function(id, generated_by, data_file = NULL, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

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

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



      query_params[["generatedBy"]] <- `generated_by`

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

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

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

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

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

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

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



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

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

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

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

      # The Content-Type representation header
      local_var_content_types <- list("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(), "object", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The syn ID of the entity to bind.
    #' @param org_sagebionetworks_repo_model_entity_bind_schema_to_entity_request 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return OrgSagebionetworksRepoModelSchemaJsonSchemaObjectBinding
    #' @export
    PutRepoV1EntityIdSchemaBinding = function(id, org_sagebionetworks_repo_model_entity_bind_schema_to_entity_request, data_file = NULL, ...) {
      local_var_response <- self$PutRepoV1EntityIdSchemaBindingWithHttpInfo(id, org_sagebionetworks_repo_model_entity_bind_schema_to_entity_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 id The syn ID of the entity to bind.
    #' @param org_sagebionetworks_repo_model_entity_bind_schema_to_entity_request 
    #' @param data_file (optional) name of the data file to save the result
    #' @param ... Other optional arguments
    #' @return API response (OrgSagebionetworksRepoModelSchemaJsonSchemaObjectBinding) with additional information such as HTTP status code, headers
    #' @export
    PutRepoV1EntityIdSchemaBindingWithHttpInfo = function(id, org_sagebionetworks_repo_model_entity_bind_schema_to_entity_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(`id`)) {
        stop("Missing required parameter `id`.")
      }

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



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

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

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

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

      # The Content-Type representation header
      local_var_content_types <- list("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(), "OrgSagebionetworksRepoModelSchemaJsonSchemaObjectBinding", loadNamespace("synclient")),
          error = function(e) {
            stop("Failed to deserialize response")
          }
        )
        local_var_resp$content <- deserialized_resp_obj
        local_var_resp
      } else if (local_var_resp$status_code >= 300 && local_var_resp$status_code <= 399) {
        ApiResponse$new(paste("Server returned ", local_var_resp$status_code, " response status code."), local_var_resp)
      } else if (local_var_resp$status_code >= 400 && local_var_resp$status_code <= 499) {
        ApiResponse$new("API client error", local_var_resp)
      } else if (local_var_resp$status_code >= 500 && local_var_resp$status_code <= 599) {
        if (is.null(local_var_resp$response) || local_var_resp$response == "") {
          local_var_resp$response <- "API server error"
        }
        local_var_resp
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The id of the file entity
    #' @param version_number The entity version
    #' @param org_sagebionetworks_repo_model_entity_file_handle_update_request 
    #' @param ... Other optional arguments
    #' @return void
    #' @export
    PutRepoV1EntityIdVersionVersionNumberFilehandle = function(id, version_number, org_sagebionetworks_repo_model_entity_file_handle_update_request, ...) {
      local_var_response <- self$PutRepoV1EntityIdVersionVersionNumberFilehandleWithHttpInfo(id, version_number, org_sagebionetworks_repo_model_entity_file_handle_update_request, ...)
      if (local_var_response$status_code >= 200 && local_var_response$status_code <= 299) {
        local_var_response$content
      } else if (local_var_response$status_code >= 300 && local_var_response$status_code <= 399) {
        local_var_response
      } else if (local_var_response$status_code >= 400 && local_var_response$status_code <= 499) {
        local_var_response
      } else if (local_var_response$status_code >= 500 && local_var_response$status_code <= 599) {
        local_var_response
      }
    },
    #' 
    #'
    #' @description
    #' 
    #'
    #' @param id The id of the file entity
    #' @param version_number The entity version
    #' @param org_sagebionetworks_repo_model_entity_file_handle_update_request 
    #' @param ... Other optional arguments
    #' @return API response (void) with additional information such as HTTP status code, headers
    #' @export
    PutRepoV1EntityIdVersionVersionNumberFilehandleWithHttpInfo = function(id, version_number, org_sagebionetworks_repo_model_entity_file_handle_update_request, ...) {
      args <- list(...)
      query_params <- list()
      header_params <- c()
      form_params <- list()
      file_params <- list()
      local_var_body <- NULL
      oauth_scopes <- NULL
      is_oauth <- FALSE

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

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

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




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

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

      if (!missing(`version_number`)) {
        local_var_url_path <- gsub("\\{versionNumber\\}", URLencode(as.character(`version_number`), 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("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) {
        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
      }
    }
  )
)
thomasyu888/synr-sdk-client documentation built on Dec. 31, 2024, 11:29 a.m.