Created
January 17, 2024 20:07
-
-
Save JustinGrote/b194ee548ac438fd66c3f33daf5718b5 to your computer and use it in GitHub Desktop.
NinjaOne AutoGen Module using nswag
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//---------------------- | |
// <auto-generated> | |
// Generated using the NSwag toolchain v13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) | |
// </auto-generated> | |
//---------------------- | |
#nullable enable | |
#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." | |
#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." | |
#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' | |
#pragma warning disable 612 // Disable "CS0612 '...' is obsolete" | |
#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... | |
#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." | |
#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" | |
#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" | |
#pragma warning disable 8603 // Disable "CS8603 Possible null reference return" | |
#pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter" | |
namespace NinjaOne | |
{ | |
using System = global::System; | |
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class Client | |
{ | |
private string _baseUrl = ""; | |
private System.Net.Http.HttpClient _httpClient; | |
private System.Lazy<System.Text.Json.JsonSerializerOptions> _settings; | |
public Client(string baseUrl, System.Net.Http.HttpClient httpClient) | |
{ | |
BaseUrl = baseUrl; | |
_httpClient = httpClient; | |
_settings = new System.Lazy<System.Text.Json.JsonSerializerOptions>(CreateSerializerSettings, true); | |
} | |
private System.Text.Json.JsonSerializerOptions CreateSerializerSettings() | |
{ | |
var settings = new System.Text.Json.JsonSerializerOptions(); | |
UpdateJsonSerializerSettings(settings); | |
return settings; | |
} | |
public string BaseUrl | |
{ | |
get { return _baseUrl; } | |
set { _baseUrl = value; } | |
} | |
protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } | |
partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); | |
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); | |
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); | |
partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); | |
/// <summary> | |
/// Reset alert/condition and provide custom data for activity | |
/// </summary> | |
/// <remarks> | |
/// Resets alert/condition by UID | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual FileResponse ResetAlertSetActivityData(System.Guid uid, object? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await ResetAlertSetActivityDataAsync(uid, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Reset alert/condition and provide custom data for activity | |
/// </summary> | |
/// <remarks> | |
/// Resets alert/condition by UID | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<FileResponse> ResetAlertSetActivityDataAsync(System.Guid uid, object? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (uid == null) | |
throw new System.ArgumentNullException("uid"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/alert/{uid}/reset"); | |
urlBuilder_.Replace("{uid}", System.Uri.EscapeDataString(ConvertToString(uid, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("POST"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
return default(FileResponse)!; | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Reset alert/condition | |
/// </summary> | |
/// <remarks> | |
/// Resets alert/condition by UID | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual FileResponse ResetAlert(System.Guid uid) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await ResetAlertAsync(uid, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Reset alert/condition | |
/// </summary> | |
/// <remarks> | |
/// Resets alert/condition by UID | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<FileResponse> ResetAlertAsync(System.Guid uid, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (uid == null) | |
throw new System.ArgumentNullException("uid"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/alert/{uid}"); | |
urlBuilder_.Replace("{uid}", System.Uri.EscapeDataString(ConvertToString(uid, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("DELETE"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
return default(FileResponse)!; | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Approve/Reject devices | |
/// </summary> | |
/// <remarks> | |
/// Approve or reject devices that are waiting for approval | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual FileResponse NodeApprovalOperation(Mode mode, DeviceIDList? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await NodeApprovalOperationAsync(mode, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Approve/Reject devices | |
/// </summary> | |
/// <remarks> | |
/// Approve or reject devices that are waiting for approval | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<FileResponse> NodeApprovalOperationAsync(Mode mode, DeviceIDList? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (mode == null) | |
throw new System.ArgumentNullException("mode"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/devices/approval/{mode}"); | |
urlBuilder_.Replace("{mode}", System.Uri.EscapeDataString(ConvertToString(mode, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("POST"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
return default(FileResponse)!; | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List organizations | |
/// </summary> | |
/// <remarks> | |
/// Returns list of organizations (Brief mode) | |
/// </remarks> | |
/// <param name="pageSize">Limit number of organizations to return</param> | |
/// <param name="after">Last Organization Identifier from previous page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<Organization> GetOrganizations(int? pageSize = null, int? after = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetOrganizationsAsync(pageSize, after, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List organizations | |
/// </summary> | |
/// <remarks> | |
/// Returns list of organizations (Brief mode) | |
/// </remarks> | |
/// <param name="pageSize">Limit number of organizations to return</param> | |
/// <param name="after">Last Organization Identifier from previous page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Organization>> GetOrganizationsAsync(int? pageSize = null, int? after = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organizations?"); | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (after != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("after") + "=").Append(System.Uri.EscapeDataString(ConvertToString(after, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<Organization>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Create new organization | |
/// </summary> | |
/// <remarks> | |
/// Creates new organization with optional list of locations and policy mappings. | |
/// <br/>Template organization ID can be specified to copy various settings | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual OrganizationDetailed CreateOrganization(int? templateOrganizationId = null, OrganizationWithLocationsAndPolicyAssignmentsModel? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await CreateOrganizationAsync(templateOrganizationId, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Create new organization | |
/// </summary> | |
/// <remarks> | |
/// Creates new organization with optional list of locations and policy mappings. | |
/// <br/>Template organization ID can be specified to copy various settings | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<OrganizationDetailed> CreateOrganizationAsync(int? templateOrganizationId = null, OrganizationWithLocationsAndPolicyAssignmentsModel? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organizations?"); | |
if (templateOrganizationId != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("templateOrganizationId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(templateOrganizationId, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("POST"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<OrganizationDetailed>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Update API Webhook configuration | |
/// </summary> | |
/// <remarks> | |
/// Creates or updates Webhook configuration for current application/client | |
/// </remarks> | |
/// <returns>No Content</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual void ConfigureWebhook(WebhookConfiguration? body = null) | |
{ | |
System.Threading.Tasks.Task.Run(async () => await ConfigureWebhookAsync(body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Update API Webhook configuration | |
/// </summary> | |
/// <remarks> | |
/// Creates or updates Webhook configuration for current application/client | |
/// </remarks> | |
/// <returns>No Content</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task ConfigureWebhookAsync(WebhookConfiguration? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/webhook"); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("PUT"); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 204) | |
{ | |
return; | |
} | |
else | |
if (status_ == 403) | |
{ | |
string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("Only system administrators can configure webhooks", status_, responseText_, headers_, null); | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Remove Webhook API channel | |
/// </summary> | |
/// <remarks> | |
/// Disables Webhook configuration for current application/client | |
/// </remarks> | |
/// <returns>No Content</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual void DisableWebhook() | |
{ | |
System.Threading.Tasks.Task.Run(async () => await DisableWebhookAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Remove Webhook API channel | |
/// </summary> | |
/// <remarks> | |
/// Disables Webhook configuration for current application/client | |
/// </remarks> | |
/// <returns>No Content</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task DisableWebhookAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/webhook"); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("DELETE"); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 204) | |
{ | |
return; | |
} | |
else | |
if (status_ == 403) | |
{ | |
string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("Different PSA is already configured", status_, responseText_, headers_, null); | |
} | |
else | |
if (status_ == 500) | |
{ | |
string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("Failed to disable PSA", status_, responseText_, headers_, null); | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List all organization documents with field values | |
/// </summary> | |
/// <remarks> | |
/// List all organization documents with field values | |
/// </remarks> | |
/// <returns>Returns a list of all organization documents with field values grouped by organization identifier</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<ClientDocumentWithAttributeValuesPublicApiDTO> GetClientDocumentsWithAttributeValues(GroupBy? groupBy = null, string? organizationIds = null, string? templateIds = null, string? templateName = null, string? documentName = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetClientDocumentsWithAttributeValuesAsync(groupBy, organizationIds, templateIds, templateName, documentName, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List all organization documents with field values | |
/// </summary> | |
/// <remarks> | |
/// List all organization documents with field values | |
/// </remarks> | |
/// <returns>Returns a list of all organization documents with field values grouped by organization identifier</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ClientDocumentWithAttributeValuesPublicApiDTO>> GetClientDocumentsWithAttributeValuesAsync(GroupBy? groupBy = null, string? organizationIds = null, string? templateIds = null, string? templateName = null, string? documentName = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/documents?"); | |
if (groupBy != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("groupBy") + "=").Append(System.Uri.EscapeDataString(ConvertToString(groupBy, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (organizationIds != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("organizationIds") + "=").Append(System.Uri.EscapeDataString(ConvertToString(organizationIds, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (templateIds != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("templateIds") + "=").Append(System.Uri.EscapeDataString(ConvertToString(templateIds, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (templateName != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("templateName") + "=").Append(System.Uri.EscapeDataString(ConvertToString(templateName, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (documentName != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("documentName") + "=").Append(System.Uri.EscapeDataString(ConvertToString(documentName, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<ClientDocumentWithAttributeValuesPublicApiDTO>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Create organization documents | |
/// </summary> | |
/// <remarks> | |
/// Creates organization documents and returns the documents created | |
/// </remarks> | |
/// <returns>Returns a list of created organization documents with field values</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<ClientDocumentWithAttributeValuesPublicApiDTO> CreateOrganizationDocuments(System.Collections.Generic.IEnumerable<ClientDocumentWithAttributeValuesBulkCreatePublicApiRequest>? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await CreateOrganizationDocumentsAsync(body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Create organization documents | |
/// </summary> | |
/// <remarks> | |
/// Creates organization documents and returns the documents created | |
/// </remarks> | |
/// <returns>Returns a list of created organization documents with field values</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ClientDocumentWithAttributeValuesPublicApiDTO>> CreateOrganizationDocumentsAsync(System.Collections.Generic.IEnumerable<ClientDocumentWithAttributeValuesBulkCreatePublicApiRequest>? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/documents"); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("POST"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<ClientDocumentWithAttributeValuesPublicApiDTO>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Update organization documents | |
/// </summary> | |
/// <remarks> | |
/// Updates organization documents and returns the documents updated | |
/// </remarks> | |
/// <returns>Returns a list of updated organization documents with field values</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<ClientDocumentWithUpdatedAttributeValuesPublicApiDTO> UpdateOrganizationDocuments(System.Collections.Generic.IEnumerable<ClientDocumentWithAttributeValuesBulkUpdatePublicApiRequest>? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await UpdateOrganizationDocumentsAsync(body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Update organization documents | |
/// </summary> | |
/// <remarks> | |
/// Updates organization documents and returns the documents updated | |
/// </remarks> | |
/// <returns>Returns a list of updated organization documents with field values</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ClientDocumentWithUpdatedAttributeValuesPublicApiDTO>> UpdateOrganizationDocumentsAsync(System.Collections.Generic.IEnumerable<ClientDocumentWithAttributeValuesBulkUpdatePublicApiRequest>? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/documents"); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("PATCH"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<ClientDocumentWithUpdatedAttributeValuesPublicApiDTO>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Create organization document | |
/// </summary> | |
/// <remarks> | |
/// Creates an organization document and returns the document created | |
/// </remarks> | |
/// <param name="organizationId">Organization identifier</param> | |
/// <param name="documentTemplateId">Document template identifier</param> | |
/// <returns>Returns the organization document created</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual ClientDocumentWithAttributeValuesPublicApiDTO CreateOrganizationDocument(int organizationId, int documentTemplateId, ClientDocumentWithAttributeValuesPublicApiRequest? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await CreateOrganizationDocumentAsync(organizationId, documentTemplateId, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Create organization document | |
/// </summary> | |
/// <remarks> | |
/// Creates an organization document and returns the document created | |
/// </remarks> | |
/// <param name="organizationId">Organization identifier</param> | |
/// <param name="documentTemplateId">Document template identifier</param> | |
/// <returns>Returns the organization document created</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<ClientDocumentWithAttributeValuesPublicApiDTO> CreateOrganizationDocumentAsync(int organizationId, int documentTemplateId, ClientDocumentWithAttributeValuesPublicApiRequest? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (organizationId == null) | |
throw new System.ArgumentNullException("organizationId"); | |
if (documentTemplateId == null) | |
throw new System.ArgumentNullException("documentTemplateId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/{organizationId}/template/{documentTemplateId}/document"); | |
urlBuilder_.Replace("{organizationId}", System.Uri.EscapeDataString(ConvertToString(organizationId, System.Globalization.CultureInfo.InvariantCulture))); | |
urlBuilder_.Replace("{documentTemplateId}", System.Uri.EscapeDataString(ConvertToString(documentTemplateId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("POST"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<ClientDocumentWithAttributeValuesPublicApiDTO>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Update organization document | |
/// </summary> | |
/// <remarks> | |
/// Updates an organization document and returns the updated version | |
/// </remarks> | |
/// <param name="organizationId">Organization identifier</param> | |
/// <param name="documentId">Organization document identifier</param> | |
/// <returns>Returns the organization document updated</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual ClientDocumentWithUpdatedAttributeValuesPublicApiDTO UpdateOrganizationDocument(int organizationId, int documentId, ClientDocumentWithAttributeValuesPublicApiRequest? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await UpdateOrganizationDocumentAsync(organizationId, documentId, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Update organization document | |
/// </summary> | |
/// <remarks> | |
/// Updates an organization document and returns the updated version | |
/// </remarks> | |
/// <param name="organizationId">Organization identifier</param> | |
/// <param name="documentId">Organization document identifier</param> | |
/// <returns>Returns the organization document updated</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<ClientDocumentWithUpdatedAttributeValuesPublicApiDTO> UpdateOrganizationDocumentAsync(int organizationId, int documentId, ClientDocumentWithAttributeValuesPublicApiRequest? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (organizationId == null) | |
throw new System.ArgumentNullException("organizationId"); | |
if (documentId == null) | |
throw new System.ArgumentNullException("documentId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/{organizationId}/document/{documentId}"); | |
urlBuilder_.Replace("{organizationId}", System.Uri.EscapeDataString(ConvertToString(organizationId, System.Globalization.CultureInfo.InvariantCulture))); | |
urlBuilder_.Replace("{documentId}", System.Uri.EscapeDataString(ConvertToString(documentId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("POST"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<ClientDocumentWithUpdatedAttributeValuesPublicApiDTO>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Delete an organization document | |
/// </summary> | |
/// <remarks> | |
/// Deletes an organization document by id | |
/// </remarks> | |
/// <returns>No Content</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual void DeleteClientDocument(int clientDocumentId) | |
{ | |
System.Threading.Tasks.Task.Run(async () => await DeleteClientDocumentAsync(clientDocumentId, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Delete an organization document | |
/// </summary> | |
/// <remarks> | |
/// Deletes an organization document by id | |
/// </remarks> | |
/// <returns>No Content</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task DeleteClientDocumentAsync(int clientDocumentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (clientDocumentId == null) | |
throw new System.ArgumentNullException("clientDocumentId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/document/{clientDocumentId}"); | |
urlBuilder_.Replace("{clientDocumentId}", System.Uri.EscapeDataString(ConvertToString(clientDocumentId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("DELETE"); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 204) | |
{ | |
return; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List organization documents with field values | |
/// </summary> | |
/// <remarks> | |
/// List organization documents with field values | |
/// </remarks> | |
/// <param name="organizationId">Organization identifier</param> | |
/// <returns>Returns a list of organization documents with field values</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<ClientDocumentWithAttributeValuesPublicApiDTO> GetOrganizationDocuments(int organizationId) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetOrganizationDocumentsAsync(organizationId, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List organization documents with field values | |
/// </summary> | |
/// <remarks> | |
/// List organization documents with field values | |
/// </remarks> | |
/// <param name="organizationId">Organization identifier</param> | |
/// <returns>Returns a list of organization documents with field values</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ClientDocumentWithAttributeValuesPublicApiDTO>> GetOrganizationDocumentsAsync(int organizationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (organizationId == null) | |
throw new System.ArgumentNullException("organizationId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/{organizationId}/documents"); | |
urlBuilder_.Replace("{organizationId}", System.Uri.EscapeDataString(ConvertToString(organizationId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<ClientDocumentWithAttributeValuesPublicApiDTO>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List document templates with fields | |
/// </summary> | |
/// <remarks> | |
/// List document templates with fields | |
/// </remarks> | |
/// <returns>Returns a list of all document templates with fields</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<DocumentTemplatePublicApiDTO> GetDocumentTemplatesWithAttributes() | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDocumentTemplatesWithAttributesAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List document templates with fields | |
/// </summary> | |
/// <remarks> | |
/// List document templates with fields | |
/// </remarks> | |
/// <returns>Returns a list of all document templates with fields</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<DocumentTemplatePublicApiDTO>> GetDocumentTemplatesWithAttributesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/document-templates"); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<DocumentTemplatePublicApiDTO>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Create document template | |
/// </summary> | |
/// <remarks> | |
/// Create document template | |
/// </remarks> | |
/// <returns>Returns the document template created</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual DocumentTemplatePublicApiDTO CreateDocumentTemplate(NewDocumentTemplatePublicApiRequest? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await CreateDocumentTemplateAsync(body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Create document template | |
/// </summary> | |
/// <remarks> | |
/// Create document template | |
/// </remarks> | |
/// <returns>Returns the document template created</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<DocumentTemplatePublicApiDTO> CreateDocumentTemplateAsync(NewDocumentTemplatePublicApiRequest? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/document-templates"); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("*/*"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("POST"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<DocumentTemplatePublicApiDTO>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Get document template | |
/// </summary> | |
/// <remarks> | |
/// Get document template | |
/// </remarks> | |
/// <returns>Returns a document template</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual DocumentTemplatePublicApiDTO GetDocumentTemplate(int documentTemplateId) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDocumentTemplateAsync(documentTemplateId, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Get document template | |
/// </summary> | |
/// <remarks> | |
/// Get document template | |
/// </remarks> | |
/// <returns>Returns a document template</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<DocumentTemplatePublicApiDTO> GetDocumentTemplateAsync(int documentTemplateId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (documentTemplateId == null) | |
throw new System.ArgumentNullException("documentTemplateId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/document-templates/{documentTemplateId}"); | |
urlBuilder_.Replace("{documentTemplateId}", System.Uri.EscapeDataString(ConvertToString(documentTemplateId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<DocumentTemplatePublicApiDTO>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Update document template | |
/// </summary> | |
/// <remarks> | |
/// Updates a document template by id | |
/// </remarks> | |
/// <returns>Returns the document template updated</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual DocumentTemplatePublicApiDTO UpdateDocumentTemplate(int documentTemplateId, UpdateDocumentTemplatePublicApiRequest? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await UpdateDocumentTemplateAsync(documentTemplateId, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Update document template | |
/// </summary> | |
/// <remarks> | |
/// Updates a document template by id | |
/// </remarks> | |
/// <returns>Returns the document template updated</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<DocumentTemplatePublicApiDTO> UpdateDocumentTemplateAsync(int documentTemplateId, UpdateDocumentTemplatePublicApiRequest? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (documentTemplateId == null) | |
throw new System.ArgumentNullException("documentTemplateId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/document-templates/{documentTemplateId}"); | |
urlBuilder_.Replace("{documentTemplateId}", System.Uri.EscapeDataString(ConvertToString(documentTemplateId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("*/*"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("PUT"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<DocumentTemplatePublicApiDTO>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Delete a document template | |
/// </summary> | |
/// <remarks> | |
/// Deletes a document template by id | |
/// </remarks> | |
/// <returns>No Content</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual void DeleteDocumentTemplate(int documentTemplateId) | |
{ | |
System.Threading.Tasks.Task.Run(async () => await DeleteDocumentTemplateAsync(documentTemplateId, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Delete a document template | |
/// </summary> | |
/// <remarks> | |
/// Deletes a document template by id | |
/// </remarks> | |
/// <returns>No Content</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task DeleteDocumentTemplateAsync(int documentTemplateId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (documentTemplateId == null) | |
throw new System.ArgumentNullException("documentTemplateId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/document-templates/{documentTemplateId}"); | |
urlBuilder_.Replace("{documentTemplateId}", System.Uri.EscapeDataString(ConvertToString(documentTemplateId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("DELETE"); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 204) | |
{ | |
return; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List host entity related items by scope | |
/// </summary> | |
/// <remarks> | |
/// List related items for a specific host entity filterable by scope | |
/// </remarks> | |
/// <returns>Returns list of the related items for an entity filterable by scope</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<RelatedItemPublicApiDTO> GetRelatedItemsForHostEntity(EntityType entityType, int entityId, Scope? scope = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetRelatedItemsForHostEntityAsync(entityType, entityId, scope, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List host entity related items by scope | |
/// </summary> | |
/// <remarks> | |
/// List related items for a specific host entity filterable by scope | |
/// </remarks> | |
/// <returns>Returns list of the related items for an entity filterable by scope</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<RelatedItemPublicApiDTO>> GetRelatedItemsForHostEntityAsync(EntityType entityType, int entityId, Scope? scope = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (entityType == null) | |
throw new System.ArgumentNullException("entityType"); | |
if (entityId == null) | |
throw new System.ArgumentNullException("entityId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/related-items/with-entity/{entityType}/{entityId}?"); | |
urlBuilder_.Replace("{entityType}", System.Uri.EscapeDataString(ConvertToString(entityType, System.Globalization.CultureInfo.InvariantCulture))); | |
urlBuilder_.Replace("{entityId}", System.Uri.EscapeDataString(ConvertToString(entityId, System.Globalization.CultureInfo.InvariantCulture))); | |
if (scope != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("scope") + "=").Append(System.Uri.EscapeDataString(ConvertToString(scope, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<RelatedItemPublicApiDTO>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List host entity type related items | |
/// </summary> | |
/// <remarks> | |
/// List relations and references for a host entity type | |
/// </remarks> | |
/// <returns>Returns a list of relations and references for an entity type</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<RelatedItemPublicApiDTO> GetRelatedItemsWithHostEntityType(EntityType2 entityType) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetRelatedItemsWithHostEntityTypeAsync(entityType, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List host entity type related items | |
/// </summary> | |
/// <remarks> | |
/// List relations and references for a host entity type | |
/// </remarks> | |
/// <returns>Returns a list of relations and references for an entity type</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<RelatedItemPublicApiDTO>> GetRelatedItemsWithHostEntityTypeAsync(EntityType2 entityType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (entityType == null) | |
throw new System.ArgumentNullException("entityType"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/related-items/with-entity-type/{entityType}"); | |
urlBuilder_.Replace("{entityType}", System.Uri.EscapeDataString(ConvertToString(entityType, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<RelatedItemPublicApiDTO>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List related entity type related items | |
/// </summary> | |
/// <remarks> | |
/// List related entities for a related entity type | |
/// </remarks> | |
/// <returns>Returns list of references for a related entity type</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<RelatedItemPublicApiDTO> GetRelatedItemsWithEntityType(RelatedEntityType relatedEntityType) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetRelatedItemsWithEntityTypeAsync(relatedEntityType, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List related entity type related items | |
/// </summary> | |
/// <remarks> | |
/// List related entities for a related entity type | |
/// </remarks> | |
/// <returns>Returns list of references for a related entity type</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<RelatedItemPublicApiDTO>> GetRelatedItemsWithEntityTypeAsync(RelatedEntityType relatedEntityType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (relatedEntityType == null) | |
throw new System.ArgumentNullException("relatedEntityType"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/related-items/with-related-entity-type/{relatedEntityType}"); | |
urlBuilder_.Replace("{relatedEntityType}", System.Uri.EscapeDataString(ConvertToString(relatedEntityType, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<RelatedItemPublicApiDTO>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List related entity related items | |
/// </summary> | |
/// <remarks> | |
/// List related items for a specific related entity | |
/// </remarks> | |
/// <returns>Returns list of the related items for a specific related entity</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<RelatedItemPublicApiDTO> GetRelatedItemsWithEntity(RelEntityType relEntityType, int relEntityId) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetRelatedItemsWithEntityAsync(relEntityType, relEntityId, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List related entity related items | |
/// </summary> | |
/// <remarks> | |
/// List related items for a specific related entity | |
/// </remarks> | |
/// <returns>Returns list of the related items for a specific related entity</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<RelatedItemPublicApiDTO>> GetRelatedItemsWithEntityAsync(RelEntityType relEntityType, int relEntityId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (relEntityType == null) | |
throw new System.ArgumentNullException("relEntityType"); | |
if (relEntityId == null) | |
throw new System.ArgumentNullException("relEntityId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/related-items/with-related-entity/{relEntityType}/{relEntityId}"); | |
urlBuilder_.Replace("{relEntityType}", System.Uri.EscapeDataString(ConvertToString(relEntityType, System.Globalization.CultureInfo.InvariantCulture))); | |
urlBuilder_.Replace("{relEntityId}", System.Uri.EscapeDataString(ConvertToString(relEntityId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<RelatedItemPublicApiDTO>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Create entity relation | |
/// </summary> | |
/// <remarks> | |
/// Create a relation between two entities | |
/// </remarks> | |
/// <returns>Returns the relation created for an entity</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual RelatedItemPublicApiDTO CreateRelatedItemForEntity(EntityType3 entityType, int entityId, NewRelatedItemEntityRequest? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await CreateRelatedItemForEntityAsync(entityType, entityId, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Create entity relation | |
/// </summary> | |
/// <remarks> | |
/// Create a relation between two entities | |
/// </remarks> | |
/// <returns>Returns the relation created for an entity</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<RelatedItemPublicApiDTO> CreateRelatedItemForEntityAsync(EntityType3 entityType, int entityId, NewRelatedItemEntityRequest? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (entityType == null) | |
throw new System.ArgumentNullException("entityType"); | |
if (entityId == null) | |
throw new System.ArgumentNullException("entityId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/related-items/entity/{entityType}/{entityId}/relation"); | |
urlBuilder_.Replace("{entityType}", System.Uri.EscapeDataString(ConvertToString(entityType, System.Globalization.CultureInfo.InvariantCulture))); | |
urlBuilder_.Replace("{entityId}", System.Uri.EscapeDataString(ConvertToString(entityId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("*/*"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("POST"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<RelatedItemPublicApiDTO>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Create Secure Relation | |
/// </summary> | |
/// <remarks> | |
/// Create a relation to a secure value | |
/// </remarks> | |
/// <returns>Returns the secure related item created for an entity</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual RelatedItemPublicApiDTO CreateSecureRelatedItemForEntity(EntityType5 entityType, int entityId, NewRelatedItemSecureValueRequest? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await CreateSecureRelatedItemForEntityAsync(entityType, entityId, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Create Secure Relation | |
/// </summary> | |
/// <remarks> | |
/// Create a relation to a secure value | |
/// </remarks> | |
/// <returns>Returns the secure related item created for an entity</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<RelatedItemPublicApiDTO> CreateSecureRelatedItemForEntityAsync(EntityType5 entityType, int entityId, NewRelatedItemSecureValueRequest? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (entityType == null) | |
throw new System.ArgumentNullException("entityType"); | |
if (entityId == null) | |
throw new System.ArgumentNullException("entityId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/related-items/entity/{entityType}/{entityId}/secure"); | |
urlBuilder_.Replace("{entityType}", System.Uri.EscapeDataString(ConvertToString(entityType, System.Globalization.CultureInfo.InvariantCulture))); | |
urlBuilder_.Replace("{entityId}", System.Uri.EscapeDataString(ConvertToString(entityId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("*/*"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("POST"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<RelatedItemPublicApiDTO>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Create Attachment Relation | |
/// </summary> | |
/// <remarks> | |
/// Relate an attachment to an entity | |
/// </remarks> | |
/// <returns>Returns the attachment related item created for an entity</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual RelatedItemPublicApiDTO CreateRelatedItem(EntityType6 entityType, int entityId, FormDataBodyPart? file = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await CreateRelatedItemAsync(entityType, entityId, file, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Create Attachment Relation | |
/// </summary> | |
/// <remarks> | |
/// Relate an attachment to an entity | |
/// </remarks> | |
/// <returns>Returns the attachment related item created for an entity</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<RelatedItemPublicApiDTO> CreateRelatedItemAsync(EntityType6 entityType, int entityId, FormDataBodyPart? file = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (entityType == null) | |
throw new System.ArgumentNullException("entityType"); | |
if (entityId == null) | |
throw new System.ArgumentNullException("entityId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/related-items/entity/{entityType}/{entityId}/attachment"); | |
urlBuilder_.Replace("{entityType}", System.Uri.EscapeDataString(ConvertToString(entityType, System.Globalization.CultureInfo.InvariantCulture))); | |
urlBuilder_.Replace("{entityId}", System.Uri.EscapeDataString(ConvertToString(entityId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var boundary_ = System.Guid.NewGuid().ToString(); | |
var content_ = new System.Net.Http.MultipartFormDataContent(boundary_); | |
content_.Headers.Remove("Content-Type"); | |
content_.Headers.TryAddWithoutValidation("Content-Type", "multipart/form-data; boundary=" + boundary_); | |
if (file == null) | |
throw new System.ArgumentNullException("file"); | |
else | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(file, _settings.Value); | |
content_.Add(new System.Net.Http.StringContent(json_), "file"); | |
} | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("POST"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<RelatedItemPublicApiDTO>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Delete related item | |
/// </summary> | |
/// <remarks> | |
/// Deletes related item | |
/// </remarks> | |
/// <returns>No Content</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual void DeleteRelatedItem(int relatedItemId) | |
{ | |
System.Threading.Tasks.Task.Run(async () => await DeleteRelatedItemAsync(relatedItemId, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Delete related item | |
/// </summary> | |
/// <remarks> | |
/// Deletes related item | |
/// </remarks> | |
/// <returns>No Content</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task DeleteRelatedItemAsync(int relatedItemId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (relatedItemId == null) | |
throw new System.ArgumentNullException("relatedItemId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/related-items/{relatedItemId}"); | |
urlBuilder_.Replace("{relatedItemId}", System.Uri.EscapeDataString(ConvertToString(relatedItemId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("DELETE"); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 204) | |
{ | |
return; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List all related items | |
/// </summary> | |
/// <remarks> | |
/// List all related items | |
/// </remarks> | |
/// <returns>Returns a list of all related items</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<RelatedItemPublicApiDTO> GetAllRelatedItems() | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetAllRelatedItemsAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List all related items | |
/// </summary> | |
/// <remarks> | |
/// List all related items | |
/// </remarks> | |
/// <returns>Returns a list of all related items</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<RelatedItemPublicApiDTO>> GetAllRelatedItemsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/related-items"); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<RelatedItemPublicApiDTO>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Delete related items | |
/// </summary> | |
/// <remarks> | |
/// Deletes related items associated with an entity | |
/// </remarks> | |
/// <returns>No Content</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual void DeleteRelatedItems(EntityType7 entityType, int entityId) | |
{ | |
System.Threading.Tasks.Task.Run(async () => await DeleteRelatedItemsAsync(entityType, entityId, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Delete related items | |
/// </summary> | |
/// <remarks> | |
/// Deletes related items associated with an entity | |
/// </remarks> | |
/// <returns>No Content</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task DeleteRelatedItemsAsync(EntityType7 entityType, int entityId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (entityType == null) | |
throw new System.ArgumentNullException("entityType"); | |
if (entityId == null) | |
throw new System.ArgumentNullException("entityId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/related-items/{entityType}/{entityId}"); | |
urlBuilder_.Replace("{entityType}", System.Uri.EscapeDataString(ConvertToString(entityType, System.Globalization.CultureInfo.InvariantCulture))); | |
urlBuilder_.Replace("{entityId}", System.Uri.EscapeDataString(ConvertToString(entityId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("DELETE"); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 204) | |
{ | |
return; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Ticket | |
/// </summary> | |
/// <remarks> | |
/// Returns a ticket | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual TicketDTO GetTicketById(int ticketId) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetTicketByIdAsync(ticketId, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Ticket | |
/// </summary> | |
/// <remarks> | |
/// Returns a ticket | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<TicketDTO> GetTicketByIdAsync(int ticketId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (ticketId == null) | |
throw new System.ArgumentNullException("ticketId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/ticketing/ticket/{ticketId}"); | |
urlBuilder_.Replace("{ticketId}", System.Uri.EscapeDataString(ConvertToString(ticketId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<TicketDTO>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Update ticket | |
/// </summary> | |
/// <remarks> | |
/// Change ticket fields. Does not accept comments | |
/// </remarks> | |
/// <param name="body">UpdateTicket object that needs to be updated to the store</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual TicketDTO Update(int ticketId, UpdateTicket body) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await UpdateAsync(ticketId, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Update ticket | |
/// </summary> | |
/// <remarks> | |
/// Change ticket fields. Does not accept comments | |
/// </remarks> | |
/// <param name="body">UpdateTicket object that needs to be updated to the store</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<TicketDTO> UpdateAsync(int ticketId, UpdateTicket body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (ticketId == null) | |
throw new System.ArgumentNullException("ticketId"); | |
if (body == null) | |
throw new System.ArgumentNullException("body"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/ticketing/ticket/{ticketId}"); | |
urlBuilder_.Replace("{ticketId}", System.Uri.EscapeDataString(ConvertToString(ticketId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("PUT"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<TicketDTO>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Create ticket | |
/// </summary> | |
/// <remarks> | |
/// Create a new ticket, does not accept files | |
/// </remarks> | |
/// <param name="body">NewTicket object that needs to be added to the store</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual TicketDTO Create(NewTicket body) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await CreateAsync(body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Create ticket | |
/// </summary> | |
/// <remarks> | |
/// Create a new ticket, does not accept files | |
/// </remarks> | |
/// <param name="body">NewTicket object that needs to be added to the store</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<TicketDTO> CreateAsync(NewTicket body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (body == null) | |
throw new System.ArgumentNullException("body"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/ticketing/ticket"); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("POST"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<TicketDTO>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List ticket log entries | |
/// </summary> | |
/// <remarks> | |
/// Returns list of the ticket log entries for a ticket | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<TicketLogEntryPublicApiDTO> GetTicketLogEntriesByTicketId(int ticketId, Type? type = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetTicketLogEntriesByTicketIdAsync(ticketId, type, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List ticket log entries | |
/// </summary> | |
/// <remarks> | |
/// Returns list of the ticket log entries for a ticket | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<TicketLogEntryPublicApiDTO>> GetTicketLogEntriesByTicketIdAsync(int ticketId, Type? type = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (ticketId == null) | |
throw new System.ArgumentNullException("ticketId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/ticketing/ticket/{ticketId}/log-entry?"); | |
urlBuilder_.Replace("{ticketId}", System.Uri.EscapeDataString(ConvertToString(ticketId, System.Globalization.CultureInfo.InvariantCulture))); | |
if (type != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("type") + "=").Append(System.Uri.EscapeDataString(ConvertToString(type, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<TicketLogEntryPublicApiDTO>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Add comment to ticket | |
/// </summary> | |
/// <remarks> | |
/// Add a new comment to a ticket, allows files | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual void CreateComment(int ticketId, NewTicketLogEntry? comment = null, System.Collections.Generic.IEnumerable<FileParameter> files = null) | |
{ | |
System.Threading.Tasks.Task.Run(async () => await CreateCommentAsync(ticketId, comment, files, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Add comment to ticket | |
/// </summary> | |
/// <remarks> | |
/// Add a new comment to a ticket, allows files | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task CreateCommentAsync(int ticketId, NewTicketLogEntry? comment = null, System.Collections.Generic.IEnumerable<FileParameter> files = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (ticketId == null) | |
throw new System.ArgumentNullException("ticketId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/ticketing/ticket/{ticketId}/comment"); | |
urlBuilder_.Replace("{ticketId}", System.Uri.EscapeDataString(ConvertToString(ticketId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var boundary_ = System.Guid.NewGuid().ToString(); | |
var content_ = new System.Net.Http.MultipartFormDataContent(boundary_); | |
content_.Headers.Remove("Content-Type"); | |
content_.Headers.TryAddWithoutValidation("Content-Type", "multipart/form-data; boundary=" + boundary_); | |
if (comment == null) | |
throw new System.ArgumentNullException("comment"); | |
else | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(comment, _settings.Value); | |
content_.Add(new System.Net.Http.StringContent(json_), "comment"); | |
} | |
if (files == null) | |
throw new System.ArgumentNullException("files"); | |
else | |
{ | |
foreach (var item_ in files) | |
{ | |
var content_files_ = new System.Net.Http.StreamContent(item_.Data); | |
if (!string.IsNullOrEmpty(item_.ContentType)) | |
content_files_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse(item_.ContentType); | |
content_.Add(content_files_, "files", item_.FileName ?? "files"); | |
} | |
} | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("POST"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
return default(void)!; | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Retrieve attachment | |
/// </summary> | |
/// <remarks> | |
/// Returns attachment (image, document) | |
/// </remarks> | |
/// <param name="id">Attachment identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual FileResponse GetAttachment(string id) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetAttachmentAsync(id, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Retrieve attachment | |
/// </summary> | |
/// <remarks> | |
/// Returns attachment (image, document) | |
/// </remarks> | |
/// <param name="id">Attachment identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<FileResponse> GetAttachmentAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/attachment/{id}"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
return default(FileResponse)!; | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Backup jobs | |
/// </summary> | |
/// <remarks> | |
/// Returns list of backup jobs | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ddf">Deleted device filter</param> | |
/// <param name="sf">Backup job status filter</param> | |
/// <param name="ptf">Backup job planType filter</param> | |
/// <param name="stf">Backup job startTime filter</param> | |
/// <param name="include">Which devices include (active|deleted|all) default value active</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>Returns a backup job report</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual BackupJobReport GetBackupJobs(string? df = null, string? ddf = null, string? sf = null, string? ptf = null, string? stf = null, string? include = null, string? cursor = null, int? pageSize = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetBackupJobsAsync(df, ddf, sf, ptf, stf, include, cursor, pageSize, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Backup jobs | |
/// </summary> | |
/// <remarks> | |
/// Returns list of backup jobs | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ddf">Deleted device filter</param> | |
/// <param name="sf">Backup job status filter</param> | |
/// <param name="ptf">Backup job planType filter</param> | |
/// <param name="stf">Backup job startTime filter</param> | |
/// <param name="include">Which devices include (active|deleted|all) default value active</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>Returns a backup job report</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<BackupJobReport> GetBackupJobsAsync(string? df = null, string? ddf = null, string? sf = null, string? ptf = null, string? stf = null, string? include = null, string? cursor = null, int? pageSize = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/backup/jobs?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (ddf != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("ddf") + "=").Append(System.Uri.EscapeDataString(ConvertToString(ddf, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (sf != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("sf") + "=").Append(System.Uri.EscapeDataString(ConvertToString(sf, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (ptf != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("ptf") + "=").Append(System.Uri.EscapeDataString(ConvertToString(ptf, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (stf != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("stf") + "=").Append(System.Uri.EscapeDataString(ConvertToString(stf, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (include != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("include") + "=").Append(System.Uri.EscapeDataString(ConvertToString(include, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<BackupJobReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Device custom fields | |
/// </summary> | |
/// <remarks> | |
/// Returns list of device custom fields | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="withInheritance">Retrieve values using definition scope hierarchy</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.IDictionary<string, object> GetNodeCustomFields(int id, bool? withInheritance = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetNodeCustomFieldsAsync(id, withInheritance, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Device custom fields | |
/// </summary> | |
/// <remarks> | |
/// Returns list of device custom fields | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="withInheritance">Retrieve values using definition scope hierarchy</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.IDictionary<string, object>> GetNodeCustomFieldsAsync(int id, bool? withInheritance = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/custom-fields?"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
if (withInheritance != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("withInheritance") + "=").Append(System.Uri.EscapeDataString(ConvertToString(withInheritance, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.IDictionary<string, object>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Update Field Values | |
/// </summary> | |
/// <remarks> | |
/// Update device custom field values | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual FileResponse UpdateNodeAttributeValues(int id, System.Collections.Generic.IDictionary<string, object>? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await UpdateNodeAttributeValuesAsync(id, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Update Field Values | |
/// </summary> | |
/// <remarks> | |
/// Update device custom field values | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<FileResponse> UpdateNodeAttributeValuesAsync(int id, System.Collections.Generic.IDictionary<string, object>? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/custom-fields"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("PATCH"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
return default(FileResponse)!; | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Last logged-on user information | |
/// </summary> | |
/// <remarks> | |
/// Returns username that was last to login to device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual LoggedOnUser GetDeviceLastLoggedOnUser(int id) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDeviceLastLoggedOnUserAsync(id, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Last logged-on user information | |
/// </summary> | |
/// <remarks> | |
/// Returns username that was last to login to device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<LoggedOnUser> GetDeviceLastLoggedOnUserAsync(int id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/last-logged-on-user"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<LoggedOnUser>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// OS Patches | |
/// </summary> | |
/// <remarks> | |
/// Returns list of pending/rejected/approved OS patches for device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="status">Patch Status filter</param> | |
/// <param name="type">Patch Type filter</param> | |
/// <param name="severity">Patch Severity filter</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<OSPatch> GetDevicePendingFailedRejectedOSPatches(int id, string? status = null, string? type = null, string? severity = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDevicePendingFailedRejectedOSPatchesAsync(id, status, type, severity, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// OS Patches | |
/// </summary> | |
/// <remarks> | |
/// Returns list of pending/rejected/approved OS patches for device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="status">Patch Status filter</param> | |
/// <param name="type">Patch Type filter</param> | |
/// <param name="severity">Patch Severity filter</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<OSPatch>> GetDevicePendingFailedRejectedOSPatchesAsync(int id, string? status = null, string? type = null, string? severity = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/os-patches?"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
if (status != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("status") + "=").Append(System.Uri.EscapeDataString(ConvertToString(status, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (type != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("type") + "=").Append(System.Uri.EscapeDataString(ConvertToString(type, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (severity != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("severity") + "=").Append(System.Uri.EscapeDataString(ConvertToString(severity, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<OSPatch>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// OS Patch installation report for device | |
/// </summary> | |
/// <remarks> | |
/// Returns patch installation history records (successful and failed) for device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="status">Patch Status filter (FAILED, INSTALLED)</param> | |
/// <param name="installedBefore">Include patches installed before specified date</param> | |
/// <param name="installedAfter">Include patches installed after specified date</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<OSPatch> GetDeviceInstalledOSPatches(int id, string? status = null, string? installedBefore = null, string? installedAfter = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDeviceInstalledOSPatchesAsync(id, status, installedBefore, installedAfter, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// OS Patch installation report for device | |
/// </summary> | |
/// <remarks> | |
/// Returns patch installation history records (successful and failed) for device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="status">Patch Status filter (FAILED, INSTALLED)</param> | |
/// <param name="installedBefore">Include patches installed before specified date</param> | |
/// <param name="installedAfter">Include patches installed after specified date</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<OSPatch>> GetDeviceInstalledOSPatchesAsync(int id, string? status = null, string? installedBefore = null, string? installedAfter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/os-patch-installs?"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
if (status != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("status") + "=").Append(System.Uri.EscapeDataString(ConvertToString(status, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (installedBefore != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("installedBefore") + "=").Append(System.Uri.EscapeDataString(ConvertToString(installedBefore, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (installedAfter != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("installedAfter") + "=").Append(System.Uri.EscapeDataString(ConvertToString(installedAfter, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<OSPatch>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Software Patch history for device | |
/// </summary> | |
/// <remarks> | |
/// Returns 3rd party software patch installation history records for device (successful and failed) | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="type">Patch Type filter</param> | |
/// <param name="impact">Patch Impact filter</param> | |
/// <param name="status">Patch Status filter</param> | |
/// <param name="productIdentifier">Product Identifier</param> | |
/// <param name="installedBefore">Include patches installed before specified date</param> | |
/// <param name="installedAfter">Include patches installed after specified date</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<SoftwarePatch> GetDeviceInstalledSoftwarePatches(int id, string? type = null, string? impact = null, string? status = null, string? productIdentifier = null, string? installedBefore = null, string? installedAfter = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDeviceInstalledSoftwarePatchesAsync(id, type, impact, status, productIdentifier, installedBefore, installedAfter, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Software Patch history for device | |
/// </summary> | |
/// <remarks> | |
/// Returns 3rd party software patch installation history records for device (successful and failed) | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="type">Patch Type filter</param> | |
/// <param name="impact">Patch Impact filter</param> | |
/// <param name="status">Patch Status filter</param> | |
/// <param name="productIdentifier">Product Identifier</param> | |
/// <param name="installedBefore">Include patches installed before specified date</param> | |
/// <param name="installedAfter">Include patches installed after specified date</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<SoftwarePatch>> GetDeviceInstalledSoftwarePatchesAsync(int id, string? type = null, string? impact = null, string? status = null, string? productIdentifier = null, string? installedBefore = null, string? installedAfter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/software-patch-installs?"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
if (type != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("type") + "=").Append(System.Uri.EscapeDataString(ConvertToString(type, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (impact != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("impact") + "=").Append(System.Uri.EscapeDataString(ConvertToString(impact, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (status != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("status") + "=").Append(System.Uri.EscapeDataString(ConvertToString(status, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (productIdentifier != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("productIdentifier") + "=").Append(System.Uri.EscapeDataString(ConvertToString(productIdentifier, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (installedBefore != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("installedBefore") + "=").Append(System.Uri.EscapeDataString(ConvertToString(installedBefore, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (installedAfter != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("installedAfter") + "=").Append(System.Uri.EscapeDataString(ConvertToString(installedAfter, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<SoftwarePatch>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Modify Windows Service configuration | |
/// </summary> | |
/// <remarks> | |
/// Configures Windows Service startup settings | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="serviceId">Service identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual FileResponse SetWindowsServiceConfiguration(int id, string serviceId, WindowsServiceConfiguration? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await SetWindowsServiceConfigurationAsync(id, serviceId, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Modify Windows Service configuration | |
/// </summary> | |
/// <remarks> | |
/// Configures Windows Service startup settings | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="serviceId">Service identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<FileResponse> SetWindowsServiceConfigurationAsync(int id, string serviceId, WindowsServiceConfiguration? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
if (serviceId == null) | |
throw new System.ArgumentNullException("serviceId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/windows-service/{serviceId}/configure"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
urlBuilder_.Replace("{serviceId}", System.Uri.EscapeDataString(ConvertToString(serviceId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("POST"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
return default(FileResponse)!; | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Device network interfaces | |
/// </summary> | |
/// <remarks> | |
/// Returns device network interfaces' details | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<NetworkInterface> GetDeviceNetworkInterfaces(int id) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDeviceNetworkInterfacesAsync(id, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Device network interfaces | |
/// </summary> | |
/// <remarks> | |
/// Returns device network interfaces' details | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<NetworkInterface>> GetDeviceNetworkInterfacesAsync(int id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/network-interfaces"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<NetworkInterface>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Device details | |
/// </summary> | |
/// <remarks> | |
/// Returns device details | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>Device information</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual Device GetDevice(int id) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDeviceAsync(id, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Device details | |
/// </summary> | |
/// <remarks> | |
/// Returns device details | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>Device information</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<Device> GetDeviceAsync(int id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<Device>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Update device information | |
/// </summary> | |
/// <remarks> | |
/// Change device friendly name, user data, etc. | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual FileResponse UpdateDevice(int id, DeviceMutableProperties? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await UpdateDeviceAsync(id, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Update device information | |
/// </summary> | |
/// <remarks> | |
/// Change device friendly name, user data, etc. | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<FileResponse> UpdateDeviceAsync(int id, DeviceMutableProperties? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("PATCH"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
return default(FileResponse)!; | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Run script or built-in action | |
/// </summary> | |
/// <remarks> | |
/// Run script or built-in action on a device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual FileResponse RunScriptOnDevice(int id, RunScriptRequest? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await RunScriptOnDeviceAsync(id, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Run script or built-in action | |
/// </summary> | |
/// <remarks> | |
/// Run script or built-in action on a device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<FileResponse> RunScriptOnDeviceAsync(int id, RunScriptRequest? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/script/run"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("POST"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
return default(FileResponse)!; | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Device activities | |
/// </summary> | |
/// <remarks> | |
/// Returns activity log for device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="olderThan">Return activities recorded that are newer than specified activity ID</param> | |
/// <param name="newerThan">Return activities recorded that are older than specified activity ID</param> | |
/// <param name="activityType">Return activities of type</param> | |
/// <param name="status">Return activities with status(es)</param> | |
/// <param name="seriesUid">Return activities related to alert (series)</param> | |
/// <param name="pageSize">Limit number of activities to return</param> | |
/// <param name="lang">Language tag</param> | |
/// <param name="tz">Time Zone</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual NodeActivitiesResponse GetDeviceActivities(int id, int? olderThan = null, int? newerThan = null, string? activityType = null, string? status = null, string? seriesUid = null, int? pageSize = null, string? lang = null, string? tz = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDeviceActivitiesAsync(id, olderThan, newerThan, activityType, status, seriesUid, pageSize, lang, tz, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Device activities | |
/// </summary> | |
/// <remarks> | |
/// Returns activity log for device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="olderThan">Return activities recorded that are newer than specified activity ID</param> | |
/// <param name="newerThan">Return activities recorded that are older than specified activity ID</param> | |
/// <param name="activityType">Return activities of type</param> | |
/// <param name="status">Return activities with status(es)</param> | |
/// <param name="seriesUid">Return activities related to alert (series)</param> | |
/// <param name="pageSize">Limit number of activities to return</param> | |
/// <param name="lang">Language tag</param> | |
/// <param name="tz">Time Zone</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<NodeActivitiesResponse> GetDeviceActivitiesAsync(int id, int? olderThan = null, int? newerThan = null, string? activityType = null, string? status = null, string? seriesUid = null, int? pageSize = null, string? lang = null, string? tz = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/activities?"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
if (olderThan != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("olderThan") + "=").Append(System.Uri.EscapeDataString(ConvertToString(olderThan, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (newerThan != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("newerThan") + "=").Append(System.Uri.EscapeDataString(ConvertToString(newerThan, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (activityType != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("activityType") + "=").Append(System.Uri.EscapeDataString(ConvertToString(activityType, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (status != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("status") + "=").Append(System.Uri.EscapeDataString(ConvertToString(status, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (seriesUid != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("seriesUid") + "=").Append(System.Uri.EscapeDataString(ConvertToString(seriesUid, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (lang != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("lang") + "=").Append(System.Uri.EscapeDataString(ConvertToString(lang, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (tz != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("tz") + "=").Append(System.Uri.EscapeDataString(ConvertToString(tz, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<NodeActivitiesResponse>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Device disk drives | |
/// </summary> | |
/// <remarks> | |
/// Returns device disks' details | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<DiskDrive> GetDeviceDiskDrives(int id) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDeviceDiskDrivesAsync(id, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Device disk drives | |
/// </summary> | |
/// <remarks> | |
/// Returns device disks' details | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<DiskDrive>> GetDeviceDiskDrivesAsync(int id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/disks"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<DiskDrive>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Device storage volumes | |
/// </summary> | |
/// <remarks> | |
/// Returns device volumes' details | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="include">Additional information to include (bl - BitLocker status)</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<Volume> GetDeviceVolumes(int id, string? include = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDeviceVolumesAsync(id, include, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Device storage volumes | |
/// </summary> | |
/// <remarks> | |
/// Returns device volumes' details | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="include">Additional information to include (bl - BitLocker status)</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Volume>> GetDeviceVolumesAsync(int id, string? include = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/volumes?"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
if (include != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("include") + "=").Append(System.Uri.EscapeDataString(ConvertToString(include, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<Volume>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Device processors | |
/// </summary> | |
/// <remarks> | |
/// Returns list of device Processor details | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<Processor> GetDeviceProcessors(int id) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDeviceProcessorsAsync(id, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Device processors | |
/// </summary> | |
/// <remarks> | |
/// Returns list of device Processor details | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Processor>> GetDeviceProcessorsAsync(int id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/processors"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<Processor>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Device software inventory | |
/// </summary> | |
/// <remarks> | |
/// Returns list of software installed on device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<Application> GetDeviceSoftware(int id) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDeviceSoftwareAsync(id, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Device software inventory | |
/// </summary> | |
/// <remarks> | |
/// Returns list of software installed on device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Application>> GetDeviceSoftwareAsync(int id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/software"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<Application>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Device alerts (triggered conditions) | |
/// </summary> | |
/// <remarks> | |
/// Returns list of active alerts (triggered conditions) for device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="tz">Time Zone</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<Alert> GetDeviceAlerts(int id, string? lang = null, string? tz = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDeviceAlertsAsync(id, lang, tz, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Device alerts (triggered conditions) | |
/// </summary> | |
/// <remarks> | |
/// Returns list of active alerts (triggered conditions) for device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="tz">Time Zone</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Alert>> GetDeviceAlertsAsync(int id, string? lang = null, string? tz = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/alerts?"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
if (lang != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("lang") + "=").Append(System.Uri.EscapeDataString(ConvertToString(lang, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (tz != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("tz") + "=").Append(System.Uri.EscapeDataString(ConvertToString(tz, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<Alert>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Device currently running (active) jobs | |
/// </summary> | |
/// <remarks> | |
/// Returns currently running jobs for device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="tz">Time Zone</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<Job> GetDeviceActiveJobs(int id, string? lang = null, string? tz = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDeviceActiveJobsAsync(id, lang, tz, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Device currently running (active) jobs | |
/// </summary> | |
/// <remarks> | |
/// Returns currently running jobs for device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="tz">Time Zone</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Job>> GetDeviceActiveJobsAsync(int id, string? lang = null, string? tz = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/jobs?"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
if (lang != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("lang") + "=").Append(System.Uri.EscapeDataString(ConvertToString(lang, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (tz != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("tz") + "=").Append(System.Uri.EscapeDataString(ConvertToString(tz, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<Job>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Windows services | |
/// </summary> | |
/// <remarks> | |
/// Returns list of Windows Services and their statuses | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="name">Service name</param> | |
/// <param name="state">Service state</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<WindowsService> GetDeviceServices(int id, string? name = null, State? state = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDeviceServicesAsync(id, name, state, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Windows services | |
/// </summary> | |
/// <remarks> | |
/// Returns list of Windows Services and their statuses | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="name">Service name</param> | |
/// <param name="state">Service state</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<WindowsService>> GetDeviceServicesAsync(int id, string? name = null, State? state = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/windows-services?"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
if (name != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("name") + "=").Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (state != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("state") + "=").Append(System.Uri.EscapeDataString(ConvertToString(state, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<WindowsService>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Device link | |
/// </summary> | |
/// <remarks> | |
/// Returns link to device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="redirect">Return redirect response</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual DeviceLink GetDeviceLink(int id, bool? redirect = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDeviceLinkAsync(id, redirect, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Device link | |
/// </summary> | |
/// <remarks> | |
/// Returns link to device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="redirect">Return redirect response</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<DeviceLink> GetDeviceLinkAsync(int id, bool? redirect = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/dashboard-url?"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
if (redirect != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("redirect") + "=").Append(System.Uri.EscapeDataString(ConvertToString(redirect, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<DeviceLink>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Get summary of device policy overrides | |
/// </summary> | |
/// <remarks> | |
/// Returns list of overridden policy sections | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual PolicyOverrides GetPolicyOverrides(int id) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetPolicyOverridesAsync(id, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Get summary of device policy overrides | |
/// </summary> | |
/// <remarks> | |
/// Returns list of overridden policy sections | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<PolicyOverrides> GetPolicyOverridesAsync(int id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/policy/overrides"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<PolicyOverrides>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Reset device policy overrides | |
/// </summary> | |
/// <remarks> | |
/// Submit request to remove device policy overrides | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual void ResetPolicyOverrides(int id) | |
{ | |
System.Threading.Tasks.Task.Run(async () => await ResetPolicyOverridesAsync(id, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Reset device policy overrides | |
/// </summary> | |
/// <remarks> | |
/// Submit request to remove device policy overrides | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task ResetPolicyOverridesAsync(int id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/policy/overrides"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("DELETE"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
return default(void)!; | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Device scripting options | |
/// </summary> | |
/// <remarks> | |
/// Returns scripting options (built-in actions, custom scripts) available for device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="lang">Language</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual DeviceScriptingOptions RequestScriptingOptions(int id, string? lang = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await RequestScriptingOptionsAsync(id, lang, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Device scripting options | |
/// </summary> | |
/// <remarks> | |
/// Returns scripting options (built-in actions, custom scripts) available for device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="lang">Language</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<DeviceScriptingOptions> RequestScriptingOptionsAsync(int id, string? lang = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/scripting/options?"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
if (lang != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("lang") + "=").Append(System.Uri.EscapeDataString(ConvertToString(lang, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<DeviceScriptingOptions>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Windows service control | |
/// </summary> | |
/// <remarks> | |
/// Start/Stop/Restart Windows Service on a device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="serviceId">Service identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual FileResponse ControlWindowsService(int id, string serviceId, WindowsServiceControlRequest? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await ControlWindowsServiceAsync(id, serviceId, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Windows service control | |
/// </summary> | |
/// <remarks> | |
/// Start/Stop/Restart Windows Service on a device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="serviceId">Service identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<FileResponse> ControlWindowsServiceAsync(int id, string serviceId, WindowsServiceControlRequest? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
if (serviceId == null) | |
throw new System.ArgumentNullException("serviceId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/windows-service/{serviceId}/control"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
urlBuilder_.Replace("{serviceId}", System.Uri.EscapeDataString(ConvertToString(serviceId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("POST"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
return default(FileResponse)!; | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Reboot device | |
/// </summary> | |
/// <remarks> | |
/// Sends a command to restart the computer | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="mode">Reboot mode</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual FileResponse RebootDevices(int id, Mode2 mode, RebootRequest? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await RebootDevicesAsync(id, mode, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Reboot device | |
/// </summary> | |
/// <remarks> | |
/// Sends a command to restart the computer | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="mode">Reboot mode</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<FileResponse> RebootDevicesAsync(int id, Mode2 mode, RebootRequest? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
if (mode == null) | |
throw new System.ArgumentNullException("mode"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/reboot/{mode}"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
urlBuilder_.Replace("{mode}", System.Uri.EscapeDataString(ConvertToString(mode, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("POST"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
return default(FileResponse)!; | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Schedule maintenance | |
/// </summary> | |
/// <remarks> | |
/// Schedule maintenance window for device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual FileResponse UpdateDeviceMaintenance(int id, MaintenanceSettings? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await UpdateDeviceMaintenanceAsync(id, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Schedule maintenance | |
/// </summary> | |
/// <remarks> | |
/// Schedule maintenance window for device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<FileResponse> UpdateDeviceMaintenanceAsync(int id, MaintenanceSettings? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/maintenance"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("PUT"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
return default(FileResponse)!; | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Cancel maintenance | |
/// </summary> | |
/// <remarks> | |
/// Cancel pending or active maintenance for device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual void CancelDeviceMaintenance(int id) | |
{ | |
System.Threading.Tasks.Task.Run(async () => await CancelDeviceMaintenanceAsync(id, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Cancel maintenance | |
/// </summary> | |
/// <remarks> | |
/// Cancel pending or active maintenance for device | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task CancelDeviceMaintenanceAsync(int id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/maintenance"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("DELETE"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
return default(void)!; | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Pending, Failed and Rejected Software patches for device | |
/// </summary> | |
/// <remarks> | |
/// Returns list of 3rd party Software patches for a device (for which there were no installation attempts) | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="status">Patch Status filter</param> | |
/// <param name="productIdentifier">Product Identifier</param> | |
/// <param name="type">Patch Type filter</param> | |
/// <param name="impact">Patch Impact filter</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<SoftwarePatch> GetDevicePendingFailedRejectedSoftwarePatches(int id, string? status = null, string? productIdentifier = null, string? type = null, string? impact = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDevicePendingFailedRejectedSoftwarePatchesAsync(id, status, productIdentifier, type, impact, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Pending, Failed and Rejected Software patches for device | |
/// </summary> | |
/// <remarks> | |
/// Returns list of 3rd party Software patches for a device (for which there were no installation attempts) | |
/// </remarks> | |
/// <param name="id">Device identifier</param> | |
/// <param name="status">Patch Status filter</param> | |
/// <param name="productIdentifier">Product Identifier</param> | |
/// <param name="type">Patch Type filter</param> | |
/// <param name="impact">Patch Impact filter</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<SoftwarePatch>> GetDevicePendingFailedRejectedSoftwarePatchesAsync(int id, string? status = null, string? productIdentifier = null, string? type = null, string? impact = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device/{id}/software-patches?"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
if (status != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("status") + "=").Append(System.Uri.EscapeDataString(ConvertToString(status, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (productIdentifier != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("productIdentifier") + "=").Append(System.Uri.EscapeDataString(ConvertToString(productIdentifier, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (type != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("type") + "=").Append(System.Uri.EscapeDataString(ConvertToString(type, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (impact != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("impact") + "=").Append(System.Uri.EscapeDataString(ConvertToString(impact, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<SoftwarePatch>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Group members | |
/// </summary> | |
/// <remarks> | |
/// Returns list of device identifiers that match group criteria | |
/// </remarks> | |
/// <param name="id">Group identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<int> GetGroupDeviceIds(int id) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetGroupDeviceIdsAsync(id, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Group members | |
/// </summary> | |
/// <remarks> | |
/// Returns list of device identifiers that match group criteria | |
/// </remarks> | |
/// <param name="id">Group identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<int>> GetGroupDeviceIdsAsync(int id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/group/{id}/device-ids"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<int>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Organization information | |
/// </summary> | |
/// <remarks> | |
/// Returns organization details (policy mappings, locations) | |
/// </remarks> | |
/// <param name="id">Organization identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual OrganizationDetailed GetOrganization(int id) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetOrganizationAsync(id, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Organization information | |
/// </summary> | |
/// <remarks> | |
/// Returns organization details (policy mappings, locations) | |
/// </remarks> | |
/// <param name="id">Organization identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<OrganizationDetailed> GetOrganizationAsync(int id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/{id}"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<OrganizationDetailed>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Update organization | |
/// </summary> | |
/// <remarks> | |
/// Change organization name, description and policy mappings | |
/// </remarks> | |
/// <param name="id">Organization identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual FileResponse UpdateOrganization(int id, OrganizationModel? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await UpdateOrganizationAsync(id, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Update organization | |
/// </summary> | |
/// <remarks> | |
/// Change organization name, description and policy mappings | |
/// </remarks> | |
/// <param name="id">Organization identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<FileResponse> UpdateOrganizationAsync(int id, OrganizationModel? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/{id}"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("PATCH"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
return default(FileResponse)!; | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Organization locations backup usage | |
/// </summary> | |
/// <remarks> | |
/// Returns a list of locations backup usage | |
/// </remarks> | |
/// <param name="id">Organization identifier</param> | |
/// <returns>Returns list of locations backup usage</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<LocationBackupUsageSummary> GetOrganizationLocationUsage(string id) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetOrganizationLocationUsageAsync(id, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Organization locations backup usage | |
/// </summary> | |
/// <remarks> | |
/// Returns a list of locations backup usage | |
/// </remarks> | |
/// <param name="id">Organization identifier</param> | |
/// <returns>Returns list of locations backup usage</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<LocationBackupUsageSummary>> GetOrganizationLocationUsageAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/{id}/locations/backup/usage"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<LocationBackupUsageSummary>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Organization locations | |
/// </summary> | |
/// <remarks> | |
/// Returns list of locations for organization | |
/// </remarks> | |
/// <param name="id">Organization identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<Location> GetOrganizationLocations(int id) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetOrganizationLocationsAsync(id, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Organization locations | |
/// </summary> | |
/// <remarks> | |
/// Returns list of locations for organization | |
/// </remarks> | |
/// <param name="id">Organization identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Location>> GetOrganizationLocationsAsync(int id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/{id}/locations"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<Location>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Add new location to organization | |
/// </summary> | |
/// <remarks> | |
/// Creates new location for organization | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual Location CreateLocationForOrganization(int id, LocationModel? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await CreateLocationForOrganizationAsync(id, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Add new location to organization | |
/// </summary> | |
/// <remarks> | |
/// Creates new location for organization | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<Location> CreateLocationForOrganizationAsync(int id, LocationModel? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/{id}/locations"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("POST"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<Location>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Update location | |
/// </summary> | |
/// <remarks> | |
/// Change location name, address, description, custom data | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual Location UpdateLocation(int id, int locationId, LocationModel? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await UpdateLocationAsync(id, locationId, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Update location | |
/// </summary> | |
/// <remarks> | |
/// Change location name, address, description, custom data | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<Location> UpdateLocationAsync(int id, int locationId, LocationModel? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
if (locationId == null) | |
throw new System.ArgumentNullException("locationId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/{id}/locations/{locationId}"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
urlBuilder_.Replace("{locationId}", System.Uri.EscapeDataString(ConvertToString(locationId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("PATCH"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<Location>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List users | |
/// </summary> | |
/// <remarks> | |
/// Returns list of end-users for organization | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<User> GetEndUsers(int id) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetEndUsersAsync(id, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List users | |
/// </summary> | |
/// <remarks> | |
/// Returns list of end-users for organization | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<User>> GetEndUsersAsync(int id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/{id}/end-users"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<User>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Organization devices | |
/// </summary> | |
/// <remarks> | |
/// Returns list of devices for organization | |
/// </remarks> | |
/// <param name="id">Organization identifier</param> | |
/// <param name="pageSize">Limit number of devices to return</param> | |
/// <param name="after">Last Node ID from previous page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<NodeWithDetailedReferences> GetOrganizationDevices(int id, int? pageSize = null, int? after = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetOrganizationDevicesAsync(id, pageSize, after, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Organization devices | |
/// </summary> | |
/// <remarks> | |
/// Returns list of devices for organization | |
/// </remarks> | |
/// <param name="id">Organization identifier</param> | |
/// <param name="pageSize">Limit number of devices to return</param> | |
/// <param name="after">Last Node ID from previous page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<NodeWithDetailedReferences>> GetOrganizationDevicesAsync(int id, int? pageSize = null, int? after = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/{id}/devices?"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (after != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("after") + "=").Append(System.Uri.EscapeDataString(ConvertToString(after, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<NodeWithDetailedReferences>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Organization location backup usage | |
/// </summary> | |
/// <remarks> | |
/// Returns a location backup usage | |
/// </remarks> | |
/// <param name="id">Organization identifier</param> | |
/// <param name="locationId">Location identifier</param> | |
/// <returns>Returns a location backup usage</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual LocationBackupUsageSummary GetLocationUsage(int id, int locationId) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetLocationUsageAsync(id, locationId, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Organization location backup usage | |
/// </summary> | |
/// <remarks> | |
/// Returns a location backup usage | |
/// </remarks> | |
/// <param name="id">Organization identifier</param> | |
/// <param name="locationId">Location identifier</param> | |
/// <returns>Returns a location backup usage</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<LocationBackupUsageSummary> GetLocationUsageAsync(int id, int locationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
if (locationId == null) | |
throw new System.ArgumentNullException("locationId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/{id}/locations/{locationId}/backup/usage"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
urlBuilder_.Replace("{locationId}", System.Uri.EscapeDataString(ConvertToString(locationId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<LocationBackupUsageSummary>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Generate installer | |
/// </summary> | |
/// <remarks> | |
/// Generates and returns URL for installer for specified organization/location | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual Link GetInstallerForLocation(int id, int location_id, Installer_type installer_type) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetInstallerForLocationAsync(id, location_id, installer_type, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Generate installer | |
/// </summary> | |
/// <remarks> | |
/// Generates and returns URL for installer for specified organization/location | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<Link> GetInstallerForLocationAsync(int id, int location_id, Installer_type installer_type, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
if (location_id == null) | |
throw new System.ArgumentNullException("location_id"); | |
if (installer_type == null) | |
throw new System.ArgumentNullException("installer_type"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/{id}/location/{location_id}/installer/{installer_type}"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
urlBuilder_.Replace("{location_id}", System.Uri.EscapeDataString(ConvertToString(location_id, System.Globalization.CultureInfo.InvariantCulture))); | |
urlBuilder_.Replace("{installer_type}", System.Uri.EscapeDataString(ConvertToString(installer_type, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<Link>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Generate installer | |
/// </summary> | |
/// <remarks> | |
/// Generates and returns URL for installer with specified settings | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual Link GetInstaller(GenerateInstallerRequestDto? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetInstallerAsync(body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Generate installer | |
/// </summary> | |
/// <remarks> | |
/// Generates and returns URL for installer with specified settings | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<Link> GetInstallerAsync(GenerateInstallerRequestDto? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/generate-installer"); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("POST"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<Link>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Change organization policy mappings | |
/// </summary> | |
/// <remarks> | |
/// Update policy assignment for node role(s). Returns list of affected device IDs | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<int> UpdateNodeRolePolicyAssignmentForOrganization(int id, System.Collections.Generic.IEnumerable<NodeRolePolicyAssignment>? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await UpdateNodeRolePolicyAssignmentForOrganizationAsync(id, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Change organization policy mappings | |
/// </summary> | |
/// <remarks> | |
/// Update policy assignment for node role(s). Returns list of affected device IDs | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<int>> UpdateNodeRolePolicyAssignmentForOrganizationAsync(int id, System.Collections.Generic.IEnumerable<NodeRolePolicyAssignment>? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/{id}/policies"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("PUT"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<int>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List Network Interfaces | |
/// </summary> | |
/// <remarks> | |
/// Returns list of Network Interfaces for each device | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual NetworkInterfacesReport GetNetworkInterfaces(string? df = null, string? cursor = null, int? pageSize = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetNetworkInterfacesAsync(df, cursor, pageSize, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List Network Interfaces | |
/// </summary> | |
/// <remarks> | |
/// Returns list of Network Interfaces for each device | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<NetworkInterfacesReport> GetNetworkInterfacesAsync(string? df = null, string? cursor = null, int? pageSize = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/network-interfaces?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<NetworkInterfacesReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Pending, Failed and Rejected OS patches report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of OS patches for which there were no installation attempts | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="status">Patch Status filter</param> | |
/// <param name="type">Patch Type filter</param> | |
/// <param name="severity">Patch Severity filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual OSPatchReport GetPendingFailedRejectedOSPatches(string? df = null, string? ts = null, string? status = null, string? type = null, string? severity = null, string? cursor = null, int? pageSize = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetPendingFailedRejectedOSPatchesAsync(df, ts, status, type, severity, cursor, pageSize, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Pending, Failed and Rejected OS patches report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of OS patches for which there were no installation attempts | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="status">Patch Status filter</param> | |
/// <param name="type">Patch Type filter</param> | |
/// <param name="severity">Patch Severity filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<OSPatchReport> GetPendingFailedRejectedOSPatchesAsync(string? df = null, string? ts = null, string? status = null, string? type = null, string? severity = null, string? cursor = null, int? pageSize = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/os-patches?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (ts != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("ts") + "=").Append(System.Uri.EscapeDataString(ConvertToString(ts, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (status != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("status") + "=").Append(System.Uri.EscapeDataString(ConvertToString(status, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (type != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("type") + "=").Append(System.Uri.EscapeDataString(ConvertToString(type, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (severity != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("severity") + "=").Append(System.Uri.EscapeDataString(ConvertToString(severity, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<OSPatchReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Pending, Failed and Rejected Software patches report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of 3rd party Software patches for which there were no installation attempts | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="status">Patch Status filter</param> | |
/// <param name="productIdentifier">Product Identifier</param> | |
/// <param name="type">Patch Type filter</param> | |
/// <param name="impact">Patch Impact filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual SoftwarePatchReport GetPendingFailedRejectedSoftwarePatches(string? df = null, string? ts = null, string? status = null, string? productIdentifier = null, string? type = null, string? impact = null, string? cursor = null, int? pageSize = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetPendingFailedRejectedSoftwarePatchesAsync(df, ts, status, productIdentifier, type, impact, cursor, pageSize, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Pending, Failed and Rejected Software patches report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of 3rd party Software patches for which there were no installation attempts | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="status">Patch Status filter</param> | |
/// <param name="productIdentifier">Product Identifier</param> | |
/// <param name="type">Patch Type filter</param> | |
/// <param name="impact">Patch Impact filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<SoftwarePatchReport> GetPendingFailedRejectedSoftwarePatchesAsync(string? df = null, string? ts = null, string? status = null, string? productIdentifier = null, string? type = null, string? impact = null, string? cursor = null, int? pageSize = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/software-patches?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (ts != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("ts") + "=").Append(System.Uri.EscapeDataString(ConvertToString(ts, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (status != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("status") + "=").Append(System.Uri.EscapeDataString(ConvertToString(status, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (productIdentifier != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("productIdentifier") + "=").Append(System.Uri.EscapeDataString(ConvertToString(productIdentifier, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (type != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("type") + "=").Append(System.Uri.EscapeDataString(ConvertToString(type, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (impact != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("impact") + "=").Append(System.Uri.EscapeDataString(ConvertToString(impact, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<SoftwarePatchReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Software Patch history report | |
/// </summary> | |
/// <remarks> | |
/// Returns 3rd party software patch installation history records (successful and failed) | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="type">Patch Type filter</param> | |
/// <param name="impact">Patch Impact filter</param> | |
/// <param name="status">Patch Status filter</param> | |
/// <param name="productIdentifier">Product Identifier</param> | |
/// <param name="installedBefore">Include patches installed before specified date</param> | |
/// <param name="installedAfter">Include patches installed after specified date</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual SoftwarePatchReport GetInstalledSoftwarePatches(string? df = null, string? type = null, string? impact = null, string? status = null, string? productIdentifier = null, string? installedBefore = null, string? installedAfter = null, string? cursor = null, int? pageSize = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetInstalledSoftwarePatchesAsync(df, type, impact, status, productIdentifier, installedBefore, installedAfter, cursor, pageSize, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Software Patch history report | |
/// </summary> | |
/// <remarks> | |
/// Returns 3rd party software patch installation history records (successful and failed) | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="type">Patch Type filter</param> | |
/// <param name="impact">Patch Impact filter</param> | |
/// <param name="status">Patch Status filter</param> | |
/// <param name="productIdentifier">Product Identifier</param> | |
/// <param name="installedBefore">Include patches installed before specified date</param> | |
/// <param name="installedAfter">Include patches installed after specified date</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<SoftwarePatchReport> GetInstalledSoftwarePatchesAsync(string? df = null, string? type = null, string? impact = null, string? status = null, string? productIdentifier = null, string? installedBefore = null, string? installedAfter = null, string? cursor = null, int? pageSize = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/software-patch-installs?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (type != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("type") + "=").Append(System.Uri.EscapeDataString(ConvertToString(type, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (impact != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("impact") + "=").Append(System.Uri.EscapeDataString(ConvertToString(impact, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (status != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("status") + "=").Append(System.Uri.EscapeDataString(ConvertToString(status, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (productIdentifier != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("productIdentifier") + "=").Append(System.Uri.EscapeDataString(ConvertToString(productIdentifier, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (installedBefore != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("installedBefore") + "=").Append(System.Uri.EscapeDataString(ConvertToString(installedBefore, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (installedAfter != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("installedAfter") + "=").Append(System.Uri.EscapeDataString(ConvertToString(installedAfter, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<SoftwarePatchReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Last logged-on user report | |
/// </summary> | |
/// <remarks> | |
/// Returns usernames and logon times | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual LoggedOnUsersReport GetLastLoggedOnUsersReport(string? df = null, string? cursor = null, int? pageSize = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetLastLoggedOnUsersReportAsync(df, cursor, pageSize, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Last logged-on user report | |
/// </summary> | |
/// <remarks> | |
/// Returns usernames and logon times | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<LoggedOnUsersReport> GetLastLoggedOnUsersReportAsync(string? df = null, string? cursor = null, int? pageSize = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/logged-on-users?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<LoggedOnUsersReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Custom fields detailed report | |
/// </summary> | |
/// <remarks> | |
/// Returns Custom Fields report with additional information about each field | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <param name="updatedAfter">Custom fields updated after specified date</param> | |
/// <param name="fields">Comma-separated list of fields</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual NodeAttributesDetailedReport GetCustomFieldsDetailedReport(string? df = null, string? cursor = null, int? pageSize = null, string? updatedAfter = null, string? fields = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetCustomFieldsDetailedReportAsync(df, cursor, pageSize, updatedAfter, fields, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Custom fields detailed report | |
/// </summary> | |
/// <remarks> | |
/// Returns Custom Fields report with additional information about each field | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <param name="updatedAfter">Custom fields updated after specified date</param> | |
/// <param name="fields">Comma-separated list of fields</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<NodeAttributesDetailedReport> GetCustomFieldsDetailedReportAsync(string? df = null, string? cursor = null, int? pageSize = null, string? updatedAfter = null, string? fields = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/custom-fields-detailed?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (updatedAfter != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("updatedAfter") + "=").Append(System.Uri.EscapeDataString(ConvertToString(updatedAfter, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (fields != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("fields") + "=").Append(System.Uri.EscapeDataString(ConvertToString(fields, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<NodeAttributesDetailedReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Scoped custom fields report | |
/// </summary> | |
/// <remarks> | |
/// Returns report for Custom Fields defined at different scopes (device, location, organization) | |
/// </remarks> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <param name="updatedAfter">Custom fields updated after specified date</param> | |
/// <param name="fields">Comma-separated list of fields</param> | |
/// <param name="scopes">Comma-separated list of scopes</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual ScopedAttributesReport GetScopedCustomFieldsReport(string? cursor = null, int? pageSize = null, string? updatedAfter = null, string? fields = null, string? scopes = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetScopedCustomFieldsReportAsync(cursor, pageSize, updatedAfter, fields, scopes, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Scoped custom fields report | |
/// </summary> | |
/// <remarks> | |
/// Returns report for Custom Fields defined at different scopes (device, location, organization) | |
/// </remarks> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <param name="updatedAfter">Custom fields updated after specified date</param> | |
/// <param name="fields">Comma-separated list of fields</param> | |
/// <param name="scopes">Comma-separated list of scopes</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<ScopedAttributesReport> GetScopedCustomFieldsReportAsync(string? cursor = null, int? pageSize = null, string? updatedAfter = null, string? fields = null, string? scopes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/scoped-custom-fields?"); | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (updatedAfter != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("updatedAfter") + "=").Append(System.Uri.EscapeDataString(ConvertToString(updatedAfter, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (fields != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("fields") + "=").Append(System.Uri.EscapeDataString(ConvertToString(fields, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (scopes != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("scopes") + "=").Append(System.Uri.EscapeDataString(ConvertToString(scopes, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<ScopedAttributesReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Scoped custom fields detailed report | |
/// </summary> | |
/// <remarks> | |
/// Returns report for Custom Fields defined at different scopes (device, location, organization) with additional information about each field | |
/// </remarks> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <param name="updatedAfter">Custom fields updated after specified date</param> | |
/// <param name="fields">Comma-separated list of fields</param> | |
/// <param name="scopes">Comma-separated list of scopes</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual ScopedAttributesDetailedReport GetScopedCustomFieldsDetailedReport(string? cursor = null, int? pageSize = null, string? updatedAfter = null, string? fields = null, string? scopes = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetScopedCustomFieldsDetailedReportAsync(cursor, pageSize, updatedAfter, fields, scopes, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Scoped custom fields detailed report | |
/// </summary> | |
/// <remarks> | |
/// Returns report for Custom Fields defined at different scopes (device, location, organization) with additional information about each field | |
/// </remarks> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <param name="updatedAfter">Custom fields updated after specified date</param> | |
/// <param name="fields">Comma-separated list of fields</param> | |
/// <param name="scopes">Comma-separated list of scopes</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<ScopedAttributesDetailedReport> GetScopedCustomFieldsDetailedReportAsync(string? cursor = null, int? pageSize = null, string? updatedAfter = null, string? fields = null, string? scopes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/scoped-custom-fields-detailed?"); | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (updatedAfter != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("updatedAfter") + "=").Append(System.Uri.EscapeDataString(ConvertToString(updatedAfter, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (fields != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("fields") + "=").Append(System.Uri.EscapeDataString(ConvertToString(fields, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (scopes != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("scopes") + "=").Append(System.Uri.EscapeDataString(ConvertToString(scopes, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<ScopedAttributesDetailedReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Processor report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of processors | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual ProcessorReport GetProcessors(string? df = null, string? ts = null, string? cursor = null, int? pageSize = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetProcessorsAsync(df, ts, cursor, pageSize, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Processor report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of processors | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<ProcessorReport> GetProcessorsAsync(string? df = null, string? ts = null, string? cursor = null, int? pageSize = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/processors?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (ts != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("ts") + "=").Append(System.Uri.EscapeDataString(ConvertToString(ts, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<ProcessorReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Disk volumes report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of disk volumes | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <param name="include">Additional information to include (bl - BitLocker status)</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual VolumesReport GetVolumes(string? df = null, string? ts = null, string? cursor = null, int? pageSize = null, string? include = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetVolumesAsync(df, ts, cursor, pageSize, include, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Disk volumes report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of disk volumes | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <param name="include">Additional information to include (bl - BitLocker status)</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<VolumesReport> GetVolumesAsync(string? df = null, string? ts = null, string? cursor = null, int? pageSize = null, string? include = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/volumes?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (ts != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("ts") + "=").Append(System.Uri.EscapeDataString(ConvertToString(ts, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (include != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("include") + "=").Append(System.Uri.EscapeDataString(ConvertToString(include, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<VolumesReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Operating systems report | |
/// </summary> | |
/// <remarks> | |
/// Returns operating systems' for devices | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual OperatingSystemsReport GetOperatingSystems(string? df = null, string? ts = null, string? cursor = null, int? pageSize = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetOperatingSystemsAsync(df, ts, cursor, pageSize, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Operating systems report | |
/// </summary> | |
/// <remarks> | |
/// Returns operating systems' for devices | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<OperatingSystemsReport> GetOperatingSystemsAsync(string? df = null, string? ts = null, string? cursor = null, int? pageSize = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/operating-systems?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (ts != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("ts") + "=").Append(System.Uri.EscapeDataString(ConvertToString(ts, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<OperatingSystemsReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Antivirus threats report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of antivirus threats | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual AntivirusThreatsReport GetAntivirusThreats(string? df = null, string? ts = null, string? cursor = null, int? pageSize = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetAntivirusThreatsAsync(df, ts, cursor, pageSize, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Antivirus threats report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of antivirus threats | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<AntivirusThreatsReport> GetAntivirusThreatsAsync(string? df = null, string? ts = null, string? cursor = null, int? pageSize = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/antivirus-threats?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (ts != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("ts") + "=").Append(System.Uri.EscapeDataString(ConvertToString(ts, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<AntivirusThreatsReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Computer systems report | |
/// </summary> | |
/// <remarks> | |
/// Returns computer systems information for devices | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual ComputerSystemsReport GetComputerSystems(string? df = null, string? ts = null, string? cursor = null, int? pageSize = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetComputerSystemsAsync(df, ts, cursor, pageSize, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Computer systems report | |
/// </summary> | |
/// <remarks> | |
/// Returns computer systems information for devices | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<ComputerSystemsReport> GetComputerSystemsAsync(string? df = null, string? ts = null, string? cursor = null, int? pageSize = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/computer-systems?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (ts != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("ts") + "=").Append(System.Uri.EscapeDataString(ConvertToString(ts, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<ComputerSystemsReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Disk drives report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of physical disks | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual DiskDriveReport GetDiskDrives(string? df = null, string? ts = null, string? cursor = null, int? pageSize = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDiskDrivesAsync(df, ts, cursor, pageSize, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Disk drives report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of physical disks | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<DiskDriveReport> GetDiskDrivesAsync(string? df = null, string? ts = null, string? cursor = null, int? pageSize = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/disks?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (ts != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("ts") + "=").Append(System.Uri.EscapeDataString(ConvertToString(ts, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<DiskDriveReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Device backup usage | |
/// </summary> | |
/// <remarks> | |
/// Returns the backup usage by device | |
/// </remarks> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <param name="includeDeletedDevices">Whether or not include deleted devices</param> | |
/// <returns>Returns a device backup usage report</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual DeviceUsageReport GetDeviceUsage(string? cursor = null, int? pageSize = null, bool? includeDeletedDevices = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDeviceUsageAsync(cursor, pageSize, includeDeletedDevices, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Device backup usage | |
/// </summary> | |
/// <remarks> | |
/// Returns the backup usage by device | |
/// </remarks> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <param name="includeDeletedDevices">Whether or not include deleted devices</param> | |
/// <returns>Returns a device backup usage report</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<DeviceUsageReport> GetDeviceUsageAsync(string? cursor = null, int? pageSize = null, bool? includeDeletedDevices = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/backup/usage?"); | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (includeDeletedDevices != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("includeDeletedDevices") + "=").Append(System.Uri.EscapeDataString(ConvertToString(includeDeletedDevices, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<DeviceUsageReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Device health report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of device health summary records | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="health">Health status filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual DeviceHealthReport GetDeviceHealthReport(string? df = null, string? health = null, string? cursor = null, int? pageSize = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDeviceHealthReportAsync(df, health, cursor, pageSize, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Device health report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of device health summary records | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="health">Health status filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<DeviceHealthReport> GetDeviceHealthReportAsync(string? df = null, string? health = null, string? cursor = null, int? pageSize = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/device-health?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (health != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("health") + "=").Append(System.Uri.EscapeDataString(ConvertToString(health, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<DeviceHealthReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Software inventory | |
/// </summary> | |
/// <remarks> | |
/// Returns list software installed on devices | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <param name="installedBefore">Include software installed before specified date</param> | |
/// <param name="installedAfter">Include software installed after specified date</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual SoftwareReport GetSoftware(string? df = null, string? cursor = null, int? pageSize = null, string? installedBefore = null, string? installedAfter = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetSoftwareAsync(df, cursor, pageSize, installedBefore, installedAfter, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Software inventory | |
/// </summary> | |
/// <remarks> | |
/// Returns list software installed on devices | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <param name="installedBefore">Include software installed before specified date</param> | |
/// <param name="installedAfter">Include software installed after specified date</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<SoftwareReport> GetSoftwareAsync(string? df = null, string? cursor = null, int? pageSize = null, string? installedBefore = null, string? installedAfter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/software?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (installedBefore != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("installedBefore") + "=").Append(System.Uri.EscapeDataString(ConvertToString(installedBefore, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (installedAfter != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("installedAfter") + "=").Append(System.Uri.EscapeDataString(ConvertToString(installedAfter, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<SoftwareReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// OS Patch installation report | |
/// </summary> | |
/// <remarks> | |
/// Returns patch installation history records (successful and failed) | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="status">Patch Status filter (FAILED, INSTALLED)</param> | |
/// <param name="installedBefore">Include patches installed before specified date</param> | |
/// <param name="installedAfter">Include patches installed after specified date</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual OSPatchReport GetInstalledOSPatches(string? df = null, string? status = null, string? installedBefore = null, string? installedAfter = null, string? cursor = null, int? pageSize = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetInstalledOSPatchesAsync(df, status, installedBefore, installedAfter, cursor, pageSize, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// OS Patch installation report | |
/// </summary> | |
/// <remarks> | |
/// Returns patch installation history records (successful and failed) | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="status">Patch Status filter (FAILED, INSTALLED)</param> | |
/// <param name="installedBefore">Include patches installed before specified date</param> | |
/// <param name="installedAfter">Include patches installed after specified date</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<OSPatchReport> GetInstalledOSPatchesAsync(string? df = null, string? status = null, string? installedBefore = null, string? installedAfter = null, string? cursor = null, int? pageSize = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/os-patch-installs?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (status != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("status") + "=").Append(System.Uri.EscapeDataString(ConvertToString(status, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (installedBefore != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("installedBefore") + "=").Append(System.Uri.EscapeDataString(ConvertToString(installedBefore, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (installedAfter != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("installedAfter") + "=").Append(System.Uri.EscapeDataString(ConvertToString(installedAfter, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<OSPatchReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Antivirus status report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of statues of antivirus software installed on devices | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="productState">Product State filter</param> | |
/// <param name="productName">Product Name filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual AntivirusStatusReport GetAntivirusStatusReport(string? df = null, string? ts = null, string? productState = null, string? productName = null, string? cursor = null, int? pageSize = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetAntivirusStatusReportAsync(df, ts, productState, productName, cursor, pageSize, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Antivirus status report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of statues of antivirus software installed on devices | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="productState">Product State filter</param> | |
/// <param name="productName">Product Name filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<AntivirusStatusReport> GetAntivirusStatusReportAsync(string? df = null, string? ts = null, string? productState = null, string? productName = null, string? cursor = null, int? pageSize = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/antivirus-status?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (ts != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("ts") + "=").Append(System.Uri.EscapeDataString(ConvertToString(ts, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (productState != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("productState") + "=").Append(System.Uri.EscapeDataString(ConvertToString(productState, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (productName != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("productName") + "=").Append(System.Uri.EscapeDataString(ConvertToString(productName, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<AntivirusStatusReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// RAID controller report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of RAID controllers | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual RAIDControllerReport GetRAIDControllerReport(string? df = null, string? ts = null, string? cursor = null, int? pageSize = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetRAIDControllerReportAsync(df, ts, cursor, pageSize, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// RAID controller report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of RAID controllers | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<RAIDControllerReport> GetRAIDControllerReportAsync(string? df = null, string? ts = null, string? cursor = null, int? pageSize = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/raid-controllers?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (ts != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("ts") + "=").Append(System.Uri.EscapeDataString(ConvertToString(ts, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<RAIDControllerReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// RAID drive report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of drives connected to RAID controllers | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual RAIDDriveReport GetRAIDDriveReport(string? df = null, string? ts = null, string? cursor = null, int? pageSize = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetRAIDDriveReportAsync(df, ts, cursor, pageSize, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// RAID drive report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of drives connected to RAID controllers | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="ts">Monitoring timestamp filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<RAIDDriveReport> GetRAIDDriveReportAsync(string? df = null, string? ts = null, string? cursor = null, int? pageSize = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/raid-drives?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (ts != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("ts") + "=").Append(System.Uri.EscapeDataString(ConvertToString(ts, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<RAIDDriveReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Windows services report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of Windows Services and their statuses | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="name">Service name</param> | |
/// <param name="state">Service state</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual WindowsServiceReport GetWindowsServicesReport(string? df = null, string? name = null, State2? state = null, string? cursor = null, int? pageSize = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetWindowsServicesReportAsync(df, name, state, cursor, pageSize, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Windows services report | |
/// </summary> | |
/// <remarks> | |
/// Returns list of Windows Services and their statuses | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="name">Service name</param> | |
/// <param name="state">Service state</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<WindowsServiceReport> GetWindowsServicesReportAsync(string? df = null, string? name = null, State2? state = null, string? cursor = null, int? pageSize = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/windows-services?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (name != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("name") + "=").Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (state != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("state") + "=").Append(System.Uri.EscapeDataString(ConvertToString(state, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<WindowsServiceReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Custom fields report | |
/// </summary> | |
/// <remarks> | |
/// Returns Custom Fields report | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <param name="updatedAfter">Custom fields updated after specified date</param> | |
/// <param name="fields">Comma-separated list of fields</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual NodeAttributesReport GetCustomFieldsReport(string? df = null, string? cursor = null, int? pageSize = null, string? updatedAfter = null, string? fields = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetCustomFieldsReportAsync(df, cursor, pageSize, updatedAfter, fields, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Custom fields report | |
/// </summary> | |
/// <remarks> | |
/// Returns Custom Fields report | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <param name="updatedAfter">Custom fields updated after specified date</param> | |
/// <param name="fields">Comma-separated list of fields</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<NodeAttributesReport> GetCustomFieldsReportAsync(string? df = null, string? cursor = null, int? pageSize = null, string? updatedAfter = null, string? fields = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/custom-fields?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (updatedAfter != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("updatedAfter") + "=").Append(System.Uri.EscapeDataString(ConvertToString(updatedAfter, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (fields != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("fields") + "=").Append(System.Uri.EscapeDataString(ConvertToString(fields, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<NodeAttributesReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Find devices | |
/// </summary> | |
/// <remarks> | |
/// Returns list of entities matching search term | |
/// </remarks> | |
/// <param name="q">Search query (name, logged on user name, IP address, etc.)</param> | |
/// <param name="limit">Limit number of devices to return</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual DeviceSearchResults Search(string? q = null, int? limit = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await SearchAsync(q, limit, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Find devices | |
/// </summary> | |
/// <remarks> | |
/// Returns list of entities matching search term | |
/// </remarks> | |
/// <param name="q">Search query (name, logged on user name, IP address, etc.)</param> | |
/// <param name="limit">Limit number of devices to return</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<DeviceSearchResults> SearchAsync(string? q = null, int? limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/devices/search?"); | |
if (q != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("q") + "=").Append(System.Uri.EscapeDataString(ConvertToString(q, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (limit != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("limit") + "=").Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<DeviceSearchResults>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Device Custom Fields | |
/// </summary> | |
/// <remarks> | |
/// Returns list of all custom fields | |
/// </remarks> | |
/// <param name="scopes">Comma-separated list of scopes</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<AttributePublicApiDTO> GetDeviceGlobalCustomFields(Scopes? scopes = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDeviceGlobalCustomFieldsAsync(scopes, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Device Custom Fields | |
/// </summary> | |
/// <remarks> | |
/// Returns list of all custom fields | |
/// </remarks> | |
/// <param name="scopes">Comma-separated list of scopes</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<AttributePublicApiDTO>> GetDeviceGlobalCustomFieldsAsync(Scopes? scopes = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/device-custom-fields?"); | |
if (scopes != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("scopes") + "=").Append(System.Uri.EscapeDataString(ConvertToString(scopes, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<AttributePublicApiDTO>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List users | |
/// </summary> | |
/// <remarks> | |
/// Returns list of users | |
/// </remarks> | |
/// <param name="userType">User type filter</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<User> GetUsers(UserType? userType = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetUsersAsync(userType, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List users | |
/// </summary> | |
/// <remarks> | |
/// Returns list of users | |
/// </remarks> | |
/// <param name="userType">User type filter</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<User>> GetUsersAsync(UserType? userType = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/users?"); | |
if (userType != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("userType") + "=").Append(System.Uri.EscapeDataString(ConvertToString(userType, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<User>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List groups (saved searches) | |
/// </summary> | |
/// <remarks> | |
/// Returns list of groups | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<Group> GetGroups() | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetGroupsAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List groups (saved searches) | |
/// </summary> | |
/// <remarks> | |
/// Returns list of groups | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Group>> GetGroupsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/groups"); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<Group>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List activities | |
/// </summary> | |
/// <remarks> | |
/// Returns activity log in reverse chronological order | |
/// </remarks> | |
/// <param name="class">Activity Class (System/Device) filter</param> | |
/// <param name="before">Return activities recorded prior to specified date</param> | |
/// <param name="after">Return activities recorded after to specified date</param> | |
/// <param name="olderThan">Return activities recorded that are newer than specified activity ID</param> | |
/// <param name="newerThan">Return activities recorded that are older than specified activity ID</param> | |
/// <param name="type">Return activities of type</param> | |
/// <param name="status">Return activities with status(es)</param> | |
/// <param name="user">Return activities for user(s)</param> | |
/// <param name="seriesUid">Return activities related to alert (series)</param> | |
/// <param name="df">Device filter</param> | |
/// <param name="pageSize">Limit number of activities to return</param> | |
/// <param name="lang">Language tag</param> | |
/// <param name="tz">Time Zone</param> | |
/// <param name="sourceConfigUid">Allows users to make a request directed to a specific script</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual ActivitiesResponse GetActivities(Class? @class = null, string? before = null, string? after = null, int? olderThan = null, int? newerThan = null, string? type = null, string? status = null, string? user = null, string? seriesUid = null, string? df = null, int? pageSize = null, string? lang = null, string? tz = null, string? sourceConfigUid = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetActivitiesAsync(@class, before, after, olderThan, newerThan, type, status, user, seriesUid, df, pageSize, lang, tz, sourceConfigUid, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List activities | |
/// </summary> | |
/// <remarks> | |
/// Returns activity log in reverse chronological order | |
/// </remarks> | |
/// <param name="class">Activity Class (System/Device) filter</param> | |
/// <param name="before">Return activities recorded prior to specified date</param> | |
/// <param name="after">Return activities recorded after to specified date</param> | |
/// <param name="olderThan">Return activities recorded that are newer than specified activity ID</param> | |
/// <param name="newerThan">Return activities recorded that are older than specified activity ID</param> | |
/// <param name="type">Return activities of type</param> | |
/// <param name="status">Return activities with status(es)</param> | |
/// <param name="user">Return activities for user(s)</param> | |
/// <param name="seriesUid">Return activities related to alert (series)</param> | |
/// <param name="df">Device filter</param> | |
/// <param name="pageSize">Limit number of activities to return</param> | |
/// <param name="lang">Language tag</param> | |
/// <param name="tz">Time Zone</param> | |
/// <param name="sourceConfigUid">Allows users to make a request directed to a specific script</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<ActivitiesResponse> GetActivitiesAsync(Class? @class = null, string? before = null, string? after = null, int? olderThan = null, int? newerThan = null, string? type = null, string? status = null, string? user = null, string? seriesUid = null, string? df = null, int? pageSize = null, string? lang = null, string? tz = null, string? sourceConfigUid = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/activities?"); | |
if (@class != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("class") + "=").Append(System.Uri.EscapeDataString(ConvertToString(@class, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (before != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("before") + "=").Append(System.Uri.EscapeDataString(ConvertToString(before, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (after != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("after") + "=").Append(System.Uri.EscapeDataString(ConvertToString(after, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (olderThan != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("olderThan") + "=").Append(System.Uri.EscapeDataString(ConvertToString(olderThan, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (newerThan != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("newerThan") + "=").Append(System.Uri.EscapeDataString(ConvertToString(newerThan, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (type != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("type") + "=").Append(System.Uri.EscapeDataString(ConvertToString(type, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (status != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("status") + "=").Append(System.Uri.EscapeDataString(ConvertToString(status, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (user != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("user") + "=").Append(System.Uri.EscapeDataString(ConvertToString(user, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (seriesUid != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("seriesUid") + "=").Append(System.Uri.EscapeDataString(ConvertToString(seriesUid, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (lang != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("lang") + "=").Append(System.Uri.EscapeDataString(ConvertToString(lang, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (tz != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("tz") + "=").Append(System.Uri.EscapeDataString(ConvertToString(tz, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (sourceConfigUid != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("sourceConfigUid") + "=").Append(System.Uri.EscapeDataString(ConvertToString(sourceConfigUid, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<ActivitiesResponse>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List devices | |
/// </summary> | |
/// <remarks> | |
/// Returns list of devices (basic node information) | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="pageSize">Limit number of devices to return</param> | |
/// <param name="after">Last Node ID from previous page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<NodeWithDetailedReferences> GetDevices(string? df = null, int? pageSize = null, int? after = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDevicesAsync(df, pageSize, after, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List devices | |
/// </summary> | |
/// <remarks> | |
/// Returns list of devices (basic node information) | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="pageSize">Limit number of devices to return</param> | |
/// <param name="after">Last Node ID from previous page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<NodeWithDetailedReferences>> GetDevicesAsync(string? df = null, int? pageSize = null, int? after = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/devices?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (after != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("after") + "=").Append(System.Uri.EscapeDataString(ConvertToString(after, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<NodeWithDetailedReferences>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List locations | |
/// </summary> | |
/// <remarks> | |
/// Returns flat list of all locations for all organizations | |
/// </remarks> | |
/// <param name="pageSize">Limit number of locations to return</param> | |
/// <param name="after">Last Location Identifier from previous page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<LocationWithOrganizationRef> GetLocations(int? pageSize = null, int? after = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetLocationsAsync(pageSize, after, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List locations | |
/// </summary> | |
/// <remarks> | |
/// Returns flat list of all locations for all organizations | |
/// </remarks> | |
/// <param name="pageSize">Limit number of locations to return</param> | |
/// <param name="after">Last Location Identifier from previous page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<LocationWithOrganizationRef>> GetLocationsAsync(int? pageSize = null, int? after = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/locations?"); | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (after != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("after") + "=").Append(System.Uri.EscapeDataString(ConvertToString(after, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<LocationWithOrganizationRef>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List policies | |
/// </summary> | |
/// <remarks> | |
/// Returns list of policies | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<Policy> GetPolicies() | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetPoliciesAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List policies | |
/// </summary> | |
/// <remarks> | |
/// Returns list of policies | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Policy>> GetPoliciesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/policies"); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<Policy>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Creates new Policy | |
/// </summary> | |
/// <remarks> | |
/// Creates new policy using (New Root, Child, Copy) | |
/// </remarks> | |
/// <param name="mode">Policy creation mode</param> | |
/// <param name="templatePolicyId">Template Policy identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual Policy CreatePolicy(Mode3? mode = null, int? templatePolicyId = null, PolicyInfo? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await CreatePolicyAsync(mode, templatePolicyId, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Creates new Policy | |
/// </summary> | |
/// <remarks> | |
/// Creates new policy using (New Root, Child, Copy) | |
/// </remarks> | |
/// <param name="mode">Policy creation mode</param> | |
/// <param name="templatePolicyId">Template Policy identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<Policy> CreatePolicyAsync(Mode3? mode = null, int? templatePolicyId = null, PolicyInfo? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/policies?"); | |
if (mode != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("mode") + "=").Append(System.Uri.EscapeDataString(ConvertToString(mode, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (templatePolicyId != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("templatePolicyId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(templatePolicyId, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("POST"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<Policy>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List scheduled tasks | |
/// </summary> | |
/// <remarks> | |
/// Returns list of registered scheduled tasks | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<ScheduledTask> GetScheduledTasks() | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetScheduledTasksAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List scheduled tasks | |
/// </summary> | |
/// <remarks> | |
/// Returns list of registered scheduled tasks | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ScheduledTask>> GetScheduledTasksAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/tasks"); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<ScheduledTask>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List active jobs | |
/// </summary> | |
/// <remarks> | |
/// Returns list of running jobs | |
/// </remarks> | |
/// <param name="jobType">Job Type filter</param> | |
/// <param name="df">Device filter</param> | |
/// <param name="lang">Language tag</param> | |
/// <param name="tz">Time Zone</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<Job> GetActiveJobs(string? jobType = null, string? df = null, string? lang = null, string? tz = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetActiveJobsAsync(jobType, df, lang, tz, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List active jobs | |
/// </summary> | |
/// <remarks> | |
/// Returns list of running jobs | |
/// </remarks> | |
/// <param name="jobType">Job Type filter</param> | |
/// <param name="df">Device filter</param> | |
/// <param name="lang">Language tag</param> | |
/// <param name="tz">Time Zone</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Job>> GetActiveJobsAsync(string? jobType = null, string? df = null, string? lang = null, string? tz = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/jobs?"); | |
if (jobType != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("jobType") + "=").Append(System.Uri.EscapeDataString(ConvertToString(jobType, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (lang != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("lang") + "=").Append(System.Uri.EscapeDataString(ConvertToString(lang, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (tz != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("tz") + "=").Append(System.Uri.EscapeDataString(ConvertToString(tz, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<Job>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List organizations (Detailed) | |
/// </summary> | |
/// <remarks> | |
/// Returns list of organizations with locations and policy mappings | |
/// </remarks> | |
/// <param name="pageSize">Limit number of organizations to return</param> | |
/// <param name="after">Last Organization Identifier from previous page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<OrganizationDetailed> GetOrganizationsDetailed(int? pageSize = null, int? after = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetOrganizationsDetailedAsync(pageSize, after, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List organizations (Detailed) | |
/// </summary> | |
/// <remarks> | |
/// Returns list of organizations with locations and policy mappings | |
/// </remarks> | |
/// <param name="pageSize">Limit number of organizations to return</param> | |
/// <param name="after">Last Organization Identifier from previous page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<OrganizationDetailed>> GetOrganizationsDetailedAsync(int? pageSize = null, int? after = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organizations-detailed?"); | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (after != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("after") + "=").Append(System.Uri.EscapeDataString(ConvertToString(after, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<OrganizationDetailed>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List device roles | |
/// </summary> | |
/// <remarks> | |
/// Returns list of device roles | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<NodeRole> GetNodeRoles() | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetNodeRolesAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List device roles | |
/// </summary> | |
/// <remarks> | |
/// Returns list of device roles | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<NodeRole>> GetNodeRolesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/roles"); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<NodeRole>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List supported 3rd party software | |
/// </summary> | |
/// <remarks> | |
/// Returns available software products (3rd party patching) | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<SoftwareProduct> GetSoftwareProducts() | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetSoftwareProductsAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List supported 3rd party software | |
/// </summary> | |
/// <remarks> | |
/// Returns available software products (3rd party patching) | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<SoftwareProduct>> GetSoftwareProductsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/software-products"); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<SoftwareProduct>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List devices (detailed) | |
/// </summary> | |
/// <remarks> | |
/// Returns list of devices with additional information | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<Device> GetDevicesDetailed(string? df = null, int? pageSize = null, int? after = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetDevicesDetailedAsync(df, pageSize, after, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List devices (detailed) | |
/// </summary> | |
/// <remarks> | |
/// Returns list of devices with additional information | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Device>> GetDevicesDetailedAsync(string? df = null, int? pageSize = null, int? after = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/devices-detailed?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (after != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("after") + "=").Append(System.Uri.EscapeDataString(ConvertToString(after, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<Device>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List active alerts (triggered conditions) | |
/// </summary> | |
/// <remarks> | |
/// Returns list of active alerts/triggered conditions | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="lang">Language tag</param> | |
/// <param name="tz">Time Zone</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<Alert> GetAlerts(string? sourceType = null, string? df = null, string? lang = null, string? tz = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetAlertsAsync(sourceType, df, lang, tz, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List active alerts (triggered conditions) | |
/// </summary> | |
/// <remarks> | |
/// Returns list of active alerts/triggered conditions | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="lang">Language tag</param> | |
/// <param name="tz">Time Zone</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Alert>> GetAlertsAsync(string? sourceType = null, string? df = null, string? lang = null, string? tz = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/alerts?"); | |
if (sourceType != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("sourceType") + "=").Append(System.Uri.EscapeDataString(ConvertToString(sourceType, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (lang != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("lang") + "=").Append(System.Uri.EscapeDataString(ConvertToString(lang, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (tz != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("tz") + "=").Append(System.Uri.EscapeDataString(ConvertToString(tz, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<Alert>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Get list of ticket status | |
/// </summary> | |
/// <remarks> | |
/// Get list of ticket status | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<TicketStatusPublicApiDTO> GetAllStatuses() | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetAllStatusesAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Get list of ticket status | |
/// </summary> | |
/// <remarks> | |
/// Get list of ticket status | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<TicketStatusPublicApiDTO>> GetAllStatusesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/ticketing/statuses"); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<TicketStatusPublicApiDTO>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List boards | |
/// </summary> | |
/// <remarks> | |
/// Returns list of ticketing boards | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<TicketingBoardPublicApiDTO> GetBoards() | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetBoardsAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List boards | |
/// </summary> | |
/// <remarks> | |
/// Returns list of ticketing boards | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<TicketingBoardPublicApiDTO>> GetBoardsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/ticketing/trigger/boards"); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<TicketingBoardPublicApiDTO>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List of tickets for board | |
/// </summary> | |
/// <remarks> | |
/// Run a board. Returns list of tickets matching the board condition and filters. Allows pagination | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual TicketDashboardPublicApiDTO GetTicketsByBoard(int boardId, TicketBoardScrollingRequestDTO? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetTicketsByBoardAsync(boardId, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List of tickets for board | |
/// </summary> | |
/// <remarks> | |
/// Run a board. Returns list of tickets matching the board condition and filters. Allows pagination | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<TicketDashboardPublicApiDTO> GetTicketsByBoardAsync(int boardId, TicketBoardScrollingRequestDTO? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (boardId == null) | |
throw new System.ArgumentNullException("boardId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/ticketing/trigger/board/{boardId}/run"); | |
urlBuilder_.Replace("{boardId}", System.Uri.EscapeDataString(ConvertToString(boardId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("POST"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<TicketDashboardPublicApiDTO>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List contacts | |
/// </summary> | |
/// <remarks> | |
/// Returns list of contacts | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<ContactResponseDTO> GetContacts() | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetContactsAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List contacts | |
/// </summary> | |
/// <remarks> | |
/// Returns list of contacts | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ContactResponseDTO>> GetContactsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/ticketing/contact/contacts"); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<ContactResponseDTO>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List ticket forms | |
/// </summary> | |
/// <remarks> | |
/// Returns list of ticket forms with their fields | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<TicketFormPublicApiDTO> GetTicketForms() | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetTicketFormsAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List ticket forms | |
/// </summary> | |
/// <remarks> | |
/// Returns list of ticket forms with their fields | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<TicketFormPublicApiDTO>> GetTicketFormsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/ticketing/ticket-form"); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<TicketFormPublicApiDTO>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Ticket form | |
/// </summary> | |
/// <remarks> | |
/// Returns a ticket form with fields | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual TicketFormPublicApiDTO GetTicketFormById(int id) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetTicketFormByIdAsync(id, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Ticket form | |
/// </summary> | |
/// <remarks> | |
/// Returns a ticket form with fields | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<TicketFormPublicApiDTO> GetTicketFormByIdAsync(int id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/ticketing/ticket-form/{id}"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<TicketFormPublicApiDTO>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// List ticket attributes | |
/// </summary> | |
/// <remarks> | |
/// Returns list of the ticket attributes | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<TicketingAttributePublicApiDTO> GetTicketAttributes() | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await GetTicketAttributesAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// List ticket attributes | |
/// </summary> | |
/// <remarks> | |
/// Returns list of the ticket attributes | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<TicketingAttributePublicApiDTO>> GetTicketAttributesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/ticketing/attributes"); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<TicketingAttributePublicApiDTO>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
protected struct ObjectResponseResult<T> | |
{ | |
public ObjectResponseResult(T responseObject, string responseText) | |
{ | |
this.Object = responseObject; | |
this.Text = responseText; | |
} | |
public T Object { get; } | |
public string Text { get; } | |
} | |
public bool ReadResponseAsString { get; set; } | |
protected virtual async System.Threading.Tasks.Task<ObjectResponseResult<T>> ReadObjectResponseAsync<T>(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Threading.CancellationToken cancellationToken) | |
{ | |
if (response == null || response.Content == null) | |
{ | |
return new ObjectResponseResult<T>(default(T)!, string.Empty); | |
} | |
if (ReadResponseAsString) | |
{ | |
var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); | |
try | |
{ | |
var typedBody = System.Text.Json.JsonSerializer.Deserialize<T>(responseText, JsonSerializerSettings); | |
return new ObjectResponseResult<T>(typedBody!, responseText); | |
} | |
catch (System.Text.Json.JsonException exception) | |
{ | |
var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; | |
throw new NinjaOneException(message, (int)response.StatusCode, responseText, headers, exception); | |
} | |
} | |
else | |
{ | |
try | |
{ | |
using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) | |
{ | |
var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync<T>(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); | |
return new ObjectResponseResult<T>(typedBody!, string.Empty); | |
} | |
} | |
catch (System.Text.Json.JsonException exception) | |
{ | |
var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; | |
throw new NinjaOneException(message, (int)response.StatusCode, string.Empty, headers, exception); | |
} | |
} | |
} | |
private string ConvertToString(object? value, System.Globalization.CultureInfo cultureInfo) | |
{ | |
if (value == null) | |
{ | |
return ""; | |
} | |
if (value is System.Enum) | |
{ | |
var name = System.Enum.GetName(value.GetType(), value); | |
if (name != null) | |
{ | |
var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); | |
if (field != null) | |
{ | |
var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) | |
as System.Runtime.Serialization.EnumMemberAttribute; | |
if (attribute != null) | |
{ | |
return attribute.Value != null ? attribute.Value : name; | |
} | |
} | |
var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); | |
return converted == null ? string.Empty : converted; | |
} | |
} | |
else if (value is bool) | |
{ | |
return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); | |
} | |
else if (value is byte[]) | |
{ | |
return System.Convert.ToBase64String((byte[]) value); | |
} | |
else if (value.GetType().IsArray) | |
{ | |
var array = System.Linq.Enumerable.OfType<object>((System.Array) value); | |
return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); | |
} | |
var result = System.Convert.ToString(value, cultureInfo); | |
return result == null ? "" : result; | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class CreateRelatedItemForEntityClient | |
{ | |
private string _baseUrl = ""; | |
private System.Net.Http.HttpClient _httpClient; | |
private System.Lazy<System.Text.Json.JsonSerializerOptions> _settings; | |
public CreateRelatedItemForEntityClient(string baseUrl, System.Net.Http.HttpClient httpClient) | |
{ | |
BaseUrl = baseUrl; | |
_httpClient = httpClient; | |
_settings = new System.Lazy<System.Text.Json.JsonSerializerOptions>(CreateSerializerSettings, true); | |
} | |
private System.Text.Json.JsonSerializerOptions CreateSerializerSettings() | |
{ | |
var settings = new System.Text.Json.JsonSerializerOptions(); | |
UpdateJsonSerializerSettings(settings); | |
return settings; | |
} | |
public string BaseUrl | |
{ | |
get { return _baseUrl; } | |
set { _baseUrl = value; } | |
} | |
protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } | |
partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); | |
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); | |
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); | |
partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); | |
/// <summary> | |
/// Create entity relations | |
/// </summary> | |
/// <remarks> | |
/// Create multiple relations between two entities | |
/// </remarks> | |
/// <returns>Returns list of relations created for an entity</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.ICollection<RelatedItemPublicApiDTO> 1(EntityType4 entityType, int entityId, System.Collections.Generic.IEnumerable<NewRelatedItemEntityRequest>? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await 1Async(entityType, entityId, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Create entity relations | |
/// </summary> | |
/// <remarks> | |
/// Create multiple relations between two entities | |
/// </remarks> | |
/// <returns>Returns list of relations created for an entity</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<RelatedItemPublicApiDTO>> 1Async(EntityType4 entityType, int entityId, System.Collections.Generic.IEnumerable<NewRelatedItemEntityRequest>? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (entityType == null) | |
throw new System.ArgumentNullException("entityType"); | |
if (entityId == null) | |
throw new System.ArgumentNullException("entityId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/related-items/entity/{entityType}/{entityId}/relations"); | |
urlBuilder_.Replace("{entityType}", System.Uri.EscapeDataString(ConvertToString(entityType, System.Globalization.CultureInfo.InvariantCulture))); | |
urlBuilder_.Replace("{entityId}", System.Uri.EscapeDataString(ConvertToString(entityId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("*/*"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("POST"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
if (status_ == 200) | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<RelatedItemPublicApiDTO>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
else | |
{ | |
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new NinjaOneException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
protected struct ObjectResponseResult<T> | |
{ | |
public ObjectResponseResult(T responseObject, string responseText) | |
{ | |
this.Object = responseObject; | |
this.Text = responseText; | |
} | |
public T Object { get; } | |
public string Text { get; } | |
} | |
public bool ReadResponseAsString { get; set; } | |
protected virtual async System.Threading.Tasks.Task<ObjectResponseResult<T>> ReadObjectResponseAsync<T>(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Threading.CancellationToken cancellationToken) | |
{ | |
if (response == null || response.Content == null) | |
{ | |
return new ObjectResponseResult<T>(default(T)!, string.Empty); | |
} | |
if (ReadResponseAsString) | |
{ | |
var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); | |
try | |
{ | |
var typedBody = System.Text.Json.JsonSerializer.Deserialize<T>(responseText, JsonSerializerSettings); | |
return new ObjectResponseResult<T>(typedBody!, responseText); | |
} | |
catch (System.Text.Json.JsonException exception) | |
{ | |
var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; | |
throw new NinjaOneException(message, (int)response.StatusCode, responseText, headers, exception); | |
} | |
} | |
else | |
{ | |
try | |
{ | |
using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) | |
{ | |
var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync<T>(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); | |
return new ObjectResponseResult<T>(typedBody!, string.Empty); | |
} | |
} | |
catch (System.Text.Json.JsonException exception) | |
{ | |
var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; | |
throw new NinjaOneException(message, (int)response.StatusCode, string.Empty, headers, exception); | |
} | |
} | |
} | |
private string ConvertToString(object? value, System.Globalization.CultureInfo cultureInfo) | |
{ | |
if (value == null) | |
{ | |
return ""; | |
} | |
if (value is System.Enum) | |
{ | |
var name = System.Enum.GetName(value.GetType(), value); | |
if (name != null) | |
{ | |
var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); | |
if (field != null) | |
{ | |
var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) | |
as System.Runtime.Serialization.EnumMemberAttribute; | |
if (attribute != null) | |
{ | |
return attribute.Value != null ? attribute.Value : name; | |
} | |
} | |
var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); | |
return converted == null ? string.Empty : converted; | |
} | |
} | |
else if (value is bool) | |
{ | |
return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); | |
} | |
else if (value is byte[]) | |
{ | |
return System.Convert.ToBase64String((byte[]) value); | |
} | |
else if (value.GetType().IsArray) | |
{ | |
var array = System.Linq.Enumerable.OfType<object>((System.Array) value); | |
return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); | |
} | |
var result = System.Convert.ToString(value, cultureInfo); | |
return result == null ? "" : result; | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class GetNodeCustomFieldsClient | |
{ | |
private string _baseUrl = ""; | |
private System.Net.Http.HttpClient _httpClient; | |
private System.Lazy<System.Text.Json.JsonSerializerOptions> _settings; | |
public GetNodeCustomFieldsClient(string baseUrl, System.Net.Http.HttpClient httpClient) | |
{ | |
BaseUrl = baseUrl; | |
_httpClient = httpClient; | |
_settings = new System.Lazy<System.Text.Json.JsonSerializerOptions>(CreateSerializerSettings, true); | |
} | |
private System.Text.Json.JsonSerializerOptions CreateSerializerSettings() | |
{ | |
var settings = new System.Text.Json.JsonSerializerOptions(); | |
UpdateJsonSerializerSettings(settings); | |
return settings; | |
} | |
public string BaseUrl | |
{ | |
get { return _baseUrl; } | |
set { _baseUrl = value; } | |
} | |
protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } | |
partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); | |
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); | |
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); | |
partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); | |
/// <summary> | |
/// Organization custom fields | |
/// </summary> | |
/// <remarks> | |
/// Returns list of organization custom fields | |
/// </remarks> | |
/// <param name="id">Organization identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.IDictionary<string, object> 1(int id) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await 1Async(id, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Organization custom fields | |
/// </summary> | |
/// <remarks> | |
/// Returns list of organization custom fields | |
/// </remarks> | |
/// <param name="id">Organization identifier</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.IDictionary<string, object>> 1Async(int id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/{id}/custom-fields"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.IDictionary<string, object>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Location custom fields | |
/// </summary> | |
/// <remarks> | |
/// Returns list of location custom fields | |
/// </remarks> | |
/// <param name="withInheritance">Retrieve values using definition scope hierarchy</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual System.Collections.Generic.IDictionary<string, object> 2(int id, int locationId, bool? withInheritance = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await 2Async(id, locationId, withInheritance, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Location custom fields | |
/// </summary> | |
/// <remarks> | |
/// Returns list of location custom fields | |
/// </remarks> | |
/// <param name="withInheritance">Retrieve values using definition scope hierarchy</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.IDictionary<string, object>> 2Async(int id, int locationId, bool? withInheritance = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
if (locationId == null) | |
throw new System.ArgumentNullException("locationId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/{id}/location/{locationId}/custom-fields?"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
urlBuilder_.Replace("{locationId}", System.Uri.EscapeDataString(ConvertToString(locationId, System.Globalization.CultureInfo.InvariantCulture))); | |
if (withInheritance != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("withInheritance") + "=").Append(System.Uri.EscapeDataString(ConvertToString(withInheritance, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.IDictionary<string, object>>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
protected struct ObjectResponseResult<T> | |
{ | |
public ObjectResponseResult(T responseObject, string responseText) | |
{ | |
this.Object = responseObject; | |
this.Text = responseText; | |
} | |
public T Object { get; } | |
public string Text { get; } | |
} | |
public bool ReadResponseAsString { get; set; } | |
protected virtual async System.Threading.Tasks.Task<ObjectResponseResult<T>> ReadObjectResponseAsync<T>(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Threading.CancellationToken cancellationToken) | |
{ | |
if (response == null || response.Content == null) | |
{ | |
return new ObjectResponseResult<T>(default(T)!, string.Empty); | |
} | |
if (ReadResponseAsString) | |
{ | |
var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); | |
try | |
{ | |
var typedBody = System.Text.Json.JsonSerializer.Deserialize<T>(responseText, JsonSerializerSettings); | |
return new ObjectResponseResult<T>(typedBody!, responseText); | |
} | |
catch (System.Text.Json.JsonException exception) | |
{ | |
var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; | |
throw new NinjaOneException(message, (int)response.StatusCode, responseText, headers, exception); | |
} | |
} | |
else | |
{ | |
try | |
{ | |
using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) | |
{ | |
var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync<T>(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); | |
return new ObjectResponseResult<T>(typedBody!, string.Empty); | |
} | |
} | |
catch (System.Text.Json.JsonException exception) | |
{ | |
var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; | |
throw new NinjaOneException(message, (int)response.StatusCode, string.Empty, headers, exception); | |
} | |
} | |
} | |
private string ConvertToString(object? value, System.Globalization.CultureInfo cultureInfo) | |
{ | |
if (value == null) | |
{ | |
return ""; | |
} | |
if (value is System.Enum) | |
{ | |
var name = System.Enum.GetName(value.GetType(), value); | |
if (name != null) | |
{ | |
var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); | |
if (field != null) | |
{ | |
var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) | |
as System.Runtime.Serialization.EnumMemberAttribute; | |
if (attribute != null) | |
{ | |
return attribute.Value != null ? attribute.Value : name; | |
} | |
} | |
var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); | |
return converted == null ? string.Empty : converted; | |
} | |
} | |
else if (value is bool) | |
{ | |
return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); | |
} | |
else if (value is byte[]) | |
{ | |
return System.Convert.ToBase64String((byte[]) value); | |
} | |
else if (value.GetType().IsArray) | |
{ | |
var array = System.Linq.Enumerable.OfType<object>((System.Array) value); | |
return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); | |
} | |
var result = System.Convert.ToString(value, cultureInfo); | |
return result == null ? "" : result; | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class UpdateNodeAttributeValuesClient | |
{ | |
private string _baseUrl = ""; | |
private System.Net.Http.HttpClient _httpClient; | |
private System.Lazy<System.Text.Json.JsonSerializerOptions> _settings; | |
public UpdateNodeAttributeValuesClient(string baseUrl, System.Net.Http.HttpClient httpClient) | |
{ | |
BaseUrl = baseUrl; | |
_httpClient = httpClient; | |
_settings = new System.Lazy<System.Text.Json.JsonSerializerOptions>(CreateSerializerSettings, true); | |
} | |
private System.Text.Json.JsonSerializerOptions CreateSerializerSettings() | |
{ | |
var settings = new System.Text.Json.JsonSerializerOptions(); | |
UpdateJsonSerializerSettings(settings); | |
return settings; | |
} | |
public string BaseUrl | |
{ | |
get { return _baseUrl; } | |
set { _baseUrl = value; } | |
} | |
protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } | |
partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); | |
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); | |
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); | |
partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); | |
/// <summary> | |
/// Update Field Values | |
/// </summary> | |
/// <remarks> | |
/// Update organization custom field values | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual FileResponse 1(int id, System.Collections.Generic.IDictionary<string, object>? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await 1Async(id, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Update Field Values | |
/// </summary> | |
/// <remarks> | |
/// Update organization custom field values | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<FileResponse> 1Async(int id, System.Collections.Generic.IDictionary<string, object>? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/{id}/custom-fields"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("PATCH"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
return default(FileResponse)!; | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
/// <summary> | |
/// Update Field Values | |
/// </summary> | |
/// <remarks> | |
/// Update location custom field values | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual FileResponse 2(int id, int locationId, System.Collections.Generic.IDictionary<string, object>? body = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await 2Async(id, locationId, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Update Field Values | |
/// </summary> | |
/// <remarks> | |
/// Update location custom field values | |
/// </remarks> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<FileResponse> 2Async(int id, int locationId, System.Collections.Generic.IDictionary<string, object>? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
if (id == null) | |
throw new System.ArgumentNullException("id"); | |
if (locationId == null) | |
throw new System.ArgumentNullException("locationId"); | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/organization/{id}/location/{locationId}/custom-fields"); | |
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); | |
urlBuilder_.Replace("{locationId}", System.Uri.EscapeDataString(ConvertToString(locationId, System.Globalization.CultureInfo.InvariantCulture))); | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value); | |
var content_ = new System.Net.Http.StringContent(json_); | |
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); | |
request_.Content = content_; | |
request_.Method = new System.Net.Http.HttpMethod("PATCH"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
return default(FileResponse)!; | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
protected struct ObjectResponseResult<T> | |
{ | |
public ObjectResponseResult(T responseObject, string responseText) | |
{ | |
this.Object = responseObject; | |
this.Text = responseText; | |
} | |
public T Object { get; } | |
public string Text { get; } | |
} | |
public bool ReadResponseAsString { get; set; } | |
protected virtual async System.Threading.Tasks.Task<ObjectResponseResult<T>> ReadObjectResponseAsync<T>(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Threading.CancellationToken cancellationToken) | |
{ | |
if (response == null || response.Content == null) | |
{ | |
return new ObjectResponseResult<T>(default(T)!, string.Empty); | |
} | |
if (ReadResponseAsString) | |
{ | |
var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); | |
try | |
{ | |
var typedBody = System.Text.Json.JsonSerializer.Deserialize<T>(responseText, JsonSerializerSettings); | |
return new ObjectResponseResult<T>(typedBody!, responseText); | |
} | |
catch (System.Text.Json.JsonException exception) | |
{ | |
var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; | |
throw new NinjaOneException(message, (int)response.StatusCode, responseText, headers, exception); | |
} | |
} | |
else | |
{ | |
try | |
{ | |
using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) | |
{ | |
var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync<T>(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); | |
return new ObjectResponseResult<T>(typedBody!, string.Empty); | |
} | |
} | |
catch (System.Text.Json.JsonException exception) | |
{ | |
var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; | |
throw new NinjaOneException(message, (int)response.StatusCode, string.Empty, headers, exception); | |
} | |
} | |
} | |
private string ConvertToString(object? value, System.Globalization.CultureInfo cultureInfo) | |
{ | |
if (value == null) | |
{ | |
return ""; | |
} | |
if (value is System.Enum) | |
{ | |
var name = System.Enum.GetName(value.GetType(), value); | |
if (name != null) | |
{ | |
var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); | |
if (field != null) | |
{ | |
var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) | |
as System.Runtime.Serialization.EnumMemberAttribute; | |
if (attribute != null) | |
{ | |
return attribute.Value != null ? attribute.Value : name; | |
} | |
} | |
var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); | |
return converted == null ? string.Empty : converted; | |
} | |
} | |
else if (value is bool) | |
{ | |
return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); | |
} | |
else if (value is byte[]) | |
{ | |
return System.Convert.ToBase64String((byte[]) value); | |
} | |
else if (value.GetType().IsArray) | |
{ | |
var array = System.Linq.Enumerable.OfType<object>((System.Array) value); | |
return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); | |
} | |
var result = System.Convert.ToString(value, cultureInfo); | |
return result == null ? "" : result; | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class GetPolicyOverridesClient | |
{ | |
private string _baseUrl = ""; | |
private System.Net.Http.HttpClient _httpClient; | |
private System.Lazy<System.Text.Json.JsonSerializerOptions> _settings; | |
public GetPolicyOverridesClient(string baseUrl, System.Net.Http.HttpClient httpClient) | |
{ | |
BaseUrl = baseUrl; | |
_httpClient = httpClient; | |
_settings = new System.Lazy<System.Text.Json.JsonSerializerOptions>(CreateSerializerSettings, true); | |
} | |
private System.Text.Json.JsonSerializerOptions CreateSerializerSettings() | |
{ | |
var settings = new System.Text.Json.JsonSerializerOptions(); | |
UpdateJsonSerializerSettings(settings); | |
return settings; | |
} | |
public string BaseUrl | |
{ | |
get { return _baseUrl; } | |
set { _baseUrl = value; } | |
} | |
protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } | |
partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); | |
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); | |
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); | |
partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); | |
/// <summary> | |
/// Get summary of device policy overrides | |
/// </summary> | |
/// <remarks> | |
/// Returns list of overridden policy sections for each device | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual PolicyOverridesReport 1(string? df = null, string? cursor = null, int? pageSize = null) | |
{ | |
return System.Threading.Tasks.Task.Run(async () => await 1Async(df, cursor, pageSize, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); | |
} | |
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> | |
/// <summary> | |
/// Get summary of device policy overrides | |
/// </summary> | |
/// <remarks> | |
/// Returns list of overridden policy sections for each device | |
/// </remarks> | |
/// <param name="df">Device filter</param> | |
/// <param name="cursor">Cursor name</param> | |
/// <param name="pageSize">Limit number of records per page</param> | |
/// <returns>default response</returns> | |
/// <exception cref="NinjaOneException">A server side error occurred.</exception> | |
public virtual async System.Threading.Tasks.Task<PolicyOverridesReport> 1Async(string? df = null, string? cursor = null, int? pageSize = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) | |
{ | |
var urlBuilder_ = new System.Text.StringBuilder(); | |
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/v2/queries/policy-overrides?"); | |
if (df != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("df") + "=").Append(System.Uri.EscapeDataString(ConvertToString(df, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (cursor != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("cursor") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cursor, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
if (pageSize != null) | |
{ | |
urlBuilder_.Append(System.Uri.EscapeDataString("pageSize") + "=").Append(System.Uri.EscapeDataString(ConvertToString(pageSize, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); | |
} | |
urlBuilder_.Length--; | |
var client_ = _httpClient; | |
var disposeClient_ = false; | |
try | |
{ | |
using (var request_ = new System.Net.Http.HttpRequestMessage()) | |
{ | |
request_.Method = new System.Net.Http.HttpMethod("GET"); | |
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); | |
PrepareRequest(client_, request_, urlBuilder_); | |
var url_ = urlBuilder_.ToString(); | |
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); | |
PrepareRequest(client_, request_, url_); | |
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | |
var disposeResponse_ = true; | |
try | |
{ | |
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); | |
if (response_.Content != null && response_.Content.Headers != null) | |
{ | |
foreach (var item_ in response_.Content.Headers) | |
headers_[item_.Key] = item_.Value; | |
} | |
ProcessResponse(client_, response_); | |
var status_ = (int)response_.StatusCode; | |
{ | |
var objectResponse_ = await ReadObjectResponseAsync<PolicyOverridesReport>(response_, headers_, cancellationToken).ConfigureAwait(false); | |
if (objectResponse_.Object == null) | |
{ | |
throw new NinjaOneException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); | |
} | |
return objectResponse_.Object; | |
} | |
} | |
finally | |
{ | |
if (disposeResponse_) | |
response_.Dispose(); | |
} | |
} | |
} | |
finally | |
{ | |
if (disposeClient_) | |
client_.Dispose(); | |
} | |
} | |
protected struct ObjectResponseResult<T> | |
{ | |
public ObjectResponseResult(T responseObject, string responseText) | |
{ | |
this.Object = responseObject; | |
this.Text = responseText; | |
} | |
public T Object { get; } | |
public string Text { get; } | |
} | |
public bool ReadResponseAsString { get; set; } | |
protected virtual async System.Threading.Tasks.Task<ObjectResponseResult<T>> ReadObjectResponseAsync<T>(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Threading.CancellationToken cancellationToken) | |
{ | |
if (response == null || response.Content == null) | |
{ | |
return new ObjectResponseResult<T>(default(T)!, string.Empty); | |
} | |
if (ReadResponseAsString) | |
{ | |
var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); | |
try | |
{ | |
var typedBody = System.Text.Json.JsonSerializer.Deserialize<T>(responseText, JsonSerializerSettings); | |
return new ObjectResponseResult<T>(typedBody!, responseText); | |
} | |
catch (System.Text.Json.JsonException exception) | |
{ | |
var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; | |
throw new NinjaOneException(message, (int)response.StatusCode, responseText, headers, exception); | |
} | |
} | |
else | |
{ | |
try | |
{ | |
using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) | |
{ | |
var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync<T>(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); | |
return new ObjectResponseResult<T>(typedBody!, string.Empty); | |
} | |
} | |
catch (System.Text.Json.JsonException exception) | |
{ | |
var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; | |
throw new NinjaOneException(message, (int)response.StatusCode, string.Empty, headers, exception); | |
} | |
} | |
} | |
private string ConvertToString(object? value, System.Globalization.CultureInfo cultureInfo) | |
{ | |
if (value == null) | |
{ | |
return ""; | |
} | |
if (value is System.Enum) | |
{ | |
var name = System.Enum.GetName(value.GetType(), value); | |
if (name != null) | |
{ | |
var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); | |
if (field != null) | |
{ | |
var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) | |
as System.Runtime.Serialization.EnumMemberAttribute; | |
if (attribute != null) | |
{ | |
return attribute.Value != null ? attribute.Value : name; | |
} | |
} | |
var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); | |
return converted == null ? string.Empty : converted; | |
} | |
} | |
else if (value is bool) | |
{ | |
return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); | |
} | |
else if (value is byte[]) | |
{ | |
return System.Convert.ToBase64String((byte[]) value); | |
} | |
else if (value.GetType().IsArray) | |
{ | |
var array = System.Linq.Enumerable.OfType<object>((System.Array) value); | |
return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); | |
} | |
var result = System.Convert.ToString(value, cultureInfo); | |
return result == null ? "" : result; | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class DeviceIDList | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public DeviceIDList(System.Collections.Generic.ICollection<int>? @devices) | |
{ | |
this.Devices = @devices; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("devices")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<int>? Devices { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static DeviceIDList FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<DeviceIDList>(data, options); | |
} | |
} | |
/// <summary> | |
/// Feature/product/integration configuration settings | |
/// </summary> | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class FeatureSettings | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public FeatureSettings(bool? @enabled, System.Collections.Generic.IDictionary<string, object>? @options, string? @product, System.Collections.Generic.ICollection<string>? @targets) | |
{ | |
this.Product = @product; | |
this.Enabled = @enabled; | |
this.Targets = @targets; | |
this.Options = @options; | |
} /// <summary> | |
/// Configured product code | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("product")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Product { get; } | |
/// <summary> | |
/// Is enabled | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("enabled")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? Enabled { get; } | |
/// <summary> | |
/// Feature deployment targets | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("targets")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<string>? Targets { get; } | |
/// <summary> | |
/// Feature options | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("options")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.IDictionary<string, object>? Options { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static FeatureSettings FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<FeatureSettings>(data, options); | |
} | |
} | |
/// <summary> | |
/// Location | |
/// </summary> | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class Location | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public Location(string? @address, string? @description, System.Collections.Generic.IDictionary<string, object>? @fields, int? @id, string? @name, System.Collections.Generic.ICollection<string>? @tags, object? @userData) | |
{ | |
this.Name = @name; | |
this.Address = @address; | |
this.Description = @description; | |
this.UserData = @userData; | |
this.Tags = @tags; | |
this.Fields = @fields; | |
this.Id = @id; | |
} /// <summary> | |
/// Location name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("name")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Name { get; } | |
/// <summary> | |
/// Address | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("address")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Address { get; } | |
/// <summary> | |
/// Description | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("description")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Description { get; } | |
/// <summary> | |
/// Custom attributes | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("userData")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public object? UserData { get; } | |
/// <summary> | |
/// Tags | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("tags")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<string>? Tags { get; } | |
/// <summary> | |
/// Custom Fields | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fields")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.IDictionary<string, object>? Fields { get; } | |
/// <summary> | |
/// Location identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("id")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? Id { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static Location FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<Location>(data, options); | |
} | |
} | |
/// <summary> | |
/// Node role policy assignments | |
/// </summary> | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class NodeRolePolicyAssignment | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public NodeRolePolicyAssignment(int? @nodeRoleId, int? @policyId) | |
{ | |
this.NodeRoleId = @nodeRoleId; | |
this.PolicyId = @policyId; | |
} /// <summary> | |
/// Node Role Identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("nodeRoleId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? NodeRoleId { get; } | |
/// <summary> | |
/// Policy Identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("policyId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? PolicyId { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static NodeRolePolicyAssignment FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<NodeRolePolicyAssignment>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class OrganizationDetailed | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public OrganizationDetailed(string? @description, System.Collections.Generic.IDictionary<string, object>? @fields, int? @id, System.Collections.Generic.ICollection<Location>? @locations, string? @name, OrganizationDetailedNodeApprovalMode? @nodeApprovalMode, System.Collections.Generic.ICollection<NodeRolePolicyAssignment>? @policies, OrganizationSettings? @settings, System.Collections.Generic.ICollection<string>? @tags, object? @userData) | |
{ | |
this.Name = @name; | |
this.Description = @description; | |
this.UserData = @userData; | |
this.NodeApprovalMode = @nodeApprovalMode; | |
this.Tags = @tags; | |
this.Fields = @fields; | |
this.Id = @id; | |
this.Locations = @locations; | |
this.Policies = @policies; | |
this.Settings = @settings; | |
} /// <summary> | |
/// Organization full name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("name")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Name { get; } | |
/// <summary> | |
/// Organization Description | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("description")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Description { get; } | |
/// <summary> | |
/// Custom attributes | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("userData")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public object? UserData { get; } | |
/// <summary> | |
/// Device Approval Mode | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("nodeApprovalMode")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public OrganizationDetailedNodeApprovalMode? NodeApprovalMode { get; } | |
/// <summary> | |
/// Tags | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("tags")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<string>? Tags { get; } | |
/// <summary> | |
/// Custom Fields | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fields")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.IDictionary<string, object>? Fields { get; } | |
/// <summary> | |
/// Organization identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("id")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? Id { get; } | |
/// <summary> | |
/// List of locations | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("locations")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<Location>? Locations { get; } | |
/// <summary> | |
/// Node role policy assignments | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("policies")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<NodeRolePolicyAssignment>? Policies { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("settings")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public OrganizationSettings? Settings { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static OrganizationDetailed FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<OrganizationDetailed>(data, options); | |
} | |
} | |
/// <summary> | |
/// Organization settings | |
/// </summary> | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class OrganizationSettings | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public OrganizationSettings(FeatureSettings? @backup, FeatureSettings? @psa, FeatureSettings? @splashtop, FeatureSettings? @teamviewer, FeatureSettings? @trayicon) | |
{ | |
this.Trayicon = @trayicon; | |
this.Splashtop = @splashtop; | |
this.Teamviewer = @teamviewer; | |
this.Backup = @backup; | |
this.Psa = @psa; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("trayicon")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public FeatureSettings? Trayicon { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("splashtop")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public FeatureSettings? Splashtop { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("teamviewer")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public FeatureSettings? Teamviewer { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("backup")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public FeatureSettings? Backup { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("psa")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public FeatureSettings? Psa { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static OrganizationSettings FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<OrganizationSettings>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class LocationModel | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public LocationModel(string? @address, string? @description, System.Collections.Generic.IDictionary<string, object>? @fields, string? @name, System.Collections.Generic.ICollection<string>? @tags, object? @userData) | |
{ | |
this.Name = @name; | |
this.Address = @address; | |
this.Description = @description; | |
this.UserData = @userData; | |
this.Tags = @tags; | |
this.Fields = @fields; | |
} /// <summary> | |
/// Location name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("name")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Name { get; } | |
/// <summary> | |
/// Address | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("address")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Address { get; } | |
/// <summary> | |
/// Description | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("description")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Description { get; } | |
/// <summary> | |
/// Custom attributes | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("userData")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public object? UserData { get; } | |
/// <summary> | |
/// Tags | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("tags")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<string>? Tags { get; } | |
/// <summary> | |
/// Custom Fields | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fields")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.IDictionary<string, object>? Fields { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static LocationModel FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<LocationModel>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class OrganizationWithLocationsAndPolicyAssignmentsModel | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public OrganizationWithLocationsAndPolicyAssignmentsModel(string? @description, System.Collections.Generic.IDictionary<string, object>? @fields, System.Collections.Generic.ICollection<LocationModel>? @locations, string? @name, OrganizationWithLocationsAndPolicyAssignmentsModelNodeApprovalMode? @nodeApprovalMode, System.Collections.Generic.ICollection<NodeRolePolicyAssignment>? @policies, System.Collections.Generic.ICollection<string>? @tags, object? @userData) | |
{ | |
this.Name = @name; | |
this.Description = @description; | |
this.UserData = @userData; | |
this.NodeApprovalMode = @nodeApprovalMode; | |
this.Tags = @tags; | |
this.Fields = @fields; | |
this.Locations = @locations; | |
this.Policies = @policies; | |
} /// <summary> | |
/// Organization full name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("name")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Name { get; } | |
/// <summary> | |
/// Organization Description | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("description")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Description { get; } | |
/// <summary> | |
/// Custom attributes | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("userData")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public object? UserData { get; } | |
/// <summary> | |
/// Device Approval Mode | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("nodeApprovalMode")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public OrganizationWithLocationsAndPolicyAssignmentsModelNodeApprovalMode? NodeApprovalMode { get; } | |
/// <summary> | |
/// Tags | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("tags")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<string>? Tags { get; } | |
/// <summary> | |
/// Custom Fields | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fields")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.IDictionary<string, object>? Fields { get; } | |
/// <summary> | |
/// List of locations | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("locations")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<LocationModel>? Locations { get; } | |
/// <summary> | |
/// Node role policy assignments | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("policies")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<NodeRolePolicyAssignment>? Policies { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static OrganizationWithLocationsAndPolicyAssignmentsModel FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<OrganizationWithLocationsAndPolicyAssignmentsModel>(data, options); | |
} | |
} | |
/// <summary> | |
/// Custom HTTP Headers (i.e. Authorization) | |
/// </summary> | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class HTTPHeader | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public HTTPHeader(string? @name, string? @value) | |
{ | |
this.Name = @name; | |
this.Value = @value; | |
} /// <summary> | |
/// Header name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("name")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Name { get; } | |
/// <summary> | |
/// Header value | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("value")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Value { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static HTTPHeader FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<HTTPHeader>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class WebhookConfiguration | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public WebhookConfiguration(System.Collections.Generic.IDictionary<string, System.Collections.Generic.ICollection<string>>? @activities, System.Collections.Generic.ICollection<string>? @expand, System.Collections.Generic.ICollection<HTTPHeader>? @headers, string? @url) | |
{ | |
this.Url = @url; | |
this.Activities = @activities; | |
this.Expand = @expand; | |
this.Headers = @headers; | |
} /// <summary> | |
/// Callback (WebHook) URL for activity notifications | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("url")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Url { get; } | |
/// <summary> | |
/// Activity filter | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("activities")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.IDictionary<string, System.Collections.Generic.ICollection<string>>? Activities { get; } | |
/// <summary> | |
/// Which references to expand in payloads | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("expand")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<string>? Expand { get; } | |
/// <summary> | |
/// Custom HTTP Headers (i.e. Authorization) | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("headers")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<HTTPHeader>? Headers { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static WebhookConfiguration FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<WebhookConfiguration>(data, options); | |
} | |
} | |
/// <summary> | |
/// Fields | |
/// </summary> | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class ClientDocumentAttributeWithValuePublicApiDTO | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public ClientDocumentAttributeWithValuePublicApiDTO(string? @name, object? @value, double? @valueUpdateTime) | |
{ | |
this.Name = @name; | |
this.Value = @value; | |
this.ValueUpdateTime = @valueUpdateTime; | |
} /// <summary> | |
/// Name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("name")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Name { get; } | |
/// <summary> | |
/// Value | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("value")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public object? Value { get; } | |
/// <summary> | |
/// Value Last Updated | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("valueUpdateTime")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public double? ValueUpdateTime { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static ClientDocumentAttributeWithValuePublicApiDTO FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<ClientDocumentAttributeWithValuePublicApiDTO>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class ClientDocumentWithAttributeValuesPublicApiDTO | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public ClientDocumentWithAttributeValuesPublicApiDTO(string? @documentDescription, int? @documentId, string? @documentName, int? @documentTemplateId, string? @documentTemplateName, double? @documentUpdateTime, System.Collections.Generic.ICollection<ClientDocumentAttributeWithValuePublicApiDTO>? @fields, int? @organizationId) | |
{ | |
this.DocumentId = @documentId; | |
this.DocumentName = @documentName; | |
this.DocumentDescription = @documentDescription; | |
this.DocumentUpdateTime = @documentUpdateTime; | |
this.Fields = @fields; | |
this.DocumentTemplateId = @documentTemplateId; | |
this.DocumentTemplateName = @documentTemplateName; | |
this.OrganizationId = @organizationId; | |
} /// <summary> | |
/// Document Identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("documentId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? DocumentId { get; } | |
/// <summary> | |
/// Document Name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("documentName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? DocumentName { get; } | |
/// <summary> | |
/// Document Description | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("documentDescription")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? DocumentDescription { get; } | |
/// <summary> | |
/// Document Last Updated | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("documentUpdateTime")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public double? DocumentUpdateTime { get; } | |
/// <summary> | |
/// Fields | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fields")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<ClientDocumentAttributeWithValuePublicApiDTO>? Fields { get; } | |
/// <summary> | |
/// Document Template Identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("documentTemplateId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? DocumentTemplateId { get; } | |
/// <summary> | |
/// Document Template Name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("documentTemplateName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? DocumentTemplateName { get; } | |
/// <summary> | |
/// Organization Identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("organizationId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? OrganizationId { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static ClientDocumentWithAttributeValuesPublicApiDTO FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<ClientDocumentWithAttributeValuesPublicApiDTO>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class ClientDocumentWithUpdatedAttributeValuesPublicApiDTO | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public ClientDocumentWithUpdatedAttributeValuesPublicApiDTO(string? @documentDescription, int? @documentId, string? @documentName, int? @documentTemplateId, string? @documentTemplateName, double? @documentUpdateTime, int? @organizationId, System.Collections.Generic.ICollection<ClientDocumentAttributeWithValuePublicApiDTO>? @updatedFields) | |
{ | |
this.DocumentId = @documentId; | |
this.DocumentName = @documentName; | |
this.DocumentDescription = @documentDescription; | |
this.DocumentUpdateTime = @documentUpdateTime; | |
this.UpdatedFields = @updatedFields; | |
this.DocumentTemplateId = @documentTemplateId; | |
this.DocumentTemplateName = @documentTemplateName; | |
this.OrganizationId = @organizationId; | |
} /// <summary> | |
/// Document Identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("documentId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? DocumentId { get; } | |
/// <summary> | |
/// Document Name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("documentName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? DocumentName { get; } | |
/// <summary> | |
/// Document Description | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("documentDescription")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? DocumentDescription { get; } | |
/// <summary> | |
/// Document Last Updated | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("documentUpdateTime")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public double? DocumentUpdateTime { get; } | |
/// <summary> | |
/// Updated Fields | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("updatedFields")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<ClientDocumentAttributeWithValuePublicApiDTO>? UpdatedFields { get; } | |
/// <summary> | |
/// Document Template Identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("documentTemplateId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? DocumentTemplateId { get; } | |
/// <summary> | |
/// Document Template Name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("documentTemplateName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? DocumentTemplateName { get; } | |
/// <summary> | |
/// Organization Identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("organizationId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? OrganizationId { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static ClientDocumentWithUpdatedAttributeValuesPublicApiDTO FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<ClientDocumentWithUpdatedAttributeValuesPublicApiDTO>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class ClientDocumentWithAttributeValuesBulkUpdatePublicApiRequest | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public ClientDocumentWithAttributeValuesBulkUpdatePublicApiRequest(string? @documentDescription, int? @documentId, string? @documentName, System.Collections.Generic.IDictionary<string, object>? @fields) | |
{ | |
this.DocumentId = @documentId; | |
this.DocumentName = @documentName; | |
this.DocumentDescription = @documentDescription; | |
this.Fields = @fields; | |
} /// <summary> | |
/// Document Identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("documentId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? DocumentId { get; } | |
/// <summary> | |
/// Document Name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("documentName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? DocumentName { get; } | |
/// <summary> | |
/// Document Description | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("documentDescription")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? DocumentDescription { get; } | |
/// <summary> | |
/// Fields | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fields")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.IDictionary<string, object>? Fields { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static ClientDocumentWithAttributeValuesBulkUpdatePublicApiRequest FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<ClientDocumentWithAttributeValuesBulkUpdatePublicApiRequest>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class ClientDocumentWithAttributeValuesPublicApiRequest | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public ClientDocumentWithAttributeValuesPublicApiRequest(string? @documentDescription, string? @documentName, System.Collections.Generic.IDictionary<string, object>? @fields) | |
{ | |
this.DocumentName = @documentName; | |
this.DocumentDescription = @documentDescription; | |
this.Fields = @fields; | |
} /// <summary> | |
/// Document Name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("documentName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? DocumentName { get; } | |
/// <summary> | |
/// Document Description | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("documentDescription")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? DocumentDescription { get; } | |
/// <summary> | |
/// Fields | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fields")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.IDictionary<string, object>? Fields { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static ClientDocumentWithAttributeValuesPublicApiRequest FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<ClientDocumentWithAttributeValuesPublicApiRequest>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class ClientDocumentWithAttributeValuesBulkCreatePublicApiRequest | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public ClientDocumentWithAttributeValuesBulkCreatePublicApiRequest(string? @documentDescription, string? @documentName, int? @documentTemplateId, System.Collections.Generic.IDictionary<string, object>? @fields, int? @organizationId) | |
{ | |
this.DocumentName = @documentName; | |
this.DocumentDescription = @documentDescription; | |
this.Fields = @fields; | |
this.DocumentTemplateId = @documentTemplateId; | |
this.OrganizationId = @organizationId; | |
} /// <summary> | |
/// Document Name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("documentName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? DocumentName { get; } | |
/// <summary> | |
/// Document Description | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("documentDescription")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? DocumentDescription { get; } | |
/// <summary> | |
/// Fields | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fields")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.IDictionary<string, object>? Fields { get; } | |
/// <summary> | |
/// Document Template Identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("documentTemplateId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? DocumentTemplateId { get; } | |
/// <summary> | |
/// Organization Identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("organizationId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? OrganizationId { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static ClientDocumentWithAttributeValuesBulkCreatePublicApiRequest FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<ClientDocumentWithAttributeValuesBulkCreatePublicApiRequest>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class AttributeContentAdvancedSettings | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public AttributeContentAdvancedSettings(AttributeContentAdvancedSettingsComplexityRules? @complexityRules, AttributeContentAdvancedSettingsDateFilters? @dateFilters, bool? @expandLargeValueOnRender, System.Collections.Generic.ICollection<string>? @fileExtensions, int? @fileMaxSize, AttributeContentAdvancedSettingsIpAddressType? @ipAddressType, int? @maxCharacters, System.Collections.Generic.ICollection<NodeClass>? @nodeClass, AttributeContentAdvancedSettingsNumericRange? @numericRange, System.Collections.Generic.ICollection<int>? @org) | |
{ | |
this.FileMaxSize = @fileMaxSize; | |
this.FileExtensions = @fileExtensions; | |
this.DateFilters = @dateFilters; | |
this.MaxCharacters = @maxCharacters; | |
this.ComplexityRules = @complexityRules; | |
this.NumericRange = @numericRange; | |
this.Org = @org; | |
this.NodeClass = @nodeClass; | |
this.IpAddressType = @ipAddressType; | |
this.ExpandLargeValueOnRender = @expandLargeValueOnRender; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("fileMaxSize")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? FileMaxSize { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("fileExtensions")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<string>? FileExtensions { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("dateFilters")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public AttributeContentAdvancedSettingsDateFilters? DateFilters { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("maxCharacters")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? MaxCharacters { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("complexityRules")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public AttributeContentAdvancedSettingsComplexityRules? ComplexityRules { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("numericRange")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public AttributeContentAdvancedSettingsNumericRange? NumericRange { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("org")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<int>? Org { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("nodeClass")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
// TODO(system.text.json): Add string enum item converter | |
public System.Collections.Generic.ICollection<NodeClass>? NodeClass { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("ipAddressType")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public AttributeContentAdvancedSettingsIpAddressType? IpAddressType { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("expandLargeValueOnRender")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? ExpandLargeValueOnRender { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static AttributeContentAdvancedSettings FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<AttributeContentAdvancedSettings>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class AttributeContentAdvancedSettingsComplexityRules | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public AttributeContentAdvancedSettingsComplexityRules(bool? @greaterOrEqualThanSixCharacters, bool? @mustContainOneInteger, bool? @mustContainOneLowercaseLetter, bool? @mustContainOneUppercaseLetter) | |
{ | |
this.MustContainOneInteger = @mustContainOneInteger; | |
this.MustContainOneLowercaseLetter = @mustContainOneLowercaseLetter; | |
this.MustContainOneUppercaseLetter = @mustContainOneUppercaseLetter; | |
this.GreaterOrEqualThanSixCharacters = @greaterOrEqualThanSixCharacters; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("mustContainOneInteger")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? MustContainOneInteger { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("mustContainOneLowercaseLetter")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? MustContainOneLowercaseLetter { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("mustContainOneUppercaseLetter")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? MustContainOneUppercaseLetter { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("greaterOrEqualThanSixCharacters")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? GreaterOrEqualThanSixCharacters { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static AttributeContentAdvancedSettingsComplexityRules FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<AttributeContentAdvancedSettingsComplexityRules>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class AttributeContentAdvancedSettingsDateFilters | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public AttributeContentAdvancedSettingsDateFilters(System.Collections.Generic.ICollection<string>? @selected, AttributeContentAdvancedSettingsDateFiltersType? @type) | |
{ | |
this.Type = @type; | |
this.Selected = @selected; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("type")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public AttributeContentAdvancedSettingsDateFiltersType? Type { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("selected")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<string>? Selected { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static AttributeContentAdvancedSettingsDateFilters FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<AttributeContentAdvancedSettingsDateFilters>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class AttributeContentAdvancedSettingsNumericRange | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public AttributeContentAdvancedSettingsNumericRange(int? @max, int? @min) | |
{ | |
this.Min = @min; | |
this.Max = @max; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("min")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? Min { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("max")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? Max { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static AttributeContentAdvancedSettingsNumericRange FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<AttributeContentAdvancedSettingsNumericRange>(data, options); | |
} | |
} | |
/// <summary> | |
/// Field content | |
/// </summary> | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class DocumentAttributeContentPublicApi | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public DocumentAttributeContentPublicApi(AttributeContentAdvancedSettings? @advancedSettings, string? @footerText, bool? @required, string? @tooltipText, System.Collections.Generic.ICollection<DocumentAttributeContentValuePublicApi>? @values) | |
{ | |
this.Values = @values; | |
this.Required = @required; | |
this.FooterText = @footerText; | |
this.TooltipText = @tooltipText; | |
this.AdvancedSettings = @advancedSettings; | |
} /// <summary> | |
/// Used for dropdown options | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("values")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<DocumentAttributeContentValuePublicApi>? Values { get; } | |
/// <summary> | |
/// Indicates if the field is required | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("required")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? Required { get; } | |
/// <summary> | |
/// Footer text | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("footerText")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? FooterText { get; } | |
/// <summary> | |
/// Tooltip text | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("tooltipText")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? TooltipText { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("advancedSettings")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public AttributeContentAdvancedSettings? AdvancedSettings { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static DocumentAttributeContentPublicApi FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<DocumentAttributeContentPublicApi>(data, options); | |
} | |
} | |
/// <summary> | |
/// Used for dropdown options | |
/// </summary> | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class DocumentAttributeContentValuePublicApi | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public DocumentAttributeContentValuePublicApi(bool? @active, System.Guid? @id, string? @name) | |
{ | |
this.Id = @id; | |
this.Name = @name; | |
this.Active = @active; | |
} /// <summary> | |
/// Identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("id")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Guid? Id { get; } | |
/// <summary> | |
/// Dropdown option name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("name")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Name { get; } | |
/// <summary> | |
/// Indicates if a dropdown option is active | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("active")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? Active { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static DocumentAttributeContentValuePublicApi FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<DocumentAttributeContentValuePublicApi>(data, options); | |
} | |
} | |
/// <summary> | |
/// Document template fields | |
/// </summary> | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class DocumentItemPublicApiDTO | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public DocumentItemPublicApiDTO(double? @createdTime, DocumentItemPublicApiDTOFieldApiPermission? @fieldApiPermission, DocumentAttributeContentPublicApi? @fieldContent, string? @fieldDefaultValue, string? @fieldDescription, int? @fieldId, string? @fieldLabel, string? @fieldName, DocumentItemPublicApiDTOFieldScriptPermission? @fieldScriptPermission, DocumentItemPublicApiDTOFieldTechnicianPermission? @fieldTechnicianPermission, DocumentItemPublicApiDTOFieldType? @fieldType, string? @uiElementName, DocumentItemPublicApiDTOUiElementType? @uiElementType, System.Guid? @uiElementUid, string? @uiElementValue, double? @updatedTime) | |
{ | |
this.FieldId = @fieldId; | |
this.FieldLabel = @fieldLabel; | |
this.FieldName = @fieldName; | |
this.FieldDescription = @fieldDescription; | |
this.FieldType = @fieldType; | |
this.FieldTechnicianPermission = @fieldTechnicianPermission; | |
this.FieldScriptPermission = @fieldScriptPermission; | |
this.FieldApiPermission = @fieldApiPermission; | |
this.FieldDefaultValue = @fieldDefaultValue; | |
this.FieldContent = @fieldContent; | |
this.UiElementUid = @uiElementUid; | |
this.UiElementName = @uiElementName; | |
this.UiElementType = @uiElementType; | |
this.UiElementValue = @uiElementValue; | |
this.CreatedTime = @createdTime; | |
this.UpdatedTime = @updatedTime; | |
} /// <summary> | |
/// Field identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? FieldId { get; } | |
/// <summary> | |
/// Field or UI element name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldLabel")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? FieldLabel { get; } | |
/// <summary> | |
/// Field name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? FieldName { get; } | |
/// <summary> | |
/// Field description | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldDescription")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? FieldDescription { get; } | |
/// <summary> | |
/// Field type | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldType")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public DocumentItemPublicApiDTOFieldType? FieldType { get; } | |
/// <summary> | |
/// Field technician permission | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldTechnicianPermission")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public DocumentItemPublicApiDTOFieldTechnicianPermission? FieldTechnicianPermission { get; } | |
/// <summary> | |
/// Field script permission | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldScriptPermission")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public DocumentItemPublicApiDTOFieldScriptPermission? FieldScriptPermission { get; } | |
/// <summary> | |
/// Field public API permission | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldApiPermission")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public DocumentItemPublicApiDTOFieldApiPermission? FieldApiPermission { get; } | |
/// <summary> | |
/// Default value | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldDefaultValue")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? FieldDefaultValue { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("fieldContent")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public DocumentAttributeContentPublicApi? FieldContent { get; } | |
/// <summary> | |
/// UI element identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("uiElementUid")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Guid? UiElementUid { get; } | |
/// <summary> | |
/// UI element name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("uiElementName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? UiElementName { get; } | |
/// <summary> | |
/// UI element type | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("uiElementType")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public DocumentItemPublicApiDTOUiElementType? UiElementType { get; } | |
/// <summary> | |
/// UI element value | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("uiElementValue")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? UiElementValue { get; } | |
/// <summary> | |
/// Creation time | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("createdTime")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public double? CreatedTime { get; } | |
/// <summary> | |
/// Last updated time | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("updatedTime")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public double? UpdatedTime { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static DocumentItemPublicApiDTO FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<DocumentItemPublicApiDTO>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class DocumentTemplatePublicApiDTO | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public DocumentTemplatePublicApiDTO(bool? @allowMultiple, double? @createTime, string? @description, System.Collections.Generic.ICollection<DocumentItemPublicApiDTO>? @fields, int? @id, bool? @mandatory, string? @name, double? @updateTime) | |
{ | |
this.Id = @id; | |
this.Name = @name; | |
this.Description = @description; | |
this.AllowMultiple = @allowMultiple; | |
this.Mandatory = @mandatory; | |
this.CreateTime = @createTime; | |
this.UpdateTime = @updateTime; | |
this.Fields = @fields; | |
} /// <summary> | |
/// Identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("id")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? Id { get; } | |
/// <summary> | |
/// Name of the template (must be unique) | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("name")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Name { get; } | |
/// <summary> | |
/// Description of the template | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("description")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Description { get; } | |
/// <summary> | |
/// Indicates if multiple instances of the document template is allowed | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("allowMultiple")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? AllowMultiple { get; } | |
/// <summary> | |
/// Indicates if the document template is mandatory | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("mandatory")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? Mandatory { get; } | |
/// <summary> | |
/// Creation time | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("createTime")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public double? CreateTime { get; } | |
/// <summary> | |
/// Last updated time | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("updateTime")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public double? UpdateTime { get; } | |
/// <summary> | |
/// Document template fields | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fields")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<DocumentItemPublicApiDTO>? Fields { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static DocumentTemplatePublicApiDTO FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<DocumentTemplatePublicApiDTO>(data, options); | |
} | |
} | |
/// <summary> | |
/// List of fields and ui elements | |
/// </summary> | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class UpdateDocumentItemPublicApiRequest | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public UpdateDocumentItemPublicApiRequest(UpdateDocumentItemPublicApiRequestFieldApiPermission? @fieldApiPermission, DocumentAttributeContentPublicApi? @fieldContent, string? @fieldDefaultValue, string? @fieldDescription, int? @fieldId, string? @fieldLabel, string? @fieldName, UpdateDocumentItemPublicApiRequestFieldScriptPermission? @fieldScriptPermission, UpdateDocumentItemPublicApiRequestFieldTechnicianPermission? @fieldTechnicianPermission, UpdateDocumentItemPublicApiRequestFieldType? @fieldType, string? @uiElementName, UpdateDocumentItemPublicApiRequestUiElementType? @uiElementType, System.Guid? @uiElementUid, string? @uiElementValue) | |
{ | |
this.FieldId = @fieldId; | |
this.FieldLabel = @fieldLabel; | |
this.FieldName = @fieldName; | |
this.FieldDescription = @fieldDescription; | |
this.FieldType = @fieldType; | |
this.FieldTechnicianPermission = @fieldTechnicianPermission; | |
this.FieldScriptPermission = @fieldScriptPermission; | |
this.FieldApiPermission = @fieldApiPermission; | |
this.FieldDefaultValue = @fieldDefaultValue; | |
this.FieldContent = @fieldContent; | |
this.UiElementUid = @uiElementUid; | |
this.UiElementName = @uiElementName; | |
this.UiElementType = @uiElementType; | |
this.UiElementValue = @uiElementValue; | |
} /// <summary> | |
/// Field identifier (Used to identify existing fields) | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? FieldId { get; } | |
/// <summary> | |
/// Field or UI element name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldLabel")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? FieldLabel { get; } | |
/// <summary> | |
/// Field name (Immutable except for new fields) | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? FieldName { get; } | |
/// <summary> | |
/// Field description | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldDescription")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? FieldDescription { get; } | |
/// <summary> | |
/// Field type (Immutable except for new fields) | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldType")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public UpdateDocumentItemPublicApiRequestFieldType? FieldType { get; } | |
/// <summary> | |
/// Field technician permission | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldTechnicianPermission")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public UpdateDocumentItemPublicApiRequestFieldTechnicianPermission? FieldTechnicianPermission { get; } | |
/// <summary> | |
/// Field script permission | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldScriptPermission")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public UpdateDocumentItemPublicApiRequestFieldScriptPermission? FieldScriptPermission { get; } | |
/// <summary> | |
/// Field public API permission | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldApiPermission")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public UpdateDocumentItemPublicApiRequestFieldApiPermission? FieldApiPermission { get; } | |
/// <summary> | |
/// Default value | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldDefaultValue")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? FieldDefaultValue { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("fieldContent")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public DocumentAttributeContentPublicApi? FieldContent { get; } | |
/// <summary> | |
/// UI element identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("uiElementUid")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Guid? UiElementUid { get; } | |
/// <summary> | |
/// UI element name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("uiElementName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? UiElementName { get; } | |
/// <summary> | |
/// UI element type | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("uiElementType")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public UpdateDocumentItemPublicApiRequestUiElementType? UiElementType { get; } | |
/// <summary> | |
/// UI element value | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("uiElementValue")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? UiElementValue { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static UpdateDocumentItemPublicApiRequest FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<UpdateDocumentItemPublicApiRequest>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class UpdateDocumentTemplatePublicApiRequest | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public UpdateDocumentTemplatePublicApiRequest(string? @description, System.Collections.Generic.ICollection<UpdateDocumentItemPublicApiRequest>? @fields, bool? @mandatory, string? @name) | |
{ | |
this.Name = @name; | |
this.Description = @description; | |
this.Mandatory = @mandatory; | |
this.Fields = @fields; | |
} /// <summary> | |
/// Name of the template (must be unique) | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("name")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Name { get; } | |
/// <summary> | |
/// Description of the template | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("description")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Description { get; } | |
/// <summary> | |
/// Indicates if the document template is mandatory | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("mandatory")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? Mandatory { get; } | |
/// <summary> | |
/// List of fields and ui elements | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fields")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<UpdateDocumentItemPublicApiRequest>? Fields { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static UpdateDocumentTemplatePublicApiRequest FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<UpdateDocumentTemplatePublicApiRequest>(data, options); | |
} | |
} | |
/// <summary> | |
/// Field content | |
/// </summary> | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class NewDocumentAttributeContentPublicApi | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public NewDocumentAttributeContentPublicApi(AttributeContentAdvancedSettings? @advancedSettings, string? @footerText, bool? @required, string? @tooltipText, System.Collections.Generic.ICollection<NewDocumentAttributeContentValuePublicApi>? @values) | |
{ | |
this.Values = @values; | |
this.Required = @required; | |
this.FooterText = @footerText; | |
this.TooltipText = @tooltipText; | |
this.AdvancedSettings = @advancedSettings; | |
} /// <summary> | |
/// Used for dropdown options | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("values")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<NewDocumentAttributeContentValuePublicApi>? Values { get; } | |
/// <summary> | |
/// Indicates if the field is required | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("required")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? Required { get; } | |
/// <summary> | |
/// Footer text | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("footerText")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? FooterText { get; } | |
/// <summary> | |
/// Tooltip text | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("tooltipText")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? TooltipText { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("advancedSettings")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public AttributeContentAdvancedSettings? AdvancedSettings { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static NewDocumentAttributeContentPublicApi FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<NewDocumentAttributeContentPublicApi>(data, options); | |
} | |
} | |
/// <summary> | |
/// Used for dropdown options | |
/// </summary> | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class NewDocumentAttributeContentValuePublicApi | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public NewDocumentAttributeContentValuePublicApi(string? @name) | |
{ | |
this.Name = @name; | |
} /// <summary> | |
/// Dropdown option name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("name")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Name { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static NewDocumentAttributeContentValuePublicApi FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<NewDocumentAttributeContentValuePublicApi>(data, options); | |
} | |
} | |
/// <summary> | |
/// List of fields and ui elements | |
/// </summary> | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class NewDocumentItemPublicApiRequest | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public NewDocumentItemPublicApiRequest(NewDocumentItemPublicApiRequestFieldApiPermission? @fieldApiPermission, NewDocumentAttributeContentPublicApi? @fieldContent, string? @fieldDefaultValue, string? @fieldDescription, string? @fieldLabel, string? @fieldName, NewDocumentItemPublicApiRequestFieldScriptPermission? @fieldScriptPermission, NewDocumentItemPublicApiRequestFieldTechnicianPermission? @fieldTechnicianPermission, NewDocumentItemPublicApiRequestFieldType? @fieldType, string? @uiElementName, NewDocumentItemPublicApiRequestUiElementType? @uiElementType, string? @uiElementValue) | |
{ | |
this.FieldLabel = @fieldLabel; | |
this.FieldName = @fieldName; | |
this.FieldDescription = @fieldDescription; | |
this.FieldType = @fieldType; | |
this.FieldTechnicianPermission = @fieldTechnicianPermission; | |
this.FieldScriptPermission = @fieldScriptPermission; | |
this.FieldApiPermission = @fieldApiPermission; | |
this.FieldDefaultValue = @fieldDefaultValue; | |
this.FieldContent = @fieldContent; | |
this.UiElementName = @uiElementName; | |
this.UiElementType = @uiElementType; | |
this.UiElementValue = @uiElementValue; | |
} /// <summary> | |
/// Field label | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldLabel")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? FieldLabel { get; } | |
/// <summary> | |
/// Field name (Immutable value) | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? FieldName { get; } | |
/// <summary> | |
/// Field description | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldDescription")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? FieldDescription { get; } | |
/// <summary> | |
/// Field type (Immutable value) | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldType")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public NewDocumentItemPublicApiRequestFieldType? FieldType { get; } | |
/// <summary> | |
/// Field technician permission | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldTechnicianPermission")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public NewDocumentItemPublicApiRequestFieldTechnicianPermission? FieldTechnicianPermission { get; } | |
/// <summary> | |
/// Field script permission | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldScriptPermission")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public NewDocumentItemPublicApiRequestFieldScriptPermission? FieldScriptPermission { get; } | |
/// <summary> | |
/// Field public API permission | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldApiPermission")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public NewDocumentItemPublicApiRequestFieldApiPermission? FieldApiPermission { get; } | |
/// <summary> | |
/// Default value | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fieldDefaultValue")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? FieldDefaultValue { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("fieldContent")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public NewDocumentAttributeContentPublicApi? FieldContent { get; } | |
/// <summary> | |
/// UI element name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("uiElementName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? UiElementName { get; } | |
/// <summary> | |
/// UI element type | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("uiElementType")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public NewDocumentItemPublicApiRequestUiElementType? UiElementType { get; } | |
/// <summary> | |
/// UI element value | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("uiElementValue")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? UiElementValue { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static NewDocumentItemPublicApiRequest FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<NewDocumentItemPublicApiRequest>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class NewDocumentTemplatePublicApiRequest | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public NewDocumentTemplatePublicApiRequest(bool? @allowMultiple, string? @description, System.Collections.Generic.ICollection<NewDocumentItemPublicApiRequest>? @fields, bool? @mandatory, string? @name) | |
{ | |
this.Name = @name; | |
this.Description = @description; | |
this.AllowMultiple = @allowMultiple; | |
this.Mandatory = @mandatory; | |
this.Fields = @fields; | |
} /// <summary> | |
/// Name of the template (must be unique) | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("name")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Name { get; } | |
/// <summary> | |
/// Description of the template | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("description")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Description { get; } | |
/// <summary> | |
/// States if multiple instances of the document template is allowed | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("allowMultiple")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? AllowMultiple { get; } | |
/// <summary> | |
/// Indicates if the document template is mandatory | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("mandatory")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? Mandatory { get; } | |
/// <summary> | |
/// List of fields and ui elements | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("fields")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<NewDocumentItemPublicApiRequest>? Fields { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static NewDocumentTemplatePublicApiRequest FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<NewDocumentTemplatePublicApiRequest>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class RelatedItemPublicApiDTO | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public RelatedItemPublicApiDTO(int? @createdByAppUserId, double? @createTime, object? @entity, int? @entityId, RelatedItemPublicApiDTOEntityType? @entityType, int? @id, object? @relEntity, int? @relEntityId, RelatedItemPublicApiDTORelEntityType? @relEntityType, RelatedItemPublicApiDTOType? @type, int? @updatedByAppUserId, double? @updateTime, object? @value) | |
{ | |
this.Id = @id; | |
this.Type = @type; | |
this.Entity = @entity; | |
this.EntityId = @entityId; | |
this.EntityType = @entityType; | |
this.RelEntity = @relEntity; | |
this.RelEntityId = @relEntityId; | |
this.RelEntityType = @relEntityType; | |
this.Value = @value; | |
this.CreateTime = @createTime; | |
this.UpdateTime = @updateTime; | |
this.CreatedByAppUserId = @createdByAppUserId; | |
this.UpdatedByAppUserId = @updatedByAppUserId; | |
} /// <summary> | |
/// Identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("id")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? Id { get; } | |
/// <summary> | |
/// Type of Relation | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("type")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public RelatedItemPublicApiDTOType? Type { get; } | |
/// <summary> | |
/// Entity | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("entity")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public object? Entity { get; } | |
/// <summary> | |
/// Entity Identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("entityId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? EntityId { get; } | |
/// <summary> | |
/// Entity Type | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("entityType")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public RelatedItemPublicApiDTOEntityType? EntityType { get; } | |
/// <summary> | |
/// Related Entity | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("relEntity")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public object? RelEntity { get; } | |
/// <summary> | |
/// Related Entity Identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("relEntityId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? RelEntityId { get; } | |
/// <summary> | |
/// Related Entity Type | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("relEntityType")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public RelatedItemPublicApiDTORelEntityType? RelEntityType { get; } | |
/// <summary> | |
/// Related item value (Attachment meta data / Secure information) | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("value")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public object? Value { get; } | |
/// <summary> | |
/// Creation time | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("createTime")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public double? CreateTime { get; } | |
/// <summary> | |
/// Last update time | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("updateTime")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public double? UpdateTime { get; } | |
/// <summary> | |
/// The identifier of the user who created the related item | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("createdByAppUserId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? CreatedByAppUserId { get; } | |
/// <summary> | |
/// The identifier of the last user to update the related item | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("updatedByAppUserId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? UpdatedByAppUserId { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static RelatedItemPublicApiDTO FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<RelatedItemPublicApiDTO>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class NewRelatedItemEntityRequest | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public NewRelatedItemEntityRequest(int? @relEntityId, NewRelatedItemEntityRequestRelEntityType? @relEntityType) | |
{ | |
this.RelEntityType = @relEntityType; | |
this.RelEntityId = @relEntityId; | |
} /// <summary> | |
/// Related Entity Type | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("relEntityType")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public NewRelatedItemEntityRequestRelEntityType? RelEntityType { get; } | |
/// <summary> | |
/// Related Entity Identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("relEntityId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? RelEntityId { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static NewRelatedItemEntityRequest FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<NewRelatedItemEntityRequest>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class NewRelatedItemSecureValueRequest | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public NewRelatedItemSecureValueRequest(string? @name, string? @notes, string? @password, string? @url, string? @username) | |
{ | |
this.Name = @name; | |
this.Url = @url; | |
this.Notes = @notes; | |
this.Username = @username; | |
this.Password = @password; | |
} /// <summary> | |
/// Name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("name")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Name { get; } | |
/// <summary> | |
/// URL | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("url")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Url { get; } | |
/// <summary> | |
/// Notes | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("notes")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Notes { get; } | |
/// <summary> | |
/// Username | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("username")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Username { get; } | |
/// <summary> | |
/// Password | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("password")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Password { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static NewRelatedItemSecureValueRequest FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<NewRelatedItemSecureValueRequest>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class BodyPart | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public BodyPart(ContentDisposition? @contentDisposition, object? @entity, System.Collections.Generic.IDictionary<string, System.Collections.Generic.ICollection<string>>? @headers, MediaType? @mediaType, MessageBodyWorkers? @messageBodyWorkers, System.Collections.Generic.IDictionary<string, System.Collections.Generic.ICollection<ParameterizedHeader>>? @parameterizedHeaders, MultiPart? @parent, object? @providers) | |
{ | |
this.ContentDisposition = @contentDisposition; | |
this.Entity = @entity; | |
this.Headers = @headers; | |
this.MediaType = @mediaType; | |
this.MessageBodyWorkers = @messageBodyWorkers; | |
this.Parent = @parent; | |
this.Providers = @providers; | |
this.ParameterizedHeaders = @parameterizedHeaders; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("contentDisposition")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public ContentDisposition? ContentDisposition { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("entity")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public object? Entity { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("headers")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.IDictionary<string, System.Collections.Generic.ICollection<string>>? Headers { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("mediaType")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public MediaType? MediaType { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("messageBodyWorkers")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public MessageBodyWorkers? MessageBodyWorkers { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("parent")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public MultiPart? Parent { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("providers")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public object? Providers { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("parameterizedHeaders")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.IDictionary<string, System.Collections.Generic.ICollection<ParameterizedHeader>>? ParameterizedHeaders { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static BodyPart FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<BodyPart>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class ContentDisposition | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public ContentDisposition(System.DateTimeOffset? @creationDate, string? @fileName, System.DateTimeOffset? @modificationDate, System.Collections.Generic.IDictionary<string, string>? @parameters, System.DateTimeOffset? @readDate, long? @size, string? @type) | |
{ | |
this.Type = @type; | |
this.Parameters = @parameters; | |
this.FileName = @fileName; | |
this.CreationDate = @creationDate; | |
this.ModificationDate = @modificationDate; | |
this.ReadDate = @readDate; | |
this.Size = @size; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("type")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Type { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("parameters")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.IDictionary<string, string>? Parameters { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("fileName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? FileName { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("creationDate")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.DateTimeOffset? CreationDate { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("modificationDate")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.DateTimeOffset? ModificationDate { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("readDate")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.DateTimeOffset? ReadDate { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("size")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public long? Size { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static ContentDisposition FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<ContentDisposition>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class FormDataBodyPart | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public FormDataBodyPart(ContentDisposition? @contentDisposition, object? @entity, FormDataContentDisposition? @formDataContentDisposition, System.Collections.Generic.IDictionary<string, System.Collections.Generic.ICollection<string>>? @headers, MediaType2? @mediaType, MessageBodyWorkers? @messageBodyWorkers, string? @name, System.Collections.Generic.IDictionary<string, System.Collections.Generic.ICollection<ParameterizedHeader>>? @parameterizedHeaders, MultiPart? @parent, object? @providers, bool? @simple, string? @value) | |
{ | |
this.ContentDisposition = @contentDisposition; | |
this.Entity = @entity; | |
this.Headers = @headers; | |
this.MediaType = @mediaType; | |
this.MessageBodyWorkers = @messageBodyWorkers; | |
this.Parent = @parent; | |
this.Providers = @providers; | |
this.Simple = @simple; | |
this.Name = @name; | |
this.Value = @value; | |
this.FormDataContentDisposition = @formDataContentDisposition; | |
this.ParameterizedHeaders = @parameterizedHeaders; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("contentDisposition")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public ContentDisposition? ContentDisposition { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("entity")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public object? Entity { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("headers")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.IDictionary<string, System.Collections.Generic.ICollection<string>>? Headers { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("mediaType")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public MediaType2? MediaType { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("messageBodyWorkers")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public MessageBodyWorkers? MessageBodyWorkers { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("parent")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public MultiPart? Parent { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("providers")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public object? Providers { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("simple")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? Simple { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("name")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Name { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("value")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Value { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("formDataContentDisposition")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public FormDataContentDisposition? FormDataContentDisposition { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("parameterizedHeaders")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.IDictionary<string, System.Collections.Generic.ICollection<ParameterizedHeader>>? ParameterizedHeaders { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static FormDataBodyPart FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<FormDataBodyPart>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class FormDataContentDisposition | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public FormDataContentDisposition(System.DateTimeOffset? @creationDate, string? @fileName, System.DateTimeOffset? @modificationDate, string? @name, System.Collections.Generic.IDictionary<string, string>? @parameters, System.DateTimeOffset? @readDate, long? @size, string? @type) | |
{ | |
this.Type = @type; | |
this.Parameters = @parameters; | |
this.FileName = @fileName; | |
this.CreationDate = @creationDate; | |
this.ModificationDate = @modificationDate; | |
this.ReadDate = @readDate; | |
this.Size = @size; | |
this.Name = @name; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("type")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Type { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("parameters")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.IDictionary<string, string>? Parameters { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("fileName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? FileName { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("creationDate")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.DateTimeOffset? CreationDate { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("modificationDate")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.DateTimeOffset? ModificationDate { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("readDate")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.DateTimeOffset? ReadDate { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("size")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public long? Size { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("name")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Name { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static FormDataContentDisposition FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<FormDataContentDisposition>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class MessageBodyWorkers | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public MessageBodyWorkers() | |
{ | |
} | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static MessageBodyWorkers FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<MessageBodyWorkers>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class MultiPart | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public MultiPart(System.Collections.Generic.ICollection<BodyPart>? @bodyParts, ContentDisposition? @contentDisposition, object? @entity, System.Collections.Generic.IDictionary<string, System.Collections.Generic.ICollection<string>>? @headers, MediaType3? @mediaType, MessageBodyWorkers? @messageBodyWorkers, System.Collections.Generic.IDictionary<string, System.Collections.Generic.ICollection<ParameterizedHeader>>? @parameterizedHeaders, MultiPart? @parent, object? @providers) | |
{ | |
this.ContentDisposition = @contentDisposition; | |
this.Entity = @entity; | |
this.Headers = @headers; | |
this.MediaType = @mediaType; | |
this.MessageBodyWorkers = @messageBodyWorkers; | |
this.Parent = @parent; | |
this.Providers = @providers; | |
this.BodyParts = @bodyParts; | |
this.ParameterizedHeaders = @parameterizedHeaders; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("contentDisposition")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public ContentDisposition? ContentDisposition { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("entity")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public object? Entity { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("headers")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.IDictionary<string, System.Collections.Generic.ICollection<string>>? Headers { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("mediaType")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public MediaType3? MediaType { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("messageBodyWorkers")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public MessageBodyWorkers? MessageBodyWorkers { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("parent")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public MultiPart? Parent { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("providers")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public object? Providers { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("bodyParts")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<BodyPart>? BodyParts { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("parameterizedHeaders")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.IDictionary<string, System.Collections.Generic.ICollection<ParameterizedHeader>>? ParameterizedHeaders { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static MultiPart FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<MultiPart>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class ParameterizedHeader | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public ParameterizedHeader(System.Collections.Generic.IDictionary<string, string>? @parameters, string? @value) | |
{ | |
this.Value = @value; | |
this.Parameters = @parameters; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("value")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Value { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("parameters")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.IDictionary<string, string>? Parameters { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static ParameterizedHeader FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<ParameterizedHeader>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class CarbonCopy | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public CarbonCopy(System.Collections.Generic.ICollection<string?>? @emails, System.Collections.Generic.ICollection<System.Guid?>? @uids) | |
{ | |
this.Uids = @uids; | |
this.Emails = @emails; | |
} /// <summary> | |
/// List of user uids to be carbon-copied | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("uids")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<System.Guid?>? Uids { get; } | |
/// <summary> | |
/// emails | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("emails")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<string?>? Emails { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static CarbonCopy FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<CarbonCopy>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class TicketingAttributeValue | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public TicketingAttributeValue(int @attributeId, int? @id, string @value) | |
{ | |
this.Id = @id; | |
this.AttributeId = @attributeId; | |
this.Value = @value; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("id")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? Id { get; } | |
/// <summary> | |
/// Attribute identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("attributeId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)] | |
public int AttributeId { get; } | |
/// <summary> | |
/// Attribute value | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("value")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)] | |
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] | |
public string Value { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static TicketingAttributeValue FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<TicketingAttributeValue>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class UpdateTicket | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public UpdateTicket(int? @assignedAppUserId, System.Collections.Generic.ICollection<TicketingAttributeValue?>? @attributes, CarbonCopy? @cc, int @clientId, int? @locationId, int? @nodeId, int? @parentTicketId, UpdateTicketPriority? @priority, System.Guid @requesterUid, UpdateTicketSeverity? @severity, string @status, string @subject, System.Collections.Generic.ICollection<string?>? @tags, int @ticketFormId, UpdateTicketType? @type, int @version) | |
{ | |
this.Version = @version; | |
this.ClientId = @clientId; | |
this.TicketFormId = @ticketFormId; | |
this.LocationId = @locationId; | |
this.NodeId = @nodeId; | |
this.Subject = @subject; | |
this.Status = @status; | |
this.Type = @type; | |
this.Cc = @cc; | |
this.AssignedAppUserId = @assignedAppUserId; | |
this.RequesterUid = @requesterUid; | |
this.Severity = @severity; | |
this.Priority = @priority; | |
this.ParentTicketId = @parentTicketId; | |
this.Tags = @tags; | |
this.Attributes = @attributes; | |
} /// <summary> | |
/// ticket version | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("version")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)] | |
public int Version { get; } | |
/// <summary> | |
/// Client (Organization) identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("clientId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)] | |
public int ClientId { get; } | |
/// <summary> | |
/// Ticket form identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("ticketFormId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)] | |
public int TicketFormId { get; } | |
/// <summary> | |
/// Location identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("locationId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? LocationId { get; } | |
/// <summary> | |
/// Device identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("nodeId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? NodeId { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("subject")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)] | |
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] | |
[System.ComponentModel.DataAnnotations.StringLength(200)] | |
public string Subject { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("status")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)] | |
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] | |
public string Status { get; } | |
/// <summary> | |
/// Type of ticket | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("type")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public UpdateTicketType? Type { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("cc")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public CarbonCopy? Cc { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("assignedAppUserId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? AssignedAppUserId { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("requesterUid")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)] | |
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] | |
public System.Guid RequesterUid { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("severity")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public UpdateTicketSeverity? Severity { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("priority")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public UpdateTicketPriority? Priority { get; } | |
/// <summary> | |
/// Ticket parent identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("parentTicketId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? ParentTicketId { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("tags")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<string?>? Tags { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("attributes")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<TicketingAttributeValue?>? Attributes { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static UpdateTicket FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<UpdateTicket>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class AttributeValueDTO | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public AttributeValueDTO(int? @attributeId, int? @id, object? @value) | |
{ | |
this.Id = @id; | |
this.AttributeId = @attributeId; | |
this.Value = @value; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("id")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? Id { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("attributeId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? AttributeId { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("value")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public object? Value { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static AttributeValueDTO FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<AttributeValueDTO>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class CcList | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public CcList(System.Collections.Generic.ICollection<string>? @emails, System.Collections.Generic.ICollection<System.Guid>? @uids) | |
{ | |
this.Uids = @uids; | |
this.Emails = @emails; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("uids")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<System.Guid>? Uids { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("emails")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<string>? Emails { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static CcList FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<CcList>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class TicketDTO | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public TicketDTO(int? @assignedAppUserId, System.Collections.Generic.ICollection<AttributeValueDTO>? @attributeValues, CcList? @ccList, int? @clientId, double? @createTime, bool? @deleted, int? @id, int? @locationId, int? @nodeId, TicketDTOPriority? @priority, System.Guid? @requesterUid, TicketDTOSeverity? @severity, TicketDTOSource? @source, TicketStatusPublicApiDTO? @status, string? @subject, System.Collections.Generic.ICollection<string>? @tags, int? @ticketFormId, TicketDTOType? @type, int? @version) | |
{ | |
this.Id = @id; | |
this.Version = @version; | |
this.NodeId = @nodeId; | |
this.ClientId = @clientId; | |
this.LocationId = @locationId; | |
this.AssignedAppUserId = @assignedAppUserId; | |
this.RequesterUid = @requesterUid; | |
this.Subject = @subject; | |
this.Status = @status; | |
this.Type = @type; | |
this.Priority = @priority; | |
this.Severity = @severity; | |
this.TicketFormId = @ticketFormId; | |
this.Source = @source; | |
this.Tags = @tags; | |
this.CcList = @ccList; | |
this.CreateTime = @createTime; | |
this.Deleted = @deleted; | |
this.AttributeValues = @attributeValues; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("id")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? Id { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("version")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? Version { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("nodeId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? NodeId { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("clientId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? ClientId { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("locationId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? LocationId { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("assignedAppUserId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? AssignedAppUserId { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("requesterUid")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Guid? RequesterUid { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("subject")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Subject { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("status")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public TicketStatusPublicApiDTO? Status { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("type")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public TicketDTOType? Type { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("priority")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public TicketDTOPriority? Priority { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("severity")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public TicketDTOSeverity? Severity { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("ticketFormId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? TicketFormId { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("source")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public TicketDTOSource? Source { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("tags")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<string>? Tags { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("ccList")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public CcList? CcList { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("createTime")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public double? CreateTime { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("deleted")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? Deleted { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("attributeValues")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<AttributeValueDTO>? AttributeValues { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static TicketDTO FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<TicketDTO>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class TicketStatusPublicApiDTO | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public TicketStatusPublicApiDTO(string? @displayName, string? @name, int? @parentId, int? @statusId) | |
{ | |
this.Name = @name; | |
this.DisplayName = @displayName; | |
this.ParentId = @parentId; | |
this.StatusId = @statusId; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("name")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Name { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("displayName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? DisplayName { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("parentId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? ParentId { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("statusId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? StatusId { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static TicketStatusPublicApiDTO FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<TicketStatusPublicApiDTO>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class NewTicket | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public NewTicket(int? @assignedAppUserId, System.Collections.Generic.ICollection<TicketingAttributeValue?>? @attributes, CarbonCopy? @cc, int @clientId, NewTicketLogEntry? @description, int? @locationId, int? @nodeId, int? @parentTicketId, NewTicketPriority? @priority, System.Guid? @requesterUid, NewTicketSeverity? @severity, string @status, string @subject, System.Collections.Generic.ICollection<string?>? @tags, int @ticketFormId, NewTicketType? @type) | |
{ | |
this.ClientId = @clientId; | |
this.TicketFormId = @ticketFormId; | |
this.LocationId = @locationId; | |
this.NodeId = @nodeId; | |
this.Subject = @subject; | |
this.Description = @description; | |
this.Status = @status; | |
this.Type = @type; | |
this.Cc = @cc; | |
this.AssignedAppUserId = @assignedAppUserId; | |
this.RequesterUid = @requesterUid; | |
this.Severity = @severity; | |
this.Priority = @priority; | |
this.ParentTicketId = @parentTicketId; | |
this.Tags = @tags; | |
this.Attributes = @attributes; | |
} /// <summary> | |
/// Client (Organization) identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("clientId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)] | |
public int ClientId { get; } | |
/// <summary> | |
/// Ticket form identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("ticketFormId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)] | |
public int TicketFormId { get; } | |
/// <summary> | |
/// Location identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("locationId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? LocationId { get; } | |
/// <summary> | |
/// Device identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("nodeId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? NodeId { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("subject")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)] | |
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] | |
[System.ComponentModel.DataAnnotations.StringLength(200)] | |
public string Subject { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("description")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public NewTicketLogEntry? Description { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("status")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)] | |
[System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] | |
public string Status { get; } | |
/// <summary> | |
/// Type of ticket | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("type")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public NewTicketType? Type { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("cc")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public CarbonCopy? Cc { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("assignedAppUserId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? AssignedAppUserId { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("requesterUid")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Guid? RequesterUid { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("severity")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public NewTicketSeverity? Severity { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("priority")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public NewTicketPriority? Priority { get; } | |
/// <summary> | |
/// Ticket parent identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("parentTicketId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? ParentTicketId { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("tags")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<string?>? Tags { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("attributes")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<TicketingAttributeValue?>? Attributes { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static NewTicket FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<NewTicket>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class NewTicketLogEntry | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public NewTicketLogEntry(string? @body, bool? @duplicateInIncidents, string? @htmlBody, bool @public, int? @timeTracked) | |
{ | |
this.Public = @public; | |
this.Body = @body; | |
this.HtmlBody = @htmlBody; | |
this.TimeTracked = @timeTracked; | |
this.DuplicateInIncidents = @duplicateInIncidents; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("public")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.Never)] | |
public bool Public { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("body")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Body { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("htmlBody")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? HtmlBody { get; } | |
/// <summary> | |
/// time in seconds | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("timeTracked")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? TimeTracked { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("duplicateInIncidents")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? DuplicateInIncidents { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static NewTicketLogEntry FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<NewTicketLogEntry>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class TechniciansTaggedMetadataDTO | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public TechniciansTaggedMetadataDTO(bool? @deleted, string? @displayName, string? @email, int? @id, bool? @permitted) | |
{ | |
this.Id = @id; | |
this.Email = @email; | |
this.DisplayName = @displayName; | |
this.Deleted = @deleted; | |
this.Permitted = @permitted; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("id")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? Id { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("email")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Email { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("displayName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? DisplayName { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("deleted")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? Deleted { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("permitted")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? Permitted { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static TechniciansTaggedMetadataDTO FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<TechniciansTaggedMetadataDTO>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class TicketLogEntryAutomationDTO | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public TicketLogEntryAutomationDTO(int? @id, string? @name, bool? @system, string? @type) | |
{ | |
this.Id = @id; | |
this.Name = @name; | |
this.System = @system; | |
this.Type = @type; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("id")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? Id { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("name")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Name { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("system")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? System { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("type")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Type { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static TicketLogEntryAutomationDTO FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<TicketLogEntryAutomationDTO>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class TicketLogEntryPublicApiDTO | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public TicketLogEntryPublicApiDTO(long? @activityId, int? @appUserContactId, TicketLogEntryPublicApiDTOAppUserContactType? @appUserContactType, System.Guid? @appUserContactUid, TicketLogEntryAutomationDTO? @automation, bool? @blockedByInvoice, string? @body, object? @changeDiff, double? @createTime, bool? @emailResponse, string? @fullEmailBody, string? @htmlBody, int? @id, bool? @publicEntry, bool? @system, System.Collections.Generic.ICollection<TechniciansTaggedMetadataDTO>? @techniciansTaggedMetadata, System.Collections.Generic.ICollection<int>? @technicianTagged, int? @timeTracked, TicketLogEntryPublicApiDTOType? @type) | |
{ | |
this.Id = @id; | |
this.AppUserContactUid = @appUserContactUid; | |
this.AppUserContactId = @appUserContactId; | |
this.AppUserContactType = @appUserContactType; | |
this.Type = @type; | |
this.Body = @body; | |
this.HtmlBody = @htmlBody; | |
this.FullEmailBody = @fullEmailBody; | |
this.PublicEntry = @publicEntry; | |
this.System = @system; | |
this.CreateTime = @createTime; | |
this.ChangeDiff = @changeDiff; | |
this.ActivityId = @activityId; | |
this.TimeTracked = @timeTracked; | |
this.TechnicianTagged = @technicianTagged; | |
this.TechniciansTaggedMetadata = @techniciansTaggedMetadata; | |
this.Automation = @automation; | |
this.BlockedByInvoice = @blockedByInvoice; | |
this.EmailResponse = @emailResponse; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("id")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? Id { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("appUserContactUid")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Guid? AppUserContactUid { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("appUserContactId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? AppUserContactId { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("appUserContactType")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public TicketLogEntryPublicApiDTOAppUserContactType? AppUserContactType { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("type")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public TicketLogEntryPublicApiDTOType? Type { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("body")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Body { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("htmlBody")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? HtmlBody { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("fullEmailBody")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? FullEmailBody { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("publicEntry")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? PublicEntry { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("system")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? System { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("createTime")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public double? CreateTime { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("changeDiff")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public object? ChangeDiff { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("activityId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public long? ActivityId { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("timeTracked")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? TimeTracked { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("technicianTagged")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<int>? TechnicianTagged { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("techniciansTaggedMetadata")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<TechniciansTaggedMetadataDTO>? TechniciansTaggedMetadata { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("automation")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public TicketLogEntryAutomationDTO? Automation { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("blockedByInvoice")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? BlockedByInvoice { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("emailResponse")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public bool? EmailResponse { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static TicketLogEntryPublicApiDTO FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<TicketLogEntryPublicApiDTO>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class BackupJob | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public BackupJob(double? @jobEndTime, System.Guid? @jobId, double? @jobStartTime, string? @jobStatus, int? @locationId, int? @organizationId, System.Guid? @planGuid, string? @planName, string? @planType, long? @totalActualStorageBytes) | |
{ | |
this.JobId = @jobId; | |
this.JobStartTime = @jobStartTime; | |
this.JobEndTime = @jobEndTime; | |
this.JobStatus = @jobStatus; | |
this.PlanGuid = @planGuid; | |
this.PlanName = @planName; | |
this.PlanType = @planType; | |
this.TotalActualStorageBytes = @totalActualStorageBytes; | |
this.OrganizationId = @organizationId; | |
this.LocationId = @locationId; | |
} /// <summary> | |
/// Job id | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("jobId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Guid? JobId { get; } | |
/// <summary> | |
/// Job start time | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("jobStartTime")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public double? JobStartTime { get; } | |
/// <summary> | |
/// Job end time | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("jobEndTime")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public double? JobEndTime { get; } | |
/// <summary> | |
/// Job status | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("jobStatus")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? JobStatus { get; } | |
/// <summary> | |
/// Plan id | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("planGuid")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Guid? PlanGuid { get; } | |
/// <summary> | |
/// Plan name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("planName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? PlanName { get; } | |
/// <summary> | |
/// Plan type | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("planType")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? PlanType { get; } | |
/// <summary> | |
/// Total bytes | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("totalActualStorageBytes")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public long? TotalActualStorageBytes { get; } | |
/// <summary> | |
/// Organization id | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("organizationId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? OrganizationId { get; } | |
/// <summary> | |
/// Location id | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("locationId")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? LocationId { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static BackupJob FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<BackupJob>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class BackupJobReport | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public BackupJobReport(Cursor? @cursor, System.Collections.Generic.ICollection<BackupJob>? @results) | |
{ | |
this.Cursor = @cursor; | |
this.Results = @results; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("cursor")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public Cursor? Cursor { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("results")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<BackupJob>? Results { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static BackupJobReport FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<BackupJobReport>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class Cursor | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public Cursor(int? @count, double? @expires, string? @name, int? @offset) | |
{ | |
this.Name = @name; | |
this.Offset = @offset; | |
this.Count = @count; | |
this.Expires = @expires; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("name")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Name { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("offset")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? Offset { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("count")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public int? Count { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("expires")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public double? Expires { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static Cursor FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<Cursor>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class LoggedOnUser | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public LoggedOnUser(double? @logonTime, string? @userName) | |
{ | |
this.UserName = @userName; | |
this.LogonTime = @logonTime; | |
} /// <summary> | |
/// User name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("userName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? UserName { get; } | |
/// <summary> | |
/// Time of logon | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("logonTime")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public double? LogonTime { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static LoggedOnUser FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<LoggedOnUser>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class OSPatch | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public OSPatch(System.Guid? @id, double? @installedAt, string? @kbNumber, string? @name, string? @severity, string? @status, string? @type) | |
{ | |
this.Id = @id; | |
this.Name = @name; | |
this.Severity = @severity; | |
this.Status = @status; | |
this.Type = @type; | |
this.InstalledAt = @installedAt; | |
this.KbNumber = @kbNumber; | |
} /// <summary> | |
/// Identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("id")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Guid? Id { get; } | |
/// <summary> | |
/// Name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("name")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Name { get; } | |
/// <summary> | |
/// Severity | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("severity")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Severity { get; } | |
/// <summary> | |
/// Status | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("status")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Status { get; } | |
/// <summary> | |
/// Type | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("type")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Type { get; } | |
/// <summary> | |
/// Installation attempt timestamp | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("installedAt")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public double? InstalledAt { get; } | |
/// <summary> | |
/// KB Number | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("kbNumber")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? KbNumber { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static OSPatch FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<OSPatch>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class SoftwarePatch | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public SoftwarePatch(System.Guid? @id, string? @impact, double? @installedAt, System.Guid? @productIdentifier, string? @status, string? @title, string? @type) | |
{ | |
this.Id = @id; | |
this.ProductIdentifier = @productIdentifier; | |
this.Title = @title; | |
this.Impact = @impact; | |
this.Status = @status; | |
this.Type = @type; | |
this.InstalledAt = @installedAt; | |
} /// <summary> | |
/// Identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("id")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Guid? Id { get; } | |
/// <summary> | |
/// Software product identifier | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("productIdentifier")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Guid? ProductIdentifier { get; } | |
/// <summary> | |
/// Patch title | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("title")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Title { get; } | |
/// <summary> | |
/// Impact | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("impact")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Impact { get; } | |
/// <summary> | |
/// Status | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("status")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Status { get; } | |
/// <summary> | |
/// Patch type | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("type")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Type { get; } | |
/// <summary> | |
/// Installation attempt timestamp | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("installedAt")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public double? InstalledAt { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static SoftwarePatch FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<SoftwarePatch>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class WindowsServiceConfiguration | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public WindowsServiceConfiguration(WindowsServiceConfigurationStartType? @startType, string? @userName) | |
{ | |
this.StartType = @startType; | |
this.UserName = @userName; | |
} /// <summary> | |
/// Start Type | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("startType")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] | |
public WindowsServiceConfigurationStartType? StartType { get; } | |
/// <summary> | |
/// Username | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("userName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? UserName { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static WindowsServiceConfiguration FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<WindowsServiceConfiguration>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class NetworkInterface | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public NetworkInterface(string? @adapterName, string? @defaultGateway, string? @dnsHostName, string? @dnsServers, string? @interfaceIndex, string? @interfaceName, string? @interfaceType, System.Collections.Generic.ICollection<string>? @ipAddress, string? @linkSpeed, System.Collections.Generic.ICollection<string>? @macAddress, string? @mtu, string? @status, string? @subnetMask) | |
{ | |
this.AdapterName = @adapterName; | |
this.DefaultGateway = @defaultGateway; | |
this.InterfaceType = @interfaceType; | |
this.DnsHostName = @dnsHostName; | |
this.DnsServers = @dnsServers; | |
this.InterfaceIndex = @interfaceIndex; | |
this.InterfaceName = @interfaceName; | |
this.IpAddress = @ipAddress; | |
this.LinkSpeed = @linkSpeed; | |
this.MacAddress = @macAddress; | |
this.Mtu = @mtu; | |
this.Status = @status; | |
this.SubnetMask = @subnetMask; | |
} /// <summary> | |
/// Adapter Name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("adapterName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? AdapterName { get; } | |
/// <summary> | |
/// Default Gateway | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("defaultGateway")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? DefaultGateway { get; } | |
/// <summary> | |
/// Interface Type | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("interfaceType")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? InterfaceType { get; } | |
/// <summary> | |
/// DNS HostName | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("dnsHostName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? DnsHostName { get; } | |
/// <summary> | |
/// DNS Servers | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("dnsServers")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? DnsServers { get; } | |
/// <summary> | |
/// Interface Index | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("interfaceIndex")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? InterfaceIndex { get; } | |
/// <summary> | |
/// Interface Name | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("interfaceName")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? InterfaceName { get; } | |
/// <summary> | |
/// IP Address | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("ipAddress")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<string>? IpAddress { get; } | |
/// <summary> | |
/// Link Speed | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("linkSpeed")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? LinkSpeed { get; } | |
/// <summary> | |
/// MAC Address | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("macAddress")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<string>? MacAddress { get; } | |
/// <summary> | |
/// MTU | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("mtu")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Mtu { get; } | |
/// <summary> | |
/// Status | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("status")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? Status { get; } | |
/// <summary> | |
/// Subnet Mask | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("subnetMask")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? SubnetMask { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static NetworkInterface FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<NetworkInterface>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class AgentDevice : Device | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public AgentDevice(DeviceApprovalStatus? @approvalStatus, double? @created, string? @displayName, string? @dnsName, System.Collections.Generic.IDictionary<string, object>? @fields, int? @id, System.Collections.Generic.ICollection<string>? @ipAddresses, double? @lastContact, string? @lastLoggedInUser, double? @lastUpdate, int? @locationId, System.Collections.Generic.ICollection<string>? @macAddresses, Maintenance? @maintenance, Memory? @memory, string? @netbiosName, DeviceNodeClass? @nodeClass, int? @nodeRoleId, System.Collections.Generic.ICollection<Note>? @notes, bool? @offline, int? @organizationId, OperatingSystem? @os, int? @parentDeviceId, int? @policyId, System.Collections.Generic.ICollection<Processor>? @processors, string? @publicIP, NodeReferences? @references, int? @rolePolicyId, ComputerSystem? @system, string? @systemName, System.Collections.Generic.ICollection<string>? @tags, object? @userData, System.Collections.Generic.ICollection<Volume>? @volumes) | |
: base(approvalStatus, created, displayName, dnsName, fields, id, ipAddresses, lastContact, lastUpdate, locationId, macAddresses, maintenance, netbiosName, nodeClass, nodeRoleId, notes, offline, organizationId, parentDeviceId, policyId, publicIP, references, rolePolicyId, systemName, tags, userData) | |
{ | |
this.Os = @os; | |
this.System = @system; | |
this.Memory = @memory; | |
this.Processors = @processors; | |
this.Volumes = @volumes; | |
this.LastLoggedInUser = @lastLoggedInUser; | |
} | |
[System.Text.Json.Serialization.JsonPropertyName("os")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public OperatingSystem? Os { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("system")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public ComputerSystem? System { get; } | |
[System.Text.Json.Serialization.JsonPropertyName("memory")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public Memory? Memory { get; } | |
/// <summary> | |
/// Processors | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("processors")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<Processor>? Processors { get; } | |
/// <summary> | |
/// Disk Volumes | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("volumes")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public System.Collections.Generic.ICollection<Volume>? Volumes { get; } | |
/// <summary> | |
/// Username that logged in most recently | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("lastLoggedInUser")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public string? LastLoggedInUser { get; } | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static AgentDevice FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<AgentDevice>(data, options); | |
} | |
} | |
/// <summary> | |
/// Device Backup Usage | |
/// </summary> | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class BackupUsage | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public BackupUsage(long? @cloudFileFolderSize, long? @cloudImageSize, long? @cloudTotalSize, long? @localFileFolderSize, long? @localImageSize, long? @localTotalSize, long? @revisionsCurrentSize, long? @revisionsDeletedSize, long? @revisionsPreviousSize, long? @revisionsTotalSize) | |
{ | |
this.RevisionsCurrentSize = @revisionsCurrentSize; | |
this.RevisionsPreviousSize = @revisionsPreviousSize; | |
this.RevisionsDeletedSize = @revisionsDeletedSize; | |
this.LocalFileFolderSize = @localFileFolderSize; | |
this.LocalImageSize = @localImageSize; | |
this.CloudFileFolderSize = @cloudFileFolderSize; | |
this.CloudImageSize = @cloudImageSize; | |
this.RevisionsTotalSize = @revisionsTotalSize; | |
this.CloudTotalSize = @cloudTotalSize; | |
this.LocalTotalSize = @localTotalSize; | |
} /// <summary> | |
/// Revisions current size | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("revisionsCurrentSize")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public long? RevisionsCurrentSize { get; } | |
/// <summary> | |
/// Revisions previous size | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("revisionsPreviousSize")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public long? RevisionsPreviousSize { get; } | |
/// <summary> | |
/// Revisions deleted size | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("revisionsDeletedSize")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public long? RevisionsDeletedSize { get; } | |
/// <summary> | |
/// Revisions local file folder size | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("localFileFolderSize")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public long? LocalFileFolderSize { get; } | |
/// <summary> | |
/// Revisions local image size | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("localImageSize")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public long? LocalImageSize { get; } | |
/// <summary> | |
/// Revisions cloud file folder size | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("cloudFileFolderSize")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public long? CloudFileFolderSize { get; } | |
/// <summary> | |
/// Revisions cloud image size | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("cloudImageSize")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public long? CloudImageSize { get; } | |
/// <summary> | |
/// Revisions total size | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("revisionsTotalSize")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public long? RevisionsTotalSize { get; } | |
/// <summary> | |
/// Revisions cloud total size | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("cloudTotalSize")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public long? CloudTotalSize { get; } | |
/// <summary> | |
/// Revisions local total size | |
/// </summary> | |
[System.Text.Json.Serialization.JsonPropertyName("localTotalSize")] | |
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)] | |
public long? LocalTotalSize { get; } | |
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties; | |
[System.Text.Json.Serialization.JsonExtensionData] | |
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties | |
{ | |
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); } | |
set { _additionalProperties = value; } | |
} | |
public string ToJson() | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Serialize(this, options); | |
} | |
public static BackupUsage FromJson(string data) | |
{ | |
var options = new System.Text.Json.JsonSerializerOptions(); | |
return System.Text.Json.JsonSerializer.Deserialize<BackupUsage>(data, options); | |
} | |
} | |
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] | |
public partial class CloudMonitorDNS : Device | |
{ | |
[System.Text.Json.Serialization.JsonConstructor] | |
public CloudMonitorDNS(DeviceApprovalStatus? @approvalStatus, double? @created, string? @displayName, string? @dnsName, bool? @enabled, System.Collections.Generic.IDictionary<string, object>? @fields, int? @id, int? @interval, System.Collections.Generic.ICollection<string>? @ipAddresses, double? @lastContact, double? @lastUpdate, int? @locationId, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment