/// <summary>
        /// Retrieve a Time Rule Plug-in by path.
        /// </summary>
        /// <remarks>
        /// This method returns a Time Rule Plug-in based on the hierarchical path associated with it, and should be used when a path has been received from a separate part of the PI System for use in the PI Web API. Users should primarily search with the WebID when available.
        /// </remarks>
        /// <exception cref="OSIsoft.PIDevClub.PIWebApiClient.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="path">The path to the Time Rule Plug-in.</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<PITimeRulePlugIn></returns>
        public ApiResponse <PITimeRulePlugIn> GetByPathWithHttpInfo(string path, string selectedFields = null)
        {
            // verify the required parameter 'path' is set
            if (path == null)
            {
                throw new ApiException(400, "Missing required parameter 'path'");
            }

            var    localVarPath         = "/timeruleplugins";
            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("GetByPathWithHttpInfo", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <PITimeRulePlugIn>(localVarStatusCode,
                                                      localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                      (PITimeRulePlugIn)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PITimeRulePlugIn))));
        }
Beispiel #2
0
        /// <summary>Retrieve all attribute traits of the specified category/categories.</summary>
        public ApiResponsePIItemsAttributeTrait GetByCategoryWithHttpInfo(string categorys, string selectedFields = null)
        {
            List <string> category = ExtensionMethods.ConvertToList(categorys);

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

            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>();
            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("category", Configuration.ApiClient.ParameterToString(category), true);
            if (selectedFields != null)
            {
                localVarQueryParams.Add("selectedFields", Configuration.ApiClient.ParameterToString(selectedFields), 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("GetByCategory", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponsePIItemsAttributeTrait(localVarStatusCode,
                                                        localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                        (PIItemsAttributeTrait)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PIItemsAttributeTrait))));
        }
		/// <summary>Get the security information of the specified security item associated with the element category for a specified user.</summary>
		public ApiResponsePIItemsSecurityRights GetSecurityWithHttpInfo(string webId, string userIdentities, bool forceRefresh, string selectedFields = null)
		{
			List<string> userIdentity = ExtensionMethods.ConvertToList(userIdentities);
			if (string.IsNullOrEmpty(webId)==true)
			{
				webId = null;
			}
			if (string.IsNullOrEmpty(selectedFields)==true)
			{
				selectedFields = null;
			}
			if (webId == null)
				throw new ApiException(400, "Missing required parameter 'webId'");

			var localVarPath = "/elementcategories/{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));
			localVarQueryParams.Add("forceRefresh", Configuration.ApiClient.ParameterToString(forceRefresh));
			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("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 an element category by path.</summary>
		public ApiResponsePIElementCategory 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 = "/elementcategories";
			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 ApiResponsePIElementCategory(localVarStatusCode,
				localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
				(PIElementCategory)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PIElementCategory)));
		}
Beispiel #5
0
        /// <summary>
        /// Retrieve notification rule subscribers.
        /// </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 resource to use as the root of the search.</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="webIdType">Optional parameter. Used to specify the type of WebID. Useful for URL brevity and other special cases. Default is the value of the configuration item "WebIDType".</param>
        /// <returns>ApiResponse<PIItemsNotificationRuleSubscriber></returns>
        public ApiResponse <PIItemsNotificationRuleSubscriber> GetNotificationRuleSubscribersWithHttpInfo(string webId, string selectedFields = null, string webIdType = null)
        {
            // verify the required parameter 'webId' is set
            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>();
            string localVarPostBody     = null;

            if (webId != null)
            {
                localVarPathParams.Add("webId", Configuration.ApiClient.ParameterToString(webId));
            }
            if (selectedFields != null)
            {
                localVarQueryParams.Add("selectedFields", selectedFields, false);
            }
            if (webIdType != null)
            {
                localVarQueryParams.Add("webIdType", webIdType, 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("GetNotificationRuleSubscribersWithHttpInfo", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <PIItemsNotificationRuleSubscriber>(localVarStatusCode,
                                                                       localVarResponse.Headers,
                                                                       (PIItemsNotificationRuleSubscriber)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PIItemsNotificationRuleSubscriber))));
        }
        /// <summary>
        /// Retrieve an Analysis Rule Plug-in by path.
        /// </summary>
        /// <remarks>
        /// This method returns an Analysis Rule Plug-in based on the hierarchical path associated with it, and should be used when a path has been received from a separate part of the PI System for use in the PI Web API. Users should primarily search with the WebID when available.
        /// </remarks>
        /// <exception cref="OSIsoft.PIDevClub.PIWebApiClient.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="path">The path to the Analysis Rule Plug-in.</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="webIdType">Optional parameter. Used to specify the type of WebID. Useful for URL brevity and other special cases. Default is the value of the configuration item "WebIDType".</param>
        /// <returns>ApiResponse<PIAnalysisRulePlugIn></returns>
        public ApiResponse <PIAnalysisRulePlugIn> GetByPathWithHttpInfo(string path, string selectedFields = null, string webIdType = null)
        {
            // verify the required parameter 'path' is set
            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>();
            string localVarPostBody     = null;

            if (path != null)
            {
                localVarQueryParams.Add("path", path, false);
            }
            if (selectedFields != null)
            {
                localVarQueryParams.Add("selectedFields", selectedFields, false);
            }
            if (webIdType != null)
            {
                localVarQueryParams.Add("webIdType", webIdType, 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("GetByPathWithHttpInfo", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <PIAnalysisRulePlugIn>(localVarStatusCode,
                                                          localVarResponse.Headers,
                                                          (PIAnalysisRulePlugIn)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PIAnalysisRulePlugIn))));
        }
        /// <summary>
        /// Retrieve an Analysis Rule Plug-in.
        /// </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 Analysis Rule Plug-in.</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="webIdType">Optional parameter. Used to specify the type of WebID. Useful for URL brevity and other special cases. Default is the value of the configuration item "WebIDType".</param>
        /// <param name="cancellationTokenSource">Signals to a CancellationToken that might be cancelled</param>
        /// <returns>async System.Threading.Tasks.Task<ApiResponse<PIAnalysisRulePlugIn>></returns>
        public async System.Threading.Tasks.Task <ApiResponse <PIAnalysisRulePlugIn> > GetAsyncWithHttpInfo(string webId, string selectedFields = null, string webIdType = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            // verify the required parameter 'webId' is set
            if (webId == null)
            {
                throw new ApiException(400, "Missing required parameter 'webId'");
            }

            var    localVarPath         = "/analysisruleplugins/{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));
            }
            if (selectedFields != null)
            {
                localVarQueryParams.Add("selectedFields", selectedFields, false);
            }
            if (webIdType != null)
            {
                localVarQueryParams.Add("webIdType", webIdType, 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("GetAsyncWithHttpInfo", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <PIAnalysisRulePlugIn>(localVarStatusCode,
                                                          localVarResponse.Headers,
                                                          (PIAnalysisRulePlugIn)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PIAnalysisRulePlugIn))));
        }
		/// <summary>Create a security entry owned by the element category.</summary>
		public ApiResponseObject CreateSecurityEntryWithHttpInfo(string webId, PISecurityEntry securityEntry, bool applyToChildren)
		{
			if (string.IsNullOrEmpty(webId)==true)
			{
				webId = null;
			}
			if (webId == null)
				throw new ApiException(400, "Missing required parameter 'webId'");
			if (securityEntry == null)
				throw new ApiException(400, "Missing required parameter 'securityEntry'");

			var localVarPath = "/elementcategories/{webId}/securityentries";
			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 (securityEntry != null && securityEntry.GetType() != typeof(byte[]))
			{
				localVarPostBody = Configuration.ApiClient.Serialize(securityEntry);
			}
			else
			{
				localVarPostBody = securityEntry;
			}
			localVarQueryParams.Add("applyToChildren", Configuration.ApiClient.ParameterToString(applyToChildren));

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

			int localVarStatusCode = (int)localVarResponse.StatusCode;

			if (ExceptionFactory != null)
			{
				Exception exception = ExceptionFactory("CreateSecurityEntry", 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 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>async System.Threading.Tasks.Task<ApiResponse<PIAttributeTrait>></returns>
        public async System.Threading.Tasks.Task <ApiResponse <PIAttributeTrait> > GetAsyncWithHttpInfo(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>();
            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 (selectedFields != null)
            {
                localVarQueryParams.Add("selectedFields", Configuration.ApiClient.ParameterToString(selectedFields));
            }
            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("GetAsyncWithHttpInfo", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <PIAttributeTrait>(localVarStatusCode,
                                                      localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                      (PIAttributeTrait)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PIAttributeTrait))));
        }
Beispiel #10
0
        /// <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))));
        }
Beispiel #11
0
        /// <summary>
        /// Retrieve notification rules based on the specified conditions. Returns notification rules using the specified search query string.
        /// </summary>
        /// <remarks>
        ///
        /// </remarks>
        /// <exception cref="OSIsoft.PIDevClub.PIWebApiClient.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="databaseWebId">The ID of the asset database to use as the root of the query.</param>
        /// <param name="maxCount">The maximum number of objects to be returned per call (page size). The default is 1000.</param>
        /// <param name="query">The query string is a list of filters used to perform an AFSearch for the Notification rules in the asset database. An example would be: "query=Name:=MyNotificationRule* Template:=NoteRuleTemplate*".</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="startIndex">The starting index (zero based) of the items to be returned. The default is 0.</param>
        /// <param name="webIdType">Optional parameter. Used to specify the type of WebID. Useful for URL brevity and other special cases. Default is the value of the configuration item "WebIDType".</param>
        /// <param name="cancellationTokenSource">Signals to a CancellationToken that might be cancelled</param>
        /// <returns>async System.Threading.Tasks.Task<ApiResponse<PIItemsNotificationRule>></returns>
        public async System.Threading.Tasks.Task <ApiResponse <PIItemsNotificationRule> > GetNotificationRulesQueryAsyncWithHttpInfo(string databaseWebId = null, int?maxCount = null, string query = null, string selectedFields = null, int?startIndex = null, string webIdType = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            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>();
            string localVarPostBody     = null;

            if (databaseWebId != null)
            {
                localVarQueryParams.Add("databaseWebId", databaseWebId, false);
            }
            if (maxCount != null)
            {
                localVarQueryParams.Add("maxCount", maxCount, false);
            }
            if (query != null)
            {
                localVarQueryParams.Add("query", query, false);
            }
            if (selectedFields != null)
            {
                localVarQueryParams.Add("selectedFields", selectedFields, false);
            }
            if (startIndex != null)
            {
                localVarQueryParams.Add("startIndex", startIndex, false);
            }
            if (webIdType != null)
            {
                localVarQueryParams.Add("webIdType", webIdType, 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("GetNotificationRulesQueryAsyncWithHttpInfo", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <PIItemsNotificationRule>(localVarStatusCode,
                                                             localVarResponse.Headers,
                                                             (PIItemsNotificationRule)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PIItemsNotificationRule))));
        }
Beispiel #12
0
        /// <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))));
        }
        /// <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>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))));
        }
Beispiel #16
0
        /// <summary>Create a unit in the specified Unit Class.</summary>
        public ApiResponseObject CreateUnitWithHttpInfo(string webId, PIUnit unitDTO, string webIdType = null)
        {
            if (string.IsNullOrEmpty(webId) == true)
            {
                webId = null;
            }
            if (string.IsNullOrEmpty(webIdType) == true)
            {
                webIdType = 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         = "/unitclasses/{webId}/units";
            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;
            }
            if (webIdType != null)
            {
                localVarQueryParams.Add("webIdType", Configuration.ApiClient.ParameterToString(webIdType), false);
            }

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

            int localVarStatusCode = (int)localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("CreateUnit", 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 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))));
        }
Beispiel #19
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))));
        }