mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
1695 lines
61 KiB
Go
1695 lines
61 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"
|
|
)
|
|
|
|
// EsignAPIService EsignAPI service
|
|
type EsignAPIService service
|
|
|
|
type EsignAPIGetEsignDocumentsRequest struct {
|
|
ctx context.Context
|
|
ApiService *EsignAPIService
|
|
}
|
|
|
|
func (r EsignAPIGetEsignDocumentsRequest) Execute() (*EsignEsignDocuments, *http.Response, error) {
|
|
return r.ApiService.GetEsignDocumentsExecute(r)
|
|
}
|
|
|
|
/*
|
|
GetEsignDocuments Returns your org's documents, newest first.
|
|
|
|
Returns your org's documents, newest first.
|
|
|
|
Each carries its status, recipients and field layout. The listing is capped at
|
|
200 and there is no paging, so treat it as the recent window rather than a
|
|
complete export. It reads the caller's own tenant store, so no other org's
|
|
documents can appear in 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 EsignAPIGetEsignDocumentsRequest
|
|
*/
|
|
func (a *EsignAPIService) GetEsignDocuments(ctx context.Context) EsignAPIGetEsignDocumentsRequest {
|
|
return EsignAPIGetEsignDocumentsRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
}
|
|
}
|
|
|
|
// Execute executes the request
|
|
//
|
|
// @return EsignEsignDocuments
|
|
func (a *EsignAPIService) GetEsignDocumentsExecute(r EsignAPIGetEsignDocumentsRequest) (*EsignEsignDocuments, *http.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = http.MethodGet
|
|
localVarPostBody interface{}
|
|
formFiles []formFile
|
|
localVarReturnValue *EsignEsignDocuments
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EsignAPIService.GetEsignDocuments")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/esign/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 EsignAPIGetEsignDocumentsByIdRequest struct {
|
|
ctx context.Context
|
|
ApiService *EsignAPIService
|
|
id string
|
|
}
|
|
|
|
func (r EsignAPIGetEsignDocumentsByIdRequest) Execute() (*EsignEsignDocument, *http.Response, error) {
|
|
return r.ApiService.GetEsignDocumentsByIdExecute(r)
|
|
}
|
|
|
|
/*
|
|
GetEsignDocumentsById Returns one document with its recipients and field layout.
|
|
|
|
Returns one document with its recipients and field layout.
|
|
|
|
It answers the document, its recipients with each one's read and signing status,
|
|
and every field with its type, page and position — the view a sender's UI
|
|
renders, and where the field ids come from. The id is resolved in the caller's
|
|
OWN tenant store, so another org's document id is a 404 rather than a refusal
|
|
that would confirm it exists.
|
|
|
|
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 act on. 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 belonging to another tenant is simply not found.
|
|
@return EsignAPIGetEsignDocumentsByIdRequest
|
|
*/
|
|
func (a *EsignAPIService) GetEsignDocumentsById(ctx context.Context, id string) EsignAPIGetEsignDocumentsByIdRequest {
|
|
return EsignAPIGetEsignDocumentsByIdRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
id: id,
|
|
}
|
|
}
|
|
|
|
// Execute executes the request
|
|
//
|
|
// @return EsignEsignDocument
|
|
func (a *EsignAPIService) GetEsignDocumentsByIdExecute(r EsignAPIGetEsignDocumentsByIdRequest) (*EsignEsignDocument, *http.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = http.MethodGet
|
|
localVarPostBody interface{}
|
|
formFiles []formFile
|
|
localVarReturnValue *EsignEsignDocument
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EsignAPIService.GetEsignDocumentsById")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/esign/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 EsignAPIGetEsignDocumentsByIdAuditRequest struct {
|
|
ctx context.Context
|
|
ApiService *EsignAPIService
|
|
id string
|
|
}
|
|
|
|
func (r EsignAPIGetEsignDocumentsByIdAuditRequest) Execute() (*EsignEsignTrail, *http.Response, error) {
|
|
return r.ApiService.GetEsignDocumentsByIdAuditExecute(r)
|
|
}
|
|
|
|
/*
|
|
GetEsignDocumentsByIdAudit Returns the document's full audit trail, oldest first.
|
|
|
|
Returns the document's full audit trail, oldest first.
|
|
|
|
It answers every recorded event for the document in order — created, recipient
|
|
added, field created, sent, opened, each field inserted, each recipient
|
|
completed or rejected, and completion — with the actor and timestamp on each.
|
|
This is the evidence record behind a signature, so it is append-only and nothing
|
|
in the surface edits it.
|
|
|
|
The id is resolved in the caller's OWN tenant store, so another org's document
|
|
id is a 404.
|
|
|
|
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 act on. 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 belonging to another tenant is simply not found.
|
|
@return EsignAPIGetEsignDocumentsByIdAuditRequest
|
|
*/
|
|
func (a *EsignAPIService) GetEsignDocumentsByIdAudit(ctx context.Context, id string) EsignAPIGetEsignDocumentsByIdAuditRequest {
|
|
return EsignAPIGetEsignDocumentsByIdAuditRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
id: id,
|
|
}
|
|
}
|
|
|
|
// Execute executes the request
|
|
//
|
|
// @return EsignEsignTrail
|
|
func (a *EsignAPIService) GetEsignDocumentsByIdAuditExecute(r EsignAPIGetEsignDocumentsByIdAuditRequest) (*EsignEsignTrail, *http.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = http.MethodGet
|
|
localVarPostBody interface{}
|
|
formFiles []formFile
|
|
localVarReturnValue *EsignEsignTrail
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EsignAPIService.GetEsignDocumentsByIdAudit")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/esign/documents/{id}/audit"
|
|
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 EsignAPIGetEsignDocumentsByIdDownloadRequest struct {
|
|
ctx context.Context
|
|
ApiService *EsignAPIService
|
|
id string
|
|
}
|
|
|
|
func (r EsignAPIGetEsignDocumentsByIdDownloadRequest) Execute() (*EsignEsignPDF, *http.Response, error) {
|
|
return r.ApiService.GetEsignDocumentsByIdDownloadExecute(r)
|
|
}
|
|
|
|
/*
|
|
GetEsignDocumentsByIdDownload Returns the document — the sealed PDF once it is complete.
|
|
|
|
Returns the document — the sealed PDF once it is complete.
|
|
|
|
It answers the document's current PDF as base64 with a sealed flag and a
|
|
filename. Before completion that is the original upload; once every signer has
|
|
finished it is the SEALED artifact, with the field values rendered onto the page
|
|
and a real x509 PKCS#7 digital signature applied. There is one pdfBase64 field
|
|
either way, so sealed is what tells you which you are holding.
|
|
|
|
The id is resolved in the caller's OWN tenant store, so another org's document
|
|
id is a 404.
|
|
|
|
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 act on. 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 belonging to another tenant is simply not found.
|
|
@return EsignAPIGetEsignDocumentsByIdDownloadRequest
|
|
*/
|
|
func (a *EsignAPIService) GetEsignDocumentsByIdDownload(ctx context.Context, id string) EsignAPIGetEsignDocumentsByIdDownloadRequest {
|
|
return EsignAPIGetEsignDocumentsByIdDownloadRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
id: id,
|
|
}
|
|
}
|
|
|
|
// Execute executes the request
|
|
//
|
|
// @return EsignEsignPDF
|
|
func (a *EsignAPIService) GetEsignDocumentsByIdDownloadExecute(r EsignAPIGetEsignDocumentsByIdDownloadRequest) (*EsignEsignPDF, *http.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = http.MethodGet
|
|
localVarPostBody interface{}
|
|
formFiles []formFile
|
|
localVarReturnValue *EsignEsignPDF
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EsignAPIService.GetEsignDocumentsByIdDownload")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/esign/documents/{id}/download"
|
|
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 EsignAPIGetEsignHealthRequest struct {
|
|
ctx context.Context
|
|
ApiService *EsignAPIService
|
|
}
|
|
|
|
func (r EsignAPIGetEsignHealthRequest) Execute() (*EsignEsignHealth, *http.Response, error) {
|
|
return r.ApiService.GetEsignHealthExecute(r)
|
|
}
|
|
|
|
/*
|
|
GetEsignHealth Reports whether the e-signature surface is mounted.
|
|
|
|
Reports whether the e-signature surface is mounted.
|
|
|
|
It answers ok whenever the subsystem is mounted, takes no tenant and needs no
|
|
principal. It is deliberately shallow: it is registered before the document host
|
|
is built, so it still answers on a deployment that came up WITHOUT object
|
|
storage and therefore serves nothing else. Read it as reachability, never as a
|
|
promise that documents can be stored.
|
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
@return EsignAPIGetEsignHealthRequest
|
|
*/
|
|
func (a *EsignAPIService) GetEsignHealth(ctx context.Context) EsignAPIGetEsignHealthRequest {
|
|
return EsignAPIGetEsignHealthRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
}
|
|
}
|
|
|
|
// Execute executes the request
|
|
//
|
|
// @return EsignEsignHealth
|
|
func (a *EsignAPIService) GetEsignHealthExecute(r EsignAPIGetEsignHealthRequest) (*EsignEsignHealth, *http.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = http.MethodGet
|
|
localVarPostBody interface{}
|
|
formFiles []formFile
|
|
localVarReturnValue *EsignEsignHealth
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EsignAPIService.GetEsignHealth")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/esign/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 EsignAPIGetEsignOByOrgSignByTokenRequest struct {
|
|
ctx context.Context
|
|
ApiService *EsignAPIService
|
|
org string
|
|
token string
|
|
}
|
|
|
|
func (r EsignAPIGetEsignOByOrgSignByTokenRequest) Execute() (*EsignEsignSession, *http.Response, error) {
|
|
return r.ApiService.GetEsignOByOrgSignByTokenExecute(r)
|
|
}
|
|
|
|
/*
|
|
GetEsignOByOrgSignByToken Opens a document you were asked to sign, using your signing link.
|
|
|
|
Opens a document you were asked to sign, using your signing link.
|
|
|
|
It answers the document, the recipient the link identifies, the fields THAT
|
|
recipient must fill, and the PDF to display. The first open also marks the
|
|
recipient as having opened it and records that on the audit trail, so this read
|
|
has a side effect by design.
|
|
|
|
This surface takes NO account: the signing token is the entire credential, and
|
|
it names the recipient, so a signer sees only their own fields and never the
|
|
other recipients' tokens. The token resolves to its owning tenant FIRST, before
|
|
any per-tenant store is opened, and the org segment is only checked against
|
|
that answer. An unknown or wrong-org token is one and the same 404, never a
|
|
hint that some other document exists.
|
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
@param org
|
|
@param token
|
|
@return EsignAPIGetEsignOByOrgSignByTokenRequest
|
|
*/
|
|
func (a *EsignAPIService) GetEsignOByOrgSignByToken(ctx context.Context, org string, token string) EsignAPIGetEsignOByOrgSignByTokenRequest {
|
|
return EsignAPIGetEsignOByOrgSignByTokenRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
org: org,
|
|
token: token,
|
|
}
|
|
}
|
|
|
|
// Execute executes the request
|
|
//
|
|
// @return EsignEsignSession
|
|
func (a *EsignAPIService) GetEsignOByOrgSignByTokenExecute(r EsignAPIGetEsignOByOrgSignByTokenRequest) (*EsignEsignSession, *http.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = http.MethodGet
|
|
localVarPostBody interface{}
|
|
formFiles []formFile
|
|
localVarReturnValue *EsignEsignSession
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EsignAPIService.GetEsignOByOrgSignByToken")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/esign/o/{org}/sign/{token}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"org"+"}", url.PathEscape(parameterValueToString(r.org, "org")), -1)
|
|
localVarPath = strings.Replace(localVarPath, "{"+"token"+"}", url.PathEscape(parameterValueToString(r.token, "token")), -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 EsignAPIPostEsignDocumentsRequest struct {
|
|
ctx context.Context
|
|
ApiService *EsignAPIService
|
|
esignEsignUploadIn *EsignEsignUploadIn
|
|
}
|
|
|
|
func (r EsignAPIPostEsignDocumentsRequest) EsignEsignUploadIn(esignEsignUploadIn EsignEsignUploadIn) EsignAPIPostEsignDocumentsRequest {
|
|
r.esignEsignUploadIn = &esignEsignUploadIn
|
|
return r
|
|
}
|
|
|
|
func (r EsignAPIPostEsignDocumentsRequest) Execute() (*EsignEsignDocument, *http.Response, error) {
|
|
return r.ApiService.PostEsignDocumentsExecute(r)
|
|
}
|
|
|
|
/*
|
|
PostEsignDocuments Uploads a PDF and opens a draft ready for recipients and fields.
|
|
|
|
Uploads a PDF and opens a draft ready for recipients and fields.
|
|
|
|
It answers 201 with the document in DRAFT — the state where recipients and
|
|
fields may still be added, and the only state they may. The bytes go to object
|
|
storage rather than into the tenant database, and the original is kept under its
|
|
own key so it survives sealing untouched: a completed document can always be
|
|
compared against what was uploaded. Creation is recorded on the audit trail.
|
|
|
|
This is the sender's surface: a validated principal is required, and the document
|
|
lands in that principal's OWN org. Isolation is physical rather than a filter —
|
|
each tenant has its own store — so another org's document id is simply not
|
|
there. A body over 32 MiB is refused with 413.
|
|
|
|
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 EsignAPIPostEsignDocumentsRequest
|
|
*/
|
|
func (a *EsignAPIService) PostEsignDocuments(ctx context.Context) EsignAPIPostEsignDocumentsRequest {
|
|
return EsignAPIPostEsignDocumentsRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
}
|
|
}
|
|
|
|
// Execute executes the request
|
|
//
|
|
// @return EsignEsignDocument
|
|
func (a *EsignAPIService) PostEsignDocumentsExecute(r EsignAPIPostEsignDocumentsRequest) (*EsignEsignDocument, *http.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = http.MethodPost
|
|
localVarPostBody interface{}
|
|
formFiles []formFile
|
|
localVarReturnValue *EsignEsignDocument
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EsignAPIService.PostEsignDocuments")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/esign/documents"
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
if r.esignEsignUploadIn == nil {
|
|
return localVarReturnValue, nil, reportError("esignEsignUploadIn 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.esignEsignUploadIn
|
|
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 EsignAPIPostEsignDocumentsByIdFieldsRequest struct {
|
|
ctx context.Context
|
|
ApiService *EsignAPIService
|
|
id string
|
|
esignEsignFieldIn *EsignEsignFieldIn
|
|
}
|
|
|
|
func (r EsignAPIPostEsignDocumentsByIdFieldsRequest) EsignEsignFieldIn(esignEsignFieldIn EsignEsignFieldIn) EsignAPIPostEsignDocumentsByIdFieldsRequest {
|
|
r.esignEsignFieldIn = &esignEsignFieldIn
|
|
return r
|
|
}
|
|
|
|
func (r EsignAPIPostEsignDocumentsByIdFieldsRequest) Execute() (*EsignEsignPlacement, *http.Response, error) {
|
|
return r.ApiService.PostEsignDocumentsByIdFieldsExecute(r)
|
|
}
|
|
|
|
/*
|
|
PostEsignDocumentsByIdFields Places a field on the page for one recipient to fill.
|
|
|
|
Places a field on the page for one recipient to fill.
|
|
|
|
It adds a signature, date, name, email or text box at a page and position for
|
|
ONE named recipient, and answers 201 with its id. The recipient must belong to
|
|
this document; one from elsewhere is refused.
|
|
|
|
Fields are what make a recipient signable: a document cannot be sent while any
|
|
signing recipient has none. Only while DRAFT — adding a field to a sent document
|
|
is a 409 — and an unknown document is a 404. The addition is recorded on the
|
|
audit trail.
|
|
|
|
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
|
|
@return EsignAPIPostEsignDocumentsByIdFieldsRequest
|
|
*/
|
|
func (a *EsignAPIService) PostEsignDocumentsByIdFields(ctx context.Context, id string) EsignAPIPostEsignDocumentsByIdFieldsRequest {
|
|
return EsignAPIPostEsignDocumentsByIdFieldsRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
id: id,
|
|
}
|
|
}
|
|
|
|
// Execute executes the request
|
|
//
|
|
// @return EsignEsignPlacement
|
|
func (a *EsignAPIService) PostEsignDocumentsByIdFieldsExecute(r EsignAPIPostEsignDocumentsByIdFieldsRequest) (*EsignEsignPlacement, *http.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = http.MethodPost
|
|
localVarPostBody interface{}
|
|
formFiles []formFile
|
|
localVarReturnValue *EsignEsignPlacement
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EsignAPIService.PostEsignDocumentsByIdFields")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/esign/documents/{id}/fields"
|
|
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.esignEsignFieldIn == nil {
|
|
return localVarReturnValue, nil, reportError("esignEsignFieldIn 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.esignEsignFieldIn
|
|
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 EsignAPIPostEsignDocumentsByIdRecipientsRequest struct {
|
|
ctx context.Context
|
|
ApiService *EsignAPIService
|
|
id string
|
|
esignEsignRecipientIn *EsignEsignRecipientIn
|
|
}
|
|
|
|
func (r EsignAPIPostEsignDocumentsByIdRecipientsRequest) EsignEsignRecipientIn(esignEsignRecipientIn EsignEsignRecipientIn) EsignAPIPostEsignDocumentsByIdRecipientsRequest {
|
|
r.esignEsignRecipientIn = &esignEsignRecipientIn
|
|
return r
|
|
}
|
|
|
|
func (r EsignAPIPostEsignDocumentsByIdRecipientsRequest) Execute() (*EsignEsignInvite, *http.Response, error) {
|
|
return r.ApiService.PostEsignDocumentsByIdRecipientsExecute(r)
|
|
}
|
|
|
|
/*
|
|
PostEsignDocumentsByIdRecipients Adds someone to a draft and mints their signing token.
|
|
|
|
Adds someone to a draft and mints their signing token.
|
|
|
|
It answers 201 with the recipient's id and their signing TOKEN — the
|
|
crypto-random capability that is the only credential the signer's surface
|
|
accepts — so this response is where the signing link is built from. A CC
|
|
recipient is recorded as already complete, because they are never asked to
|
|
sign.
|
|
|
|
Only while DRAFT: adding a recipient to a document already sent is a 409,
|
|
because the field layout and the turn order were fixed when it went out. An
|
|
unknown document is a 404. The addition is recorded on the audit trail.
|
|
|
|
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
|
|
@return EsignAPIPostEsignDocumentsByIdRecipientsRequest
|
|
*/
|
|
func (a *EsignAPIService) PostEsignDocumentsByIdRecipients(ctx context.Context, id string) EsignAPIPostEsignDocumentsByIdRecipientsRequest {
|
|
return EsignAPIPostEsignDocumentsByIdRecipientsRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
id: id,
|
|
}
|
|
}
|
|
|
|
// Execute executes the request
|
|
//
|
|
// @return EsignEsignInvite
|
|
func (a *EsignAPIService) PostEsignDocumentsByIdRecipientsExecute(r EsignAPIPostEsignDocumentsByIdRecipientsRequest) (*EsignEsignInvite, *http.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = http.MethodPost
|
|
localVarPostBody interface{}
|
|
formFiles []formFile
|
|
localVarReturnValue *EsignEsignInvite
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EsignAPIService.PostEsignDocumentsByIdRecipients")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/esign/documents/{id}/recipients"
|
|
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.esignEsignRecipientIn == nil {
|
|
return localVarReturnValue, nil, reportError("esignEsignRecipientIn 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.esignEsignRecipientIn
|
|
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 EsignAPIPostEsignDocumentsByIdSendRequest struct {
|
|
ctx context.Context
|
|
ApiService *EsignAPIService
|
|
id string
|
|
}
|
|
|
|
func (r EsignAPIPostEsignDocumentsByIdSendRequest) Execute() (*EsignEsignLinks, *http.Response, error) {
|
|
return r.ApiService.PostEsignDocumentsByIdSendExecute(r)
|
|
}
|
|
|
|
/*
|
|
PostEsignDocumentsByIdSend Sends the document out and answers each signer's link.
|
|
|
|
Sends the document out and answers each signer's link.
|
|
|
|
It moves the document from DRAFT to PENDING and answers the signing tokens — one
|
|
per signing recipient, with the path to hand them — which is how the links reach
|
|
the people who must sign. Nothing is emailed by this call; delivering the links
|
|
is the caller's.
|
|
|
|
It refuses to send an unsignable document: no recipients at all is a 400, and so
|
|
is any signing recipient with no fields to fill, named in the error. Re-sending
|
|
an already-pending document is allowed and re-issues the same links rather than
|
|
restarting anything; a completed document is a 409, and an unknown one a 404.
|
|
The send is recorded on the audit trail.
|
|
|
|
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 send. The URL is the addressing authority.
|
|
@return EsignAPIPostEsignDocumentsByIdSendRequest
|
|
*/
|
|
func (a *EsignAPIService) PostEsignDocumentsByIdSend(ctx context.Context, id string) EsignAPIPostEsignDocumentsByIdSendRequest {
|
|
return EsignAPIPostEsignDocumentsByIdSendRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
id: id,
|
|
}
|
|
}
|
|
|
|
// Execute executes the request
|
|
//
|
|
// @return EsignEsignLinks
|
|
func (a *EsignAPIService) PostEsignDocumentsByIdSendExecute(r EsignAPIPostEsignDocumentsByIdSendRequest) (*EsignEsignLinks, *http.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = http.MethodPost
|
|
localVarPostBody interface{}
|
|
formFiles []formFile
|
|
localVarReturnValue *EsignEsignLinks
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EsignAPIService.PostEsignDocumentsByIdSend")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/esign/documents/{id}/send"
|
|
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 EsignAPIPostEsignOByOrgSignByTokenCompleteRequest struct {
|
|
ctx context.Context
|
|
ApiService *EsignAPIService
|
|
org string
|
|
token string
|
|
}
|
|
|
|
func (r EsignAPIPostEsignOByOrgSignByTokenCompleteRequest) Execute() (*EsignEsignCompletion, *http.Response, error) {
|
|
return r.ApiService.PostEsignOByOrgSignByTokenCompleteExecute(r)
|
|
}
|
|
|
|
/*
|
|
PostEsignOByOrgSignByTokenComplete Finishes your signing — and seals the document if you were the last.
|
|
|
|
Finishes your signing — and seals the document if you were the
|
|
last.
|
|
|
|
It marks this recipient as done and answers whether the DOCUMENT sealed with it.
|
|
When every signing recipient has completed, sealing happens right here in the
|
|
same call: the collected values are rendered onto the PDF, a real x509 PKCS#7
|
|
signature is applied, the sealed bytes are stored beside the untouched original,
|
|
and the document moves to COMPLETED. Until then the answer is the recipient's
|
|
own completion with the document still pending.
|
|
|
|
It refuses to complete a half-filled signature: a recipient with any unfilled
|
|
field is a 400 naming how many remain. A document not out for signature is a
|
|
409, as is a recipient who has already completed, and under SEQUENTIAL order a
|
|
signer out of turn is a 403. The token is the whole credential — no account, and
|
|
a token that does not resolve under the org segment is a 404. Sealing and
|
|
completion are one transaction, so a failure anywhere leaves the document
|
|
exactly as it was.
|
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
@param org
|
|
@param token
|
|
@return EsignAPIPostEsignOByOrgSignByTokenCompleteRequest
|
|
*/
|
|
func (a *EsignAPIService) PostEsignOByOrgSignByTokenComplete(ctx context.Context, org string, token string) EsignAPIPostEsignOByOrgSignByTokenCompleteRequest {
|
|
return EsignAPIPostEsignOByOrgSignByTokenCompleteRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
org: org,
|
|
token: token,
|
|
}
|
|
}
|
|
|
|
// Execute executes the request
|
|
//
|
|
// @return EsignEsignCompletion
|
|
func (a *EsignAPIService) PostEsignOByOrgSignByTokenCompleteExecute(r EsignAPIPostEsignOByOrgSignByTokenCompleteRequest) (*EsignEsignCompletion, *http.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = http.MethodPost
|
|
localVarPostBody interface{}
|
|
formFiles []formFile
|
|
localVarReturnValue *EsignEsignCompletion
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EsignAPIService.PostEsignOByOrgSignByTokenComplete")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/esign/o/{org}/sign/{token}/complete"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"org"+"}", url.PathEscape(parameterValueToString(r.org, "org")), -1)
|
|
localVarPath = strings.Replace(localVarPath, "{"+"token"+"}", url.PathEscape(parameterValueToString(r.token, "token")), -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 EsignAPIPostEsignOByOrgSignByTokenFieldsByFieldidRequest struct {
|
|
ctx context.Context
|
|
ApiService *EsignAPIService
|
|
org string
|
|
token string
|
|
fieldId string
|
|
esignEsignValueIn *EsignEsignValueIn
|
|
}
|
|
|
|
func (r EsignAPIPostEsignOByOrgSignByTokenFieldsByFieldidRequest) EsignEsignValueIn(esignEsignValueIn EsignEsignValueIn) EsignAPIPostEsignOByOrgSignByTokenFieldsByFieldidRequest {
|
|
r.esignEsignValueIn = &esignEsignValueIn
|
|
return r
|
|
}
|
|
|
|
func (r EsignAPIPostEsignOByOrgSignByTokenFieldsByFieldidRequest) Execute() (*EsignEsignInsertion, *http.Response, error) {
|
|
return r.ApiService.PostEsignOByOrgSignByTokenFieldsByFieldidExecute(r)
|
|
}
|
|
|
|
/*
|
|
PostEsignOByOrgSignByTokenFieldsByFieldid Fills in one of your fields.
|
|
|
|
Fills in one of your fields.
|
|
|
|
It records a value for one field and marks it inserted. A signature field takes
|
|
a value with isBase64 true for drawn image bytes, or false for a typed
|
|
signature; a date, name or email field falls back to today, the recipient's name
|
|
or their email when the value is omitted; any other type requires one.
|
|
|
|
Nothing is sealed here — filling every field still leaves the document pending
|
|
until the completion call. The token is the whole credential and it bounds what
|
|
can be written: a field belonging to another recipient is refused with 401 even
|
|
under a valid token, an unknown field is a 404, and a field already filled is a
|
|
409. A document not out for signature is a 409, as is a recipient who has
|
|
already completed or rejected. Under SEQUENTIAL order a signer whose turn has
|
|
not come is refused 403 until every earlier signer has signed. Each insertion is
|
|
recorded on the audit trail.
|
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
@param org
|
|
@param token
|
|
@param fieldId
|
|
@return EsignAPIPostEsignOByOrgSignByTokenFieldsByFieldidRequest
|
|
*/
|
|
func (a *EsignAPIService) PostEsignOByOrgSignByTokenFieldsByFieldid(ctx context.Context, org string, token string, fieldId string) EsignAPIPostEsignOByOrgSignByTokenFieldsByFieldidRequest {
|
|
return EsignAPIPostEsignOByOrgSignByTokenFieldsByFieldidRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
org: org,
|
|
token: token,
|
|
fieldId: fieldId,
|
|
}
|
|
}
|
|
|
|
// Execute executes the request
|
|
//
|
|
// @return EsignEsignInsertion
|
|
func (a *EsignAPIService) PostEsignOByOrgSignByTokenFieldsByFieldidExecute(r EsignAPIPostEsignOByOrgSignByTokenFieldsByFieldidRequest) (*EsignEsignInsertion, *http.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = http.MethodPost
|
|
localVarPostBody interface{}
|
|
formFiles []formFile
|
|
localVarReturnValue *EsignEsignInsertion
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EsignAPIService.PostEsignOByOrgSignByTokenFieldsByFieldid")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/esign/o/{org}/sign/{token}/fields/{fieldId}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"org"+"}", url.PathEscape(parameterValueToString(r.org, "org")), -1)
|
|
localVarPath = strings.Replace(localVarPath, "{"+"token"+"}", url.PathEscape(parameterValueToString(r.token, "token")), -1)
|
|
localVarPath = strings.Replace(localVarPath, "{"+"fieldId"+"}", url.PathEscape(parameterValueToString(r.fieldId, "fieldId")), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
if r.esignEsignValueIn == nil {
|
|
return localVarReturnValue, nil, reportError("esignEsignValueIn 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.esignEsignValueIn
|
|
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 EsignAPIPostEsignOByOrgSignByTokenRejectRequest struct {
|
|
ctx context.Context
|
|
ApiService *EsignAPIService
|
|
org string
|
|
token string
|
|
esignEsignRejectIn *EsignEsignRejectIn
|
|
}
|
|
|
|
func (r EsignAPIPostEsignOByOrgSignByTokenRejectRequest) EsignEsignRejectIn(esignEsignRejectIn EsignEsignRejectIn) EsignAPIPostEsignOByOrgSignByTokenRejectRequest {
|
|
r.esignEsignRejectIn = &esignEsignRejectIn
|
|
return r
|
|
}
|
|
|
|
func (r EsignAPIPostEsignOByOrgSignByTokenRejectRequest) Execute() (*EsignEsignRejection, *http.Response, error) {
|
|
return r.ApiService.PostEsignOByOrgSignByTokenRejectExecute(r)
|
|
}
|
|
|
|
/*
|
|
PostEsignOByOrgSignByTokenReject Declines to sign, with an optional reason.
|
|
|
|
Declines to sign, with an optional reason.
|
|
|
|
It records this recipient's refusal and moves the WHOLE DOCUMENT to REJECTED —
|
|
one declining signer ends it for everyone, and there is no route back: the
|
|
document cannot then be signed or completed. An optional reason is stored and
|
|
written onto the audit trail with the rejection, which is what the sender sees.
|
|
|
|
A document not out for signature is a 409, and so is a recipient who has already
|
|
signed or already rejected — a refusal cannot be taken back or repeated. The
|
|
token is the whole credential; one that does not resolve under the org segment
|
|
is a 404.
|
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
@param org
|
|
@param token
|
|
@return EsignAPIPostEsignOByOrgSignByTokenRejectRequest
|
|
*/
|
|
func (a *EsignAPIService) PostEsignOByOrgSignByTokenReject(ctx context.Context, org string, token string) EsignAPIPostEsignOByOrgSignByTokenRejectRequest {
|
|
return EsignAPIPostEsignOByOrgSignByTokenRejectRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
org: org,
|
|
token: token,
|
|
}
|
|
}
|
|
|
|
// Execute executes the request
|
|
//
|
|
// @return EsignEsignRejection
|
|
func (a *EsignAPIService) PostEsignOByOrgSignByTokenRejectExecute(r EsignAPIPostEsignOByOrgSignByTokenRejectRequest) (*EsignEsignRejection, *http.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = http.MethodPost
|
|
localVarPostBody interface{}
|
|
formFiles []formFile
|
|
localVarReturnValue *EsignEsignRejection
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EsignAPIService.PostEsignOByOrgSignByTokenReject")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/esign/o/{org}/sign/{token}/reject"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"org"+"}", url.PathEscape(parameterValueToString(r.org, "org")), -1)
|
|
localVarPath = strings.Replace(localVarPath, "{"+"token"+"}", url.PathEscape(parameterValueToString(r.token, "token")), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
if r.esignEsignRejectIn == nil {
|
|
return localVarReturnValue, nil, reportError("esignEsignRejectIn 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.esignEsignRejectIn
|
|
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
|
|
}
|