Exemple #1
0
        public bool CreateAssetDatabase(LazyPI.Common.Connection Connection, string AFServerID, LazyObjects.AFDatabase AFDB)
        {
            WebAPIConnection webConnection = (WebAPIConnection)Connection;
            var request = new RestRequest("/assetservers/{webId}/assetdatabases", Method.POST);

            request.AddUrlSegment("webId", AFServerID);
            ResponseModels.AFDB body = DataConversions.Convert(AFDB);
            request.AddParameter("application/json; charset=utf-8", Newtonsoft.Json.JsonConvert.SerializeObject(body), ParameterType.RequestBody);

            var statusCode = webConnection.Client.Execute(request).StatusCode;

            return((int)statusCode == 201);
        }
        public static ResponseModels.AFDB Convert(LazyObjects.AFDatabase database)
        {
            ResponseModels.AFDB result = new ResponseModels.AFDB(database.ID, database.WebID, database.Name, database.Description, database.Path);

            return(result);
        }