I’ve been using a code like this to get the data from a Stream and Branch:
public class SpeckleModel
{
public Client Client { get; private set; }
public Account Account { get; private set; }
public Stream Stream { get; private set; }
public Branch Branch { get; private set; }
public SpeckleModel(Client client, Account account, Stream stream, Branch branch)
{
Client = client;
Account = account;
Stream = stream;
Branch = branch;
}
public async Task<Base> GetData()
{
var objectId = Branch.commits.items[0].referencedObject;
var transport = new ServerTransport(Client.Account, Stream.id);
return await Operations.Receive(objectId, remoteTransport: transport);
}
}
Now I’m not sure how to get the objectId to get the data:
using System.Linq;
using System.Threading.Tasks;
using Speckle.Core.Api;
using Speckle.Core.Api.GraphQL.Models;
using Speckle.Core.Credentials;
using Speckle.Core.Models;
using Speckle.Core.Transports;
namespace EdsaSpeckleManager.Command.Core.Models
{
public class SpeckleModel
{
public Client Client { get; private set; }
public Account Account { get; private set; }
public Project Project { get; private set; }
public Model Model { get; private set; }
public SpeckleModel(Client client, Account account, Project project, Model model)
{
Client = client;
Account = account;
Project = project;
Model = model;
}
public async Task<Base> GetData()
{
var objectId = // ?????
var transport = new ServerTransport(Client.Account, Project.id);
return await Operations.Receive(objectId, remoteTransport: transport);
}
}
}
I couldn’t find any documentation regarding this new API.
Thanks!