Esempio n. 1
0
 /// <summary>
 /// Creates a new operation with the specified parameters
 /// </summary>
 /// <param name="parentId">Parent operation ID</param>
 /// <param name="name">Name of the new operation</param>
 /// <param name="twoFactor">Two factor (OTP) mode (optional)</param>
 /// <param name="lockOnRequest">Lock on request (LOR) mode (optional)</param>
 /// <returns>If everything goes well, a <code>LatchResponse</code> object containing the new operation ID</returns>
 public LatchResponse CreateOperation(string parentId, string name, FeatureMode twoFactor = FeatureMode.DISABLED, FeatureMode lockOnRequest = FeatureMode.DISABLED)
 {
     var data = new Dictionary<string, string>();
     data.Add("parentId", parentId);
     data.Add("name", name);
     data.Add("two_factor", twoFactor.ToString());
     data.Add("lock_on_request", lockOnRequest.ToString());
     return HTTP_PUT_proxy(API_OPERATION_URL, data);
 }
Esempio n. 2
0
        /// <summary>
        /// Creates a new operation with the specified parameters
        /// </summary>
        /// <param name="parentId">Parent operation ID</param>
        /// <param name="name">Name of the new operation</param>
        /// <param name="twoFactor">Two factor (OTP) mode (optional)</param>
        /// <param name="lockOnRequest">Lock on request (LOR) mode (optional)</param>
        /// <returns>If everything goes well, a <code>LatchResponse</code> object containing the new operation ID</returns>
        public LatchResponse CreateOperation(string parentId, string name, FeatureMode twoFactor = FeatureMode.DISABLED, FeatureMode lockOnRequest = FeatureMode.DISABLED)
        {
            var data = new Dictionary <string, string>();

            data.Add("parentId", parentId);
            data.Add("name", name);
            data.Add("two_factor", twoFactor.ToString());
            data.Add("lock_on_request", lockOnRequest.ToString());
            return(HttpPerformRequest(API_OPERATION_URL, HttpMethod.PUT, data));
        }
Esempio n. 3
0
 /// <summary>
 /// Updates an existing operation with one or more of the specified parameters
 /// </summary>
 /// <param name="operationId">Operation ID to change</param>
 /// <param name="name">New name of the operation (optional)</param>
 /// <param name="twoFactor">New two factor (OTP) mode (optional)</param>
 /// <param name="lockOnRequest">New lock on request (LOR) mode (optional)</param>
 /// <returns>If everything goes well, an empty response</returns>
 public LatchResponse UpdateOperation(string operationId, string name, FeatureMode? twoFactor = null, FeatureMode? lockOnRequest = null)
 {
     var data = new Dictionary<string, string>();
     if (!String.IsNullOrEmpty(name))
         data.Add("name", name);
     if (twoFactor.HasValue)
         data.Add("two_factor", twoFactor.ToString());
     if (lockOnRequest.HasValue)
         data.Add("lock_on_request", lockOnRequest.ToString());
     return HttpPerformRequest(API_OPERATION_URL + "/" + UrlEncode(operationId), HttpMethod.POST, data);
 }