api

package
v0.0.0-...-19e6a5f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2021 License: MIT Imports: 24 Imported by: 0

README

Go API client for api

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

Overview

This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you can easily generate an API client.

  • API version: 21.1
  • Package version: 20.5.0
  • Build package: io.swagger.codegen.languages.GoClientCodegen

Installation

Put the package under your project folder and add the following in import:

    "./api"

Documentation for API Endpoints

All URIs are relative to https://localhost/v1.0

Class Method HTTP request Description
AssemblyApi AssembleDocument Post /assembly/assemble Builds a document using document template and XML or JSON data passed in request.
AssemblyApi CopyFile Put /assembly/storage/file/copy/{srcPath} Copy file
AssemblyApi CopyFolder Put /assembly/storage/folder/copy/{srcPath} Copy folder
AssemblyApi CreateFolder Put /assembly/storage/folder/{path} Create the folder
AssemblyApi DeleteFile Delete /assembly/storage/file/{path} Delete file
AssemblyApi DeleteFolder Delete /assembly/storage/folder/{path} Delete folder
AssemblyApi DownloadFile Get /assembly/storage/file/{path} Download file
AssemblyApi GetFilesList Get /assembly/storage/folder/{path} Get all files and folders within a folder
AssemblyApi GetSupportedFileFormats Get /assembly/formats Retrieves list of supported file formats.
AssemblyApi MoveFile Put /assembly/storage/file/move/{srcPath} Move file
AssemblyApi MoveFolder Put /assembly/storage/folder/move/{srcPath} Move folder
AssemblyApi UploadFile Put /assembly/storage/file/{path} Upload file

Documentation For Models

Documentation For Authorization

JWT

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes: N/A

Example

	auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING")
    r, err := client.Service.Operation(auth, args)

Or via OAuth2 module to automatically refresh tokens and perform user authentication.

	import 	"golang.org/x/oauth2"

    / .. Perform OAuth2 round trip request and obtain a token .. //

    tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
	auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource)
    r, err := client.Service.Operation(auth, args)

Author

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.
	ContextOAuth2 = contextKey("token")

	// ContextBasicAuth takes BasicAuth as authentication for the request.
	ContextBasicAuth = contextKey("basic")

	// ContextAccessToken takes a string oauth2 access token as authentication for the request.
	ContextAccessToken = contextKey("accesstoken")

	// ContextAPIKey takes an APIKey as authentication for the request
	ContextAPIKey = contextKey("apikey")
)

Functions

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

Types

type APIClient

type APIClient struct {

	// API Services
	AssemblyApi *AssemblyApiService
	// contains filtered or unexported fields
}

APIClient manages communication with the GroupDocs.Assembly Cloud API Reference API v21.1 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(cfg *Configuration) (client *APIClient, err error)

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) ChangeBasePath

func (c *APIClient) ChangeBasePath(path string)

Change base path to allow switching to mocks

func (*APIClient) NewContextWithToken

func (c *APIClient) NewContextWithToken(ctx context.Context) (ctxWithToken context.Context, err error)

create context with token

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the swagger operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

type ApiError

type ApiError struct {

	// Gets or sets api error code.
	Code string `json:"Code,omitempty"`

	// Gets or sets error message.
	Message string `json:"Message,omitempty"`

	// Gets or sets error description.
	Description string `json:"Description,omitempty"`

	// Gets or sets server datetime.
	DateTime time.Time `json:"DateTime,omitempty"`

	// Gets or sets inner error.
	InnerError *ApiError `json:"InnerError,omitempty"`
}

Error class.

func (ApiError) IsApiError

func (ApiError) IsApiError() bool

type AssembleOptions

type AssembleOptions struct {

	// Gets or sets the template name which is located on storage.
	TemplateFileInfo *TemplateFileInfo `json:"TemplateFileInfo,omitempty"`

	// Gets or sets a save format for assembled document.
	SaveFormat string `json:"SaveFormat,omitempty"`

	// Gets or sets a data for report.
	ReportData string `json:"ReportData,omitempty"`

	// Gets or sets result path of a built document.
	OutputPath string `json:"OutputPath,omitempty"`
}

Assemble options data which is using for specifying assemble options, like template name, save format, report data and etc.

func (AssembleOptions) IsAssembleOptions

func (AssembleOptions) IsAssembleOptions() bool

type AssemblyApiErrorResponse

type AssemblyApiErrorResponse struct {

	// Gets or sets request Id.
	RequestId string `json:"RequestId,omitempty"`

	// Gets or sets error.
	Error_ *ApiError `json:"Error,omitempty"`
}

Error response for exceptions.

func (*AssemblyApiErrorResponse) Error

func (w *AssemblyApiErrorResponse) Error() string

func (AssemblyApiErrorResponse) IsAssemblyApiErrorResponse

func (AssemblyApiErrorResponse) IsAssemblyApiErrorResponse() bool

func (AssemblyApiErrorResponse) IsAssemblyResponse

func (AssemblyApiErrorResponse) IsAssemblyResponse() bool

type AssemblyApiService

type AssemblyApiService service

func (*AssemblyApiService) AssembleDocument

func (a *AssemblyApiService) AssembleDocument(ctx context.Context, assembleOptions IAssembleOptions) (*http.Response, error)

AssemblyApiService Builds a document using document template and XML or JSON data passed in request. * @param ctx context.Context for authentication, logging, tracing, etc. @param assembleOptions Assemble Options. It should be JSON or XML with TemplateFileInfo, SaveFormat, ReportData and etc. @return *os.File

func (*AssemblyApiService) CopyFile

func (a *AssemblyApiService) CopyFile(ctx context.Context, destPath string, srcPath string, localVarOptionals map[string]interface{}) (*http.Response, error)

AssemblyApiService Copy file * @param ctx context.Context for authentication, logging, tracing, etc. @param destPath Destination file path @param srcPath Source file's path e.g. '/Folder 1/file.ext' or '/Bucket/Folder 1/file.ext' @param optional (nil or map[string]interface{}) with one or more of:

@param "srcStorageName" (string) Source storage name
@param "destStorageName" (string) Destination storage name
@param "versionId" (string) File version ID to copy

@return

func (*AssemblyApiService) CopyFolder

func (a *AssemblyApiService) CopyFolder(ctx context.Context, destPath string, srcPath string, localVarOptionals map[string]interface{}) (*http.Response, error)

AssemblyApiService Copy folder * @param ctx context.Context for authentication, logging, tracing, etc. @param destPath Destination folder path e.g. '/dst' @param srcPath Source folder path e.g. /Folder1 @param optional (nil or map[string]interface{}) with one or more of:

@param "srcStorageName" (string) Source storage name
@param "destStorageName" (string) Destination storage name

@return

func (*AssemblyApiService) CreateFolder

func (a *AssemblyApiService) CreateFolder(ctx context.Context, path string, localVarOptionals map[string]interface{}) (*http.Response, error)

AssemblyApiService Create the folder * @param ctx context.Context for authentication, logging, tracing, etc. @param path Target folder's path e.g. Folder1/Folder2/. The folders will be created recursively @param optional (nil or map[string]interface{}) with one or more of:

@param "storageName" (string) Storage name

@return

func (*AssemblyApiService) DeleteFile

func (a *AssemblyApiService) DeleteFile(ctx context.Context, path string, localVarOptionals map[string]interface{}) (*http.Response, error)

AssemblyApiService Delete file * @param ctx context.Context for authentication, logging, tracing, etc. @param path Path of the file including file name and extension e.g. /Folder1/file.ext @param optional (nil or map[string]interface{}) with one or more of:

@param "storageName" (string) Storage name
@param "versionId" (string) File version ID to delete

@return

func (*AssemblyApiService) DeleteFolder

func (a *AssemblyApiService) DeleteFolder(ctx context.Context, path string, localVarOptionals map[string]interface{}) (*http.Response, error)

AssemblyApiService Delete folder * @param ctx context.Context for authentication, logging, tracing, etc. @param path Folder path e.g. /Folder1s @param optional (nil or map[string]interface{}) with one or more of:

@param "storageName" (string) Storage name
@param "recursive" (bool) Enable to delete folders, subfolders and files

@return

func (*AssemblyApiService) DownloadFile

func (a *AssemblyApiService) DownloadFile(ctx context.Context, path string, localVarOptionals map[string]interface{}) (*http.Response, error)

AssemblyApiService Download file * @param ctx context.Context for authentication, logging, tracing, etc. @param path Path of the file including the file name and extension e.g. /folder1/file.ext @param optional (nil or map[string]interface{}) with one or more of:

@param "storageName" (string) Storage name
@param "versionId" (string) File version ID to download

@return *os.File

func (*AssemblyApiService) GetFilesList

func (a *AssemblyApiService) GetFilesList(ctx context.Context, path string, localVarOptionals map[string]interface{}) (FilesList, *http.Response, error)

AssemblyApiService Get all files and folders within a folder * @param ctx context.Context for authentication, logging, tracing, etc. @param path Folder path e.g. /Folder1 @param optional (nil or map[string]interface{}) with one or more of:

@param "storageName" (string) Storage name

@return FilesList

func (*AssemblyApiService) GetSupportedFileFormats

func (a *AssemblyApiService) GetSupportedFileFormats(ctx context.Context) (FileFormatsResponse, *http.Response, error)

AssemblyApiService Retrieves list of supported file formats. * @param ctx context.Context for authentication, logging, tracing, etc. @return FileFormatsResponse

func (*AssemblyApiService) MoveFile

func (a *AssemblyApiService) MoveFile(ctx context.Context, destPath string, srcPath string, localVarOptionals map[string]interface{}) (*http.Response, error)

AssemblyApiService Move file * @param ctx context.Context for authentication, logging, tracing, etc. @param destPath Destination file path e.g. '/dest.ext' @param srcPath Source file's path e.g. '/Folder 1/file.ext' or '/Bucket/Folder 1/file.ext' @param optional (nil or map[string]interface{}) with one or more of:

@param "srcStorageName" (string) Source storage name
@param "destStorageName" (string) Destination storage name
@param "versionId" (string) File version ID to move

@return

func (*AssemblyApiService) MoveFolder

func (a *AssemblyApiService) MoveFolder(ctx context.Context, destPath string, srcPath string, localVarOptionals map[string]interface{}) (*http.Response, error)

AssemblyApiService Move folder * @param ctx context.Context for authentication, logging, tracing, etc. @param destPath Destination folder path to move to e.g '/dst' @param srcPath Source folder path e.g. /Folder1 @param optional (nil or map[string]interface{}) with one or more of:

@param "srcStorageName" (string) Source storage name
@param "destStorageName" (string) Destination storage name

@return

func (*AssemblyApiService) UploadFile

func (a *AssemblyApiService) UploadFile(ctx context.Context, fileContent *os.File, path string, localVarOptionals map[string]interface{}) (FilesUploadResult, *http.Response, error)

AssemblyApiService Upload file * @param ctx context.Context for authentication, logging, tracing, etc. @param fileContent File to upload @param path Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext If the content is multipart and path does not contains the file name it tries to get them from filename parameter from Content-Disposition header. @param optional (nil or map[string]interface{}) with one or more of:

@param "storageName" (string) Storage name

@return FilesUploadResult

type AssemblyResponse

type AssemblyResponse struct {

	// Gets or sets request Id.
	RequestId string `json:"RequestId,omitempty"`
}

Base class for all responses.

func (AssemblyResponse) IsAssemblyResponse

func (AssemblyResponse) IsAssemblyResponse() bool

type BasicAuth

type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type Configuration

type Configuration struct {
	BaseUrl       string            `json:"BaseUrl,omitempty"`
	AppKey        string            `json:"AppKey"`
	AppSid        string            `json:"AppSid"`
	DebugMode     bool              `json:"DebugMode,omitempty"`
	DefaultHeader map[string]string `json:"DefaultHeader,omitempty"`
	HttpClient    *http.Client
}

func NewConfiguration

func NewConfiguration(configFilePath string) (pConfig *Configuration, err error)

type ErrorDetails

type ErrorDetails struct {

	// The request id.
	RequestId string `json:"RequestId,omitempty"`

	// Error datetime.
	ErrorDateTime time.Time `json:"ErrorDateTime"`
}

The error details

func (ErrorDetails) IsErrorDetails

func (ErrorDetails) IsErrorDetails() bool

type FileFormatsResponse

type FileFormatsResponse struct {

	// Gets or sets request Id.
	RequestId string `json:"RequestId,omitempty"`

	// Gets or sets file formats.
	FileFormats *FormatCollection `json:"FileFormats,omitempty"`

	// Gets response status code.
	Code int32 `json:"Code,omitempty"`

	// Gets or sets response status.
	Status string `json:"Status,omitempty"`
}

Response with file formats.

func (FileFormatsResponse) IsAssemblyResponse

func (FileFormatsResponse) IsAssemblyResponse() bool

func (FileFormatsResponse) IsFileFormatsResponse

func (FileFormatsResponse) IsFileFormatsResponse() bool

type FileResponse

type FileResponse struct {
}

The empty type used as a flag.

func (FileResponse) IsFileResponse

func (FileResponse) IsFileResponse() bool

type FilesList

type FilesList struct {

	// Files and folders contained by folder .
	Value []StorageFile `json:"Value,omitempty"`
}

Files list

func (FilesList) IsFilesList

func (FilesList) IsFilesList() bool

type FilesUploadResult

type FilesUploadResult struct {

	// List of uploaded file names
	Uploaded []string `json:"Uploaded,omitempty"`

	// List of errors.
	Errors []StorageApiError `json:"Errors,omitempty"`
}

File upload result

func (FilesUploadResult) IsFilesUploadResult

func (FilesUploadResult) IsFilesUploadResult() bool

type Format

type Format struct {

	// Gets or sets file format.
	FileFormat string `json:"FileFormat,omitempty"`

	// Gets or sets file extension.
	Extension string `json:"Extension,omitempty"`
}

Format description.

func (Format) IsFormat

func (Format) IsFormat() bool

type FormatCollection

type FormatCollection struct {

	// Gets or sets supported file formats.
	Formats []Format `json:"Formats,omitempty"`
}

Describes object which contains list of supported file formats.

func (FormatCollection) IsFormatCollection

func (FormatCollection) IsFormatCollection() bool

type IApiError

type IApiError interface {
	IsApiError() bool
}

type IAssembleOptions

type IAssembleOptions interface {
	IsAssembleOptions() bool
}

type IAssemblyApiErrorResponse

type IAssemblyApiErrorResponse interface {
	IsAssemblyApiErrorResponse() bool
}

type IAssemblyResponse

type IAssemblyResponse interface {
	IsAssemblyResponse() bool
}

type IErrorDetails

type IErrorDetails interface {
	IsErrorDetails() bool
}

type IFileFormatsResponse

type IFileFormatsResponse interface {
	IsFileFormatsResponse() bool
}

type IFileResponse

type IFileResponse interface {
	IsFileResponse() bool
}

type IFilesList

type IFilesList interface {
	IsFilesList() bool
}

type IFilesUploadResult

type IFilesUploadResult interface {
	IsFilesUploadResult() bool
}

type IFormat

type IFormat interface {
	IsFormat() bool
}

type IFormatCollection

type IFormatCollection interface {
	IsFormatCollection() bool
}

type IStorageApiError

type IStorageApiError interface {
	IsStorageApiError() bool
}

type IStorageFile

type IStorageFile interface {
	IsStorageFile() bool
}

type ITemplateFileInfo

type ITemplateFileInfo interface {
	IsTemplateFileInfo() bool
}

type StorageApiError

type StorageApiError struct {

	// Code
	Code string `json:"Code,omitempty"`

	// Message
	Message string `json:"Message,omitempty"`

	// Description
	Description string `json:"Description,omitempty"`

	// Inner Error
	InnerError *ErrorDetails `json:"InnerError,omitempty"`
}

Error

func (StorageApiError) IsStorageApiError

func (StorageApiError) IsStorageApiError() bool

type StorageFile

type StorageFile struct {

	// File or folder name.
	Name string `json:"Name,omitempty"`

	// True if it is a folder.
	IsFolder bool `json:"IsFolder"`

	// File or folder last modified .
	ModifiedDate time.Time `json:"ModifiedDate,omitempty"`

	// File or folder size.
	Size int64 `json:"Size"`

	// File or folder path.
	Path string `json:"Path,omitempty"`
}

File or folder information

func (StorageFile) IsStorageFile

func (StorageFile) IsStorageFile() bool

type TemplateFileInfo

type TemplateFileInfo struct {

	// Gets or sets path to file.
	FilePath string `json:"FilePath,omitempty"`

	// Gets or sets the name of storage.
	StorageName string `json:"StorageName,omitempty"`

	// Gets or sets the name of storage.
	VersionId string `json:"VersionId,omitempty"`

	// Gets or sets the password.
	Password string `json:"Password,omitempty"`
}

TemplateFileInfo dto.

func (TemplateFileInfo) IsTemplateFileInfo

func (TemplateFileInfo) IsTemplateFileInfo() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL