public static Dataset <TData> CreateDataset(string apiToken, V2.CoreApi.Model.Registration registration, string anotherBaseUrl = null) { CoreApi.Client.Configuration conf = new CoreApi.Client.Configuration(); conf.AddDefaultHeader("Authorization", apiToken); if (!string.IsNullOrEmpty(anotherBaseUrl)) { conf.BasePath = anotherBaseUrl; } var api = new V2.CoreApi.DatasetyApi(conf); registration.DatasetId = registration.DatasetId; var res = api.ApiV2DatasetyCreate(registration); var dataset = new Dataset <TData>(res.DatasetId, api); return(dataset); }
public static Dataset <TData> OpenDataset(string apiToken, string datasetNameId, string anotherBaseUrl = null) { CoreApi.Client.Configuration conf = new CoreApi.Client.Configuration(); conf.AddDefaultHeader("Authorization", apiToken); if (!string.IsNullOrEmpty(anotherBaseUrl)) { conf.BasePath = anotherBaseUrl; } var api = new V2.CoreApi.DatasetyApi(conf); var res = api.ApiV2DatasetyDetail(datasetNameId); if (res == null) { return(null); } var dataset = new Dataset <TData>(res.DatasetId, api); return(dataset); }