예제 #1
0
파일: Dataset.cs 프로젝트: PisaSoftware/API
        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);
        }
예제 #2
0
파일: Dataset.cs 프로젝트: PisaSoftware/API
        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);
        }