public bool Update(LazyPI.Common.Connection Connection, LazyObjects.AFEventFrame Eventframe)
        {
            WebAPIConnection webConnection = (WebAPIConnection)Connection;
            var request = new RestRequest("/eventframes/{webId}", Method.PATCH);

            request.AddUrlSegment("webId", Eventframe.ID);
            request.AddBody(Eventframe);

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

            return((int)statusCode == 204 ? true : false);
        }
示例#2
0
        public bool Update(LazyPI.Common.Connection Connection, LazyObjects.AFEventFrame Eventframe)
        {
            WebAPIConnection webConnection = (WebAPIConnection)Connection;
            var request = new RestRequest("/eventframes/{webId}", Method.PATCH);

            request.AddUrlSegment("webId", Eventframe.WebID);

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

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

            return((int)statusCode == 204 ? true : false);
        }
        public bool CreateEventFrame(LazyPI.Common.Connection Connection, string FrameID, LazyObjects.AFEventFrame Eventframe)
        {
            WebAPIConnection webConnection = (WebAPIConnection)Connection;
            var request = new RestRequest("/eventframes/{webId}/eventframes", Method.POST);

            request.AddUrlSegment("webId", FrameID);
            request.AddBody(Eventframe);

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

            return((int)statusCode == 201 ? true : false);
        }