File Store Service (FS) Client Library

The client library allows consuming the service REST API.

Index

Service Client

Class Description
FileStoreClient The entry point of the File Store Service client library.

^ Back to top

Controllers

Class Description
Files Provides operations on files.

^ Back to top

Models

Class Description
CreateFileVersionRequest Describes a create file version request.
FileInfo Describes a file.
FileVersionInfo Describes a file version.
MetadataItemInfo Describes a metadata item.
UpdateFileVersionRequest Describes an update file version request.

^ Back to top

Enumerations

The client library has no enumerations.

^ Back to top

Authorization Policies

Policy Description Scope
DefaultScope Defines an authorization policy that requires the default scope. lithium-filestore

^ Back to top

Reference

Service Client

FileStoreClient

Constructors
FileStoreClient(Uri, BearerTokenCredential)
Parameter Type Description
serviceUri Uri The service URI.
credential BearerTokenCredential The credential that should be used to access the service.
FileStoreClient(Uri, BearerTokenCredential, FileStoreClientOptions)
Parameter Type Description
serviceUri Uri The service URI.
credential BearerTokenCredential The credential that should be used to access the service.
clientOptions FileStoreClientOptions The client options.
Example
Uri address = new Uri("[service-address]");
Uri authorizationServer = new Uri("[authorization-server]");
string clientId = "[client-id]"
string clientSecret = "[client-secret]"

FileStoreClient client = new FileStoreClient(
    new Uri(address),
    new ClientSecretCredential(
        authorizationServer,
        clientId,
        clientSecret));

^ Back to top

Error Codes

ErrorCodes

Constants
Constants Description Remarks
CategoriesNotFound No categories found.
CategoryFilesNotDeleted The category files could not be deleted.
CategoryFilesNotFound No files found for the specified category.
CategoryFilesValidNotFound No valid files found for the specified category.
FileNotDeleted The file could not be deleted.
FileNotFound The specified file does not exist.
FilesNotDeleted The files could not be deleted.
FilesNotFound No files found.
FilesValidNotFound No valid files found.
FileValidNotFound The specified valid file does not exist.
FileVersionNotCreated The file version was not created.
FileVersionNotDeleted The file version could not be deleted.
FileVersionNotFound The specified file version does not exist.
FileVersionNotUpdated The file version was not updated.
RequestArgsInvalid The request arguments are invalid.

Controllers

FilesClientController

Provides operations on files.

Methods
CreateFileVersionAsync()

Allows creating a new file version.

public async Task<Cegid.Hydrogen.Rest.Client.RestServiceResult<System.Uri>> CreateFileVersionAsync(Cegid.Lithium.FileStore.Client.Rest.Models.CreateFileVersionRequest request, CancellationToken cancellationToken = default);
Parameters
Parameter Type Description Rules
request Cegid.Lithium.FileStore.Client.Rest.Models.CreateFileVersionRequest The request. Required.
Returns
Return Type Description
System.Uri The address of the file.
Status Codes
Status Code Description
HttpStatusCode.Created Success.
HttpStatusCode.BadRequest Failure: the request is invalid.
HttpStatusCode.NotFound Failure: not found.
HttpStatusCode.Conflict Failure: conflict.

The operation will raise RestRequestException for any failure status code. The exception may include a body with an instance of RestProblemDetails depending on the status code.

^ Back to top

DeleteCategoryFilesAsync()

Allows deleting all the files of the specified category.

public async Task<Cegid.Hydrogen.Rest.Client.RestServiceResult> DeleteCategoryFilesAsync(string category, CancellationToken cancellationToken = default);
Parameters
Parameter Type Description Rules
category string The files category. Required.RegEx (^(\d|[a-z]|[A-Z]|\.|-)*$).
Returns
Return Type Description
None The operation has no return value.
Status Codes
Status Code Description
HttpStatusCode.NoContent Success.
HttpStatusCode.UnprocessableEntity Failure: the request is invalid.

The operation will raise RestRequestException for any failure status code. The exception may include a body with an instance of RestProblemDetails depending on the status code.

^ Back to top

DeleteFileAsync()

Allows deleting the specified file.

public async Task<Cegid.Hydrogen.Rest.Client.RestServiceResult> DeleteFileAsync(string category, string name, CancellationToken cancellationToken = default);
Parameters
Parameter Type Description Rules
category string The file category. Required.RegEx (^(\d|[a-z]|[A-Z]|\.|-)*$).
name string The file name. Required.RegEx (^(\d|[a-z]|[A-Z]|\.|-)*$).
Returns
Return Type Description
None The operation has no return value.
Status Codes
Status Code Description
HttpStatusCode.NoContent Success.
HttpStatusCode.UnprocessableEntity Failure: the request is invalid.

The operation will raise RestRequestException for any failure status code. The exception may include a body with an instance of RestProblemDetails depending on the status code.

^ Back to top

DeleteFilesAsync()

Allows deleting all the files.

public async Task<Cegid.Hydrogen.Rest.Client.RestServiceResult> DeleteFilesAsync(CancellationToken cancellationToken = default);
Parameters

The operation has no parameters.

Returns
Return Type Description
None The operation has no return value.
Status Codes
Status Code Description
HttpStatusCode.NoContent Success.

The operation will raise RestRequestException for any failure status code. The exception may include a body with an instance of RestProblemDetails depending on the status code.

^ Back to top

DeleteFileVersionAsync()

Allows deleting the specified file version.

public async Task<Cegid.Hydrogen.Rest.Client.RestServiceResult> DeleteFileVersionAsync(string category, string name, int versionNumber, CancellationToken cancellationToken = default);
Parameters
Parameter Type Description Rules
category string The file category. Required.RegEx (^(\d|[a-z]|[A-Z]|\.|-)*$).
name string The file name. Required.RegEx (^(\d|[a-z]|[A-Z]|\.|-)*$).
versionNumber int The version number. Required.> 0.
Returns
Return Type Description
None The operation has no return value.
Status Codes
Status Code Description
HttpStatusCode.NoContent Success.
HttpStatusCode.UnprocessableEntity Failure: the request is invalid.

The operation will raise RestRequestException for any failure status code. The exception may include a body with an instance of RestProblemDetails depending on the status code.

^ Back to top

GetCategoriesAsync()

Allows retrieving all the categories.

public async Task<Cegid.Hydrogen.Rest.Client.RestServiceResult<System.Collections.Generic.IList<string>>> GetCategoriesAsync(CancellationToken cancellationToken = default);
Parameters

The operation has no parameters.

Returns
Return Type Description
System.Collections.Generic.IList<string> The categories retrieved.
Status Codes
Status Code Description
HttpStatusCode.OK Success.

The operation will raise RestRequestException for any failure status code. The exception may include a body with an instance of RestProblemDetails depending on the status code.

^ Back to top

GetCategoryFilesAsync()

Allows retrieving all the files of the specified category.

public async Task<Cegid.Hydrogen.Rest.Client.RestServiceResult<System.Collections.Generic.IList<Cegid.Lithium.FileStore.Client.Rest.Models.FileInfo>>> GetCategoryFilesAsync(string category, CancellationToken cancellationToken = default);
Parameters
Parameter Type Description Rules
category string The files category. Required.RegEx (^(\d|[a-z]|[A-Z]|\.|-)*$).
Returns
Return Type Description
System.Collections.Generic.IList<Cegid.Lithium.FileStore.Client.Rest.Models.FileInfo> The files retrieved.
Status Codes
Status Code Description
HttpStatusCode.OK Success.
HttpStatusCode.UnprocessableEntity Failure: the request is invalid.

The operation will raise RestRequestException for any failure status code. The exception may include a body with an instance of RestProblemDetails depending on the status code.

^ Back to top

GetCategoryFilesValidAsync()

Allows retrieving all the valid files of the specified category.

public async Task<Cegid.Hydrogen.Rest.Client.RestServiceResult<System.Collections.Generic.IList<Cegid.Lithium.FileStore.Client.Rest.Models.FileInfo>>> GetCategoryFilesValidAsync(string category, CancellationToken cancellationToken = default);
Parameters
Parameter Type Description Rules
category string The files category. Required.RegEx (^(\d|[a-z]|[A-Z]|\.|-)*$).
Returns
Return Type Description
System.Collections.Generic.IList<Cegid.Lithium.FileStore.Client.Rest.Models.FileInfo> The files retrieved.
Status Codes
Status Code Description
HttpStatusCode.OK Success.
HttpStatusCode.UnprocessableEntity Failure: the request is invalid.

The operation will raise RestRequestException for any failure status code. The exception may include a body with an instance of RestProblemDetails depending on the status code.

^ Back to top

GetFileAsync()

Allows retrieving the specified file.

public async Task<Cegid.Hydrogen.Rest.Client.RestServiceResult<Cegid.Lithium.FileStore.Client.Rest.Models.FileInfo>> GetFileAsync(string category, string name, CancellationToken cancellationToken = default);
Parameters
Parameter Type Description Rules
category string The file category. Required.RegEx (^(\d|[a-z]|[A-Z]|\.|-)*$).
name string The file name. Required.RegEx (^(\d|[a-z]|[A-Z]|\.|-)*$).
Returns
Return Type Description
Cegid.Lithium.FileStore.Client.Rest.Models.FileInfo The file retrieved.
Status Codes
Status Code Description
HttpStatusCode.OK Success.
HttpStatusCode.UnprocessableEntity Failure: the request is invalid.

The operation will raise RestRequestException for any failure status code. The exception may include a body with an instance of RestProblemDetails depending on the status code.

^ Back to top

GetFilesAsync()

Allows retrieving all the files.

public async Task<Cegid.Hydrogen.Rest.Client.RestServiceResult<System.Collections.Generic.IList<Cegid.Lithium.FileStore.Client.Rest.Models.FileInfo>>> GetFilesAsync(CancellationToken cancellationToken = default);
Parameters

The operation has no parameters.

Returns
Return Type Description
System.Collections.Generic.IList<Cegid.Lithium.FileStore.Client.Rest.Models.FileInfo> The files retrieved.
Status Codes
Status Code Description
HttpStatusCode.OK Success.

The operation will raise RestRequestException for any failure status code. The exception may include a body with an instance of RestProblemDetails depending on the status code.

^ Back to top

GetFilesValidAsync()

Allows retrieving all the valid files.

public async Task<Cegid.Hydrogen.Rest.Client.RestServiceResult<System.Collections.Generic.IList<Cegid.Lithium.FileStore.Client.Rest.Models.FileInfo>>> GetFilesValidAsync(CancellationToken cancellationToken = default);
Parameters

The operation has no parameters.

Returns
Return Type Description
System.Collections.Generic.IList<Cegid.Lithium.FileStore.Client.Rest.Models.FileInfo> The files retrieved.
Status Codes
Status Code Description
HttpStatusCode.OK Success.

The operation will raise RestRequestException for any failure status code. The exception may include a body with an instance of RestProblemDetails depending on the status code.

^ Back to top

GetFileValidAsync()

Allows retrieving the specified valid file.

public async Task<Cegid.Hydrogen.Rest.Client.RestServiceResult<Cegid.Lithium.FileStore.Client.Rest.Models.FileInfo>> GetFileValidAsync(string category, string name, CancellationToken cancellationToken = default);
Parameters
Parameter Type Description Rules
category string The file category. Required.RegEx (^(\d|[a-z]|[A-Z]|\.|-)*$).
name string The file name. Required.RegEx (^(\d|[a-z]|[A-Z]|\.|-)*$).
Returns
Return Type Description
Cegid.Lithium.FileStore.Client.Rest.Models.FileInfo The file retrieved.
Status Codes
Status Code Description
HttpStatusCode.OK Success.
HttpStatusCode.UnprocessableEntity Failure: the request is invalid.

The operation will raise RestRequestException for any failure status code. The exception may include a body with an instance of RestProblemDetails depending on the status code.

^ Back to top

GetFileVersionAsync()

Allows retrieving the specified file version.

public async Task<Cegid.Hydrogen.Rest.Client.RestServiceResult<Cegid.Lithium.FileStore.Client.Rest.Models.FileInfo>> GetFileVersionAsync(string category, string name, int versionNumber, CancellationToken cancellationToken = default);
Parameters
Parameter Type Description Rules
category string The file category. Required.RegEx (^(\d|[a-z]|[A-Z]|\.|-)*$).
name string The file name. Required.RegEx (^(\d|[a-z]|[A-Z]|\.|-)*$).
versionNumber int The version number. Required.> 0.
Returns
Return Type Description
Cegid.Lithium.FileStore.Client.Rest.Models.FileInfo The file version retrieved.
Status Codes
Status Code Description
HttpStatusCode.OK Success.
HttpStatusCode.UnprocessableEntity Failure: the request is invalid.

The operation will raise RestRequestException for any failure status code. The exception may include a body with an instance of RestProblemDetails depending on the status code.

^ Back to top

UpdateFileVersionAsync()

Allows updating the specified file version.

public async Task<Cegid.Hydrogen.Rest.Client.RestServiceResult> UpdateFileVersionAsync(string category, string name, int versionNumber, Cegid.Lithium.FileStore.Client.Rest.Models.UpdateFileVersionRequest request, CancellationToken cancellationToken = default);
Parameters
Parameter Type Description Rules
category string The file category. Required.RegEx (^(\d|[a-z]|[A-Z]|\.|-)*$).
name string The file name. Required.RegEx (^(\d|[a-z]|[A-Z]|\.|-)*$).
versionNumber int The version number. Required.> 0.
request Cegid.Lithium.FileStore.Client.Rest.Models.UpdateFileVersionRequest The request. Required.
Returns
Return Type Description
None The operation has no return value.
Status Codes
Status Code Description
HttpStatusCode.NoContent Success.
HttpStatusCode.BadRequest Failure: the request is invalid.
HttpStatusCode.UnprocessableEntity Failure: the request is invalid.
HttpStatusCode.NotFound Failure: not found.
HttpStatusCode.Conflict Failure: conflict.

The operation will raise RestRequestException for any failure status code. The exception may include a body with an instance of RestProblemDetails depending on the status code.

^ Back to top

Models

CreateFileVersionRequest

Describes a create file version request.

Properties
Property Type Description Rules
Category string Gets or sets the category. Required.RegEx (^(\d|[a-z]|[A-Z]|\.|-)*$).
Name string Gets or sets the name. Required.RegEx (^(\d|[a-z]|[A-Z]|\.|-)*$).
Version int Gets or sets the version. Required.> 0.
ValidFrom System.DateTime Gets or sets the valid from. Required.
ValidTo System.DateTime? Gets or sets the valid to.
ContentType string Gets or sets the content type. Required.
Content byte[] Gets or sets the content. Required.
Metadata System.Collections.Generic.IList<Cegid.Lithium.FileStore.Client.Rest.Models.MetadataItemInfo>? Gets or sets the metadata.

^ Back to top

FileInfo

Describes a file.

Properties
Property Type Description Rules
Category string Gets or sets the category. Required.RegEx (^(\d|[a-z]|[A-Z]|\.|-)*$).
Name string Gets or sets the name. Required.RegEx (^(\d|[a-z]|[A-Z]|\.|-)*$).
Versions System.Collections.Generic.IList<Cegid.Lithium.FileStore.Client.Rest.Models.FileVersionInfo> Gets or sets the versions. Required.

^ Back to top

FileVersionInfo

Describes a file version.

Properties
Property Type Description Rules
Version int Gets or sets the version. Required.> 0.
ValidFrom System.DateTime Gets or sets the valid from. Required.
ValidTo System.DateTime? Gets or sets the valid to.
ContentType string Gets or sets the content type. Required.
Address System.Uri Gets or sets the address. Required.Absolute URI.
Metadata System.Collections.Generic.IList<Cegid.Lithium.FileStore.Client.Rest.Models.MetadataItemInfo>? Gets or sets the metadata.

^ Back to top

MetadataItemInfo

Describes a metadata item.

Properties
Property Type Description Rules
Key string Gets or sets the key. Required.RegEx (^(\d|[a-z]|[A-Z]|\.|-)*$).
Value string Gets or sets the value. Required.

^ Back to top

UpdateFileVersionRequest

Describes an update file version request.

Properties
Property Type Description Rules
ValidFrom System.DateTime Gets or sets the valid from. Required.
ValidTo System.DateTime? Gets or sets the valid to.
ContentType string Gets or sets the content type. Required.
Content byte[] Gets or sets the content. Required.
Metadata System.Collections.Generic.IList<Cegid.Lithium.FileStore.Client.Rest.Models.MetadataItemInfo>? Gets or sets the metadata.

^ Back to top