Skip to content

Commit

Permalink
chore: update DBRPs API (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
bednar authored Jun 23, 2021
1 parent 63493e5 commit 45d5963
Show file tree
Hide file tree
Showing 7 changed files with 622 additions and 312 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This release introduces a support for new InfluxDB OSS API definitions - [oss.ym
- `DeleteService` is used to delete time series data instead of `DefaultService`
- `Run` contains list of `LogEvent` in `Log` property
- `DBRPs` contains list of `DBRP` in `Content` property
- `DBRPsService` uses `DBRPCreate` to create `DBRP`
- Inheritance structure:
- `Check` <- `CheckDiscriminator` <- `CheckBase`
- `NotificationEndpoint` <- `NotificationEndpointDiscriminator` <- `NotificationEndpointBase`
Expand All @@ -26,7 +27,7 @@ This release introduces a support for new InfluxDB OSS API definitions - [oss.ym
1. [#206](https://github.com/influxdata/influxdb-client-csharp/pull/206): Use optional args to pass query parameters into API list call - useful for the ability to use pagination.

### API
1. [#206](https://github.com/influxdata/influxdb-client-csharp/pull/206), [#210](https://github.com/influxdata/influxdb-client-csharp/pull/210): Use InfluxDB OSS API definitions to generated APIs
1. [#206](https://github.com/influxdata/influxdb-client-csharp/pull/206), [#210](https://github.com/influxdata/influxdb-client-csharp/pull/210), [#211](https://github.com/influxdata/influxdb-client-csharp/pull/211): Use InfluxDB OSS API definitions to generated APIs

## 1.19.0 [2021-06-04]

Expand Down
31 changes: 11 additions & 20 deletions Client/InfluxDB.Client.Api/Domain/DBRP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@ protected DBRP() { }
/// Initializes a new instance of the <see cref="DBRP" /> class.
/// </summary>
/// <param name="orgID">the organization ID that owns this mapping. (required).</param>
/// <param name="org">the organization that owns this mapping..</param>
/// <param name="bucketID">the bucket ID used as target for the translation. (required).</param>
/// <param name="database">InfluxDB v1 database (required).</param>
/// <param name="retentionPolicy">InfluxDB v1 retention policy (required).</param>
/// <param name="_default">Specify if this mapping represents the default retention policy for the database specificed..</param>
/// <param name="_default">Specify if this mapping represents the default retention policy for the database specificed. (required).</param>
/// <param name="links">links.</param>
public DBRP(string orgID = default(string), string org = default(string), string bucketID = default(string), string database = default(string), string retentionPolicy = default(string), bool? _default = default(bool?), Links links = default(Links))
public DBRP(string orgID = default(string), string bucketID = default(string), string database = default(string), string retentionPolicy = default(string), bool? _default = default(bool?), Links links = default(Links))
{
// to ensure "orgID" is required (not null)
if (orgID == null)
Expand Down Expand Up @@ -82,8 +81,15 @@ protected DBRP() { }
{
this.RetentionPolicy = retentionPolicy;
}
this.Org = org;
this.Default = _default;
// to ensure "_default" is required (not null)
if (_default == null)
{
throw new InvalidDataException("_default is a required property for DBRP and cannot be null");
}
else
{
this.Default = _default;
}
this.Links = links;
}

Expand All @@ -101,13 +107,6 @@ protected DBRP() { }
[DataMember(Name="orgID", EmitDefaultValue=false)]
public string OrgID { get; set; }

/// <summary>
/// the organization that owns this mapping.
/// </summary>
/// <value>the organization that owns this mapping.</value>
[DataMember(Name="org", EmitDefaultValue=false)]
public string Org { get; set; }

/// <summary>
/// the bucket ID used as target for the translation.
/// </summary>
Expand Down Expand Up @@ -152,7 +151,6 @@ public override string ToString()
sb.Append("class DBRP {\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" OrgID: ").Append(OrgID).Append("\n");
sb.Append(" Org: ").Append(Org).Append("\n");
sb.Append(" BucketID: ").Append(BucketID).Append("\n");
sb.Append(" Database: ").Append(Database).Append("\n");
sb.Append(" RetentionPolicy: ").Append(RetentionPolicy).Append("\n");
Expand Down Expand Up @@ -202,11 +200,6 @@ public bool Equals(DBRP input)
(this.OrgID != null &&
this.OrgID.Equals(input.OrgID))
) &&
(
this.Org == input.Org ||
(this.Org != null &&
this.Org.Equals(input.Org))
) &&
(
this.BucketID == input.BucketID ||
(this.BucketID != null &&
Expand Down Expand Up @@ -247,8 +240,6 @@ public override int GetHashCode()
hashCode = hashCode * 59 + this.Id.GetHashCode();
if (this.OrgID != null)
hashCode = hashCode * 59 + this.OrgID.GetHashCode();
if (this.Org != null)
hashCode = hashCode * 59 + this.Org.GetHashCode();
if (this.BucketID != null)
hashCode = hashCode * 59 + this.BucketID.GetHashCode();
if (this.Database != null)
Expand Down
229 changes: 229 additions & 0 deletions Client/InfluxDB.Client.Api/Domain/DBRPCreate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
/*
* Influx OSS API Service
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* OpenAPI spec version: 2.0.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>
/// DBRPCreate
/// </summary>
[DataContract]
public partial class DBRPCreate : IEquatable<DBRPCreate>
{
/// <summary>
/// Initializes a new instance of the <see cref="DBRPCreate" /> class.
/// </summary>
[JsonConstructorAttribute]
protected DBRPCreate() { }
/// <summary>
/// Initializes a new instance of the <see cref="DBRPCreate" /> class.
/// </summary>
/// <param name="orgID">the organization ID that owns this mapping..</param>
/// <param name="org">the organization that owns this mapping..</param>
/// <param name="bucketID">the bucket ID used as target for the translation. (required).</param>
/// <param name="database">InfluxDB v1 database (required).</param>
/// <param name="retentionPolicy">InfluxDB v1 retention policy (required).</param>
/// <param name="_default">Specify if this mapping represents the default retention policy for the database specificed..</param>
public DBRPCreate(string orgID = default(string), string org = default(string), string bucketID = default(string), string database = default(string), string retentionPolicy = default(string), bool? _default = default(bool?))
{
// to ensure "bucketID" is required (not null)
if (bucketID == null)
{
throw new InvalidDataException("bucketID is a required property for DBRPCreate and cannot be null");
}
else
{
this.BucketID = bucketID;
}
// to ensure "database" is required (not null)
if (database == null)
{
throw new InvalidDataException("database is a required property for DBRPCreate and cannot be null");
}
else
{
this.Database = database;
}
// to ensure "retentionPolicy" is required (not null)
if (retentionPolicy == null)
{
throw new InvalidDataException("retentionPolicy is a required property for DBRPCreate and cannot be null");
}
else
{
this.RetentionPolicy = retentionPolicy;
}
this.OrgID = orgID;
this.Org = org;
this.Default = _default;
}

/// <summary>
/// the organization ID that owns this mapping.
/// </summary>
/// <value>the organization ID that owns this mapping.</value>
[DataMember(Name="orgID", EmitDefaultValue=false)]
public string OrgID { get; set; }

/// <summary>
/// the organization that owns this mapping.
/// </summary>
/// <value>the organization that owns this mapping.</value>
[DataMember(Name="org", EmitDefaultValue=false)]
public string Org { get; set; }

/// <summary>
/// the bucket ID used as target for the translation.
/// </summary>
/// <value>the bucket ID used as target for the translation.</value>
[DataMember(Name="bucketID", EmitDefaultValue=false)]
public string BucketID { get; set; }

/// <summary>
/// InfluxDB v1 database
/// </summary>
/// <value>InfluxDB v1 database</value>
[DataMember(Name="database", EmitDefaultValue=false)]
public string Database { get; set; }

/// <summary>
/// InfluxDB v1 retention policy
/// </summary>
/// <value>InfluxDB v1 retention policy</value>
[DataMember(Name="retention_policy", EmitDefaultValue=false)]
public string RetentionPolicy { get; set; }

/// <summary>
/// Specify if this mapping represents the default retention policy for the database specificed.
/// </summary>
/// <value>Specify if this mapping represents the default retention policy for the database specificed.</value>
[DataMember(Name="default", EmitDefaultValue=false)]
public bool? Default { 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 DBRPCreate {\n");
sb.Append(" OrgID: ").Append(OrgID).Append("\n");
sb.Append(" Org: ").Append(Org).Append("\n");
sb.Append(" BucketID: ").Append(BucketID).Append("\n");
sb.Append(" Database: ").Append(Database).Append("\n");
sb.Append(" RetentionPolicy: ").Append(RetentionPolicy).Append("\n");
sb.Append(" Default: ").Append(Default).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 DBRPCreate);
}

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

return
(
this.OrgID == input.OrgID ||
(this.OrgID != null &&
this.OrgID.Equals(input.OrgID))
) &&
(
this.Org == input.Org ||
(this.Org != null &&
this.Org.Equals(input.Org))
) &&
(
this.BucketID == input.BucketID ||
(this.BucketID != null &&
this.BucketID.Equals(input.BucketID))
) &&
(
this.Database == input.Database ||
(this.Database != null &&
this.Database.Equals(input.Database))
) &&
(
this.RetentionPolicy == input.RetentionPolicy ||
(this.RetentionPolicy != null &&
this.RetentionPolicy.Equals(input.RetentionPolicy))
) &&
(
this.Default == input.Default ||
(this.Default != null &&
this.Default.Equals(input.Default))
);
}

/// <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.OrgID != null)
hashCode = hashCode * 59 + this.OrgID.GetHashCode();
if (this.Org != null)
hashCode = hashCode * 59 + this.Org.GetHashCode();
if (this.BucketID != null)
hashCode = hashCode * 59 + this.BucketID.GetHashCode();
if (this.Database != null)
hashCode = hashCode * 59 + this.Database.GetHashCode();
if (this.RetentionPolicy != null)
hashCode = hashCode * 59 + this.RetentionPolicy.GetHashCode();
if (this.Default != null)
hashCode = hashCode * 59 + this.Default.GetHashCode();
return hashCode;
}
}

}

}
Loading

0 comments on commit 45d5963

Please sign in to comment.