Ejemplo n.º 1
0
 /// <summary>
 /// setThresholdByStream threshold Set thresholds for specified stream Id
 /// </summary>
 /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="streamId">Stream Id</param>
 /// <param name="authorization">JWT used for authentication</param>
 /// <param name="setThresholdByStreamRequestBody"></param>
 /// <returns>Task of void</returns>
 public async System.Threading.Tasks.Task ThresholdSetThresholdByStreamAsync(int?streamId, string authorization, ThresholdSetThresholdByStreamRequestBody setThresholdByStreamRequestBody)
 {
     await ThresholdSetThresholdByStreamAsyncWithHttpInfo(streamId, authorization, setThresholdByStreamRequestBody);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// setThresholdByStream threshold Set thresholds for specified stream Id
        /// </summary>
        /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="streamId">Stream Id</param>
        /// <param name="authorization">JWT used for authentication</param>
        /// <param name="setThresholdByStreamRequestBody"></param>
        /// <returns>Task of ApiResponse</returns>
        public async System.Threading.Tasks.Task <ApiResponse <Object> > ThresholdSetThresholdByStreamAsyncWithHttpInfo(int?streamId, string authorization, ThresholdSetThresholdByStreamRequestBody setThresholdByStreamRequestBody)
        {
            // verify the required parameter 'streamId' is set
            if (streamId == null)
            {
                throw new ApiException(400, "Missing required parameter 'streamId' when calling ThresholdApi->ThresholdSetThresholdByStream");
            }
            // verify the required parameter 'authorization' is set
            if (authorization == null)
            {
                throw new ApiException(400, "Missing required parameter 'authorization' when calling ThresholdApi->ThresholdSetThresholdByStream");
            }
            // verify the required parameter 'setThresholdByStreamRequestBody' is set
            if (setThresholdByStreamRequestBody == null)
            {
                throw new ApiException(400, "Missing required parameter 'setThresholdByStreamRequestBody' when calling ThresholdApi->ThresholdSetThresholdByStream");
            }

            var    localVarPath         = "/stream/{streamId}/threshold";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new List <KeyValuePair <String, String> >();
            var    localVarHeaderParams = new Dictionary <String, String>(this.Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
                "application/json"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

            if (localVarHttpHeaderAccept != null)
            {
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            }

            if (streamId != null)
            {
                localVarPathParams.Add("streamId", this.Configuration.ApiClient.ParameterToString(streamId));                   // path parameter
            }
            if (authorization != null)
            {
                localVarHeaderParams.Add("Authorization", this.Configuration.ApiClient.ParameterToString(authorization));                        // header parameter
            }
            if (setThresholdByStreamRequestBody != null && setThresholdByStreamRequestBody.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(setThresholdByStreamRequestBody); // http body (model) parameter
            }
            else
            {
                localVarPostBody = setThresholdByStreamRequestBody; // byte array
            }

            // authentication (jwt_header_Authorization) required
            if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization")))
            {
                localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization");
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath,
                                                                                                            Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                                            localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("ThresholdSetThresholdByStream", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <Object>(localVarStatusCode,
                                            localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                            null));
        }
Ejemplo n.º 3
0
 /// <summary>
 /// setThresholdByStream threshold Set thresholds for specified stream Id
 /// </summary>
 /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="streamId">Stream Id</param>
 /// <param name="authorization">JWT used for authentication</param>
 /// <param name="setThresholdByStreamRequestBody"></param>
 /// <returns></returns>
 public void ThresholdSetThresholdByStream(int?streamId, string authorization, ThresholdSetThresholdByStreamRequestBody setThresholdByStreamRequestBody)
 {
     ThresholdSetThresholdByStreamWithHttpInfo(streamId, authorization, setThresholdByStreamRequestBody);
 }