C# Class NuxeoClient.Client

A client that provides all the methods required to perform Automation operations and REST CRUD operations on an instance of the Nuxeo Server.
Inheritance: IDisposable
Show file Open project: nuxeo/nuxeo-dotnet-client Class Usage Examples

Public Methods

Method Description
AddDefaultSchema ( string schema ) : Client

Adds a default document schema to be sent in all requests.

For more details about schemas, check Nuxeo Documentation Center.

Batch ( ) : Task

Requests a new Batch from the server.

ClearDefaultSchemas ( ) : Client

Removes all default schemas to be sent in all requests.

For more details about schemas, check Nuxeo Documentation Center.

Client ( string serverURL = "http://localhost:8080/nuxeo/", Authorization authorization = null, string automationPath = "api/v1/automation/", string restPath = "api/v1/", string schemas = null, int timeout = 30 ) : Newtonsoft.Json

Initializes a new instance of the Nuxeo Client.

Dispose ( ) : void

Releases the unmanaged resources used by the Client and optionally disposes of the managed resources.

DocumentFromPath ( string path ) : Document

Creates a new instance of a Nuxeo Document.

DocumentFromUid ( string uid ) : Document

Creates a new instance of a Nuxeo Document.

Operation ( string id ) : Operation

Creates a new instance of an Automation Operation.

RemoveDefaultSchema ( string schema ) : Client

Removes a default schema to be sent in all requests.

For more details about schemas, check Nuxeo Documentation Center.

Request ( RequestType type, string endpoint, QueryParams parameters = null, JToken data = null, string>.Dictionary additionalHeaders = null, string contentType = ContentType.JSON ) : Task

Performs a RESTful request to the Nuxeo Server.

SetAuthomationPath ( string path ) : Client

Sets the path to the Automation endpoint.

SetAuthorization ( Authorization auth ) : Client

Sets the authorization information to be sent in all requests.

SetDefaultSchemas ( string schemas ) : Client

Sets the default document schemas to be sent in all requests.

For more details about schemas, check Nuxeo Documentation Center.

SetMarshaller ( IMarshaller marshaller ) : Client

Sets the object marshaller for this client.

SetRestPath ( string path ) : Client

Sets the path to the REST API endpoint.

SetServerURL ( string url ) : Client

Sets the URL of the Nuxeo server.

SetTimemout ( int timeout ) : Client

Sets the default reques timeout.

Uploader ( ) : Uploader

Returns a new instance of Uploader.

Private Methods

Method Description
AddBlobToMultipartContent ( MultipartContent content, Blob blob ) : void
BuildMultipartContent ( JToken data ) : MultipartContent
Delete ( string endpoint, QueryParams parameters = null, string>.Dictionary additionalHeaders = null, string contentType = ContentType.JSON ) : Task
Get ( string endpoint, QueryParams parameters = null, string>.Dictionary additionalHeaders = null, string contentType = ContentType.JSON ) : Task
Post ( string endpoint, QueryParams parameters = null, JToken data = null, string>.Dictionary additionalHeaders = null, string contentType = ContentType.JSON ) : Task
PostBin ( string endpoint, QueryParams parameters = null, byte data = null, string>.Dictionary additionalHeaders = null ) : Task
ProcessRequest ( HttpRequestMessage request, string>.Dictionary additionalHeaders = null ) : Task
ProcessResponse ( HttpResponseMessage response ) : Task
Put ( string endpoint, QueryParams parameters = null, JToken data = null, string>.Dictionary additionalHeaders = null, string contentType = ContentType.JSON ) : Task
RequestBin ( string endpoint, QueryParams parameters = null, byte data = null, HttpMethod httpMethod = null, string>.Dictionary additionalHeaders = null, string contentType = ContentType.OCTETSTREAM ) : Task
RequestJson ( string endpoint, QueryParams parameters = null, JToken data = null, HttpMethod httpMethod = null, string>.Dictionary additionalHeaders = null, string contentType = ContentType.JSON ) : Task
RequestMultipart ( string endpoint, JToken data, Blob input, HttpMethod htttpMethod = null, string>.Dictionary additionalHeaders = null, string contentType = ContentType.NXREQUEST ) : Task
RequestMultipart ( string endpoint, JToken data, BlobList input, HttpMethod htttpMethod = null, string>.Dictionary additionalHeaders = null, string contentType = ContentType.NXREQUEST ) : Task

Method Details

AddDefaultSchema() public method

Adds a default document schema to be sent in all requests.
For more details about schemas, check Nuxeo Documentation Center.
public AddDefaultSchema ( string schema ) : Client
schema string A string containing the schema's name.
return Client

Batch() public method

Requests a new Batch from the server.
public Batch ( ) : Task
return Task

ClearDefaultSchemas() public method

Removes all default schemas to be sent in all requests.
For more details about schemas, check Nuxeo Documentation Center.
public ClearDefaultSchemas ( ) : Client
return Client

Client() public method

Initializes a new instance of the Nuxeo Client.
public Client ( string serverURL = "http://localhost:8080/nuxeo/", Authorization authorization = null, string automationPath = "api/v1/automation/", string restPath = "api/v1/", string schemas = null, int timeout = 30 ) : Newtonsoft.Json
serverURL string The URL of the Nuxeo server.
authorization Authorization The authorization credentials.
automationPath string The Automation API path.
restPath string The REST API path.
schemas string The default schemas to be used in the requests.
timeout int The default request timeout.
return Newtonsoft.Json

Dispose() public method

Releases the unmanaged resources used by the Client and optionally disposes of the managed resources.
public Dispose ( ) : void
return void

DocumentFromPath() public method

Creates a new instance of a Nuxeo Document.
public DocumentFromPath ( string path ) : Document
path string The remote path to the document.
return Document

DocumentFromUid() public method

Creates a new instance of a Nuxeo Document.
public DocumentFromUid ( string uid ) : Document
uid string The remote document's UID.
return Document

Operation() public method

Creates a new instance of an Automation Operation.
public Operation ( string id ) : Operation
id string The operation's id.
return Operation

RemoveDefaultSchema() public method

Removes a default schema to be sent in all requests.
For more details about schemas, check Nuxeo Documentation Center.
public RemoveDefaultSchema ( string schema ) : Client
schema string A string containing the schema's name.
return Client

Request() public method

Performs a RESTful request to the Nuxeo Server.
public Request ( RequestType type, string endpoint, QueryParams parameters = null, JToken data = null, string>.Dictionary additionalHeaders = null, string contentType = ContentType.JSON ) : Task
type RequestType The type of the request.
endpoint string The end point, following "api/v1/".
parameters QueryParams The query parameters to follow the url.
data JToken The JSON data to be send.
additionalHeaders string>.Dictionary The additional request headers, besides those already specified in the client.
contentType string The type of the content to be sent.
return Task

SetAuthomationPath() public method

Sets the path to the Automation endpoint.
public SetAuthomationPath ( string path ) : Client
path string The path to the Automation endpoint.
return Client

SetAuthorization() public method

Sets the authorization information to be sent in all requests.
public SetAuthorization ( Authorization auth ) : Client
auth Authorization The authorization data.
return Client

SetDefaultSchemas() public method

Sets the default document schemas to be sent in all requests.
For more details about schemas, check Nuxeo Documentation Center.
public SetDefaultSchemas ( string schemas ) : Client
schemas string One or more strings representing schema names.
return Client

SetMarshaller() public method

Sets the object marshaller for this client.
public SetMarshaller ( IMarshaller marshaller ) : Client
marshaller IMarshaller The object marshaller implementing the interface.
return Client

SetRestPath() public method

Sets the path to the REST API endpoint.
public SetRestPath ( string path ) : Client
path string The path to the REST API endpoint.
return Client

SetServerURL() public method

Sets the URL of the Nuxeo server.
public SetServerURL ( string url ) : Client
url string The Nuxeo server's URL.
return Client

SetTimemout() public method

Sets the default reques timeout.
public SetTimemout ( int timeout ) : Client
timeout int The timeout.
return Client

Uploader() public method

Returns a new instance of Uploader.
public Uploader ( ) : Uploader
return Uploader