Files
sdk/api_dataroom.go

3095 lines
117 KiB
Go

/*
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hanzoai
import (
"bytes"
"context"
"io"
"net/http"
"net/url"
"strings"
)
// DataroomAPIService DataroomAPI service
type DataroomAPIService service
type DataroomAPIGetDataroomAnalyticsDataroomByDataroomidRequest struct {
ctx context.Context
ApiService *DataroomAPIService
dataroomId string
}
func (r DataroomAPIGetDataroomAnalyticsDataroomByDataroomidRequest) Execute() (*DataroomDataroomStats, *http.Response, error) {
return r.ApiService.GetDataroomAnalyticsDataroomByDataroomidExecute(r)
}
/*
GetDataroomAnalyticsDataroomByDataroomid Rolls up every share link pointing at one data room: session and page-view totals for the room, plus the per-page breakdown for each link beneath it.
Rolls up every share link pointing at one data room:
session and page-view totals for the room, plus the per-page breakdown for each
link beneath it.
A room id outside the caller's own tenant store is not found. Only links that
NAME the room are counted — a link created over a single document contributes
nothing here, even when that document also sits in the room.
Only a SuperAdmin or an admin of the org may call it; a member who is neither is
refused 403.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param dataroomId DataroomID is the room to report on. It is the path segment, resolved in the caller's own tenant store.
@return DataroomAPIGetDataroomAnalyticsDataroomByDataroomidRequest
*/
func (a *DataroomAPIService) GetDataroomAnalyticsDataroomByDataroomid(ctx context.Context, dataroomId string) DataroomAPIGetDataroomAnalyticsDataroomByDataroomidRequest {
return DataroomAPIGetDataroomAnalyticsDataroomByDataroomidRequest{
ApiService: a,
ctx: ctx,
dataroomId: dataroomId,
}
}
// Execute executes the request
//
// @return DataroomDataroomStats
func (a *DataroomAPIService) GetDataroomAnalyticsDataroomByDataroomidExecute(r DataroomAPIGetDataroomAnalyticsDataroomByDataroomidRequest) (*DataroomDataroomStats, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DataroomDataroomStats
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.GetDataroomAnalyticsDataroomByDataroomid")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/analytics/dataroom/{dataroomId}"
localVarPath = strings.Replace(localVarPath, "{"+"dataroomId"+"}", url.PathEscape(parameterValueToString(r.dataroomId, "dataroomId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type DataroomAPIGetDataroomAnalyticsLinkByLinkidRequest struct {
ctx context.Context
ApiService *DataroomAPIService
linkId string
}
func (r DataroomAPIGetDataroomAnalyticsLinkByLinkidRequest) Execute() (*DataroomDataroomLinkStats, *http.Response, error) {
return r.ApiService.GetDataroomAnalyticsLinkByLinkidExecute(r)
}
/*
GetDataroomAnalyticsLinkByLinkid Reports how one share link was actually read: total viewing sessions, total page views, and per page the view count, the summed dwell measure and its average.
Reports how one share link was actually read: total viewing
sessions, total page views, and per page the view count, the summed dwell
measure and its average.
The link is resolved in the caller's OWN tenant store, so another org's link id
is not found — knowing a link id is enough to OPEN the room it shares, and
never enough to read who has been reading it.
Only a SuperAdmin or an admin of the org may call it; a member who is neither is
refused 403.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param linkId LinkID is the link to report on. It is the path segment, resolved in the caller's own tenant store.
@return DataroomAPIGetDataroomAnalyticsLinkByLinkidRequest
*/
func (a *DataroomAPIService) GetDataroomAnalyticsLinkByLinkid(ctx context.Context, linkId string) DataroomAPIGetDataroomAnalyticsLinkByLinkidRequest {
return DataroomAPIGetDataroomAnalyticsLinkByLinkidRequest{
ApiService: a,
ctx: ctx,
linkId: linkId,
}
}
// Execute executes the request
//
// @return DataroomDataroomLinkStats
func (a *DataroomAPIService) GetDataroomAnalyticsLinkByLinkidExecute(r DataroomAPIGetDataroomAnalyticsLinkByLinkidRequest) (*DataroomDataroomLinkStats, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DataroomDataroomLinkStats
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.GetDataroomAnalyticsLinkByLinkid")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/analytics/link/{linkId}"
localVarPath = strings.Replace(localVarPath, "{"+"linkId"+"}", url.PathEscape(parameterValueToString(r.linkId, "linkId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type DataroomAPIGetDataroomDataroomsRequest struct {
ctx context.Context
ApiService *DataroomAPIService
}
func (r DataroomAPIGetDataroomDataroomsRequest) Execute() (*DataroomDataroomRooms, *http.Response, error) {
return r.ApiService.GetDataroomDataroomsExecute(r)
}
/*
GetDataroomDatarooms Returns every data room in the caller org's own store, newest first, with its short public id, name, description and timestamps.
Returns every data room in the caller org's own store, newest
first, with its short public id, name, description and timestamps.
Documents are not included — a room's contents come from reading the single
room.
Only a SuperAdmin or an admin of the org may call it; a member who is neither is
refused 403.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return DataroomAPIGetDataroomDataroomsRequest
*/
func (a *DataroomAPIService) GetDataroomDatarooms(ctx context.Context) DataroomAPIGetDataroomDataroomsRequest {
return DataroomAPIGetDataroomDataroomsRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return DataroomDataroomRooms
func (a *DataroomAPIService) GetDataroomDataroomsExecute(r DataroomAPIGetDataroomDataroomsRequest) (*DataroomDataroomRooms, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DataroomDataroomRooms
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.GetDataroomDatarooms")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/datarooms"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type DataroomAPIGetDataroomDataroomsByIdRequest struct {
ctx context.Context
ApiService *DataroomAPIService
id string
}
func (r DataroomAPIGetDataroomDataroomsByIdRequest) Execute() (*DataroomDataroomRoomDetailOne, *http.Response, error) {
return r.ApiService.GetDataroomDataroomsByIdExecute(r)
}
/*
GetDataroomDataroomsById Reads one of the caller org's data rooms together with every document in it, each carrying its membership id and order index.
Reads one of the caller org's data rooms together with every
document in it, each carrying its membership id and order index.
The documents are sorted by that index with unordered ones last and creation
time breaking ties — the SAME order a link's visitor sees, so this is what the
room looks like from the outside. A room id outside the caller's own tenant
store is not found.
Only a SuperAdmin or an admin of the org may call it; a member who is neither is
refused 403.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id ID is the room to read. It is the path segment: the URL is the addressing authority, and the org it is resolved in comes from the caller's principal, so an id from another tenant is simply not found.
@return DataroomAPIGetDataroomDataroomsByIdRequest
*/
func (a *DataroomAPIService) GetDataroomDataroomsById(ctx context.Context, id string) DataroomAPIGetDataroomDataroomsByIdRequest {
return DataroomAPIGetDataroomDataroomsByIdRequest{
ApiService: a,
ctx: ctx,
id: id,
}
}
// Execute executes the request
//
// @return DataroomDataroomRoomDetailOne
func (a *DataroomAPIService) GetDataroomDataroomsByIdExecute(r DataroomAPIGetDataroomDataroomsByIdRequest) (*DataroomDataroomRoomDetailOne, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DataroomDataroomRoomDetailOne
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.GetDataroomDataroomsById")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/datarooms/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type DataroomAPIGetDataroomDocumentsRequest struct {
ctx context.Context
ApiService *DataroomAPIService
}
func (r DataroomAPIGetDataroomDocumentsRequest) Execute() (*DataroomDataroomDocuments, *http.Response, error) {
return r.ApiService.GetDataroomDocumentsExecute(r)
}
/*
GetDataroomDocuments Returns every document in the caller org's own store, newest first — name, opaque storage key, content type, page count, size and timestamps.
Returns every document in the caller org's own store, newest
first — name, opaque storage key, content type, page count, size and
timestamps.
Tenant isolation is the per-org store itself: there is one SQLite file per org
and the org is never a parameter, so no input the caller controls can address
another tenant's documents. Metadata only — the bytes come from the file route.
Only a SuperAdmin or an admin of the org may call it; a member who is neither is
refused 403.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return DataroomAPIGetDataroomDocumentsRequest
*/
func (a *DataroomAPIService) GetDataroomDocuments(ctx context.Context) DataroomAPIGetDataroomDocumentsRequest {
return DataroomAPIGetDataroomDocumentsRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return DataroomDataroomDocuments
func (a *DataroomAPIService) GetDataroomDocumentsExecute(r DataroomAPIGetDataroomDocumentsRequest) (*DataroomDataroomDocuments, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DataroomDataroomDocuments
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.GetDataroomDocuments")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/documents"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type DataroomAPIGetDataroomDocumentsByIdRequest struct {
ctx context.Context
ApiService *DataroomAPIService
id string
}
func (r DataroomAPIGetDataroomDocumentsByIdRequest) Execute() (*DataroomDataroomDocumentOne, *http.Response, error) {
return r.ApiService.GetDataroomDocumentsByIdExecute(r)
}
/*
GetDataroomDocumentsById Reads one of the caller org's documents — its name, opaque storage key, content type, page count, size and timestamps.
Reads one of the caller org's documents — its name, opaque storage
key, content type, page count, size and timestamps.
The lookup runs in the caller's own tenant store, so an id belonging to another
org is not found exactly like one that never existed. Metadata only: the bytes
are a separate read.
Only a SuperAdmin or an admin of the org may call it; a member who is neither is
refused 403.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id ID is the document to read. It is the path segment: the URL is the addressing authority, and the org it is resolved in comes from the caller's principal, so an id from another tenant is simply not found.
@return DataroomAPIGetDataroomDocumentsByIdRequest
*/
func (a *DataroomAPIService) GetDataroomDocumentsById(ctx context.Context, id string) DataroomAPIGetDataroomDocumentsByIdRequest {
return DataroomAPIGetDataroomDocumentsByIdRequest{
ApiService: a,
ctx: ctx,
id: id,
}
}
// Execute executes the request
//
// @return DataroomDataroomDocumentOne
func (a *DataroomAPIService) GetDataroomDocumentsByIdExecute(r DataroomAPIGetDataroomDocumentsByIdRequest) (*DataroomDataroomDocumentOne, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DataroomDataroomDocumentOne
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.GetDataroomDocumentsById")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/documents/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type DataroomAPIGetDataroomDocumentsByIdFileRequest struct {
ctx context.Context
ApiService *DataroomAPIService
id string
}
func (r DataroomAPIGetDataroomDocumentsByIdFileRequest) Execute() (*http.Response, error) {
return r.ApiService.GetDataroomDocumentsByIdFileExecute(r)
}
/*
GetDataroomDocumentsByIdFile Download a document's bytes as its owner
Streams the stored file back under the type read from its BYTES — a raster image or a PDF renders in place, and anything else is served as application/octet-stream with an attachment disposition, so a stored file never executes as markup in this origin. Every response carries nosniff, which keeps the declared type binding.
Requires a validated principal that is a SuperAdmin or an admin of the org; 401 without one, 403 for a member who is neither, and the document is resolved in the caller's own tenant store, so another org's id is a 404. This is the OWNER's path and applies no link gate at all — the per-link password, email and download controls live on the viewer surface, not here. Bytes that cannot be fetched from object storage are 502, never a truncated or empty file.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id
@return DataroomAPIGetDataroomDocumentsByIdFileRequest
*/
func (a *DataroomAPIService) GetDataroomDocumentsByIdFile(ctx context.Context, id string) DataroomAPIGetDataroomDocumentsByIdFileRequest {
return DataroomAPIGetDataroomDocumentsByIdFileRequest{
ApiService: a,
ctx: ctx,
id: id,
}
}
// Execute executes the request
func (a *DataroomAPIService) GetDataroomDocumentsByIdFileExecute(r DataroomAPIGetDataroomDocumentsByIdFileRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.GetDataroomDocumentsByIdFile")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/documents/{id}/file"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarHTTPResponse, newErr
}
return localVarHTTPResponse, nil
}
type DataroomAPIGetDataroomHealthRequest struct {
ctx context.Context
ApiService *DataroomAPIService
}
func (r DataroomAPIGetDataroomHealthRequest) Execute() (*DataroomDataroomLiveness, *http.Response, error) {
return r.ApiService.GetDataroomHealthExecute(r)
}
/*
GetDataroomHealth Reports that the data room subsystem is up.
Reports that the data room subsystem is up.
It answers before the bundle loads, holds no state and touches no store, so it
stays true in exactly the situation an operator is probing for. It says nothing
about whether a room can be OPENED — that is what the room operations answer —
because a liveness probe that fails on a dependency takes a working process out
of rotation.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return DataroomAPIGetDataroomHealthRequest
*/
func (a *DataroomAPIService) GetDataroomHealth(ctx context.Context) DataroomAPIGetDataroomHealthRequest {
return DataroomAPIGetDataroomHealthRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return DataroomDataroomLiveness
func (a *DataroomAPIService) GetDataroomHealthExecute(r DataroomAPIGetDataroomHealthRequest) (*DataroomDataroomLiveness, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DataroomDataroomLiveness
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.GetDataroomHealth")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/health"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type DataroomAPIGetDataroomLinksRequest struct {
ctx context.Context
ApiService *DataroomAPIService
}
func (r DataroomAPIGetDataroomLinksRequest) Execute() (*DataroomDataroomLinks, *http.Response, error) {
return r.ApiService.GetDataroomLinksExecute(r)
}
/*
GetDataroomLinks Returns every live share link in the caller org's own store, newest first, with the controls a visitor will meet: whether an address is required, whether a password is set, the allow and deny lists, whether download is permitted, and when the link expires.
Returns every live share link in the caller org's own store,
newest first, with the controls a visitor will meet: whether an address is
required, whether a password is set, the allow and deny lists, whether download
is permitted, and when the link expires.
Archived links are omitted entirely. A link reports only THAT a password is
set — the stored form is a bcrypt hash and no route returns it.
Only a SuperAdmin or an admin of the org may call it; a member who is neither is
refused 403.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return DataroomAPIGetDataroomLinksRequest
*/
func (a *DataroomAPIService) GetDataroomLinks(ctx context.Context) DataroomAPIGetDataroomLinksRequest {
return DataroomAPIGetDataroomLinksRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return DataroomDataroomLinks
func (a *DataroomAPIService) GetDataroomLinksExecute(r DataroomAPIGetDataroomLinksRequest) (*DataroomDataroomLinks, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DataroomDataroomLinks
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.GetDataroomLinks")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/links"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type DataroomAPIGetDataroomTrustRequest struct {
ctx context.Context
ApiService *DataroomAPIService
}
func (r DataroomAPIGetDataroomTrustRequest) Execute() (*DataroomTrustDesk, *http.Response, error) {
return r.ApiService.GetDataroomTrustExecute(r)
}
/*
GetDataroomTrust Answers the caller org's OWN trust centre: its settings, every item it holds in both tiers, the requests waiting on it, and the grants it has made.
Answers the caller org's OWN trust centre: its settings, every item it
holds in both tiers, the requests waiting on it, and the grants it has made.
The org is the caller's, taken from the validated bearer and from nothing else,
so this op cannot be pointed at another tenant — there is no field for one. An
org that has never opened a centre reads back an empty one rather than an error,
because having no trust centre is an ordinary state and this is the read that
tells you so.
Only a SuperAdmin or an admin of the org may call it; a member who is neither is
refused 403.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return DataroomAPIGetDataroomTrustRequest
*/
func (a *DataroomAPIService) GetDataroomTrust(ctx context.Context) DataroomAPIGetDataroomTrustRequest {
return DataroomAPIGetDataroomTrustRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return DataroomTrustDesk
func (a *DataroomAPIService) GetDataroomTrustExecute(r DataroomAPIGetDataroomTrustRequest) (*DataroomTrustDesk, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DataroomTrustDesk
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.GetDataroomTrust")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/trust"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type DataroomAPIGetDataroomTrustCenterBySlugRequest struct {
ctx context.Context
ApiService *DataroomAPIService
slug string
}
func (r DataroomAPIGetDataroomTrustCenterBySlugRequest) Execute() (*DataroomTrustPage, *http.Response, error) {
return r.ApiService.GetDataroomTrustCenterBySlugExecute(r)
}
/*
GetDataroomTrustCenterBySlug Answers an org's public trust centre: its name, the text a party must accept to ask for a document, and every item it publishes.
Answers an org's public trust centre: its name, the text a party must
accept to ask for a document, and every item it publishes.
An item is either available NOW — the things the org states itself, its policies,
its filled questionnaires, its subprocessor list, its knowledge base — or
available ON REQUEST, which is everything an independent auditor put their name
to. Both are listed by name and kind, so a reader can see WHAT exists before
asking for it; only the second withholds the content.
No principal is involved and none is accepted: the org is resolved from the
address, which answers only for a centre its owner has published. An address
nobody publishes at is not found, the same answer an unpublished one gets.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param slug Slug is the centre's public address. It resolves only for an org that has published; anything else is not found, so this cannot be used to learn which orgs exist.
@return DataroomAPIGetDataroomTrustCenterBySlugRequest
*/
func (a *DataroomAPIService) GetDataroomTrustCenterBySlug(ctx context.Context, slug string) DataroomAPIGetDataroomTrustCenterBySlugRequest {
return DataroomAPIGetDataroomTrustCenterBySlugRequest{
ApiService: a,
ctx: ctx,
slug: slug,
}
}
// Execute executes the request
//
// @return DataroomTrustPage
func (a *DataroomAPIService) GetDataroomTrustCenterBySlugExecute(r DataroomAPIGetDataroomTrustCenterBySlugRequest) (*DataroomTrustPage, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DataroomTrustPage
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.GetDataroomTrustCenterBySlug")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/trust/center/{slug}"
localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type DataroomAPIGetDataroomTrustCenterBySlugFileByItemRequest struct {
ctx context.Context
ApiService *DataroomAPIService
slug string
item string
}
func (r DataroomAPIGetDataroomTrustCenterBySlugFileByItemRequest) Execute() (*http.Response, error) {
return r.ApiService.GetDataroomTrustCenterBySlugFileByItemExecute(r)
}
/*
GetDataroomTrustCenterBySlugFileByItem Read a public trust-centre item's bytes
Streams the file behind an item a trust centre publishes openly — a policy, a filled questionnaire, a knowledge-base attachment — under the type read from its bytes: a picture or a PDF renders in place, anything else downloads inert.
No principal and no link: these are the things an org states about itself, so they are served to anyone who asks. The narrowing is in the lookup rather than in a check: the item must be public, must not be retired, and must belong to a centre its owner has published, so an item released only on request is NOT FOUND here rather than refused — the same answer an id that never existed gets, which is what stops this reporting what the released-on-request tier holds.
Bytes that cannot be fetched from object storage are 502, never a truncated file.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param slug
@param item
@return DataroomAPIGetDataroomTrustCenterBySlugFileByItemRequest
*/
func (a *DataroomAPIService) GetDataroomTrustCenterBySlugFileByItem(ctx context.Context, slug string, item string) DataroomAPIGetDataroomTrustCenterBySlugFileByItemRequest {
return DataroomAPIGetDataroomTrustCenterBySlugFileByItemRequest{
ApiService: a,
ctx: ctx,
slug: slug,
item: item,
}
}
// Execute executes the request
func (a *DataroomAPIService) GetDataroomTrustCenterBySlugFileByItemExecute(r DataroomAPIGetDataroomTrustCenterBySlugFileByItemRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.GetDataroomTrustCenterBySlugFileByItem")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/trust/center/{slug}/file/{item}"
localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"item"+"}", url.PathEscape(parameterValueToString(r.item, "item")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarHTTPResponse, newErr
}
return localVarHTTPResponse, nil
}
type DataroomAPIGetDataroomViewByLinkidRequest struct {
ctx context.Context
ApiService *DataroomAPIService
linkId string
}
func (r DataroomAPIGetDataroomViewByLinkidRequest) Execute() (*http.Response, error) {
return r.ApiService.GetDataroomViewByLinkidExecute(r)
}
/*
GetDataroomViewByLinkid What a share link's visitor sees before authenticating
Answers the pre-auth face of a link to anyone holding its id: name and type, which gates apply (whether an address is required, whether a password is set), whether download is permitted, whether it has expired, and the name and description of the room behind it — or, for a single-document link, that document's name and page count.
No principal is involved: the owning org is resolved from the link id through dataroom's one cross-tenant routing table, and an unknown or archived link is a 404.
It is metadata only — a room's document list and every file stay behind the authenticate step. An expired link is REPORTED as expired here rather than refused, so a visitor learns why the next step will fail; nothing about the password beyond its existence is disclosed.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param linkId
@return DataroomAPIGetDataroomViewByLinkidRequest
*/
func (a *DataroomAPIService) GetDataroomViewByLinkid(ctx context.Context, linkId string) DataroomAPIGetDataroomViewByLinkidRequest {
return DataroomAPIGetDataroomViewByLinkidRequest{
ApiService: a,
ctx: ctx,
linkId: linkId,
}
}
// Execute executes the request
func (a *DataroomAPIService) GetDataroomViewByLinkidExecute(r DataroomAPIGetDataroomViewByLinkidRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.GetDataroomViewByLinkid")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/view/{linkId}"
localVarPath = strings.Replace(localVarPath, "{"+"linkId"+"}", url.PathEscape(parameterValueToString(r.linkId, "linkId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarHTTPResponse, newErr
}
return localVarHTTPResponse, nil
}
type DataroomAPIGetDataroomViewByLinkidDocumentByDocumentidFileRequest struct {
ctx context.Context
ApiService *DataroomAPIService
linkId string
documentId string
}
func (r DataroomAPIGetDataroomViewByLinkidDocumentByDocumentidFileRequest) Execute() (*http.Response, error) {
return r.ApiService.GetDataroomViewByLinkidDocumentByDocumentidFileExecute(r)
}
/*
GetDataroomViewByLinkidDocumentByDocumentidFile Read a document's bytes as an authorised link visitor
Streams a document's bytes to a visitor holding an open viewing session, under the type read from those bytes: a picture or a PDF renders in place, anything else downloads inert.
No principal: `?viewId=` from the authenticate step is the authorisation and must belong to this link, or the call is 403 — holding the link id alone gets no bytes. The document must be reachable THROUGH this link (a member of the room the link opens, or the single document the link names), so a visitor cannot walk to an unrelated document by guessing an id; anything else is a 404, as is an unknown or archived link. Bytes that cannot be fetched from object storage are 502.
`?download=1` additionally requires the link's `allowDownload` and is 403 when the owner did not permit it. Read that flag precisely: it gates the DOWNLOAD intent, not access to the bytes — without the parameter an authorised visitor is served the file for in-place viewing whether or not downloads are allowed.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param linkId
@param documentId
@return DataroomAPIGetDataroomViewByLinkidDocumentByDocumentidFileRequest
*/
func (a *DataroomAPIService) GetDataroomViewByLinkidDocumentByDocumentidFile(ctx context.Context, linkId string, documentId string) DataroomAPIGetDataroomViewByLinkidDocumentByDocumentidFileRequest {
return DataroomAPIGetDataroomViewByLinkidDocumentByDocumentidFileRequest{
ApiService: a,
ctx: ctx,
linkId: linkId,
documentId: documentId,
}
}
// Execute executes the request
func (a *DataroomAPIService) GetDataroomViewByLinkidDocumentByDocumentidFileExecute(r DataroomAPIGetDataroomViewByLinkidDocumentByDocumentidFileRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.GetDataroomViewByLinkidDocumentByDocumentidFile")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/view/{linkId}/document/{documentId}/file"
localVarPath = strings.Replace(localVarPath, "{"+"linkId"+"}", url.PathEscape(parameterValueToString(r.linkId, "linkId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"documentId"+"}", url.PathEscape(parameterValueToString(r.documentId, "documentId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarHTTPResponse, newErr
}
return localVarHTTPResponse, nil
}
type DataroomAPIPatchDataroomTrustArtifactsByIdRequest struct {
ctx context.Context
ApiService *DataroomAPIService
id string
dataroomTrustEdit *DataroomTrustEdit
}
func (r DataroomAPIPatchDataroomTrustArtifactsByIdRequest) DataroomTrustEdit(dataroomTrustEdit DataroomTrustEdit) DataroomAPIPatchDataroomTrustArtifactsByIdRequest {
r.dataroomTrustEdit = &dataroomTrustEdit
return r
}
func (r DataroomAPIPatchDataroomTrustArtifactsByIdRequest) Execute() (*DataroomTrustItemView, *http.Response, error) {
return r.ApiService.PatchDataroomTrustArtifactsByIdExecute(r)
}
/*
PatchDataroomTrustArtifactsById Changes an item on the caller org's trust centre — replace its file with a newer edition, move it between public and gated, rewrite what it says, or retire it — and answers with the item as it now stands.
Changes an item on the caller org's trust centre — replace its file with a
newer edition, move it between public and gated, rewrite what it says, or retire
it — and answers with the item as it now stands.
Retiring is the withdrawal: the item leaves the public centre immediately and can
no longer be granted, while grants already made over it stand, because a release
that happened is part of the record and un-happening it in the record would be a
lie. Restoring is the same call with retired false.
Moving an item an independent auditor signed to the public tier is refused, and
refused by the database rather than only here. Only an admin of the org may call
it, and the item is resolved in that org's own store, so another org's id is not
found.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id ID is the item to change, taken from the path.
@return DataroomAPIPatchDataroomTrustArtifactsByIdRequest
*/
func (a *DataroomAPIService) PatchDataroomTrustArtifactsById(ctx context.Context, id string) DataroomAPIPatchDataroomTrustArtifactsByIdRequest {
return DataroomAPIPatchDataroomTrustArtifactsByIdRequest{
ApiService: a,
ctx: ctx,
id: id,
}
}
// Execute executes the request
//
// @return DataroomTrustItemView
func (a *DataroomAPIService) PatchDataroomTrustArtifactsByIdExecute(r DataroomAPIPatchDataroomTrustArtifactsByIdRequest) (*DataroomTrustItemView, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPatch
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DataroomTrustItemView
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.PatchDataroomTrustArtifactsById")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/trust/artifacts/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.dataroomTrustEdit == nil {
return localVarReturnValue, nil, reportError("dataroomTrustEdit is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.dataroomTrustEdit
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type DataroomAPIPostDataroomDataroomsRequest struct {
ctx context.Context
ApiService *DataroomAPIService
dataroomDataroomCreate *DataroomDataroomCreate
}
func (r DataroomAPIPostDataroomDataroomsRequest) DataroomDataroomCreate(dataroomDataroomCreate DataroomDataroomCreate) DataroomAPIPostDataroomDataroomsRequest {
r.dataroomDataroomCreate = &dataroomDataroomCreate
return r
}
func (r DataroomAPIPostDataroomDataroomsRequest) Execute() (*DataroomDataroomRoomOne, *http.Response, error) {
return r.ApiService.PostDataroomDataroomsExecute(r)
}
/*
PostDataroomDatarooms Opens a new data room for the caller org and answers with it, including the short public id it is addressed by.
Opens a new data room for the caller org and answers with it,
including the short public id it is addressed by.
`name` is required; without it the call is refused and the tenant store is
untouched, because a dispatch answering 4xx rolls its transaction back. A new
room holds no documents and is reachable by NOBODY until a share link is
created over it — opening a room and granting access are two separate acts, so
a room cannot leak by existing.
Only a SuperAdmin or an admin of the org may call it; a member who is neither is
refused 403.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return DataroomAPIPostDataroomDataroomsRequest
*/
func (a *DataroomAPIService) PostDataroomDatarooms(ctx context.Context) DataroomAPIPostDataroomDataroomsRequest {
return DataroomAPIPostDataroomDataroomsRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return DataroomDataroomRoomOne
func (a *DataroomAPIService) PostDataroomDataroomsExecute(r DataroomAPIPostDataroomDataroomsRequest) (*DataroomDataroomRoomOne, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DataroomDataroomRoomOne
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.PostDataroomDatarooms")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/datarooms"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.dataroomDataroomCreate == nil {
return localVarReturnValue, nil, reportError("dataroomDataroomCreate is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.dataroomDataroomCreate
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type DataroomAPIPostDataroomDataroomsByIdDocumentsRequest struct {
ctx context.Context
ApiService *DataroomAPIService
id string
dataroomDataroomAddDocument *DataroomDataroomAddDocument
}
func (r DataroomAPIPostDataroomDataroomsByIdDocumentsRequest) DataroomDataroomAddDocument(dataroomDataroomAddDocument DataroomDataroomAddDocument) DataroomAPIPostDataroomDataroomsByIdDocumentsRequest {
r.dataroomDataroomAddDocument = &dataroomDataroomAddDocument
return r
}
func (r DataroomAPIPostDataroomDataroomsByIdDocumentsRequest) Execute() (*DataroomDataroomMembership, *http.Response, error) {
return r.ApiService.PostDataroomDataroomsByIdDocumentsExecute(r)
}
/*
PostDataroomDataroomsByIdDocuments Puts an already-uploaded document into one of the caller org's data rooms and answers with the new membership id.
Puts an already-uploaded document into one of the caller
org's data rooms and answers with the new membership id.
It ATTACHES, it never uploads: the bytes must already be stored, so the usual
order is upload the document, then add it to the room. Both the room and the
document must exist in the caller's own store — either missing is not found —
and a document already in the room is refused as a conflict rather than
duplicated.
Only a SuperAdmin or an admin of the org may call it; a member who is neither is
refused 403.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id ID is the room to add to. It is the path segment: the URL is the addressing authority, and the org it is resolved in comes from the caller's principal, so an id from another tenant is simply not found.
@return DataroomAPIPostDataroomDataroomsByIdDocumentsRequest
*/
func (a *DataroomAPIService) PostDataroomDataroomsByIdDocuments(ctx context.Context, id string) DataroomAPIPostDataroomDataroomsByIdDocumentsRequest {
return DataroomAPIPostDataroomDataroomsByIdDocumentsRequest{
ApiService: a,
ctx: ctx,
id: id,
}
}
// Execute executes the request
//
// @return DataroomDataroomMembership
func (a *DataroomAPIService) PostDataroomDataroomsByIdDocumentsExecute(r DataroomAPIPostDataroomDataroomsByIdDocumentsRequest) (*DataroomDataroomMembership, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DataroomDataroomMembership
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.PostDataroomDataroomsByIdDocuments")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/datarooms/{id}/documents"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.dataroomDataroomAddDocument == nil {
return localVarReturnValue, nil, reportError("dataroomDataroomAddDocument is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.dataroomDataroomAddDocument
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type DataroomAPIPostDataroomDocumentsRequest struct {
ctx context.Context
ApiService *DataroomAPIService
}
func (r DataroomAPIPostDataroomDocumentsRequest) Execute() (*http.Response, error) {
return r.ApiService.PostDataroomDocumentsExecute(r)
}
/*
PostDataroomDocuments Upload a document's bytes and record it
Takes the file ITSELF as the raw request body — not a JSON envelope, not multipart — stores it on the object-storage client, and records the metadata row, answering with the new document. `?name=` names it (default "document"), the request's Content-Type is recorded as the document's mime type, and `?numPages=` is optional. That recorded type is metadata the owner sees; what the file is later SERVED as is read from the bytes.
Requires a validated principal that is a SuperAdmin or an admin of the org; 401 without one, 403 for a member who is neither. An empty body is 400 and anything over 64 MiB is 413 — a data room holds decks and PDFs, not a media library.
The storage key is 128 random bits under the tenant's own key prefix, minted before the bytes are written: if the system's randomness is unavailable the upload fails 500 rather than fall back to a predictable key that could overwrite another document's bytes. A storage write that fails is 502 and no metadata row is recorded, so a document never exists without its file.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return DataroomAPIPostDataroomDocumentsRequest
*/
func (a *DataroomAPIService) PostDataroomDocuments(ctx context.Context) DataroomAPIPostDataroomDocumentsRequest {
return DataroomAPIPostDataroomDocumentsRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
func (a *DataroomAPIService) PostDataroomDocumentsExecute(r DataroomAPIPostDataroomDocumentsRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.PostDataroomDocuments")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/documents"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarHTTPResponse, newErr
}
return localVarHTTPResponse, nil
}
type DataroomAPIPostDataroomLinksRequest struct {
ctx context.Context
ApiService *DataroomAPIService
dataroomDataroomLinkCreate *DataroomDataroomLinkCreate
}
func (r DataroomAPIPostDataroomLinksRequest) DataroomDataroomLinkCreate(dataroomDataroomLinkCreate DataroomDataroomLinkCreate) DataroomAPIPostDataroomLinksRequest {
r.dataroomDataroomLinkCreate = &dataroomDataroomLinkCreate
return r
}
func (r DataroomAPIPostDataroomLinksRequest) Execute() (*DataroomDataroomLinkOne, *http.Response, error) {
return r.ApiService.PostDataroomLinksExecute(r)
}
/*
PostDataroomLinks Grants access: it mints a public share link over one data room (`dataroomId`) or one document (`documentId`) — one of the two is required — and answers with the link, whose `id` is the token a visitor opens it with.
Grants access: it mints a public share link over one data
room (`dataroomId`) or one document (`documentId`) — one of the two is
required — and answers with the link, whose `id` is the token a visitor opens
it with.
This is how a party is let in. The controls are declared HERE and enforced on
the viewer surface: `password` is hashed with bcrypt before storage and is
never readable back, `emailProtected` (on by default) makes a visitor state an
address, `allowList`/`denyList` narrow which addresses pass, `allowDownload`
(off by default) governs downloads, and `expiresAt` closes the link. The target
room or document must exist in the caller's own store or it is not found.
Creating a link also writes dataroom's ONE cross-tenant row: the link id to
owning org mapping an anonymous visitor is routed through. That write is part
of the operation — if it fails the call is 500 — so a link that no visitor
could open is never handed back as usable.
The address a visitor later states is recorded UNVERIFIED, so a link gated only
by email is openable by anyone the link reaches. Use a password for a link that
must not travel.
Only a SuperAdmin or an admin of the org may call it; a member who is neither is
refused 403.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return DataroomAPIPostDataroomLinksRequest
*/
func (a *DataroomAPIService) PostDataroomLinks(ctx context.Context) DataroomAPIPostDataroomLinksRequest {
return DataroomAPIPostDataroomLinksRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return DataroomDataroomLinkOne
func (a *DataroomAPIService) PostDataroomLinksExecute(r DataroomAPIPostDataroomLinksRequest) (*DataroomDataroomLinkOne, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DataroomDataroomLinkOne
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.PostDataroomLinks")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/links"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.dataroomDataroomLinkCreate == nil {
return localVarReturnValue, nil, reportError("dataroomDataroomLinkCreate is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.dataroomDataroomLinkCreate
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type DataroomAPIPostDataroomTrustArtifactsRequest struct {
ctx context.Context
ApiService *DataroomAPIService
dataroomTrustPublish *DataroomTrustPublish
}
func (r DataroomAPIPostDataroomTrustArtifactsRequest) DataroomTrustPublish(dataroomTrustPublish DataroomTrustPublish) DataroomAPIPostDataroomTrustArtifactsRequest {
r.dataroomTrustPublish = &dataroomTrustPublish
return r
}
func (r DataroomAPIPostDataroomTrustArtifactsRequest) Execute() (*DataroomTrustItemView, *http.Response, error) {
return r.ApiService.PostDataroomTrustArtifactsExecute(r)
}
/*
PostDataroomTrustArtifacts Puts an item on the caller org's trust centre and answers with it.
Puts an item on the caller org's trust centre and answers with it.
The item is GATED unless it says otherwise, so a kind nobody has thought of yet
arrives private and someone has to release it deliberately — that default is what
keeps an auditor's report from becoming readable because a field went unset. An
item whose attester is "auditor" cannot be public at all: the database refuses the
pair, so no path through this API can publish one.
A file is optional and is uploaded FIRST, through POST /v1/dataroom/documents,
then named here — the data room is the one place bytes enter, so a trust centre
document is an ordinary data-room document and inherits its storage, its grants
and its page-by-page access record. A gated item that has a file is added to the
org's release room, which is what lets a party be granted the whole gated tier in
one link.
Only an admin of the org may call it.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return DataroomAPIPostDataroomTrustArtifactsRequest
*/
func (a *DataroomAPIService) PostDataroomTrustArtifacts(ctx context.Context) DataroomAPIPostDataroomTrustArtifactsRequest {
return DataroomAPIPostDataroomTrustArtifactsRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return DataroomTrustItemView
func (a *DataroomAPIService) PostDataroomTrustArtifactsExecute(r DataroomAPIPostDataroomTrustArtifactsRequest) (*DataroomTrustItemView, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DataroomTrustItemView
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.PostDataroomTrustArtifacts")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/trust/artifacts"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.dataroomTrustPublish == nil {
return localVarReturnValue, nil, reportError("dataroomTrustPublish is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.dataroomTrustPublish
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type DataroomAPIPostDataroomTrustCenterBySlugRequestsRequest struct {
ctx context.Context
ApiService *DataroomAPIService
slug string
dataroomTrustAsk *DataroomTrustAsk
}
func (r DataroomAPIPostDataroomTrustCenterBySlugRequestsRequest) DataroomTrustAsk(dataroomTrustAsk DataroomTrustAsk) DataroomAPIPostDataroomTrustCenterBySlugRequestsRequest {
r.dataroomTrustAsk = &dataroomTrustAsk
return r
}
func (r DataroomAPIPostDataroomTrustCenterBySlugRequestsRequest) Execute() (*DataroomTrustAsked, *http.Response, error) {
return r.ApiService.PostDataroomTrustCenterBySlugRequestsExecute(r)
}
/*
PostDataroomTrustCenterBySlugRequests Records a request to read what an independent auditor signed, and answers with its id.
Records a request to read what an independent auditor signed, and
answers with its id.
The org that owns the centre decides. Nothing is released here and no link is
minted: this writes the ask down, which is the whole promise the form makes.
The write is the answer — a request that could not be stored is an error, never
a receipt, so a form can never appear to have been sent and be gone.
`email` is required and is the ONLY address the eventual grant will admit, so an
address the asker cannot read is an ask that cannot be answered. Where the centre
states an NDA, `accept` must be true and the text in force is recorded verbatim
against the request.
Asking twice for the same thing from the same address is the SAME ask: the second
answers with the first's id rather than opening a second row, which is also what
keeps an anonymous endpoint from filling a tenant's store.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param slug Slug is the centre's public address, taken from the path.
@return DataroomAPIPostDataroomTrustCenterBySlugRequestsRequest
*/
func (a *DataroomAPIService) PostDataroomTrustCenterBySlugRequests(ctx context.Context, slug string) DataroomAPIPostDataroomTrustCenterBySlugRequestsRequest {
return DataroomAPIPostDataroomTrustCenterBySlugRequestsRequest{
ApiService: a,
ctx: ctx,
slug: slug,
}
}
// Execute executes the request
//
// @return DataroomTrustAsked
func (a *DataroomAPIService) PostDataroomTrustCenterBySlugRequestsExecute(r DataroomAPIPostDataroomTrustCenterBySlugRequestsRequest) (*DataroomTrustAsked, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DataroomTrustAsked
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.PostDataroomTrustCenterBySlugRequests")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/trust/center/{slug}/requests"
localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.dataroomTrustAsk == nil {
return localVarReturnValue, nil, reportError("dataroomTrustAsk is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.dataroomTrustAsk
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type DataroomAPIPostDataroomTrustRequestsByIdGrantRequest struct {
ctx context.Context
ApiService *DataroomAPIService
id string
dataroomTrustDecision *DataroomTrustDecision
}
func (r DataroomAPIPostDataroomTrustRequestsByIdGrantRequest) DataroomTrustDecision(dataroomTrustDecision DataroomTrustDecision) DataroomAPIPostDataroomTrustRequestsByIdGrantRequest {
r.dataroomTrustDecision = &dataroomTrustDecision
return r
}
func (r DataroomAPIPostDataroomTrustRequestsByIdGrantRequest) Execute() (*DataroomTrustGranted, *http.Response, error) {
return r.ApiService.PostDataroomTrustRequestsByIdGrantExecute(r)
}
/*
PostDataroomTrustRequestsByIdGrant Answers a request by opening access: it mints a share link over what was asked for, addressed to the address that asked and closing at expiry, records the decision, and mails the asker.
Answers a request by opening access: it mints a share link over what was
asked for, addressed to the address that asked and closing at expiry, records the
decision, and mails the asker.
The link is NEVER a public URL. It carries the asker's address on its allow list,
so forwarding it to somebody else does not open it, and it expires. What the
party then does with it — which document, which page, for how long — is recorded
by the data room's own view tracking, which is where the access record for this
release lives; there is no second log.
A request that was already answered is refused rather than answered twice, so a
second click cannot mint a second link. Only an admin of the org may call it, and
the request is resolved in that org's own store, so another org's request id is
not found — which is also what stops one org deciding another's queue.
Mail is best effort and the grant does not depend on it: a deployment that sends
no mail still records the grant and says so in `delivery`, so the approver knows
to pass the address on themselves.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id ID is the request to answer, taken from the path.
@return DataroomAPIPostDataroomTrustRequestsByIdGrantRequest
*/
func (a *DataroomAPIService) PostDataroomTrustRequestsByIdGrant(ctx context.Context, id string) DataroomAPIPostDataroomTrustRequestsByIdGrantRequest {
return DataroomAPIPostDataroomTrustRequestsByIdGrantRequest{
ApiService: a,
ctx: ctx,
id: id,
}
}
// Execute executes the request
//
// @return DataroomTrustGranted
func (a *DataroomAPIService) PostDataroomTrustRequestsByIdGrantExecute(r DataroomAPIPostDataroomTrustRequestsByIdGrantRequest) (*DataroomTrustGranted, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DataroomTrustGranted
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.PostDataroomTrustRequestsByIdGrant")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/trust/requests/{id}/grant"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.dataroomTrustDecision == nil {
return localVarReturnValue, nil, reportError("dataroomTrustDecision is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.dataroomTrustDecision
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type DataroomAPIPostDataroomTrustRequestsByIdRefuseRequest struct {
ctx context.Context
ApiService *DataroomAPIService
id string
dataroomTrustDecision *DataroomTrustDecision
}
func (r DataroomAPIPostDataroomTrustRequestsByIdRefuseRequest) DataroomTrustDecision(dataroomTrustDecision DataroomTrustDecision) DataroomAPIPostDataroomTrustRequestsByIdRefuseRequest {
r.dataroomTrustDecision = &dataroomTrustDecision
return r
}
func (r DataroomAPIPostDataroomTrustRequestsByIdRefuseRequest) Execute() (*DataroomTrustRefused, *http.Response, error) {
return r.ApiService.PostDataroomTrustRequestsByIdRefuseExecute(r)
}
/*
PostDataroomTrustRequestsByIdRefuse Answers a request by declining it, recording who declined and why.
Answers a request by declining it, recording who declined and why.
Nothing is released and no link is minted. The refusal STAYS on the record beside
the ask — a request that was turned down is part of the access record exactly as
one that was granted is, and deleting it would leave a queue that only ever shows
the decisions somebody liked.
A request that was already answered is refused rather than answered twice. Only an
admin of the org may call it, and the request is resolved in that org's own store,
so another org's request id is not found.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id ID is the request to answer, taken from the path.
@return DataroomAPIPostDataroomTrustRequestsByIdRefuseRequest
*/
func (a *DataroomAPIService) PostDataroomTrustRequestsByIdRefuse(ctx context.Context, id string) DataroomAPIPostDataroomTrustRequestsByIdRefuseRequest {
return DataroomAPIPostDataroomTrustRequestsByIdRefuseRequest{
ApiService: a,
ctx: ctx,
id: id,
}
}
// Execute executes the request
//
// @return DataroomTrustRefused
func (a *DataroomAPIService) PostDataroomTrustRequestsByIdRefuseExecute(r DataroomAPIPostDataroomTrustRequestsByIdRefuseRequest) (*DataroomTrustRefused, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DataroomTrustRefused
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.PostDataroomTrustRequestsByIdRefuse")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/trust/requests/{id}/refuse"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.dataroomTrustDecision == nil {
return localVarReturnValue, nil, reportError("dataroomTrustDecision is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.dataroomTrustDecision
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type DataroomAPIPostDataroomViewByLinkidAuthenticateRequest struct {
ctx context.Context
ApiService *DataroomAPIService
linkId string
}
func (r DataroomAPIPostDataroomViewByLinkidAuthenticateRequest) Execute() (*http.Response, error) {
return r.ApiService.PostDataroomViewByLinkidAuthenticateExecute(r)
}
/*
PostDataroomViewByLinkidAuthenticate Pass a share link's gates and open a viewing session
Clears the link's access controls and answers with the viewing session — a `viewId`, whether download is permitted, and the documents behind the link — which every later viewer call is authorised by.
No principal: the visitor is whoever holds the link id, and the org is resolved from it. The gates run in a fixed order and each is a flat refusal, never a hint. An archived or unknown link is 404 and an expired one 403. A missing address on an email-protected link is 401. An address on the deny list is 403, checked BEFORE the allow list so deny always wins. An address the allow list does not admit is 403 — an EMPTY allow list admits everyone, so a link with no list enforces the email gate alone. A wrong or absent password is 401, decided against the stored bcrypt hash.
The address is taken as stated and recorded UNVERIFIED: it names a viewer for analytics and repeat visits from it reuse one viewer record, but it proves nothing about who is on the other end. A link gated only by email is openable by anyone the link reaches.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param linkId
@return DataroomAPIPostDataroomViewByLinkidAuthenticateRequest
*/
func (a *DataroomAPIService) PostDataroomViewByLinkidAuthenticate(ctx context.Context, linkId string) DataroomAPIPostDataroomViewByLinkidAuthenticateRequest {
return DataroomAPIPostDataroomViewByLinkidAuthenticateRequest{
ApiService: a,
ctx: ctx,
linkId: linkId,
}
}
// Execute executes the request
func (a *DataroomAPIService) PostDataroomViewByLinkidAuthenticateExecute(r DataroomAPIPostDataroomViewByLinkidAuthenticateRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.PostDataroomViewByLinkidAuthenticate")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/view/{linkId}/authenticate"
localVarPath = strings.Replace(localVarPath, "{"+"linkId"+"}", url.PathEscape(parameterValueToString(r.linkId, "linkId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarHTTPResponse, newErr
}
return localVarHTTPResponse, nil
}
type DataroomAPIPostDataroomViewByLinkidPageviewRequest struct {
ctx context.Context
ApiService *DataroomAPIService
linkId string
}
func (r DataroomAPIPostDataroomViewByLinkidPageviewRequest) Execute() (*http.Response, error) {
return r.ApiService.PostDataroomViewByLinkidPageviewExecute(r)
}
/*
PostDataroomViewByLinkidPageview Record one page-view against an open viewing session
Appends a single per-page analytics event — {viewId, pageNumber, documentId, versionNumber, duration} — and answers with its id. These events are what the owner's analytics count.
No principal: the `viewId` from the authenticate step IS the authorisation, and it must belong to THIS link or the call is 404, so a session opened on one link cannot write events onto another. `pageNumber` is required (400 without it); `documentId` falls back to the document the session was opened on, and `duration` is the caller's own dwell measure, summed per page by analytics.
Events are additive: the same page reported twice is two views, which is the metric's whole point.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param linkId
@return DataroomAPIPostDataroomViewByLinkidPageviewRequest
*/
func (a *DataroomAPIService) PostDataroomViewByLinkidPageview(ctx context.Context, linkId string) DataroomAPIPostDataroomViewByLinkidPageviewRequest {
return DataroomAPIPostDataroomViewByLinkidPageviewRequest{
ApiService: a,
ctx: ctx,
linkId: linkId,
}
}
// Execute executes the request
func (a *DataroomAPIService) PostDataroomViewByLinkidPageviewExecute(r DataroomAPIPostDataroomViewByLinkidPageviewRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.PostDataroomViewByLinkidPageview")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/view/{linkId}/pageview"
localVarPath = strings.Replace(localVarPath, "{"+"linkId"+"}", url.PathEscape(parameterValueToString(r.linkId, "linkId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarHTTPResponse, newErr
}
return localVarHTTPResponse, nil
}
type DataroomAPIPutDataroomTrustRequest struct {
ctx context.Context
ApiService *DataroomAPIService
dataroomTrustSettings *DataroomTrustSettings
}
func (r DataroomAPIPutDataroomTrustRequest) DataroomTrustSettings(dataroomTrustSettings DataroomTrustSettings) DataroomAPIPutDataroomTrustRequest {
r.dataroomTrustSettings = &dataroomTrustSettings
return r
}
func (r DataroomAPIPutDataroomTrustRequest) Execute() (*DataroomTrustDesk, *http.Response, error) {
return r.ApiService.PutDataroomTrustExecute(r)
}
/*
PutDataroomTrust SetCenter opens, publishes or withdraws the caller org's trust centre and answers with the centre as it now stands.
SetCenter opens, publishes or withdraws the caller org's trust centre and answers
with the centre as it now stands.
Publishing requires a name and an address, and the address must be free: another
org already answering there is a conflict, never a takeover. Withdrawing closes
the public endpoint only — items, grants and the access record are untouched, so
an org can go quiet and come back without losing anything.
Only an admin of the org may call it. The org is the caller's own, so there is no
field naming one and no way to point this at another tenant.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return DataroomAPIPutDataroomTrustRequest
*/
func (a *DataroomAPIService) PutDataroomTrust(ctx context.Context) DataroomAPIPutDataroomTrustRequest {
return DataroomAPIPutDataroomTrustRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return DataroomTrustDesk
func (a *DataroomAPIService) PutDataroomTrustExecute(r DataroomAPIPutDataroomTrustRequest) (*DataroomTrustDesk, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPut
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DataroomTrustDesk
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataroomAPIService.PutDataroomTrust")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1/dataroom/trust"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.dataroomTrustSettings == nil {
return localVarReturnValue, nil, reportError("dataroomTrustSettings is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.dataroomTrustSettings
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
var v ProblemDetails
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}