Box.V2.Managers.BoxFilesManager.GetLockAsync C# (CSharp) Method

GetLockAsync() public method

Gets a lock file object representation of the lock on the provided file Id (if a lock exists, otherwise returns null).
public GetLockAsync ( string id ) : Task
id string Id of the file.
return Task
        public async Task<BoxFileLock> GetLockAsync(string id)
        {
            id.ThrowIfNullOrWhiteSpace("id");

            BoxRequest request = new BoxRequest(_config.FilesEndpointUri, id)
                .Param(ParamFields, BoxFile.FieldLock);

            IBoxResponse<BoxFile> response = await ToResponseAsync<BoxFile>(request).ConfigureAwait(false);

            return response.ResponseObject.Lock;
        }