/* * InfluxDB OSS API Service * * The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. * * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Threading; using RestSharp; using InfluxDB.Client.Api.Client; using InfluxDB.Client.Api.Domain; namespace InfluxDB.Client.Api.Service { /// /// Represents a collection of functions to interact with the API endpoints /// public interface INotificationRulesService : IApiAccessor { #region Synchronous Operations /// /// Add a notification rule /// /// /// /// /// Thrown when fails to make API call /// Notification rule to create /// NotificationRule NotificationRule CreateNotificationRule(NotificationRule notificationRule); /// /// Add a notification rule /// /// /// /// /// Thrown when fails to make API call /// Notification rule to create /// ApiResponse of NotificationRule ApiResponse CreateNotificationRuleWithHttpInfo(NotificationRule notificationRule); /// /// Delete a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// void DeleteNotificationRulesID(string ruleID, string zapTraceSpan = null); /// /// Delete a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) ApiResponse DeleteNotificationRulesIDWithHttpInfo(string ruleID, string zapTraceSpan = null); /// /// Delete label from a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// The ID of the label to delete. /// OpenTracing span context (optional) /// void DeleteNotificationRulesIDLabelsID(string ruleID, string labelID, string zapTraceSpan = null); /// /// Delete label from a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// The ID of the label to delete. /// OpenTracing span context (optional) /// ApiResponse of Object(void) ApiResponse DeleteNotificationRulesIDLabelsIDWithHttpInfo(string ruleID, string labelID, string zapTraceSpan = null); /// /// List all notification rules /// /// /// /// /// Thrown when fails to make API call /// Only show notification rules that belong to a specific organization ID. /// OpenTracing span context (optional) /// (optional) /// (optional, default to 20) /// Only show notifications that belong to the specific check ID. (optional) /// Only return notification rules that \"would match\" statuses which contain the tag key value pairs provided. (optional) /// NotificationRules NotificationRules GetNotificationRules(string orgID, string zapTraceSpan = null, int? offset = null, int? limit = null, string checkID = null, string tag = null); /// /// List all notification rules /// /// /// /// /// Thrown when fails to make API call /// Only show notification rules that belong to a specific organization ID. /// OpenTracing span context (optional) /// (optional) /// (optional, default to 20) /// Only show notifications that belong to the specific check ID. (optional) /// Only return notification rules that \"would match\" statuses which contain the tag key value pairs provided. (optional) /// ApiResponse of NotificationRules ApiResponse GetNotificationRulesWithHttpInfo(string orgID, string zapTraceSpan = null, int? offset = null, int? limit = null, string checkID = null, string tag = null); /// /// Retrieve a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// NotificationRule NotificationRule GetNotificationRulesID(string ruleID, string zapTraceSpan = null); /// /// Retrieve a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// ApiResponse of NotificationRule ApiResponse GetNotificationRulesIDWithHttpInfo(string ruleID, string zapTraceSpan = null); /// /// List all labels for a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// LabelsResponse LabelsResponse GetNotificationRulesIDLabels(string ruleID, string zapTraceSpan = null); /// /// List all labels for a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// ApiResponse of LabelsResponse ApiResponse GetNotificationRulesIDLabelsWithHttpInfo(string ruleID, string zapTraceSpan = null); /// /// Update a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// NotificationRule NotificationRule PatchNotificationRulesID(string ruleID, NotificationRuleUpdate notificationRuleUpdate, string zapTraceSpan = null); /// /// Update a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// ApiResponse of NotificationRule ApiResponse PatchNotificationRulesIDWithHttpInfo(string ruleID, NotificationRuleUpdate notificationRuleUpdate, string zapTraceSpan = null); /// /// Add a label to a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// Label to add /// OpenTracing span context (optional) /// LabelResponse LabelResponse PostNotificationRuleIDLabels(string ruleID, LabelMapping labelMapping, string zapTraceSpan = null); /// /// Add a label to a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// Label to add /// OpenTracing span context (optional) /// ApiResponse of LabelResponse ApiResponse PostNotificationRuleIDLabelsWithHttpInfo(string ruleID, LabelMapping labelMapping, string zapTraceSpan = null); /// /// Update a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// NotificationRule NotificationRule PutNotificationRulesID(string ruleID, NotificationRule notificationRule, string zapTraceSpan = null); /// /// Update a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// ApiResponse of NotificationRule ApiResponse PutNotificationRulesIDWithHttpInfo(string ruleID, NotificationRule notificationRule, string zapTraceSpan = null); #endregion Synchronous Operations #region Asynchronous Operations /// /// Add a notification rule /// /// /// /// /// Thrown when fails to make API call /// Notification rule to create /// Cancellation token /// Task of NotificationRule System.Threading.Tasks.Task CreateNotificationRuleAsync(NotificationRule notificationRule, CancellationToken cancellationToken = default); /// /// Add a notification rule /// /// /// /// /// Thrown when fails to make API call /// Notification rule to create /// Cancellation token /// Task of ApiResponse (NotificationRule) System.Threading.Tasks.Task> CreateNotificationRuleAsyncWithHttpInfo( NotificationRule notificationRule, CancellationToken cancellationToken = default); /// /// Delete a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of void System.Threading.Tasks.Task DeleteNotificationRulesIDAsync(string ruleID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Delete a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse System.Threading.Tasks.Task> DeleteNotificationRulesIDAsyncWithHttpInfo(string ruleID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Delete label from a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// The ID of the label to delete. /// OpenTracing span context (optional) /// Cancellation token /// Task of void System.Threading.Tasks.Task DeleteNotificationRulesIDLabelsIDAsync(string ruleID, string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Delete label from a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// The ID of the label to delete. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse System.Threading.Tasks.Task> DeleteNotificationRulesIDLabelsIDAsyncWithHttpInfo( string ruleID, string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// List all notification rules /// /// /// /// /// Thrown when fails to make API call /// Only show notification rules that belong to a specific organization ID. /// OpenTracing span context (optional) /// (optional) /// (optional, default to 20) /// Only show notifications that belong to the specific check ID. (optional) /// Only return notification rules that \"would match\" statuses which contain the tag key value pairs provided. (optional) /// Cancellation token /// Task of NotificationRules System.Threading.Tasks.Task GetNotificationRulesAsync(string orgID, string zapTraceSpan = null, int? offset = null, int? limit = null, string checkID = null, string tag = null, CancellationToken cancellationToken = default); /// /// List all notification rules /// /// /// /// /// Thrown when fails to make API call /// Only show notification rules that belong to a specific organization ID. /// OpenTracing span context (optional) /// (optional) /// (optional, default to 20) /// Only show notifications that belong to the specific check ID. (optional) /// Only return notification rules that \"would match\" statuses which contain the tag key value pairs provided. (optional) /// Cancellation token /// Task of ApiResponse (NotificationRules) System.Threading.Tasks.Task> GetNotificationRulesAsyncWithHttpInfo(string orgID, string zapTraceSpan = null, int? offset = null, int? limit = null, string checkID = null, string tag = null, CancellationToken cancellationToken = default); /// /// Retrieve a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of NotificationRule System.Threading.Tasks.Task GetNotificationRulesIDAsync(string ruleID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Retrieve a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (NotificationRule) System.Threading.Tasks.Task> GetNotificationRulesIDAsyncWithHttpInfo( string ruleID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// List all labels for a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of LabelsResponse System.Threading.Tasks.Task GetNotificationRulesIDLabelsAsync(string ruleID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// List all labels for a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (LabelsResponse) System.Threading.Tasks.Task> GetNotificationRulesIDLabelsAsyncWithHttpInfo( string ruleID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Update a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// Cancellation token /// Task of NotificationRule System.Threading.Tasks.Task PatchNotificationRulesIDAsync(string ruleID, NotificationRuleUpdate notificationRuleUpdate, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Update a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (NotificationRule) System.Threading.Tasks.Task> PatchNotificationRulesIDAsyncWithHttpInfo( string ruleID, NotificationRuleUpdate notificationRuleUpdate, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Add a label to a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// Label to add /// OpenTracing span context (optional) /// Cancellation token /// Task of LabelResponse System.Threading.Tasks.Task PostNotificationRuleIDLabelsAsync(string ruleID, LabelMapping labelMapping, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Add a label to a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// Label to add /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (LabelResponse) System.Threading.Tasks.Task> PostNotificationRuleIDLabelsAsyncWithHttpInfo( string ruleID, LabelMapping labelMapping, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Update a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// Cancellation token /// Task of NotificationRule System.Threading.Tasks.Task PutNotificationRulesIDAsync(string ruleID, NotificationRule notificationRule, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Update a notification rule /// /// /// /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (NotificationRule) System.Threading.Tasks.Task> PutNotificationRulesIDAsyncWithHttpInfo( string ruleID, NotificationRule notificationRule, string zapTraceSpan = null, CancellationToken cancellationToken = default); #endregion Asynchronous Operations } /// /// Represents a collection of functions to interact with the API endpoints /// public partial class NotificationRulesService : INotificationRulesService { private ExceptionFactory _exceptionFactory = (name, response) => null; /// /// Initializes a new instance of the class. /// /// public NotificationRulesService(string basePath) { Configuration = new Configuration { BasePath = basePath }; ExceptionFactory = Configuration.DefaultExceptionFactory; } /// /// Initializes a new instance of the class /// using Configuration object /// /// An instance of Configuration /// public NotificationRulesService(Configuration configuration = null) { if (configuration == null) // use the default one in Configuration { Configuration = Configuration.Default; } else { Configuration = configuration; } ExceptionFactory = Configuration.DefaultExceptionFactory; } /// /// Gets the base path of the API client. /// /// The base path public string GetBasePath() { return Configuration.ApiClient.RestClientOptions.BaseUrl.ToString(); } /// /// Sets the base path of the API client. /// /// The base path [Obsolete( "SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] public void SetBasePath(string basePath) { // do nothing } /// /// Gets or sets the configuration object /// /// An instance of the Configuration public Configuration Configuration { get; set; } /// /// Provides a factory method hook for the creation of exceptions. /// public ExceptionFactory ExceptionFactory { get { if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) { throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); } return _exceptionFactory; } set => _exceptionFactory = value; } /// /// Gets the default header. /// /// Dictionary of HTTP header [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] public IDictionary DefaultHeader() { return new ReadOnlyDictionary(Configuration.DefaultHeader); } /// /// Add default header. /// /// Header field name. /// Header field value. /// [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] public void AddDefaultHeader(string key, string value) { Configuration.AddDefaultHeader(key, value); } /// /// Add a notification rule /// /// Thrown when fails to make API call /// Notification rule to create /// NotificationRule public NotificationRule CreateNotificationRule(NotificationRule notificationRule) { var localVarResponse = CreateNotificationRuleWithHttpInfo(notificationRule); return localVarResponse.Data; } /// /// Add a notification rule /// /// Thrown when fails to make API call /// Notification rule to create /// ApiResponse of NotificationRule public ApiResponse CreateNotificationRuleWithHttpInfo(NotificationRule notificationRule) { // verify the required parameter 'notificationRule' is set if (notificationRule == null) { throw new ApiException(400, "Missing required parameter 'notificationRule' when calling NotificationRulesService->CreateNotificationRule"); } var localVarPath = "/api/v2/notificationRules"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (notificationRule != null && notificationRule.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(notificationRule); // http body (model) parameter } else { localVarPostBody = notificationRule; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("CreateNotificationRule", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (NotificationRule)Configuration.ApiClient.Deserialize(localVarResponse, typeof(NotificationRule))); } /// /// Add a notification rule /// /// Thrown when fails to make API call /// Notification rule to create /// Cancellation token /// ApiResponse of NotificationRule public async System.Threading.Tasks.Task CreateNotificationRuleWithIRestResponseAsync( NotificationRule notificationRule, CancellationToken cancellationToken = default) { // verify the required parameter 'notificationRule' is set if (notificationRule == null) { throw new ApiException(400, "Missing required parameter 'notificationRule' when calling NotificationRulesService->CreateNotificationRule"); } var localVarPath = "/api/v2/notificationRules"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (notificationRule != null && notificationRule.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(notificationRule); // http body (model) parameter } else { localVarPostBody = notificationRule; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("CreateNotificationRule", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Add a notification rule /// /// Thrown when fails to make API call /// Notification rule to create /// ApiResponse of NotificationRule public RestResponse CreateNotificationRuleWithIRestResponse(NotificationRule notificationRule) { // verify the required parameter 'notificationRule' is set if (notificationRule == null) { throw new ApiException(400, "Missing required parameter 'notificationRule' when calling NotificationRulesService->CreateNotificationRule"); } var localVarPath = "/api/v2/notificationRules"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (notificationRule != null && notificationRule.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(notificationRule); // http body (model) parameter } else { localVarPostBody = notificationRule; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("CreateNotificationRule", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Add a notification rule /// /// Thrown when fails to make API call /// Notification rule to create /// ApiResponse of NotificationRule public RestRequest CreateNotificationRuleWithRestRequest(NotificationRule notificationRule) { // verify the required parameter 'notificationRule' is set if (notificationRule == null) { throw new ApiException(400, "Missing required parameter 'notificationRule' when calling NotificationRulesService->CreateNotificationRule"); } var localVarPath = "/api/v2/notificationRules"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (notificationRule != null && notificationRule.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(notificationRule); // http body (model) parameter } else { localVarPostBody = notificationRule; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } return Configuration.ApiClient.PrepareRequest(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Add a notification rule /// /// Thrown when fails to make API call /// Notification rule to create /// Cancellation token /// Task of NotificationRule public async System.Threading.Tasks.Task CreateNotificationRuleAsync( NotificationRule notificationRule, CancellationToken cancellationToken = default) { var localVarResponse = await CreateNotificationRuleAsyncWithHttpInfo(notificationRule, cancellationToken) .ConfigureAwait(false); return localVarResponse.Data; } /// /// Add a notification rule /// /// Thrown when fails to make API call /// Notification rule to create /// Cancellation token /// Task of ApiResponse (NotificationRule) public async System.Threading.Tasks.Task> CreateNotificationRuleAsyncWithHttpInfo( NotificationRule notificationRule, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await CreateNotificationRuleAsyncWithIRestResponse(notificationRule, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("CreateNotificationRule", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (NotificationRule)Configuration.ApiClient.Deserialize(localVarResponse, typeof(NotificationRule))); } /// /// Add a notification rule /// /// Thrown when fails to make API call /// Notification rule to create /// Cancellation token /// Task of RestResponse (NotificationRule) public async System.Threading.Tasks.Task CreateNotificationRuleAsyncWithIRestResponse( NotificationRule notificationRule, CancellationToken cancellationToken = default) { // verify the required parameter 'notificationRule' is set if (notificationRule == null) { throw new ApiException(400, "Missing required parameter 'notificationRule' when calling NotificationRulesService->CreateNotificationRule"); } var localVarPath = "/api/v2/notificationRules"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (notificationRule != null && notificationRule.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(notificationRule); // http body (model) parameter } else { localVarPostBody = notificationRule; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("CreateNotificationRule", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Delete a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// public void DeleteNotificationRulesID(string ruleID, string zapTraceSpan = null) { DeleteNotificationRulesIDWithHttpInfo(ruleID, zapTraceSpan); } /// /// Delete a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public ApiResponse DeleteNotificationRulesIDWithHttpInfo(string ruleID, string zapTraceSpan = null) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->DeleteNotificationRulesID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteNotificationRulesID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Delete a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of Object(void) public async System.Threading.Tasks.Task DeleteNotificationRulesIDWithIRestResponseAsync( string ruleID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->DeleteNotificationRulesID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteNotificationRulesID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Delete a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public RestResponse DeleteNotificationRulesIDWithIRestResponse(string ruleID, string zapTraceSpan = null) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->DeleteNotificationRulesID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteNotificationRulesID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Delete a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public RestRequest DeleteNotificationRulesIDWithRestRequest(string ruleID, string zapTraceSpan = null) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->DeleteNotificationRulesID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } return Configuration.ApiClient.PrepareRequest(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Delete a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of void public System.Threading.Tasks.Task DeleteNotificationRulesIDAsync(string ruleID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { return DeleteNotificationRulesIDAsyncWithHttpInfo(ruleID, zapTraceSpan, cancellationToken); } /// /// Delete a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse public async System.Threading.Tasks.Task> DeleteNotificationRulesIDAsyncWithHttpInfo( string ruleID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await DeleteNotificationRulesIDAsyncWithIRestResponse(ruleID, zapTraceSpan, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteNotificationRulesID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Delete a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse public async System.Threading.Tasks.Task DeleteNotificationRulesIDAsyncWithIRestResponse( string ruleID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->DeleteNotificationRulesID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteNotificationRulesID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Delete label from a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// The ID of the label to delete. /// OpenTracing span context (optional) /// public void DeleteNotificationRulesIDLabelsID(string ruleID, string labelID, string zapTraceSpan = null) { DeleteNotificationRulesIDLabelsIDWithHttpInfo(ruleID, labelID, zapTraceSpan); } /// /// Delete label from a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// The ID of the label to delete. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public ApiResponse DeleteNotificationRulesIDLabelsIDWithHttpInfo(string ruleID, string labelID, string zapTraceSpan = null) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->DeleteNotificationRulesIDLabelsID"); } // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling NotificationRulesService->DeleteNotificationRulesIDLabelsID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}/labels/{labelID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (labelID != null) { localVarPathParams.Add("labelID", Configuration.ApiClient.ParameterToString(labelID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteNotificationRulesIDLabelsID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Delete label from a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// The ID of the label to delete. /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of Object(void) public async System.Threading.Tasks.Task DeleteNotificationRulesIDLabelsIDWithIRestResponseAsync( string ruleID, string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->DeleteNotificationRulesIDLabelsID"); } // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling NotificationRulesService->DeleteNotificationRulesIDLabelsID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}/labels/{labelID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (labelID != null) { localVarPathParams.Add("labelID", Configuration.ApiClient.ParameterToString(labelID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteNotificationRulesIDLabelsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Delete label from a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// The ID of the label to delete. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public RestResponse DeleteNotificationRulesIDLabelsIDWithIRestResponse(string ruleID, string labelID, string zapTraceSpan = null) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->DeleteNotificationRulesIDLabelsID"); } // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling NotificationRulesService->DeleteNotificationRulesIDLabelsID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}/labels/{labelID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (labelID != null) { localVarPathParams.Add("labelID", Configuration.ApiClient.ParameterToString(labelID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteNotificationRulesIDLabelsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Delete label from a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// The ID of the label to delete. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public RestRequest DeleteNotificationRulesIDLabelsIDWithRestRequest(string ruleID, string labelID, string zapTraceSpan = null) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->DeleteNotificationRulesIDLabelsID"); } // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling NotificationRulesService->DeleteNotificationRulesIDLabelsID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}/labels/{labelID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (labelID != null) { localVarPathParams.Add("labelID", Configuration.ApiClient.ParameterToString(labelID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } return Configuration.ApiClient.PrepareRequest(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Delete label from a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// The ID of the label to delete. /// OpenTracing span context (optional) /// Cancellation token /// Task of void public System.Threading.Tasks.Task DeleteNotificationRulesIDLabelsIDAsync(string ruleID, string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { return DeleteNotificationRulesIDLabelsIDAsyncWithHttpInfo(ruleID, labelID, zapTraceSpan, cancellationToken); } /// /// Delete label from a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// The ID of the label to delete. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse public async System.Threading.Tasks.Task> DeleteNotificationRulesIDLabelsIDAsyncWithHttpInfo(string ruleID, string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await DeleteNotificationRulesIDLabelsIDAsyncWithIRestResponse(ruleID, labelID, zapTraceSpan, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteNotificationRulesIDLabelsID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Delete label from a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// The ID of the label to delete. /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse public async System.Threading.Tasks.Task DeleteNotificationRulesIDLabelsIDAsyncWithIRestResponse( string ruleID, string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->DeleteNotificationRulesIDLabelsID"); } // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling NotificationRulesService->DeleteNotificationRulesIDLabelsID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}/labels/{labelID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (labelID != null) { localVarPathParams.Add("labelID", Configuration.ApiClient.ParameterToString(labelID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteNotificationRulesIDLabelsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all notification rules /// /// Thrown when fails to make API call /// Only show notification rules that belong to a specific organization ID. /// OpenTracing span context (optional) /// (optional) /// (optional, default to 20) /// Only show notifications that belong to the specific check ID. (optional) /// Only return notification rules that \"would match\" statuses which contain the tag key value pairs provided. (optional) /// NotificationRules public NotificationRules GetNotificationRules(string orgID, string zapTraceSpan = null, int? offset = null, int? limit = null, string checkID = null, string tag = null) { var localVarResponse = GetNotificationRulesWithHttpInfo(orgID, zapTraceSpan, offset, limit, checkID, tag); return localVarResponse.Data; } /// /// List all notification rules /// /// Thrown when fails to make API call /// Only show notification rules that belong to a specific organization ID. /// OpenTracing span context (optional) /// (optional) /// (optional, default to 20) /// Only show notifications that belong to the specific check ID. (optional) /// Only return notification rules that \"would match\" statuses which contain the tag key value pairs provided. (optional) /// ApiResponse of NotificationRules public ApiResponse GetNotificationRulesWithHttpInfo(string orgID, string zapTraceSpan = null, int? offset = null, int? limit = null, string checkID = null, string tag = null) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling NotificationRulesService->GetNotificationRules"); } var localVarPath = "/api/v2/notificationRules"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (offset != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter } if (limit != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter } if (orgID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter } if (checkID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "checkID", checkID)); // query parameter } if (tag != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "tag", tag)); // query parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetNotificationRules", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (NotificationRules)Configuration.ApiClient.Deserialize(localVarResponse, typeof(NotificationRules))); } /// /// List all notification rules /// /// Thrown when fails to make API call /// Only show notification rules that belong to a specific organization ID. /// OpenTracing span context (optional) /// (optional) /// (optional, default to 20) /// Only show notifications that belong to the specific check ID. (optional) /// Only return notification rules that \"would match\" statuses which contain the tag key value pairs provided. (optional) /// Cancellation token /// ApiResponse of NotificationRules public async System.Threading.Tasks.Task GetNotificationRulesWithIRestResponseAsync(string orgID, string zapTraceSpan = null, int? offset = null, int? limit = null, string checkID = null, string tag = null, CancellationToken cancellationToken = default) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling NotificationRulesService->GetNotificationRules"); } var localVarPath = "/api/v2/notificationRules"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (offset != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter } if (limit != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter } if (orgID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter } if (checkID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "checkID", checkID)); // query parameter } if (tag != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "tag", tag)); // query parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetNotificationRules", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all notification rules /// /// Thrown when fails to make API call /// Only show notification rules that belong to a specific organization ID. /// OpenTracing span context (optional) /// (optional) /// (optional, default to 20) /// Only show notifications that belong to the specific check ID. (optional) /// Only return notification rules that \"would match\" statuses which contain the tag key value pairs provided. (optional) /// ApiResponse of NotificationRules public RestResponse GetNotificationRulesWithIRestResponse(string orgID, string zapTraceSpan = null, int? offset = null, int? limit = null, string checkID = null, string tag = null) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling NotificationRulesService->GetNotificationRules"); } var localVarPath = "/api/v2/notificationRules"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (offset != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter } if (limit != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter } if (orgID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter } if (checkID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "checkID", checkID)); // query parameter } if (tag != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "tag", tag)); // query parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetNotificationRules", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all notification rules /// /// Thrown when fails to make API call /// Only show notification rules that belong to a specific organization ID. /// OpenTracing span context (optional) /// (optional) /// (optional, default to 20) /// Only show notifications that belong to the specific check ID. (optional) /// Only return notification rules that \"would match\" statuses which contain the tag key value pairs provided. (optional) /// ApiResponse of NotificationRules public RestRequest GetNotificationRulesWithRestRequest(string orgID, string zapTraceSpan = null, int? offset = null, int? limit = null, string checkID = null, string tag = null) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling NotificationRulesService->GetNotificationRules"); } var localVarPath = "/api/v2/notificationRules"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (offset != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter } if (limit != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter } if (orgID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter } if (checkID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "checkID", checkID)); // query parameter } if (tag != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "tag", tag)); // query parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } return Configuration.ApiClient.PrepareRequest(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// List all notification rules /// /// Thrown when fails to make API call /// Only show notification rules that belong to a specific organization ID. /// OpenTracing span context (optional) /// (optional) /// (optional, default to 20) /// Only show notifications that belong to the specific check ID. (optional) /// Only return notification rules that \"would match\" statuses which contain the tag key value pairs provided. (optional) /// Cancellation token /// Task of NotificationRules public async System.Threading.Tasks.Task GetNotificationRulesAsync(string orgID, string zapTraceSpan = null, int? offset = null, int? limit = null, string checkID = null, string tag = null, CancellationToken cancellationToken = default) { var localVarResponse = await GetNotificationRulesAsyncWithHttpInfo(orgID, zapTraceSpan, offset, limit, checkID, tag, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// List all notification rules /// /// Thrown when fails to make API call /// Only show notification rules that belong to a specific organization ID. /// OpenTracing span context (optional) /// (optional) /// (optional, default to 20) /// Only show notifications that belong to the specific check ID. (optional) /// Only return notification rules that \"would match\" statuses which contain the tag key value pairs provided. (optional) /// Cancellation token /// Task of ApiResponse (NotificationRules) public async System.Threading.Tasks.Task> GetNotificationRulesAsyncWithHttpInfo( string orgID, string zapTraceSpan = null, int? offset = null, int? limit = null, string checkID = null, string tag = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await GetNotificationRulesAsyncWithIRestResponse(orgID, zapTraceSpan, offset, limit, checkID, tag, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetNotificationRules", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (NotificationRules)Configuration.ApiClient.Deserialize(localVarResponse, typeof(NotificationRules))); } /// /// List all notification rules /// /// Thrown when fails to make API call /// Only show notification rules that belong to a specific organization ID. /// OpenTracing span context (optional) /// (optional) /// (optional, default to 20) /// Only show notifications that belong to the specific check ID. (optional) /// Only return notification rules that \"would match\" statuses which contain the tag key value pairs provided. (optional) /// Cancellation token /// Task of RestResponse (NotificationRules) public async System.Threading.Tasks.Task GetNotificationRulesAsyncWithIRestResponse(string orgID, string zapTraceSpan = null, int? offset = null, int? limit = null, string checkID = null, string tag = null, CancellationToken cancellationToken = default) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling NotificationRulesService->GetNotificationRules"); } var localVarPath = "/api/v2/notificationRules"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (offset != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "offset", offset)); // query parameter } if (limit != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "limit", limit)); // query parameter } if (orgID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter } if (checkID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "checkID", checkID)); // query parameter } if (tag != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "tag", tag)); // query parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("GetNotificationRules", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Retrieve a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// NotificationRule public NotificationRule GetNotificationRulesID(string ruleID, string zapTraceSpan = null) { var localVarResponse = GetNotificationRulesIDWithHttpInfo(ruleID, zapTraceSpan); return localVarResponse.Data; } /// /// Retrieve a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// ApiResponse of NotificationRule public ApiResponse GetNotificationRulesIDWithHttpInfo(string ruleID, string zapTraceSpan = null) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->GetNotificationRulesID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetNotificationRulesID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (NotificationRule)Configuration.ApiClient.Deserialize(localVarResponse, typeof(NotificationRule))); } /// /// Retrieve a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of NotificationRule public async System.Threading.Tasks.Task GetNotificationRulesIDWithIRestResponseAsync( string ruleID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->GetNotificationRulesID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetNotificationRulesID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Retrieve a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// ApiResponse of NotificationRule public RestResponse GetNotificationRulesIDWithIRestResponse(string ruleID, string zapTraceSpan = null) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->GetNotificationRulesID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetNotificationRulesID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Retrieve a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// ApiResponse of NotificationRule public RestRequest GetNotificationRulesIDWithRestRequest(string ruleID, string zapTraceSpan = null) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->GetNotificationRulesID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } return Configuration.ApiClient.PrepareRequest(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Retrieve a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of NotificationRule public async System.Threading.Tasks.Task GetNotificationRulesIDAsync(string ruleID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { var localVarResponse = await GetNotificationRulesIDAsyncWithHttpInfo(ruleID, zapTraceSpan, cancellationToken) .ConfigureAwait(false); return localVarResponse.Data; } /// /// Retrieve a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (NotificationRule) public async System.Threading.Tasks.Task> GetNotificationRulesIDAsyncWithHttpInfo( string ruleID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await GetNotificationRulesIDAsyncWithIRestResponse(ruleID, zapTraceSpan, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetNotificationRulesID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (NotificationRule)Configuration.ApiClient.Deserialize(localVarResponse, typeof(NotificationRule))); } /// /// Retrieve a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse (NotificationRule) public async System.Threading.Tasks.Task GetNotificationRulesIDAsyncWithIRestResponse( string ruleID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->GetNotificationRulesID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("GetNotificationRulesID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all labels for a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// LabelsResponse public LabelsResponse GetNotificationRulesIDLabels(string ruleID, string zapTraceSpan = null) { var localVarResponse = GetNotificationRulesIDLabelsWithHttpInfo(ruleID, zapTraceSpan); return localVarResponse.Data; } /// /// List all labels for a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// ApiResponse of LabelsResponse public ApiResponse GetNotificationRulesIDLabelsWithHttpInfo(string ruleID, string zapTraceSpan = null) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->GetNotificationRulesIDLabels"); } var localVarPath = "/api/v2/notificationRules/{ruleID}/labels"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetNotificationRulesIDLabels", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (LabelsResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(LabelsResponse))); } /// /// List all labels for a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of LabelsResponse public async System.Threading.Tasks.Task GetNotificationRulesIDLabelsWithIRestResponseAsync( string ruleID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->GetNotificationRulesIDLabels"); } var localVarPath = "/api/v2/notificationRules/{ruleID}/labels"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetNotificationRulesIDLabels", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all labels for a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// ApiResponse of LabelsResponse public RestResponse GetNotificationRulesIDLabelsWithIRestResponse(string ruleID, string zapTraceSpan = null) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->GetNotificationRulesIDLabels"); } var localVarPath = "/api/v2/notificationRules/{ruleID}/labels"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetNotificationRulesIDLabels", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all labels for a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// ApiResponse of LabelsResponse public RestRequest GetNotificationRulesIDLabelsWithRestRequest(string ruleID, string zapTraceSpan = null) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->GetNotificationRulesIDLabels"); } var localVarPath = "/api/v2/notificationRules/{ruleID}/labels"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } return Configuration.ApiClient.PrepareRequest(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// List all labels for a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of LabelsResponse public async System.Threading.Tasks.Task GetNotificationRulesIDLabelsAsync(string ruleID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { var localVarResponse = await GetNotificationRulesIDLabelsAsyncWithHttpInfo(ruleID, zapTraceSpan, cancellationToken) .ConfigureAwait(false); return localVarResponse.Data; } /// /// List all labels for a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (LabelsResponse) public async System.Threading.Tasks.Task> GetNotificationRulesIDLabelsAsyncWithHttpInfo(string ruleID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await GetNotificationRulesIDLabelsAsyncWithIRestResponse(ruleID, zapTraceSpan, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetNotificationRulesIDLabels", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (LabelsResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(LabelsResponse))); } /// /// List all labels for a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse (LabelsResponse) public async System.Threading.Tasks.Task GetNotificationRulesIDLabelsAsyncWithIRestResponse( string ruleID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->GetNotificationRulesIDLabels"); } var localVarPath = "/api/v2/notificationRules/{ruleID}/labels"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("GetNotificationRulesIDLabels", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Update a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// NotificationRule public NotificationRule PatchNotificationRulesID(string ruleID, NotificationRuleUpdate notificationRuleUpdate, string zapTraceSpan = null) { var localVarResponse = PatchNotificationRulesIDWithHttpInfo(ruleID, notificationRuleUpdate, zapTraceSpan); return localVarResponse.Data; } /// /// Update a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// ApiResponse of NotificationRule public ApiResponse PatchNotificationRulesIDWithHttpInfo(string ruleID, NotificationRuleUpdate notificationRuleUpdate, string zapTraceSpan = null) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->PatchNotificationRulesID"); } // verify the required parameter 'notificationRuleUpdate' is set if (notificationRuleUpdate == null) { throw new ApiException(400, "Missing required parameter 'notificationRuleUpdate' when calling NotificationRulesService->PatchNotificationRulesID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (notificationRuleUpdate != null && notificationRuleUpdate.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(notificationRuleUpdate); // http body (model) parameter } else { localVarPostBody = notificationRuleUpdate; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PatchNotificationRulesID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (NotificationRule)Configuration.ApiClient.Deserialize(localVarResponse, typeof(NotificationRule))); } /// /// Update a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of NotificationRule public async System.Threading.Tasks.Task PatchNotificationRulesIDWithIRestResponseAsync( string ruleID, NotificationRuleUpdate notificationRuleUpdate, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->PatchNotificationRulesID"); } // verify the required parameter 'notificationRuleUpdate' is set if (notificationRuleUpdate == null) { throw new ApiException(400, "Missing required parameter 'notificationRuleUpdate' when calling NotificationRulesService->PatchNotificationRulesID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (notificationRuleUpdate != null && notificationRuleUpdate.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(notificationRuleUpdate); // http body (model) parameter } else { localVarPostBody = notificationRuleUpdate; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PatchNotificationRulesID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Update a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// ApiResponse of NotificationRule public RestResponse PatchNotificationRulesIDWithIRestResponse(string ruleID, NotificationRuleUpdate notificationRuleUpdate, string zapTraceSpan = null) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->PatchNotificationRulesID"); } // verify the required parameter 'notificationRuleUpdate' is set if (notificationRuleUpdate == null) { throw new ApiException(400, "Missing required parameter 'notificationRuleUpdate' when calling NotificationRulesService->PatchNotificationRulesID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (notificationRuleUpdate != null && notificationRuleUpdate.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(notificationRuleUpdate); // http body (model) parameter } else { localVarPostBody = notificationRuleUpdate; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PatchNotificationRulesID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Update a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// ApiResponse of NotificationRule public RestRequest PatchNotificationRulesIDWithRestRequest(string ruleID, NotificationRuleUpdate notificationRuleUpdate, string zapTraceSpan = null) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->PatchNotificationRulesID"); } // verify the required parameter 'notificationRuleUpdate' is set if (notificationRuleUpdate == null) { throw new ApiException(400, "Missing required parameter 'notificationRuleUpdate' when calling NotificationRulesService->PatchNotificationRulesID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (notificationRuleUpdate != null && notificationRuleUpdate.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(notificationRuleUpdate); // http body (model) parameter } else { localVarPostBody = notificationRuleUpdate; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } return Configuration.ApiClient.PrepareRequest(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Update a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// Cancellation token /// Task of NotificationRule public async System.Threading.Tasks.Task PatchNotificationRulesIDAsync(string ruleID, NotificationRuleUpdate notificationRuleUpdate, string zapTraceSpan = null, CancellationToken cancellationToken = default) { var localVarResponse = await PatchNotificationRulesIDAsyncWithHttpInfo(ruleID, notificationRuleUpdate, zapTraceSpan, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// Update a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (NotificationRule) public async System.Threading.Tasks.Task> PatchNotificationRulesIDAsyncWithHttpInfo(string ruleID, NotificationRuleUpdate notificationRuleUpdate, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await PatchNotificationRulesIDAsyncWithIRestResponse(ruleID, notificationRuleUpdate, zapTraceSpan, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PatchNotificationRulesID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (NotificationRule)Configuration.ApiClient.Deserialize(localVarResponse, typeof(NotificationRule))); } /// /// Update a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse (NotificationRule) public async System.Threading.Tasks.Task PatchNotificationRulesIDAsyncWithIRestResponse( string ruleID, NotificationRuleUpdate notificationRuleUpdate, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->PatchNotificationRulesID"); } // verify the required parameter 'notificationRuleUpdate' is set if (notificationRuleUpdate == null) { throw new ApiException(400, "Missing required parameter 'notificationRuleUpdate' when calling NotificationRulesService->PatchNotificationRulesID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (notificationRuleUpdate != null && notificationRuleUpdate.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(notificationRuleUpdate); // http body (model) parameter } else { localVarPostBody = notificationRuleUpdate; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("PatchNotificationRulesID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Add a label to a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Label to add /// OpenTracing span context (optional) /// LabelResponse public LabelResponse PostNotificationRuleIDLabels(string ruleID, LabelMapping labelMapping, string zapTraceSpan = null) { var localVarResponse = PostNotificationRuleIDLabelsWithHttpInfo(ruleID, labelMapping, zapTraceSpan); return localVarResponse.Data; } /// /// Add a label to a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Label to add /// OpenTracing span context (optional) /// ApiResponse of LabelResponse public ApiResponse PostNotificationRuleIDLabelsWithHttpInfo(string ruleID, LabelMapping labelMapping, string zapTraceSpan = null) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->PostNotificationRuleIDLabels"); } // verify the required parameter 'labelMapping' is set if (labelMapping == null) { throw new ApiException(400, "Missing required parameter 'labelMapping' when calling NotificationRulesService->PostNotificationRuleIDLabels"); } var localVarPath = "/api/v2/notificationRules/{ruleID}/labels"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (labelMapping != null && labelMapping.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(labelMapping); // http body (model) parameter } else { localVarPostBody = labelMapping; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostNotificationRuleIDLabels", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (LabelResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(LabelResponse))); } /// /// Add a label to a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Label to add /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of LabelResponse public async System.Threading.Tasks.Task PostNotificationRuleIDLabelsWithIRestResponseAsync( string ruleID, LabelMapping labelMapping, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->PostNotificationRuleIDLabels"); } // verify the required parameter 'labelMapping' is set if (labelMapping == null) { throw new ApiException(400, "Missing required parameter 'labelMapping' when calling NotificationRulesService->PostNotificationRuleIDLabels"); } var localVarPath = "/api/v2/notificationRules/{ruleID}/labels"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (labelMapping != null && labelMapping.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(labelMapping); // http body (model) parameter } else { localVarPostBody = labelMapping; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostNotificationRuleIDLabels", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Add a label to a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Label to add /// OpenTracing span context (optional) /// ApiResponse of LabelResponse public RestResponse PostNotificationRuleIDLabelsWithIRestResponse(string ruleID, LabelMapping labelMapping, string zapTraceSpan = null) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->PostNotificationRuleIDLabels"); } // verify the required parameter 'labelMapping' is set if (labelMapping == null) { throw new ApiException(400, "Missing required parameter 'labelMapping' when calling NotificationRulesService->PostNotificationRuleIDLabels"); } var localVarPath = "/api/v2/notificationRules/{ruleID}/labels"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (labelMapping != null && labelMapping.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(labelMapping); // http body (model) parameter } else { localVarPostBody = labelMapping; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostNotificationRuleIDLabels", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Add a label to a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Label to add /// OpenTracing span context (optional) /// ApiResponse of LabelResponse public RestRequest PostNotificationRuleIDLabelsWithRestRequest(string ruleID, LabelMapping labelMapping, string zapTraceSpan = null) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->PostNotificationRuleIDLabels"); } // verify the required parameter 'labelMapping' is set if (labelMapping == null) { throw new ApiException(400, "Missing required parameter 'labelMapping' when calling NotificationRulesService->PostNotificationRuleIDLabels"); } var localVarPath = "/api/v2/notificationRules/{ruleID}/labels"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (labelMapping != null && labelMapping.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(labelMapping); // http body (model) parameter } else { localVarPostBody = labelMapping; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } return Configuration.ApiClient.PrepareRequest(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Add a label to a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Label to add /// OpenTracing span context (optional) /// Cancellation token /// Task of LabelResponse public async System.Threading.Tasks.Task PostNotificationRuleIDLabelsAsync(string ruleID, LabelMapping labelMapping, string zapTraceSpan = null, CancellationToken cancellationToken = default) { var localVarResponse = await PostNotificationRuleIDLabelsAsyncWithHttpInfo(ruleID, labelMapping, zapTraceSpan, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// Add a label to a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Label to add /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (LabelResponse) public async System.Threading.Tasks.Task> PostNotificationRuleIDLabelsAsyncWithHttpInfo(string ruleID, LabelMapping labelMapping, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await PostNotificationRuleIDLabelsAsyncWithIRestResponse(ruleID, labelMapping, zapTraceSpan, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostNotificationRuleIDLabels", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (LabelResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(LabelResponse))); } /// /// Add a label to a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Label to add /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse (LabelResponse) public async System.Threading.Tasks.Task PostNotificationRuleIDLabelsAsyncWithIRestResponse( string ruleID, LabelMapping labelMapping, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->PostNotificationRuleIDLabels"); } // verify the required parameter 'labelMapping' is set if (labelMapping == null) { throw new ApiException(400, "Missing required parameter 'labelMapping' when calling NotificationRulesService->PostNotificationRuleIDLabels"); } var localVarPath = "/api/v2/notificationRules/{ruleID}/labels"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (labelMapping != null && labelMapping.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(labelMapping); // http body (model) parameter } else { localVarPostBody = labelMapping; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("PostNotificationRuleIDLabels", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Update a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// NotificationRule public NotificationRule PutNotificationRulesID(string ruleID, NotificationRule notificationRule, string zapTraceSpan = null) { var localVarResponse = PutNotificationRulesIDWithHttpInfo(ruleID, notificationRule, zapTraceSpan); return localVarResponse.Data; } /// /// Update a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// ApiResponse of NotificationRule public ApiResponse PutNotificationRulesIDWithHttpInfo(string ruleID, NotificationRule notificationRule, string zapTraceSpan = null) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->PutNotificationRulesID"); } // verify the required parameter 'notificationRule' is set if (notificationRule == null) { throw new ApiException(400, "Missing required parameter 'notificationRule' when calling NotificationRulesService->PutNotificationRulesID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (notificationRule != null && notificationRule.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(notificationRule); // http body (model) parameter } else { localVarPostBody = notificationRule; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PutNotificationRulesID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (NotificationRule)Configuration.ApiClient.Deserialize(localVarResponse, typeof(NotificationRule))); } /// /// Update a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of NotificationRule public async System.Threading.Tasks.Task PutNotificationRulesIDWithIRestResponseAsync( string ruleID, NotificationRule notificationRule, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->PutNotificationRulesID"); } // verify the required parameter 'notificationRule' is set if (notificationRule == null) { throw new ApiException(400, "Missing required parameter 'notificationRule' when calling NotificationRulesService->PutNotificationRulesID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (notificationRule != null && notificationRule.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(notificationRule); // http body (model) parameter } else { localVarPostBody = notificationRule; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PutNotificationRulesID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Update a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// ApiResponse of NotificationRule public RestResponse PutNotificationRulesIDWithIRestResponse(string ruleID, NotificationRule notificationRule, string zapTraceSpan = null) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->PutNotificationRulesID"); } // verify the required parameter 'notificationRule' is set if (notificationRule == null) { throw new ApiException(400, "Missing required parameter 'notificationRule' when calling NotificationRulesService->PutNotificationRulesID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (notificationRule != null && notificationRule.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(notificationRule); // http body (model) parameter } else { localVarPostBody = notificationRule; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PutNotificationRulesID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Update a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// ApiResponse of NotificationRule public RestRequest PutNotificationRulesIDWithRestRequest(string ruleID, NotificationRule notificationRule, string zapTraceSpan = null) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->PutNotificationRulesID"); } // verify the required parameter 'notificationRule' is set if (notificationRule == null) { throw new ApiException(400, "Missing required parameter 'notificationRule' when calling NotificationRulesService->PutNotificationRulesID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (notificationRule != null && notificationRule.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(notificationRule); // http body (model) parameter } else { localVarPostBody = notificationRule; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } return Configuration.ApiClient.PrepareRequest(localVarPath, Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Update a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// Cancellation token /// Task of NotificationRule public async System.Threading.Tasks.Task PutNotificationRulesIDAsync(string ruleID, NotificationRule notificationRule, string zapTraceSpan = null, CancellationToken cancellationToken = default) { var localVarResponse = await PutNotificationRulesIDAsyncWithHttpInfo(ruleID, notificationRule, zapTraceSpan, cancellationToken) .ConfigureAwait(false); return localVarResponse.Data; } /// /// Update a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (NotificationRule) public async System.Threading.Tasks.Task> PutNotificationRulesIDAsyncWithHttpInfo( string ruleID, NotificationRule notificationRule, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await PutNotificationRulesIDAsyncWithIRestResponse(ruleID, notificationRule, zapTraceSpan, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PutNotificationRulesID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (NotificationRule)Configuration.ApiClient.Deserialize(localVarResponse, typeof(NotificationRule))); } /// /// Update a notification rule /// /// Thrown when fails to make API call /// The notification rule ID. /// Notification rule update to apply /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse (NotificationRule) public async System.Threading.Tasks.Task PutNotificationRulesIDAsyncWithIRestResponse( string ruleID, NotificationRule notificationRule, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'ruleID' is set if (ruleID == null) { throw new ApiException(400, "Missing required parameter 'ruleID' when calling NotificationRulesService->PutNotificationRulesID"); } // verify the required parameter 'notificationRule' is set if (notificationRule == null) { throw new ApiException(400, "Missing required parameter 'notificationRule' when calling NotificationRulesService->PutNotificationRulesID"); } var localVarPath = "/api/v2/notificationRules/{ruleID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (ruleID != null) { localVarPathParams.Add("ruleID", Configuration.ApiClient.ParameterToString(ruleID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (notificationRule != null && notificationRule.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(notificationRule); // http body (model) parameter } else { localVarPostBody = notificationRule; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("PutNotificationRulesID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } } }