Search Results for

    Show / Hide Table of Contents

    Class CmsClient

    Implementation of ICmsClient

    Inheritance
    object
    CmsClient
    Implements
    ICmsClient
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Noxum.Nova.Cms.Client
    Assembly: Noxum.Nova.Cms.Client.dll
    Syntax
    public class CmsClient : ICmsClient

    Constructors

    CmsClient(string, HttpClient)

    Declaration
    public CmsClient(string baseUrl, HttpClient httpClient)
    Parameters
    Type Name Description
    string baseUrl
    HttpClient httpClient

    Properties

    BaseUrl

    Declaration
    public string BaseUrl { get; set; }
    Property Value
    Type Description
    string

    JsonSerializerSettings

    Declaration
    protected JsonSerializerOptions JsonSerializerSettings { get; }
    Property Value
    Type Description
    JsonSerializerOptions

    ReadResponseAsString

    Declaration
    public bool ReadResponseAsString { get; set; }
    Property Value
    Type Description
    bool

    Methods

    CreateBranchAsync(CreateBranchRequest, string, CancellationToken)

    Create a branch

    Declaration
    public virtual Task<CmsObject> CreateBranchAsync(CreateBranchRequest request, string username = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CreateBranchRequest request

    The model describing the branch to create

    string username

    The username this transaction is committed for. This must be set for internal access, otherwise, the transaction will be committed as the user who is currently logged in.

    CancellationToken cancellationToken

    A cancellation token that can be used by other objects or threads to receive notice of cancellation.

    Returns
    Type Description
    Task<CmsObject>

    OK

    Exceptions
    Type Condition
    CmsApiException

    A server side error occurred.

    CreateObjectsAsync(string, CreateObjectsRequest, string, CancellationToken)

    Create objects

    Declaration
    public virtual Task<CreateObjectsResponse> CreateObjectsAsync(string branch, CreateObjectsRequest request, string username = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string branch

    The branch ID, Guid or ApiIdentifier

    CreateObjectsRequest request

    The list of objects to be created

    string username

    The username this transaction is committed for. This must be set for internal access, otherwise, the transaction will be committed as the user who is currently logged in.

    CancellationToken cancellationToken

    A cancellation token that can be used by other objects or threads to receive notice of cancellation.

    Returns
    Type Description
    Task<CreateObjectsResponse>

    Object(s) Created

    Exceptions
    Type Condition
    CmsApiException

    A server side error occurred.

    DeleteBranchAsync(string, DeleteBranchRequest, string, CancellationToken)

    Deletes a branch by ID

    Declaration
    public virtual Task<DeleteBranchResponse> DeleteBranchAsync(string id, DeleteBranchRequest request, string username = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string id

    The branch ID, Guid or ApiIdentifier

    DeleteBranchRequest request

    The delete request

    string username

    The username this transaction is committed for. This must be set for internal access, otherwise, the transaction will be committed as the user who is currently logged in.

    CancellationToken cancellationToken

    A cancellation token that can be used by other objects or threads to receive notice of cancellation.

    Returns
    Type Description
    Task<DeleteBranchResponse>

    OK

    Exceptions
    Type Condition
    CmsApiException

    A server side error occurred.

    DeleteObjectsAsync(string, DeleteObjectsRequest, string, CancellationToken)

    Delete objects by ID

    Declaration
    public virtual Task<DeleteObjectsResponse> DeleteObjectsAsync(string branch, DeleteObjectsRequest request, string username = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string branch

    The branch ID, Guid or ApiIdentifier

    DeleteObjectsRequest request

    The delete request

    string username

    The username this transaction is committed for. This must be set for internal access, otherwise, the transaction will be committed as the user who is currently logged in.

    CancellationToken cancellationToken

    A cancellation token that can be used by other objects or threads to receive notice of cancellation.

    Returns
    Type Description
    Task<DeleteObjectsResponse>

    OK

    Exceptions
    Type Condition
    CmsApiException

    A server side error occurred.

    GetBranchAsync(string, string, string, string, CancellationToken)

    Get a single branch by ID

    Declaration
    public virtual Task<CmsObject> GetBranchAsync(string id, string attributes = null, string variants = null, string languages = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string id

    The branch ID, Guid or ApiIdentifier

    string attributes

    A comma separated list of object IDs, Guids or ApiIdentifiers to filter down values by attributes

    string variants

    A comma separated list of object IDs, Guids or ApiIdentifiers to filter down values by variants

    string languages

    A comma separated list of object IDs, Guids or ApiIdentifiers to filter down values by languages

    CancellationToken cancellationToken

    A cancellation token that can be used by other objects or threads to receive notice of cancellation.

    Returns
    Type Description
    Task<CmsObject>

    OK

    Exceptions
    Type Condition
    CmsApiException

    A server side error occurred.

    GetObjectAsync(string, string, bool?, string, string, string, CancellationToken)

    Get a single object by ID

    Declaration
    public virtual Task<CmsObject> GetObjectAsync(string branch, string id, bool? inherited = null, string attributes = null, string variants = null, string languages = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string branch

    The branch ID, Guid or ApiIdentifier

    string id

    The object ID, Guid or ApiIdentifier

    bool? inherited

    Include inherited values

    string attributes

    A comma separated list of object IDs, Guids or ApiIdentifiers to filter down values by attributes

    string variants

    A comma separated list of object IDs, Guids or ApiIdentifiers to filter down values by variants

    string languages

    A comma separated list of object IDs, Guids or ApiIdentifiers to filter down values by languages

    CancellationToken cancellationToken

    A cancellation token that can be used by other objects or threads to receive notice of cancellation.

    Returns
    Type Description
    Task<CmsObject>

    OK

    Exceptions
    Type Condition
    CmsApiException

    A server side error occurred.

    GetObjectAsync<T>(string, string, bool?, string, string, string, CancellationToken)

    Declaration
    public Task<T> GetObjectAsync<T>(string branch, string id, bool? inherited = null, string attributes = null, string variants = null, string languages = null, CancellationToken cancellationToken = default) where T : CmsObject, new()
    Parameters
    Type Name Description
    string branch
    string id
    bool? inherited
    string attributes
    string variants
    string languages
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<T>
    Type Parameters
    Name Description
    T

    GetObjectsAsync(string, string, bool?, string, string, string, CancellationToken)

    Get multiple objects by ID

    Declaration
    public virtual Task<CmsObjectList> GetObjectsAsync(string branch, string ids, bool? inherited = null, string attributes = null, string variants = null, string languages = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string branch

    The branch ID, Guid or ApiIdentifier

    string ids

    A comma separated list of object IDs, Guids or ApiIdentifiers

    bool? inherited

    Include inherited values

    string attributes

    A comma separated list of object IDs, Guids or ApiIdentifiers to filter down values by attributes

    string variants

    A comma separated list of object IDs, Guids or ApiIdentifiers to filter down values by variants

    string languages

    A comma separated list of object IDs, Guids or ApiIdentifiers to filter down values by languages

    CancellationToken cancellationToken

    A cancellation token that can be used by other objects or threads to receive notice of cancellation.

    Returns
    Type Description
    Task<CmsObjectList>

    OK

    Exceptions
    Type Condition
    CmsApiException

    A server side error occurred.

    GetTypedObjectsAsync(string, string, bool?, bool?, string, int?, string, string, string, CancellationToken)

    Get objects of a type

    Declaration
    public virtual Task<CmsObjectList> GetTypedObjectsAsync(string branch, string type, bool? deleted = null, bool? inherited = null, string @continue = null, int? take = null, string attributes = null, string variants = null, string languages = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string branch

    The branch ID, Guid or ApiIdentifier

    string type

    The object type ID, Guid or ApiIdentifier

    bool? deleted

    Value of the deleted flag (default: return deleted and undeleted objects)

    bool? inherited

    Include inherited values

    string continue

    The token for the next objects

    int? take

    The number of objects to take

    string attributes

    A comma separated list of object IDs, Guids or ApiIdentifiers to filter down values by attributes

    string variants

    A comma separated list of object IDs, Guids or ApiIdentifiers to filter down values by variants

    string languages

    A comma separated list of object IDs, Guids or ApiIdentifiers to filter down values by languages

    CancellationToken cancellationToken

    A cancellation token that can be used by other objects or threads to receive notice of cancellation.

    Returns
    Type Description
    Task<CmsObjectList>

    OK

    Exceptions
    Type Condition
    CmsApiException

    A server side error occurred.

    ReadObjectResponseAsync<T>(HttpResponseMessage, IReadOnlyDictionary<string, IEnumerable<string>>, CancellationToken)

    Declaration
    protected virtual Task<CmsClient.ObjectResponseResult<T>> ReadObjectResponseAsync<T>(HttpResponseMessage response, IReadOnlyDictionary<string, IEnumerable<string>> headers, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    HttpResponseMessage response
    IReadOnlyDictionary<string, IEnumerable<string>> headers
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<CmsClient.ObjectResponseResult<T>>
    Type Parameters
    Name Description
    T

    UpdateBranchAsync(string, UpdateBranchRequest, string, CancellationToken)

    Update a branch

    Declaration
    public virtual Task<UpdateBranchResponse> UpdateBranchAsync(string id, UpdateBranchRequest request, string username = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string id

    The branch ID, Guid or ApiIdentifier

    UpdateBranchRequest request

    The object to update. Either an ID or a Guid must be provided for the object.

    string username

    The username this transaction is committed for. This must be set for internal access, otherwise, the transaction will be committed as the user who is currently logged in.

    CancellationToken cancellationToken

    A cancellation token that can be used by other objects or threads to receive notice of cancellation.

    Returns
    Type Description
    Task<UpdateBranchResponse>

    OK

    Exceptions
    Type Condition
    CmsApiException

    A server side error occurred.

    UpdateObjectsAsync(string, UpdateObjectsRequest, string, CancellationToken)

    Update objects

    Declaration
    public virtual Task<UpdateObjectsResponse> UpdateObjectsAsync(string branch, UpdateObjectsRequest list, string username = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string branch

    The branch ID, Guid or ApiIdentifier

    UpdateObjectsRequest list

    The list of objects to update. Either an ID or a Guid must be provided for each object.

    string username

    The username this transaction is committed for. This must be set for internal access, otherwise, the transaction will be committed as the user who is currently logged in.

    CancellationToken cancellationToken

    A cancellation token that can be used by other objects or threads to receive notice of cancellation.

    Returns
    Type Description
    Task<UpdateObjectsResponse>

    OK

    Exceptions
    Type Condition
    CmsApiException

    A server side error occurred.

    Implements

    ICmsClient
    In this article
    Back to top Version 6.1.0.31rc