Show / Hide Table of Contents

Class ClientContext

Represents the execution context of an IOperation. An execution context typically consists of the desired authentication credentials and client configurations such as timeouts. Currently, it is set up using a config json file.

For each set of authentication credentials, a ClientContext instance can be reused across operations.

Sample Usage:
ClientContext context = ClientContext.CreateFromFile(Directory.GetCurrentDirectory() + "/dc-services-sdk-config.json");
CreatePDFOperation cpdfOperation = CreatePDFOperation.CreateNew();
cpdfOperation.setInput(FileRef.CreateFromLocalFile("createPdfInput.docx"));
cpdfOperation.Execute(context);
Inheritance
System.Object
ClientContext
Namespace: Adobe.DocumentCloud.Services
Assembly: Adobe.DocumentCloud.Services.Doc.dll
Syntax
public class ClientContext

Constructors

ClientContext()

Declaration
protected ClientContext()

Methods

CreateFromFile(String)

Creates a context instance using the config file per configFilePath parameter. Set config file property to "Copy Always"

Declaration
public static ClientContext CreateFromFile(string configFilePath)
Parameters
Type Name Description
System.String configFilePath

the absolute path of the config json file

Returns
Type Description
ClientContext

a new ClientContext instance

Exceptions
Type Condition
System.IO.IOException

if an I/O error occurs while reading the config file

System.IO.FileNotFoundException

if the config file is not found

WithAuthentication(Authentication)

Creates a copy of this ClientContext with the provided Authentication instance.

Declaration
public ClientContext WithAuthentication(Authentication authentication)
Parameters
Type Name Description
Authentication authentication

an authentication instance

Returns
Type Description
ClientContext

a new ClientContext instance

Back to top Copyright © 2019 Adobe. All rights reserved.