/// <summary>
        /// Retrieve all attribute traits of the specified category/categories.
        /// </summary>
        /// <remarks>
        ///
        /// </remarks>
        /// <exception cref="OSIsoft.PIDevClub.PIWebApiClient.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="category">The category of the attribute traits. Multiple categories may be specified with multiple instances of the parameter. If the parameter is not specified, or if its value is "all", then all attribute traits of all categories will be returned.</param>
        /// <param name="selectedFields">List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned.</param>
        /// <param name="cancellationTokenSource">Signals to a CancellationToken that might be cancelled</param>
        /// <returns>async System.Threading.Tasks.Task<ApiResponse<PIItemsAttributeTrait>></returns>
        public async System.Threading.Tasks.Task <ApiResponse <PIItemsAttributeTrait> > GetByCategoryAsyncWithHttpInfo(List <string> category, string selectedFields = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            // verify the required parameter 'category' is set
            if (category == null)
            {
                throw new ApiException(400, "Missing required parameter 'category'");
            }

            var    localVarPath         = "/attributetraits";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new CustomDictionaryForQueryString();
            var    localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            string localVarPostBody     = null;

            if (category != null)
            {
                localVarQueryParams.Add("category", category, true);
            }
            if (selectedFields != null)
            {
                localVarQueryParams.Add("selectedFields", selectedFields, false);
            }
            IRestResponse localVarResponse = (IRestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath,
                                                                                                       new HttpMethod("GET"), localVarQueryParams, localVarPostBody, localVarHeaderParams,
                                                                                                       localVarPathParams, cancellationToken);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

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

            return(new ApiResponse <PIItemsAttributeTrait>(localVarStatusCode,
                                                           localVarResponse.Headers,
                                                           (PIItemsAttributeTrait)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PIItemsAttributeTrait))));
        }
        /// <summary>
        /// Retrieve an attribute trait.
        /// </summary>
        /// <remarks>
        ///
        /// </remarks>
        /// <exception cref="OSIsoft.PIDevClub.PIWebApiClient.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="name">The name or abbreviation of the attribute trait.</param>
        /// <param name="selectedFields">List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned.</param>
        /// <returns>ApiResponse<PIAttributeTrait></returns>
        public ApiResponse <PIAttributeTrait> GetWithHttpInfo(string name, string selectedFields = null)
        {
            // verify the required parameter 'name' is set
            if (name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name'");
            }

            var    localVarPath         = "/attributetraits/{name}";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new CustomDictionaryForQueryString();
            var    localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            string localVarPostBody     = null;

            if (name != null)
            {
                localVarPathParams.Add("name", Configuration.ApiClient.ParameterToString(name));
            }
            if (selectedFields != null)
            {
                localVarQueryParams.Add("selectedFields", selectedFields, false);
            }
            IRestResponse localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath,
                                                                                            new HttpMethod("GET"), localVarQueryParams, localVarPostBody, localVarHeaderParams,
                                                                                            localVarPathParams);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

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

            return(new ApiResponse <PIAttributeTrait>(localVarStatusCode,
                                                      localVarResponse.Headers,
                                                      (PIAttributeTrait)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PIAttributeTrait))));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Get the current versions of the PI Web API instance and all external plugins.
        /// </summary>
        /// <remarks>
        ///
        /// </remarks>
        /// <exception cref="OSIsoft.PIDevClub.PIWebApiClient.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>async System.Threading.Tasks.Task<ApiResponse<Dictionary<string, PIVersion>>></returns>
        public async System.Threading.Tasks.Task <ApiResponse <Dictionary <string, PIVersion> > > VersionsAsyncWithHttpInfo()
        {
            var    localVarPath         = "/system/versions";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new CustomDictionaryForQueryString();
            var    localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            String[] localVarHttpContentTypes = new String[] { };
            String   localVarHttpContentType  = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            String[] localVarHttpHeaderAccepts = new String[] { "application/json", "text/json", "text/xml" };
            String   localVarHttpHeaderAccept  = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

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

            IRestResponse localVarResponse = (IRestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath,
                                                                                                       Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                                       localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

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

            return(new ApiResponse <Dictionary <string, PIVersion> >(localVarStatusCode,
                                                                     localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                                     (Dictionary <string, PIVersion>)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary <string, PIVersion>))));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Delete a configuration item.
        /// </summary>
        /// <remarks>
        ///
        /// </remarks>
        /// <exception cref="OSIsoft.PIDevClub.PIWebApiClient.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="key">The key of the configuration item to remove.</param>
        /// <param name="cancellationTokenSource">Signals to a CancellationToken that might be cancelled</param>
        /// <returns>async System.Threading.Tasks.Task<ApiResponse<Object>></returns>
        public async System.Threading.Tasks.Task <ApiResponse <Object> > DeleteAsyncWithHttpInfo(string key, CancellationToken cancellationToken = default(CancellationToken))
        {
            // verify the required parameter 'key' is set
            if (key == null)
            {
                throw new ApiException(400, "Missing required parameter 'key'");
            }

            var    localVarPath         = "/system/configuration/{key}";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new CustomDictionaryForQueryString();
            var    localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            string localVarPostBody     = null;

            if (key != null)
            {
                localVarPathParams.Add("key", Configuration.ApiClient.ParameterToString(key));
            }
            IRestResponse localVarResponse = (IRestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath,
                                                                                                       new HttpMethod("DELETE"), localVarQueryParams, localVarPostBody, localVarHeaderParams,
                                                                                                       localVarPathParams, cancellationToken);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

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

            return(new ApiResponse <Object>(localVarStatusCode,
                                            localVarResponse.Headers,
                                            (Object)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))));
        }
Exemplo n.º 5
0
        /// <summary>
        /// Delete a Time Rule.
        /// </summary>
        /// <remarks>
        ///
        /// </remarks>
        /// <exception cref="OSIsoft.PIDevClub.PIWebApiClient.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="webId">The ID of the Time Rule.</param>
        /// <returns>ApiResponse<Object></returns>
        public ApiResponse <Object> DeleteWithHttpInfo(string webId)
        {
            // verify the required parameter 'webId' is set
            if (webId == null)
            {
                throw new ApiException(400, "Missing required parameter 'webId'");
            }

            var    localVarPath         = "/timerules/{webId}";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new CustomDictionaryForQueryString();
            var    localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            string localVarPostBody     = null;

            if (webId != null)
            {
                localVarPathParams.Add("webId", Configuration.ApiClient.ParameterToString(webId));
            }
            IRestResponse localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath,
                                                                                            new HttpMethod("DELETE"), localVarQueryParams, localVarPostBody, localVarHeaderParams,
                                                                                            localVarPathParams);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

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

            return(new ApiResponse <Object>(localVarStatusCode,
                                            localVarResponse.Headers,
                                            (Object)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))));
        }
        /// <summary>Retrieve notification rules based on the specified conditions. Returns notification rules using the specified search query string.</summary>
        public ApiResponsePIItemsNotificationRule GetNotificationRulesQueryWithHttpInfo(int maxCount, int startIndex, string databaseWebId = null, string query = null, string selectedFields = null, string webIdType = null)
        {
            if (string.IsNullOrEmpty(databaseWebId) == true)
            {
                databaseWebId = null;
            }
            if (string.IsNullOrEmpty(query) == true)
            {
                query = null;
            }
            if (string.IsNullOrEmpty(selectedFields) == true)
            {
                selectedFields = null;
            }
            if (string.IsNullOrEmpty(webIdType) == true)
            {
                webIdType = null;
            }

            var    localVarPath         = "/notificationrules/search";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new CustomDictionaryForQueryString();
            var    localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            String[] localVarHttpContentTypes = new String[] { };
            String   localVarHttpContentType  = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            String[] localVarHttpHeaderAccepts = new String[] { "application/json", "text/json", "text/xml" };
            String   localVarHttpHeaderAccept  = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

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

            localVarPathParams.Add("format", "json");

            if (databaseWebId != null)
            {
                localVarQueryParams.Add("databaseWebId", Configuration.ApiClient.ParameterToString(databaseWebId), false);
            }
            localVarQueryParams.Add("maxCount", Configuration.ApiClient.ParameterToString(maxCount), false);
            if (query != null)
            {
                localVarQueryParams.Add("query", Configuration.ApiClient.ParameterToString(query), false);
            }
            if (selectedFields != null)
            {
                localVarQueryParams.Add("selectedFields", Configuration.ApiClient.ParameterToString(selectedFields), false);
            }
            localVarQueryParams.Add("startIndex", Configuration.ApiClient.ParameterToString(startIndex), false);
            if (webIdType != null)
            {
                localVarQueryParams.Add("webIdType", Configuration.ApiClient.ParameterToString(webIdType), false);
            }

            IRestResponse localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath,
                                                                                            Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                            localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

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

            return(new ApiResponsePIItemsNotificationRule(localVarStatusCode,
                                                          localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                          (PIItemsNotificationRule)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PIItemsNotificationRule))));
        }
        /// <summary>Retrieve notification rule subscribers.</summary>
        public ApiResponsePIItemsNotificationRuleSubscriber GetNotificationRuleSubscribersWithHttpInfo(string webId, string selectedFields = null, string webIdType = null)
        {
            if (string.IsNullOrEmpty(webId) == true)
            {
                webId = null;
            }
            if (string.IsNullOrEmpty(selectedFields) == true)
            {
                selectedFields = null;
            }
            if (string.IsNullOrEmpty(webIdType) == true)
            {
                webIdType = null;
            }
            if (webId == null)
            {
                throw new ApiException(400, "Missing required parameter 'webId'");
            }

            var    localVarPath         = "/notificationrules/{webId}/notificationrulesubscribers";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new CustomDictionaryForQueryString();
            var    localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            String[] localVarHttpContentTypes = new String[] { };
            String   localVarHttpContentType  = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            String[] localVarHttpHeaderAccepts = new String[] { "application/json", "text/json", "text/xml" };
            String   localVarHttpHeaderAccept  = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

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

            localVarPathParams.Add("format", "json");

            if (webId != null)
            {
                localVarPathParams.Add("webId", Configuration.ApiClient.ParameterToString(webId));
            }
            if (selectedFields != null)
            {
                localVarQueryParams.Add("selectedFields", Configuration.ApiClient.ParameterToString(selectedFields), false);
            }
            if (webIdType != null)
            {
                localVarQueryParams.Add("webIdType", Configuration.ApiClient.ParameterToString(webIdType), false);
            }

            IRestResponse localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath,
                                                                                            Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                            localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

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

            return(new ApiResponsePIItemsNotificationRuleSubscriber(localVarStatusCode,
                                                                    localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                                    (PIItemsNotificationRuleSubscriber)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PIItemsNotificationRuleSubscriber))));
        }
        /// <summary>Create or update a configuration item.</summary>
        public ApiResponseObject PutWithHttpInfo(string key, string value)
        {
            if (string.IsNullOrEmpty(key) == true)
            {
                key = null;
            }
            if (key == null)
            {
                throw new ApiException(400, "Missing required parameter 'key'");
            }
            if (value == null)
            {
                throw new ApiException(400, "Missing required parameter 'value'");
            }

            var    localVarPath         = "/system/configuration/{key}";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new CustomDictionaryForQueryString();
            var    localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            String[] localVarHttpContentTypes = new String[] { };
            String   localVarHttpContentType  = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            String[] localVarHttpHeaderAccepts = new String[] { "application/json", "text/json", "text/xml" };
            String   localVarHttpHeaderAccept  = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

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

            localVarPathParams.Add("format", "json");

            if (key != null)
            {
                localVarPathParams.Add("key", Configuration.ApiClient.ParameterToString(key));
            }
            if (value != null && value.GetType() != typeof(byte[]))
            {
                localVarPostBody = Configuration.ApiClient.Serialize(value);
            }
            else
            {
                localVarPostBody = value;
            }

            IRestResponse localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath,
                                                                                            Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                            localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

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

            return(new ApiResponseObject(localVarStatusCode,
                                         localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                         (Object)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))));
        }
        /// <summary>Retrieve an Analysis Rule Plug-in by path.</summary>
        public ApiResponsePIAnalysisRulePlugIn GetByPathWithHttpInfo(string path, string selectedFields = null)
        {
            if (string.IsNullOrEmpty(path) == true)
            {
                path = null;
            }
            if (string.IsNullOrEmpty(selectedFields) == true)
            {
                selectedFields = null;
            }
            if (path == null)
            {
                throw new ApiException(400, "Missing required parameter 'path'");
            }

            var    localVarPath         = "/analysisruleplugins";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new CustomDictionaryForQueryString();
            var    localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            String[] localVarHttpContentTypes = new String[] { };
            String   localVarHttpContentType  = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            String[] localVarHttpHeaderAccepts = new String[] { "application/json", "text/json", "text/xml" };
            String   localVarHttpHeaderAccept  = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

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

            localVarPathParams.Add("format", "json");

            if (path != null)
            {
                localVarQueryParams.Add("path", Configuration.ApiClient.ParameterToString(path));
            }
            if (selectedFields != null)
            {
                localVarQueryParams.Add("selectedFields", Configuration.ApiClient.ParameterToString(selectedFields));
            }

            IRestResponse localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath,
                                                                                            Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                            localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

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

            return(new ApiResponsePIAnalysisRulePlugIn(localVarStatusCode,
                                                       localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                       (PIAnalysisRulePlugIn)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PIAnalysisRulePlugIn))));
        }
        /// <summary>Update a unit.</summary>
        public ApiResponseObject UpdateWithHttpInfo(string webId, PIUnit unitDTO)
        {
            if (string.IsNullOrEmpty(webId) == true)
            {
                webId = null;
            }
            if (webId == null)
            {
                throw new ApiException(400, "Missing required parameter 'webId'");
            }
            if (unitDTO == null)
            {
                throw new ApiException(400, "Missing required parameter 'unitDTO'");
            }

            var    localVarPath         = "/units/{webId}";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new CustomDictionaryForQueryString();
            var    localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            String[] localVarHttpContentTypes = new String[] { };
            String   localVarHttpContentType  = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            String[] localVarHttpHeaderAccepts = new String[] { "application/json", "text/json", "text/xml" };
            String   localVarHttpHeaderAccept  = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

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

            localVarPathParams.Add("format", "json");

            if (webId != null)
            {
                localVarPathParams.Add("webId", Configuration.ApiClient.ParameterToString(webId));
            }
            if (unitDTO != null && unitDTO.GetType() != typeof(byte[]))
            {
                localVarPostBody = Configuration.ApiClient.Serialize(unitDTO);
            }
            else
            {
                localVarPostBody = unitDTO;
            }

            IRestResponse localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath,
                                                                                            Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                            localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

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

            return(new ApiResponseObject(localVarStatusCode,
                                         localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                         (Object)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))));
        }
        /// <summary>Delete a security entry owned by the attribute category.</summary>
        public ApiResponseObject DeleteSecurityEntryWithHttpInfo(string name, string webId, bool applyToChildren)
        {
            if (string.IsNullOrEmpty(name) == true)
            {
                name = null;
            }
            if (string.IsNullOrEmpty(webId) == true)
            {
                webId = null;
            }
            if (name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name'");
            }
            if (webId == null)
            {
                throw new ApiException(400, "Missing required parameter 'webId'");
            }

            var    localVarPath         = "/attributecategories/{webId}/securityentries/{name}";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new CustomDictionaryForQueryString();
            var    localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            String[] localVarHttpContentTypes = new String[] { };
            String   localVarHttpContentType  = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            String[] localVarHttpHeaderAccepts = new String[] { "application/json", "text/json", "text/xml" };
            String   localVarHttpHeaderAccept  = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

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

            localVarPathParams.Add("format", "json");

            if (name != null)
            {
                localVarPathParams.Add("name", Configuration.ApiClient.ParameterToString(name));
            }
            if (webId != null)
            {
                localVarPathParams.Add("webId", Configuration.ApiClient.ParameterToString(webId));
            }
            localVarQueryParams.Add("applyToChildren", Configuration.ApiClient.ParameterToString(applyToChildren), false);

            IRestResponse localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath,
                                                                                            Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                            localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

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

            return(new ApiResponseObject(localVarStatusCode,
                                         localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                         (Object)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))));
        }
        /// <summary>Get the security information of the specified security item associated with the attribute category for a specified user.</summary>
        public ApiResponsePIItemsSecurityRights GetSecurityWithHttpInfo(string webId, string userIdentities, bool forceRefresh, string selectedFields = null, string webIdType = null)
        {
            List <string> userIdentity = ExtensionMethods.ConvertToList(userIdentities);

            if (string.IsNullOrEmpty(webId) == true)
            {
                webId = null;
            }
            if (string.IsNullOrEmpty(selectedFields) == true)
            {
                selectedFields = null;
            }
            if (string.IsNullOrEmpty(webIdType) == true)
            {
                webIdType = null;
            }
            if (webId == null)
            {
                throw new ApiException(400, "Missing required parameter 'webId'");
            }

            var    localVarPath         = "/attributecategories/{webId}/security";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new CustomDictionaryForQueryString();
            var    localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            String[] localVarHttpContentTypes = new String[] { };
            String   localVarHttpContentType  = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            String[] localVarHttpHeaderAccepts = new String[] { "application/json", "text/json", "text/xml" };
            String   localVarHttpHeaderAccept  = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

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

            localVarPathParams.Add("format", "json");

            if (webId != null)
            {
                localVarPathParams.Add("webId", Configuration.ApiClient.ParameterToString(webId));
            }
            localVarQueryParams.Add("userIdentity", Configuration.ApiClient.ParameterToString(userIdentity), true);
            localVarQueryParams.Add("forceRefresh", Configuration.ApiClient.ParameterToString(forceRefresh), false);
            if (selectedFields != null)
            {
                localVarQueryParams.Add("selectedFields", Configuration.ApiClient.ParameterToString(selectedFields), false);
            }
            if (webIdType != null)
            {
                localVarQueryParams.Add("webIdType", Configuration.ApiClient.ParameterToString(webIdType), false);
            }

            IRestResponse localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath,
                                                                                            Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                            localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

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

            return(new ApiResponsePIItemsSecurityRights(localVarStatusCode,
                                                        localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                        (PIItemsSecurityRights)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PIItemsSecurityRights))));
        }
        /// <summary>Retrieve multiple attributes by web id or path.</summary>
        public ApiResponsePIItemsItemAttribute GetMultipleWithHttpInfo(bool asParallel, string includeMode = null, string paths = null, string selectedFields = null, string webIds = null)
        {
            List <string> path  = ExtensionMethods.ConvertToList(paths);
            List <string> webId = ExtensionMethods.ConvertToList(webIds);

            if (string.IsNullOrEmpty(includeMode) == true)
            {
                includeMode = null;
            }
            if (string.IsNullOrEmpty(selectedFields) == true)
            {
                selectedFields = null;
            }

            var    localVarPath         = "/attributes/multiple";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new CustomDictionaryForQueryString();
            var    localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            String[] localVarHttpContentTypes = new String[] { };
            String   localVarHttpContentType  = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            String[] localVarHttpHeaderAccepts = new String[] { "application/json", "text/json", "text/xml" };
            String   localVarHttpHeaderAccept  = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

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

            localVarPathParams.Add("format", "json");

            localVarQueryParams.Add("asParallel", Configuration.ApiClient.ParameterToString(asParallel));
            if (includeMode != null)
            {
                localVarQueryParams.Add("includeMode", Configuration.ApiClient.ParameterToString(includeMode));
            }
            localVarQueryParams.Add("path", Configuration.ApiClient.ParameterToString(path));
            if (selectedFields != null)
            {
                localVarQueryParams.Add("selectedFields", Configuration.ApiClient.ParameterToString(selectedFields));
            }
            localVarQueryParams.Add("webId", Configuration.ApiClient.ParameterToString(webId));

            IRestResponse localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath,
                                                                                            Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                            localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

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

            return(new ApiResponsePIItemsItemAttribute(localVarStatusCode,
                                                       localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                       (PIItemsItemAttribute)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PIItemsItemAttribute))));
        }
        /// <summary>Get the child attributes of the specified attribute.</summary>
        public ApiResponsePIItemsAttribute GetAttributesWithHttpInfo(string webId, int maxCount, bool searchFullHierarchy, bool showExcluded, bool showHidden, int startIndex, string categoryName = null, string nameFilter = null, string selectedFields = null, string sortField = null, string sortOrder = null, string templateName = null, string valueType = null)
        {
            if (string.IsNullOrEmpty(webId) == true)
            {
                webId = null;
            }
            if (string.IsNullOrEmpty(categoryName) == true)
            {
                categoryName = null;
            }
            if (string.IsNullOrEmpty(nameFilter) == true)
            {
                nameFilter = null;
            }
            if (string.IsNullOrEmpty(selectedFields) == true)
            {
                selectedFields = null;
            }
            if (string.IsNullOrEmpty(sortField) == true)
            {
                sortField = null;
            }
            if (string.IsNullOrEmpty(sortOrder) == true)
            {
                sortOrder = null;
            }
            if (string.IsNullOrEmpty(templateName) == true)
            {
                templateName = null;
            }
            if (string.IsNullOrEmpty(valueType) == true)
            {
                valueType = null;
            }
            if (webId == null)
            {
                throw new ApiException(400, "Missing required parameter 'webId'");
            }

            var    localVarPath         = "/attributes/{webId}/attributes";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new CustomDictionaryForQueryString();
            var    localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            String[] localVarHttpContentTypes = new String[] { };
            String   localVarHttpContentType  = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            String[] localVarHttpHeaderAccepts = new String[] { "application/json", "text/json", "text/xml" };
            String   localVarHttpHeaderAccept  = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

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

            localVarPathParams.Add("format", "json");

            if (webId != null)
            {
                localVarPathParams.Add("webId", Configuration.ApiClient.ParameterToString(webId));
            }
            if (categoryName != null)
            {
                localVarQueryParams.Add("categoryName", Configuration.ApiClient.ParameterToString(categoryName));
            }
            localVarQueryParams.Add("maxCount", Configuration.ApiClient.ParameterToString(maxCount));
            if (nameFilter != null)
            {
                localVarQueryParams.Add("nameFilter", Configuration.ApiClient.ParameterToString(nameFilter));
            }
            localVarQueryParams.Add("searchFullHierarchy", Configuration.ApiClient.ParameterToString(searchFullHierarchy));
            if (selectedFields != null)
            {
                localVarQueryParams.Add("selectedFields", Configuration.ApiClient.ParameterToString(selectedFields));
            }
            localVarQueryParams.Add("showExcluded", Configuration.ApiClient.ParameterToString(showExcluded));
            localVarQueryParams.Add("showHidden", Configuration.ApiClient.ParameterToString(showHidden));
            if (sortField != null)
            {
                localVarQueryParams.Add("sortField", Configuration.ApiClient.ParameterToString(sortField));
            }
            if (sortOrder != null)
            {
                localVarQueryParams.Add("sortOrder", Configuration.ApiClient.ParameterToString(sortOrder));
            }
            localVarQueryParams.Add("startIndex", Configuration.ApiClient.ParameterToString(startIndex));
            if (templateName != null)
            {
                localVarQueryParams.Add("templateName", Configuration.ApiClient.ParameterToString(templateName));
            }
            if (valueType != null)
            {
                localVarQueryParams.Add("valueType", Configuration.ApiClient.ParameterToString(valueType));
            }

            IRestResponse localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath,
                                                                                            Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                            localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

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

            return(new ApiResponsePIItemsAttribute(localVarStatusCode,
                                                   localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                   (PIItemsAttribute)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PIItemsAttribute))));
        }
Exemplo n.º 15
0
        /// <summary>Returns the result of evaluating the expression at the specified timestamps.</summary>
        public ApiResponsePITimedValues GetAtTimesWithHttpInfo(string expression = null, string selectedFields = null, string sortOrder = null, string times = null, string webId = null)
        {
            List <string> time = ExtensionMethods.ConvertToList(times);

            if (string.IsNullOrEmpty(expression) == true)
            {
                expression = null;
            }
            if (string.IsNullOrEmpty(selectedFields) == true)
            {
                selectedFields = null;
            }
            if (string.IsNullOrEmpty(sortOrder) == true)
            {
                sortOrder = null;
            }
            if (string.IsNullOrEmpty(webId) == true)
            {
                webId = null;
            }

            var    localVarPath         = "/calculation/times";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new CustomDictionaryForQueryString();
            var    localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            String[] localVarHttpContentTypes = new String[] { };
            String   localVarHttpContentType  = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            String[] localVarHttpHeaderAccepts = new String[] { "application/json", "text/json", "text/xml" };
            String   localVarHttpHeaderAccept  = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

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

            localVarPathParams.Add("format", "json");

            if (expression != null)
            {
                localVarQueryParams.Add("expression", Configuration.ApiClient.ParameterToString(expression), false);
            }
            if (selectedFields != null)
            {
                localVarQueryParams.Add("selectedFields", Configuration.ApiClient.ParameterToString(selectedFields), false);
            }
            if (sortOrder != null)
            {
                localVarQueryParams.Add("sortOrder", Configuration.ApiClient.ParameterToString(sortOrder), false);
            }
            localVarQueryParams.Add("time", Configuration.ApiClient.ParameterToString(time), true);
            if (webId != null)
            {
                localVarQueryParams.Add("webId", Configuration.ApiClient.ParameterToString(webId), false);
            }

            IRestResponse localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath,
                                                                                            Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                            localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

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

            return(new ApiResponsePITimedValues(localVarStatusCode,
                                                localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                (PITimedValues)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PITimedValues))));
        }
Exemplo n.º 16
0
        /// <summary>Returns the result of evaluating the expression over the time range from the start time to the end time. The time range is first divided into a number of summary intervals. Then the calculation is performed for the specified summaries over each interval.</summary>
        public ApiResponsePIItemsSummaryValue GetSummaryWithHttpInfo(string calculationBasis = null, string endTime = null, string expression = null, string sampleInterval = null, string sampleType = null, string selectedFields = null, string startTime = null, string summaryDuration = null, string summaryTypes = null, string timeType = null, string webId = null)
        {
            List <string> summaryType = ExtensionMethods.ConvertToList(summaryTypes);

            if (string.IsNullOrEmpty(calculationBasis) == true)
            {
                calculationBasis = null;
            }
            if (string.IsNullOrEmpty(endTime) == true)
            {
                endTime = null;
            }
            if (string.IsNullOrEmpty(expression) == true)
            {
                expression = null;
            }
            if (string.IsNullOrEmpty(sampleInterval) == true)
            {
                sampleInterval = null;
            }
            if (string.IsNullOrEmpty(sampleType) == true)
            {
                sampleType = null;
            }
            if (string.IsNullOrEmpty(selectedFields) == true)
            {
                selectedFields = null;
            }
            if (string.IsNullOrEmpty(startTime) == true)
            {
                startTime = null;
            }
            if (string.IsNullOrEmpty(summaryDuration) == true)
            {
                summaryDuration = null;
            }
            if (string.IsNullOrEmpty(timeType) == true)
            {
                timeType = null;
            }
            if (string.IsNullOrEmpty(webId) == true)
            {
                webId = null;
            }

            var    localVarPath         = "/calculation/summary";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new CustomDictionaryForQueryString();
            var    localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            String[] localVarHttpContentTypes = new String[] { };
            String   localVarHttpContentType  = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            String[] localVarHttpHeaderAccepts = new String[] { "application/json", "text/json", "text/xml" };
            String   localVarHttpHeaderAccept  = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

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

            localVarPathParams.Add("format", "json");

            if (calculationBasis != null)
            {
                localVarQueryParams.Add("calculationBasis", Configuration.ApiClient.ParameterToString(calculationBasis));
            }
            if (endTime != null)
            {
                localVarQueryParams.Add("endTime", Configuration.ApiClient.ParameterToString(endTime));
            }
            if (expression != null)
            {
                localVarQueryParams.Add("expression", Configuration.ApiClient.ParameterToString(expression));
            }
            if (sampleInterval != null)
            {
                localVarQueryParams.Add("sampleInterval", Configuration.ApiClient.ParameterToString(sampleInterval));
            }
            if (sampleType != null)
            {
                localVarQueryParams.Add("sampleType", Configuration.ApiClient.ParameterToString(sampleType));
            }
            if (selectedFields != null)
            {
                localVarQueryParams.Add("selectedFields", Configuration.ApiClient.ParameterToString(selectedFields));
            }
            if (startTime != null)
            {
                localVarQueryParams.Add("startTime", Configuration.ApiClient.ParameterToString(startTime));
            }
            if (summaryDuration != null)
            {
                localVarQueryParams.Add("summaryDuration", Configuration.ApiClient.ParameterToString(summaryDuration));
            }
            localVarQueryParams.Add("summaryType", Configuration.ApiClient.ParameterToString(summaryType));
            if (timeType != null)
            {
                localVarQueryParams.Add("timeType", Configuration.ApiClient.ParameterToString(timeType));
            }
            if (webId != null)
            {
                localVarQueryParams.Add("webId", Configuration.ApiClient.ParameterToString(webId));
            }

            IRestResponse localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath,
                                                                                            Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                            localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

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

            return(new ApiResponsePIItemsSummaryValue(localVarStatusCode,
                                                      localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                      (PIItemsSummaryValue)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PIItemsSummaryValue))));
        }