Documentation
¶
Index ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- type APIClient
- type APIKey
- type APIResponse
- type ApiError
- type AssembleOptions
- type AssemblyApiErrorResponse
- type AssemblyApiService
- func (a *AssemblyApiService) AssembleDocument(ctx context.Context, assembleOptions IAssembleOptions) (*http.Response, error)
- func (a *AssemblyApiService) CopyFile(ctx context.Context, destPath string, srcPath string, ...) (*http.Response, error)
- func (a *AssemblyApiService) CopyFolder(ctx context.Context, destPath string, srcPath string, ...) (*http.Response, error)
- func (a *AssemblyApiService) CreateFolder(ctx context.Context, path string, localVarOptionals map[string]interface{}) (*http.Response, error)
- func (a *AssemblyApiService) DeleteFile(ctx context.Context, path string, localVarOptionals map[string]interface{}) (*http.Response, error)
- func (a *AssemblyApiService) DeleteFolder(ctx context.Context, path string, localVarOptionals map[string]interface{}) (*http.Response, error)
- func (a *AssemblyApiService) DownloadFile(ctx context.Context, path string, localVarOptionals map[string]interface{}) (*http.Response, error)
- func (a *AssemblyApiService) GetFilesList(ctx context.Context, path string, localVarOptionals map[string]interface{}) (FilesList, *http.Response, error)
- func (a *AssemblyApiService) GetSupportedFileFormats(ctx context.Context) (FileFormatsResponse, *http.Response, error)
- func (a *AssemblyApiService) MoveFile(ctx context.Context, destPath string, srcPath string, ...) (*http.Response, error)
- func (a *AssemblyApiService) MoveFolder(ctx context.Context, destPath string, srcPath string, ...) (*http.Response, error)
- func (a *AssemblyApiService) UploadFile(ctx context.Context, fileContent *os.File, path string, ...) (FilesUploadResult, *http.Response, error)
- type AssemblyResponse
- type BasicAuth
- type Configuration
- type ErrorDetails
- type FileFormatsResponse
- type FileResponse
- type FilesList
- type FilesUploadResult
- type Format
- type FormatCollection
- type IApiError
- type IAssembleOptions
- type IAssemblyApiErrorResponse
- type IAssemblyResponse
- type IErrorDetails
- type IFileFormatsResponse
- type IFileResponse
- type IFilesList
- type IFilesUploadResult
- type IFormat
- type IFormatCollection
- type IStorageApiError
- type IStorageFile
- type ITemplateFileInfo
- type StorageApiError
- type StorageFile
- type TemplateFileInfo
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 ¶
Change base path to allow switching to mocks
type APIKey ¶
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 ¶
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 ¶
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.
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 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 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
Source Files
¶
- api_client.go
- api_error.go
- api_response.go
- assemble_options.go
- assembly_api.go
- assembly_api_error_response.go
- assembly_response.go
- configuration.go
- error_details.go
- file_formats_response.go
- file_response.go
- files_list.go
- files_upload_result.go
- format.go
- format_collection.go
- storage_api_error.go
- storage_file.go
- template_file_info.go