예제 #1
0
        /// <summary>
        /// Deletes the given User Defined Table
        /// </summary>
        /// <param name="TableID"></param>
        /// <returns></returns>
        /// <remarks>Not Found is returned if table does not exist</remarks>
        public bool DeleteUserDefinedTable(string TableID)
        {
            string RequestUri = string.Format(@"meta_data/user_defined_tables/{0}", TableID);
            Dictionary <string, string> dicQueryStringParameters = new Dictionary <string, string>();
            string accept = "application/json";

            PepperiHttpClient         PepperiHttpClient         = new PepperiHttpClient(this.Authentication, this.Logger);
            PepperiHttpClientResponse PepperiHttpClientResponse = PepperiHttpClient.Delete(
                ApiBaseUri,
                RequestUri,
                dicQueryStringParameters,
                accept);

            PepperiHttpClient.HandleError(PepperiHttpClientResponse);

            bool result = PepperiJsonSerializer.DeserializeOne <bool>(PepperiHttpClientResponse.Body);

            return(result);
        }
예제 #2
0
        /// <summary>
        /// Deletes a UserDefinedField from a given Type
        /// </summary>
        /// <param name="FieldID">Identifies the field to delete</param>
        /// <param name="TypeID">Identifies the  type that holds the field to delete</param>
        /// <returns>true on Success</returns>
        /// <remarks>
        /// 1. Attempting to delete a field that is not a "User Defined Field" will fail
        /// </remarks>
        public bool DeleteUserDefinedField(long TypeID, string FieldID)
        {
            string RequestUri = string.Format(@"meta_data/{0}/types/{1}/fields/{2}", this.ResourceName, TypeID, FieldID);
            Dictionary <string, string> dicQueryStringParameters = new Dictionary <string, string>();
            string accept = "application/json";

            PepperiHttpClient PepperiHttpClient = new PepperiHttpClient(this.Authentication, this.Logger);

            PepperiHttpClientResponse PepperiHttpClientResponse = PepperiHttpClient.Delete(
                ApiBaseUri,
                RequestUri,
                dicQueryStringParameters,
                accept);

            PepperiHttpClient.HandleError(PepperiHttpClientResponse);

            bool result = PepperiJsonSerializer.DeserializeOne <bool>(PepperiHttpClientResponse.Body);   //Api returns bool right now. true-when resource is found and deleted. Otherwise, false.

            return(result);
        }
        public bool DeleteByExternalID(string externalId)
        {
            string RequestUri = ResourceName + "//externalid//" + HttpUtility.UrlEncode(externalId);
            Dictionary <string, string> dicQueryStringParameters = new Dictionary <string, string>();

            string accept = "application/json";

            PepperiHttpClient         PepperiHttpClient         = new PepperiHttpClient(this.Authentication, this.Logger);
            PepperiHttpClientResponse PepperiHttpClientResponse = PepperiHttpClient.Delete(
                ApiBaseUri,
                RequestUri,
                dicQueryStringParameters,
                accept);

            PepperiHttpClient.HandleError(PepperiHttpClientResponse);

            bool result = PepperiJsonSerializer.DeserializeOne <bool>(PepperiHttpClientResponse.Body);   //Api returns bool right now. true-when resource is found and deleted. Otherwise, false.

            return(result);
        }