-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c108bb
commit c3d62d3
Showing
5 changed files
with
297 additions
and
9 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"id": "7832b8b1-xxxx-xxxx-xxxx-8ee6253b0aab", | ||
"created_at": "2023-12-11T00:26:25.877353+00:00", | ||
"updated_at": "2023-12-25T03:00:27.492802+00:00", | ||
"key": "5A87B3-XXXXXX-XXXXXX-XXXXXX-XXXXXX-666F6E", | ||
"revoked": false, | ||
"suspended": false, | ||
"total_activations": 0, | ||
"total_deactivations": 0, | ||
"validity": 0, | ||
"allowed_activations": 20, | ||
"type": "hosted-floating", | ||
"server_sync_grace_period": 86400, | ||
"server_sync_interval": 3600, | ||
"lease_duration": 3630, | ||
"product_id": "95e61f3a-xxxx-xxxx-xxxx-5aaa9321ba23", | ||
"notes": null, | ||
"metadata": [ | ||
{ | ||
"id": "f38f378d-xxxx-xxxx-xxxx-5ca758a917e2", | ||
"key": "pollination/account-id", | ||
"value": "1da45dba-xxxx-xxxx-xxxx-b5df2f28e3bd", | ||
"visible": false | ||
} | ||
] | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,252 @@ | ||
/* | ||
* pollination-server | ||
* | ||
* Pollination Server OpenAPI Definition | ||
* | ||
* Contact: [email protected] | ||
* 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 System.ComponentModel.DataAnnotations; | ||
|
||
|
||
namespace PollinationSDK | ||
{ | ||
/// <summary> | ||
/// Metadata | ||
/// </summary> | ||
[DataContract(Name = "LicenseMetadata")] | ||
public partial class LicenseMetadata : CryptlexBase, IEquatable<LicenseMetadata>, IValidatableObject | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="Metadata" /> class. | ||
/// </summary> | ||
[JsonConstructorAttribute] | ||
protected LicenseMetadata() | ||
{ | ||
// Set non-required readonly properties with defaultValue | ||
this.Type = "LicenseMetadata"; | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="Metadata" /> class. | ||
/// </summary> | ||
/// <param name="key">key (required).</param> | ||
/// <param name="value">value (required).</param> | ||
/// <param name="id">id.</param> | ||
/// <param name="visible">visible (default to false).</param> | ||
public LicenseMetadata | ||
( | ||
string key, string value, // Required parameters | ||
string id = default, bool visible = false // Optional parameters | ||
) : base()// BaseClass | ||
{ | ||
// to ensure "key" is required (not null) | ||
this.Key = key ?? throw new ArgumentNullException("key is a required property for Metadata and cannot be null"); | ||
// to ensure "value" is required (not null) | ||
this.Value = value ?? throw new ArgumentNullException("value is a required property for Metadata and cannot be null"); | ||
this.Id = id; | ||
this.Visible = visible; | ||
|
||
// Set non-required readonly properties with defaultValue | ||
this.Type = "LicenseMetadata"; | ||
} | ||
|
||
//============================================== is ReadOnly | ||
/// <summary> | ||
/// Gets or Sets Type | ||
/// </summary> | ||
[DataMember(Name = "type", EmitDefaultValue = true)] | ||
public override string Type { get; protected set; } = "LicenseMetadata"; | ||
|
||
/// <summary> | ||
/// Gets or Sets Key | ||
/// </summary> | ||
[DataMember(Name = "key", IsRequired = true, EmitDefaultValue = false)] | ||
public string Key { get; set; } | ||
/// <summary> | ||
/// Gets or Sets Value | ||
/// </summary> | ||
[DataMember(Name = "value", IsRequired = true, EmitDefaultValue = false)] | ||
public string Value { get; set; } | ||
/// <summary> | ||
/// Gets or Sets Id | ||
/// </summary> | ||
[DataMember(Name = "id", EmitDefaultValue = false)] | ||
public string Id { get; set; } | ||
/// <summary> | ||
/// Gets or Sets Visible | ||
/// </summary> | ||
[DataMember(Name = "visible", EmitDefaultValue = true)] | ||
public bool Visible { get; set; } = false; | ||
|
||
/// <summary> | ||
/// Returns the string presentation of the object | ||
/// </summary> | ||
/// <returns>String presentation of the object</returns> | ||
public override string ToString() | ||
{ | ||
return "LicenseMetadata"; | ||
} | ||
|
||
/// <summary> | ||
/// Returns the string presentation of the object | ||
/// </summary> | ||
/// <returns>String presentation of the object</returns> | ||
public override string ToString(bool detailed) | ||
{ | ||
if (!detailed) | ||
return this.ToString(); | ||
|
||
var sb = new StringBuilder(); | ||
sb.Append("LicenseMetadata:\n"); | ||
sb.Append(" Type: ").Append(Type).Append("\n"); | ||
sb.Append(" Key: ").Append(Key).Append("\n"); | ||
sb.Append(" Value: ").Append(Value).Append("\n"); | ||
sb.Append(" Id: ").Append(Id).Append("\n"); | ||
sb.Append(" Visible: ").Append(Visible).Append("\n"); | ||
return sb.ToString(); | ||
} | ||
|
||
/// <summary> | ||
/// Returns the object from JSON string | ||
/// </summary> | ||
/// <returns>Metadata object</returns> | ||
public static LicenseMetadata FromJson(string json) | ||
{ | ||
var obj = JsonConvert.DeserializeObject<LicenseMetadata>(json, JsonSetting.AnyOfConvertSetting); | ||
if (obj == null) | ||
return null; | ||
return obj.Type.ToLower() == obj.GetType().Name.ToLower() ? obj : null; | ||
} | ||
|
||
/// <summary> | ||
/// Creates a new instance with the same properties. | ||
/// </summary> | ||
/// <returns>Metadata object</returns> | ||
public virtual LicenseMetadata DuplicateMetadata() | ||
{ | ||
return FromJson(this.ToJson()); | ||
} | ||
|
||
/// <summary> | ||
/// Creates a new instance with the same properties. | ||
/// </summary> | ||
/// <returns>OpenAPIGenBaseModel</returns> | ||
public override OpenAPIGenBaseModel Duplicate() | ||
{ | ||
return DuplicateMetadata(); | ||
} | ||
|
||
/// <summary> | ||
/// Creates a new instance with the same properties. | ||
/// </summary> | ||
/// <returns>OpenAPIGenBaseModel</returns> | ||
public override CryptlexBase DuplicateCryptlexBase() | ||
{ | ||
return DuplicateMetadata(); | ||
} | ||
|
||
/// <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) | ||
{ | ||
input = input is AnyOf anyOf ? anyOf.Obj : input; | ||
return this.Equals(input as LicenseMetadata); | ||
} | ||
|
||
/// <summary> | ||
/// Returns true if Metadata instances are equal | ||
/// </summary> | ||
/// <param name="input">Instance of Metadata to be compared</param> | ||
/// <returns>Boolean</returns> | ||
public bool Equals(LicenseMetadata input) | ||
{ | ||
if (input == null) | ||
return false; | ||
return base.Equals(input) && | ||
( | ||
this.Key == input.Key || | ||
(this.Key != null && | ||
this.Key.Equals(input.Key)) | ||
) && base.Equals(input) && | ||
( | ||
this.Value == input.Value || | ||
(this.Value != null && | ||
this.Value.Equals(input.Value)) | ||
) && base.Equals(input) && | ||
( | ||
this.Id == input.Id || | ||
(this.Id != null && | ||
this.Id.Equals(input.Id)) | ||
) && base.Equals(input) && | ||
( | ||
this.Visible == input.Visible || | ||
(this.Visible != null && | ||
this.Visible.Equals(input.Visible)) | ||
) && base.Equals(input) && | ||
( | ||
this.Type == input.Type || | ||
(this.Type != null && | ||
this.Type.Equals(input.Type)) | ||
); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the hash code | ||
/// </summary> | ||
/// <returns>Hash code</returns> | ||
public override int GetHashCode() | ||
{ | ||
unchecked // Overflow is fine, just wrap | ||
{ | ||
int hashCode = base.GetHashCode(); | ||
if (this.Key != null) | ||
hashCode = hashCode * 59 + this.Key.GetHashCode(); | ||
if (this.Value != null) | ||
hashCode = hashCode * 59 + this.Value.GetHashCode(); | ||
if (this.Id != null) | ||
hashCode = hashCode * 59 + this.Id.GetHashCode(); | ||
if (this.Visible != null) | ||
hashCode = hashCode * 59 + this.Visible.GetHashCode(); | ||
if (this.Type != null) | ||
hashCode = hashCode * 59 + this.Type.GetHashCode(); | ||
return hashCode; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// To validate all properties of the instance | ||
/// </summary> | ||
/// <param name="validationContext">Validation context</param> | ||
/// <returns>Validation Result</returns> | ||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext) | ||
{ | ||
foreach (var x in base.BaseValidate(validationContext)) yield return x; | ||
|
||
|
||
// Type (string) pattern | ||
Regex regexType = new Regex(@"^LicenseMetadata", RegexOptions.CultureInvariant); | ||
if (false == regexType.Match(this.Type).Success) | ||
{ | ||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Type, must match a pattern of " + regexType, new[] { "Type" }); | ||
} | ||
|
||
yield break; | ||
} | ||
} | ||
} |
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