Example #1
0
        /// <summary>
        /// Store VariableUserSource Store VariableUserSource
        /// </summary>
        /// <param name="body">VariableUserSource that should be stored</param>
        /// <returns>InlineResponse20026</returns>
        public InlineResponse20026 VariableUserSourcesPost(VariableUserSource body)
        {
            var path = "/variableUserSources";

            path = path.Replace("{format}", "json");


            var    queryParams  = new Dictionary <String, String>();
            var    headerParams = new Dictionary <String, String>();
            var    formParams   = new Dictionary <String, String>();
            var    fileParams   = new Dictionary <String, FileParameter>();
            String postBody     = null;



            postBody = ApiClient.Serialize(body); // http body (model) parameter


            // authentication setting, if any
            String[] authSettings = new String[] {  };

            // make the HTTP request
            IRestResponse response = (IRestResponse)ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);

            if (((int)response.StatusCode) >= 400)
            {
                throw new ApiException((int)response.StatusCode, "Error calling VariableUserSourcesPost: " + response.Content, response.Content);
            }
            else if (((int)response.StatusCode) == 0)
            {
                throw new ApiException((int)response.StatusCode, "Error calling VariableUserSourcesPost: " + response.ErrorMessage, response.ErrorMessage);
            }

            return((InlineResponse20026)ApiClient.Deserialize(response.Content, typeof(InlineResponse20026), response.Headers));
        }
Example #2
0
        /// <summary>
        /// Update VariableUserSource Update VariableUserSource
        /// </summary>
        /// <param name="id">variable_id of VariableUserSource</param>
        /// <param name="sourceId">source id of VariableUserSource</param>
        /// <param name="body">VariableUserSource that should be updated</param>
        /// <returns>InlineResponse2002</returns>
        public InlineResponse2002 VariableUserSourcesIdPut(int?id, int?sourceId, VariableUserSource body)
        {
            // verify the required parameter 'id' is set
            if (id == null)
            {
                throw new ApiException(400, "Missing required parameter 'id' when calling VariableUserSourcesIdPut");
            }

            // verify the required parameter 'sourceId' is set
            if (sourceId == null)
            {
                throw new ApiException(400, "Missing required parameter 'sourceId' when calling VariableUserSourcesIdPut");
            }


            var path = "/variableUserSources/{id}";

            path = path.Replace("{format}", "json");
            path = path.Replace("{" + "id" + "}", ApiClient.ParameterToString(id));


            var    queryParams  = new Dictionary <String, String>();
            var    headerParams = new Dictionary <String, String>();
            var    formParams   = new Dictionary <String, String>();
            var    fileParams   = new Dictionary <String, FileParameter>();
            String postBody     = null;

            if (sourceId != null)
            {
                queryParams.Add("source_id", ApiClient.ParameterToString(sourceId)); // query parameter
            }
            postBody = ApiClient.Serialize(body);                                    // http body (model) parameter


            // authentication setting, if any
            String[] authSettings = new String[] {  };

            // make the HTTP request
            IRestResponse response = (IRestResponse)ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings);

            if (((int)response.StatusCode) >= 400)
            {
                throw new ApiException((int)response.StatusCode, "Error calling VariableUserSourcesIdPut: " + response.Content, response.Content);
            }
            else if (((int)response.StatusCode) == 0)
            {
                throw new ApiException((int)response.StatusCode, "Error calling VariableUserSourcesIdPut: " + response.ErrorMessage, response.ErrorMessage);
            }

            return((InlineResponse2002)ApiClient.Deserialize(response.Content, typeof(InlineResponse2002), response.Headers));
        }