Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## 1.2.0 [unreleased]

### API
1. [#42](https://github.com/influxdata/influxdb-client-csharp/pull/42): Updated swagger to latest version


## 1.1.0 [2019-10-11]

### Breaking Changes
Expand Down
2 changes: 1 addition & 1 deletion Client.Core.Test/AbstractMockServerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void ResetServer()
[OneTimeTearDown]
public void ShutdownServer()
{
MockServer.Stop();
MockServer?.Stop();
}

protected IResponseBuilder CreateErrorResponse(string influxDbError)
Expand Down
1 change: 1 addition & 0 deletions Client.Test/ItBucketsApiTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ public async Task FindBucketLogsPaging()
}

[Test]
[Ignore("TODO https://github.com/influxdata/influxdb/issues/14900")]
public async Task FindBuckets()
{
var size = (await _bucketsApi.FindBucketsAsync()).Count;
Expand Down
9 changes: 7 additions & 2 deletions Client.Test/ItTasksApiTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ public class ItTasksApiTest : AbstractItClientTest

_usersApi = Client.GetUsersApi();

(await _tasksApi.FindTasksAsync()).ForEach(async task => await _tasksApi.DeleteTaskAsync(task));
foreach (var task in (await _tasksApi.FindTasksAsync()).Where(task => task.Name.EndsWith("-IT")))
await _tasksApi.DeleteTaskAsync(task);

var organizationsApi = Client.GetOrganizationsApi();
foreach (var org in (await organizationsApi.FindOrganizationsAsync()).Where(org => org.Name.EndsWith("-IT")))
await organizationsApi.DeleteOrganizationAsync(org);
}

private const string TaskFlux = "from(bucket: \"my-bucket\")\n\t|> range(start: 0)\n\t|> last()";
Expand Down Expand Up @@ -521,7 +526,7 @@ public async Task Runs()
Assert.Greater(DateTime.Now, run.StartedAt);
Assert.Greater(DateTime.Now, run.FinishedAt);
Assert.Greater(DateTime.Now, run.ScheduledFor);
Assert.AreEqual(run.RequestedAt, DateTime.Parse("0001-01-01 00:00:00"));
Assert.IsNull(run.RequestedAt);

task = await _tasksApi.FindTaskByIdAsync(task.Id);
Assert.IsNotNull(task.LatestCompleted);
Expand Down
170 changes: 170 additions & 0 deletions Client/InfluxDB.Client.Api/Domain/DeletePredicateRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
/*
* Influx API Service
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* OpenAPI spec version: 0.1.0
*
* Generated by: https://github.com/openapitools/openapi-generator.git
*/

using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using OpenAPIDateConverter = InfluxDB.Client.Api.Client.OpenAPIDateConverter;

namespace InfluxDB.Client.Api.Domain
{
/// <summary>
/// the delete predicate request
/// </summary>
[DataContract]
public partial class DeletePredicateRequest : IEquatable<DeletePredicateRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="DeletePredicateRequest" /> class.
/// </summary>
[JsonConstructorAttribute]
protected DeletePredicateRequest() { }
/// <summary>
/// Initializes a new instance of the <see cref="DeletePredicateRequest" /> class.
/// </summary>
/// <param name="start">RFC3339Nano. (required).</param>
/// <param name="stop">RFC3339Nano. (required).</param>
/// <param name="predicate">sql where like delete statement.</param>
public DeletePredicateRequest(DateTime? start = default(DateTime?), DateTime? stop = default(DateTime?), string predicate = default(string))
{
// to ensure "start" is required (not null)
if (start == null)
{
throw new InvalidDataException("start is a required property for DeletePredicateRequest and cannot be null");
}
else
{
this.Start = start;
}
// to ensure "stop" is required (not null)
if (stop == null)
{
throw new InvalidDataException("stop is a required property for DeletePredicateRequest and cannot be null");
}
else
{
this.Stop = stop;
}
this.Predicate = predicate;
}

/// <summary>
/// RFC3339Nano.
/// </summary>
/// <value>RFC3339Nano.</value>
[DataMember(Name="start", EmitDefaultValue=false)]
public DateTime? Start { get; set; }

/// <summary>
/// RFC3339Nano.
/// </summary>
/// <value>RFC3339Nano.</value>
[DataMember(Name="stop", EmitDefaultValue=false)]
public DateTime? Stop { get; set; }

/// <summary>
/// sql where like delete statement
/// </summary>
/// <value>sql where like delete statement</value>
[DataMember(Name="predicate", EmitDefaultValue=false)]
public string Predicate { get; set; }

/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class DeletePredicateRequest {\n");
sb.Append(" Start: ").Append(Start).Append("\n");
sb.Append(" Stop: ").Append(Stop).Append("\n");
sb.Append(" Predicate: ").Append(Predicate).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}

/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as DeletePredicateRequest);
}

/// <summary>
/// Returns true if DeletePredicateRequest instances are equal
/// </summary>
/// <param name="input">Instance of DeletePredicateRequest to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(DeletePredicateRequest input)
{
if (input == null)
return false;

return
(
this.Start == input.Start ||
(this.Start != null &&
this.Start.Equals(input.Start))
) &&
(
this.Stop == input.Stop ||
(this.Stop != null &&
this.Stop.Equals(input.Stop))
) &&
(
this.Predicate == input.Predicate ||
(this.Predicate != null &&
this.Predicate.Equals(input.Predicate))
);
}

/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.Start != null)
hashCode = hashCode * 59 + this.Start.GetHashCode();
if (this.Stop != null)
hashCode = hashCode * 59 + this.Stop.GetHashCode();
if (this.Predicate != null)
hashCode = hashCode * 59 + this.Predicate.GetHashCode();
return hashCode;
}
}

}

}
Loading