Class SchemaClient
Inherited Members
Namespace: System.Dynamic.ExpandoObject
Syntax
public class SchemaClient : ClientBase
Constructors
SchemaClient(Contract.IPictureparkServiceSettings, Http.HttpClient)
Declaration
public SchemaClient(Contract.IPictureparkServiceSettings configuration, Http.HttpClient httpClient)
Parameters
Picturepark.SDK.V1.Contract.IPictureparkServiceSettings
configuration
|
System.Net.Http.HttpClient
httpClient
|
Properties
JsonSerializerSettings
Declaration
protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get; }
Property Value
Newtonsoft.Json.JsonSerializerSettings
|
ReadResponseAsString
Declaration
public bool ReadResponseAsString { get; set; }
Property Value
System.Boolean
|
Methods
CreateAsync(SchemaCreateRequest, Nullable<TimeSpan>, CancellationToken)
Create schema
Declaration
public virtual async Task<SchemaCreateResult> CreateAsync(SchemaCreateRequest request, TimeSpan? timeout = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
SchemaCreateRequest
request
The schema create request. |
System.Nullable<System.TimeSpan>
timeout
Maximum time to wait for the operation to complete. If timeout is exceeded, the operation is not aborted but continues anyhow.
|
System.Threading.CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
System.Threading.Tasks.Task<SchemaCreateResult>
Schema create result, containing the created schema |
Remarks
Create a new schema.
CreateManyCoreAsync(SchemaCreateManyRequest, CancellationToken)
Create multiple schemas
Declaration
protected virtual async Task<BusinessProcess> CreateManyCoreAsync(SchemaCreateManyRequest request, CancellationToken cancellationToken = default(CancellationToken))
Parameters
SchemaCreateManyRequest
request
The schema create many request. |
System.Threading.CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
System.Threading.Tasks.Task<BusinessProcess>
BusinessProcess which can be awaited |
Remarks
Creates new schemas. The operation is executed asynchronously and is not awaited. Call WaitForCompletion to wait for the process to finish.
DeleteAsync(String, Nullable<TimeSpan>, CancellationToken)
Delete schema
Declaration
public virtual async Task<SchemaDeleteResult> DeleteAsync(string id, TimeSpan? timeout = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
System.String
id
The schema ID. |
System.Nullable<System.TimeSpan>
timeout
Maximum time to wait for the operation to complete. If timeout is exceeded, the operation is not aborted but continues anyhow.
|
System.Threading.CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
System.Threading.Tasks.Task<SchemaDeleteResult>
Schema delete result |
Remarks
Deletes an existing schema.
Depending on how much the schema is referenced, the operation can take a lot of time.
ExistsCoreAsync(String, CancellationToken)
Exists schema
Declaration
protected virtual async Task<SchemaExistsResponse> ExistsCoreAsync(string id, CancellationToken cancellationToken = default(CancellationToken))
Parameters
System.String
id
The schema ID. |
System.Threading.CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
System.Threading.Tasks.Task<SchemaExistsResponse>
Schema Exists response |
Remarks
Checks if the schema already exists.
FieldExistsAsync(String, String, CancellationToken)
Exists field in schema
Declaration
public virtual async Task<FieldExistsResponse> FieldExistsAsync(string schemaId, string fieldId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
System.String
schemaId
The schema ID. |
System.String
fieldId
The field ID. |
System.Threading.CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
System.Threading.Tasks.Task<FieldExistsResponse>
Field Exists response |
Remarks
Checks if the field in the specified schema already exists.
Also returns a flag indicating if the field was previously deleted and the ID can therefore not be reused.
GetAggregationFieldsAsync(String, CancellationToken)
Retrieve the fields that can be used in an aggregator on a schema.
Declaration
public virtual async Task<ICollection<FieldInfo>> GetAggregationFieldsAsync(string id, CancellationToken cancellationToken = default(CancellationToken))
Parameters
System.String
id
The ID of the schema. |
System.Threading.CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<FieldInfo>>
The list of fields |
GetAggregationFieldsManyAsync(IEnumerable<String>, CancellationToken)
Retrieve the fields that can be used in an aggregator on multiple schemas.
Declaration
public virtual async Task<ICollection<FieldInfo>> GetAggregationFieldsManyAsync(IEnumerable<string> ids = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
System.Collections.Generic.IEnumerable<System.String>
ids
The IDs of the schemas. |
System.Threading.CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<FieldInfo>>
The list of fields |
GetAsync(String, CancellationToken)
Get schema
Declaration
public virtual async Task<SchemaDetail> GetAsync(string id, CancellationToken cancellationToken = default(CancellationToken))
Parameters
System.String
id
The schema ID. |
System.Threading.CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
System.Threading.Tasks.Task<SchemaDetail>
Schema detail |
Remarks
Gets the schema detail by schema ID.
GetFilterFieldsAsync(String, CancellationToken)
Retrieve the fields that can be used in a filter on a schema.
Declaration
public virtual async Task<ICollection<FieldInfo>> GetFilterFieldsAsync(string id, CancellationToken cancellationToken = default(CancellationToken))
Parameters
System.String
id
The ID of the schema. |
System.Threading.CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<FieldInfo>>
The list of fields |
GetFilterFieldsManyAsync(IEnumerable<String>, CancellationToken)
Retrieve the fields that can be used in a filter on multiple schemas.
Declaration
public virtual async Task<ICollection<FieldInfo>> GetFilterFieldsManyAsync(IEnumerable<string> ids = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
System.Collections.Generic.IEnumerable<System.String>
ids
The IDs of the schemas. |
System.Threading.CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<FieldInfo>>
The list of fields |
GetManyAsync(IEnumerable<String>, CancellationToken)
Get multiple schemas
Declaration
public virtual async Task<ICollection<SchemaDetail>> GetManyAsync(IEnumerable<string> ids = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
System.Collections.Generic.IEnumerable<System.String>
ids
Comma separated list of schema IDs. |
System.Threading.CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<SchemaDetail>>
List of schema details |
Remarks
Gets multiple schema details by given schema IDs.
Can fetch 100 schema details at most.
GetManyReferencedAsync(IEnumerable<String>, Nullable<Boolean>, CancellationToken)
Gets all schemas referenced by the schemas specified in ids
Declaration
public virtual async Task<ICollection<SchemaDetail>> GetManyReferencedAsync(IEnumerable<string> ids = null, bool? sourceSchema = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
System.Collections.Generic.IEnumerable<System.String>
ids
The schema IDs. |
System.Nullable<System.Boolean>
sourceSchema
If true, the returned schemas contain also the source schemas for which the referenced schemas were requested. If false, the source schemas are not returned (default behavior). |
System.Threading.CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<SchemaDetail>>
Referenced schema details |
GetReferencedAsync(String, Nullable<Boolean>, CancellationToken)
Gets all schemas referenced by the schema specified in id
Declaration
public virtual async Task<ICollection<SchemaDetail>> GetReferencedAsync(string id, bool? sourceSchema = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
System.String
id
The schema ID. |
System.Nullable<System.Boolean>
sourceSchema
If true, the returned schemas contain also the source schema for which the referenced schemas were requested. If false, the source schema is not returned (default behavior). |
System.Threading.CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<SchemaDetail>>
Referenced schema details |
Remarks
Can fetch referencing schemas for 100 schemas at most.
GetSortFieldsBySchemaTypesAsync(IEnumerable<SchemaType>, CancellationToken)
Retrieve the fields that can be used for sorting.
Declaration
public virtual async Task<ICollection<SortFieldInfo>> GetSortFieldsBySchemaTypesAsync(IEnumerable<SchemaType> schemaTypes = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
System.Collections.Generic.IEnumerable<SchemaType>
schemaTypes
Schema types to include in search |
System.Threading.CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<SortFieldInfo>>
The list of fields |
ReadObjectResponseAsync<T>(Http.HttpResponseMessage, IReadOnlyDictionary<String, IEnumerable<String>>, CancellationToken)
Declaration
protected virtual async Task<SchemaClient.ObjectResponseResult<T>> ReadObjectResponseAsync<T>(Http.HttpResponseMessage response, IReadOnlyDictionary<string, IEnumerable<string>> headers, CancellationToken cancellationToken)
Parameters
System.Net.Http.HttpResponseMessage
response
|
System.Collections.Generic.IReadOnlyDictionary<System.String, System.Collections.Generic.IEnumerable<System.String>>
headers
|
System.Threading.CancellationToken
cancellationToken
|
Returns
System.Threading.Tasks.Task<SchemaClient.ObjectResponseResult<T>>
|
Type Parameters
T
|
SearchAsync(SchemaSearchRequest, CancellationToken)
Search schemas
Declaration
public virtual async Task<SchemaSearchResult> SearchAsync(SchemaSearchRequest request, CancellationToken cancellationToken = default(CancellationToken))
Parameters
SchemaSearchRequest
request
The schema search request. |
System.Threading.CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
System.Threading.Tasks.Task<SchemaSearchResult>
Schema search result |
Remarks
Searches schemas as specified in the search request.
TransferOwnershipAsync(String, SchemaOwnershipTransferRequest, Nullable<TimeSpan>, CancellationToken)
Transfer ownership
Declaration
public virtual async Task TransferOwnershipAsync(string id, SchemaOwnershipTransferRequest request, TimeSpan? timeout = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
System.String
id
The schema ID. |
SchemaOwnershipTransferRequest
request
Request detailing which user to transfer to. |
System.Nullable<System.TimeSpan>
timeout
Maximum time to wait for the operation to complete. If timeout is exceeded, the operation is not aborted but continues anyhow.
|
System.Threading.CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
System.Threading.Tasks.Task
OK |
Remarks
Transfer ownership of the schema specified in id
TransferOwnershipManyAsync(SchemaOwnershipTransferManyRequest, CancellationToken)
Transfer ownership of multiple schemas
Declaration
public virtual async Task<BusinessProcess> TransferOwnershipManyAsync(SchemaOwnershipTransferManyRequest request, CancellationToken cancellationToken = default(CancellationToken))
Parameters
SchemaOwnershipTransferManyRequest
request
Schema ownership transfer many request. |
System.Threading.CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
System.Threading.Tasks.Task<BusinessProcess>
Business process |
Remarks
Transfers ownership of multiple schemas to specified user. The target user must have the ManageSchemas user right.
The operation is executed asynchronous and is not awaited. Call WaitForCompletion to wait for the process to finish.
UpdateAsync(String, SchemaUpdateRequest, Nullable<TimeSpan>, CancellationToken)
Update schema
Declaration
public virtual async Task<SchemaUpdateResult> UpdateAsync(string id, SchemaUpdateRequest request, TimeSpan? timeout = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
System.String
id
The schema ID. |
SchemaUpdateRequest
request
The schema update request. |
System.Nullable<System.TimeSpan>
timeout
Maximum time to wait for the operation to complete. If timeout is exceeded, the operation is not aborted but continues anyhow.
|
System.Threading.CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
System.Threading.Tasks.Task<SchemaUpdateResult>
Schema update result, containing the updated schema |
Remarks
Updates an existing schema.
Depending on how much the schema is referenced by existing data, the operation can take a lot of time.
UpdateManyCoreAsync(SchemaUpdateManyRequest, CancellationToken)
Update multiple schema
Declaration
protected virtual async Task<BusinessProcess> UpdateManyCoreAsync(SchemaUpdateManyRequest request, CancellationToken cancellationToken = default(CancellationToken))
Parameters
SchemaUpdateManyRequest
request
Request to update multiple schemas. |
System.Threading.CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
System.Threading.Tasks.Task<BusinessProcess>
BusinessProcess which can be awaited |
Remarks
Updates multiple existing schemas.
Prefer this whenever you have updates for multiple schemas. The operation is executed asynchronously and is not awaited. Call WaitForCompletion to wait for the process to finish.