Skip to content

Commit 40c9e33

Browse files
committed
fix(*): manually fix generated codes
1 parent 1b5a464 commit 40c9e33

File tree

12 files changed

+490
-120
lines changed

12 files changed

+490
-120
lines changed

docs/Metadata.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11

2-
# PollinationSDK.Model.Metadata
2+
# PollinationSDK.Model.MetaData
33

44
## Properties
55

66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
8-
**Key** | **string** | |
9-
**Value** | **string** | |
10-
**Id** | **string** | | [optional]
11-
**Visible** | **bool** | | [optional] [default to false]
12-
**Type** | **string** | | [optional] [readonly] [default to "Metadata"]
8+
**Name** | **string** | Package name. Make it descriptive and helpful ;) |
9+
**Tag** | **string** | The tag of the package |
10+
**Type** | **string** | | [optional] [readonly] [default to "MetaData"]
11+
**Annotations** | **Dictionary<string, string>** | An optional dictionary to add annotations to inputs. These annotations will be used by the client side libraries. | [optional]
12+
**AppVersion** | **string** | The version of the application code underlying the manifest | [optional]
13+
**Keywords** | **List<string>** | A list of keywords to search the package by | [optional]
14+
**Maintainers** | [**List<Maintainer>**](Maintainer.md) | A list of maintainers for the package | [optional]
15+
**Home** | **string** | The URL of this package's home page | [optional]
16+
**Sources** | **List<string>** | A list of URLs to source code for this project | [optional]
17+
**Icon** | **string** | A URL to an SVG or PNG image to be used as an icon | [optional]
18+
**Deprecated** | **bool** | Whether this package is deprecated | [optional]
19+
**Description** | **string** | A description of what this package does | [optional]
20+
**License** | [**License**](License.md) | The license information. | [optional]
1321

1422
[[Back to Model list]](../README.md#documentation-for-models)
1523
[[Back to API list]](../README.md#documentation-for-api-endpoints)

src/PollinationSDK/Interface/Server/Rest/Projects/Query.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/PollinationSDK/Interface/Server/Rest/Repositories/Query.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/PollinationSDK/Model/Activation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ protected Activation()
5858
public Activation
5959
(
6060
string id, DateTime createdAt, DateTime updatedAt, bool offline, DateTime lastSyncedAt, Location location, // Required parameters
61-
string os= default, string osVersion= default, string hostname= default, string appVersion= default, DateTime leaseExpiresAt= default, List<Metadata> metadata= default, string licenseId= default // Optional parameters
61+
string os= default, string osVersion= default, string hostname= default, string appVersion= default, DateTime leaseExpiresAt= default, List<LicenseMetadata> metadata= default, string licenseId= default // Optional parameters
6262
) : base()// BaseClass
6363
{
6464
// to ensure "id" is required (not null)
@@ -147,7 +147,7 @@ public Activation
147147
/// Gets or Sets Metadata
148148
/// </summary>
149149
[DataMember(Name = "metadata", EmitDefaultValue = false)]
150-
public List<Metadata> Metadata { get; set; }
150+
public List<LicenseMetadata> Metadata { get; set; }
151151
/// <summary>
152152
/// Gets or Sets LicenseId
153153
/// </summary>

src/PollinationSDK/Model/HTTPValidationError.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace PollinationSDK
2727
/// HTTPValidationError
2828
/// </summary>
2929
[DataContract(Name = "HTTPValidationError")]
30-
public partial class HTTPValidationError : IEquatable<HTTPValidationError>, IValidatableObject
30+
public partial class HTTPValidationError : OpenAPIGenBaseModel, IEquatable<HTTPValidationError>, IValidatableObject
3131
{
3232
/// <summary>
3333
/// Initializes a new instance of the <see cref="HTTPValidationError" /> class.
@@ -40,7 +40,6 @@ public HTTPValidationError
4040
)// BaseClass
4141
{
4242
this.Detail = detail;
43-
4443
// Set non-required readonly properties with defaultValue
4544
}
4645

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
/*
2+
* pollination-server
3+
*
4+
* Pollination Server OpenAPI Definition
5+
*
6+
* Contact: [email protected]
7+
* Generated by: https://github.com/openapitools/openapi-generator.git
8+
*/
9+
10+
using System;
11+
using System.Linq;
12+
using System.IO;
13+
using System.Text;
14+
using System.Text.RegularExpressions;
15+
using System.Collections;
16+
using System.Collections.Generic;
17+
using System.Collections.ObjectModel;
18+
using System.Runtime.Serialization;
19+
using Newtonsoft.Json;
20+
using Newtonsoft.Json.Converters;
21+
using System.ComponentModel.DataAnnotations;
22+
23+
24+
namespace PollinationSDK
25+
{
26+
/// <summary>
27+
/// Metadata
28+
/// </summary>
29+
[DataContract(Name = "Metadata")]
30+
public partial class LicenseMetadata : CryptlexBase, IEquatable<LicenseMetadata>, IValidatableObject
31+
{
32+
/// <summary>
33+
/// Initializes a new instance of the <see cref="Metadata" /> class.
34+
/// </summary>
35+
[JsonConstructorAttribute]
36+
protected LicenseMetadata()
37+
{
38+
// Set non-required readonly properties with defaultValue
39+
this.Type = "Metadata";
40+
}
41+
42+
/// <summary>
43+
/// Initializes a new instance of the <see cref="Metadata" /> class.
44+
/// </summary>
45+
/// <param name="key">key (required).</param>
46+
/// <param name="value">value (required).</param>
47+
/// <param name="id">id.</param>
48+
/// <param name="visible">visible (default to false).</param>
49+
public LicenseMetadata
50+
(
51+
string key, string value, // Required parameters
52+
string id= default, bool visible = false // Optional parameters
53+
) : base()// BaseClass
54+
{
55+
// to ensure "key" is required (not null)
56+
this.Key = key ?? throw new ArgumentNullException("key is a required property for Metadata and cannot be null");
57+
// to ensure "value" is required (not null)
58+
this.Value = value ?? throw new ArgumentNullException("value is a required property for Metadata and cannot be null");
59+
this.Id = id;
60+
this.Visible = visible;
61+
62+
// Set non-required readonly properties with defaultValue
63+
this.Type = "Metadata";
64+
}
65+
66+
//============================================== is ReadOnly
67+
/// <summary>
68+
/// Gets or Sets Type
69+
/// </summary>
70+
[DataMember(Name = "type", EmitDefaultValue = true)]
71+
public string Type { get; protected internal set; } = "Metadata";
72+
73+
/// <summary>
74+
/// Gets or Sets Key
75+
/// </summary>
76+
[DataMember(Name = "key", IsRequired = true, EmitDefaultValue = false)]
77+
public string Key { get; set; }
78+
/// <summary>
79+
/// Gets or Sets Value
80+
/// </summary>
81+
[DataMember(Name = "value", IsRequired = true, EmitDefaultValue = false)]
82+
public string Value { get; set; }
83+
/// <summary>
84+
/// Gets or Sets Id
85+
/// </summary>
86+
[DataMember(Name = "id", EmitDefaultValue = false)]
87+
public string Id { get; set; }
88+
/// <summary>
89+
/// Gets or Sets Visible
90+
/// </summary>
91+
[DataMember(Name = "visible", EmitDefaultValue = true)]
92+
public bool Visible { get; set; } = false;
93+
94+
/// <summary>
95+
/// Returns the string presentation of the object
96+
/// </summary>
97+
/// <returns>String presentation of the object</returns>
98+
public override string ToString()
99+
{
100+
return "Metadata";
101+
}
102+
103+
/// <summary>
104+
/// Returns the string presentation of the object
105+
/// </summary>
106+
/// <returns>String presentation of the object</returns>
107+
public override string ToString(bool detailed)
108+
{
109+
if (!detailed)
110+
return this.ToString();
111+
112+
var sb = new StringBuilder();
113+
sb.Append("Metadata:\n");
114+
sb.Append(" Type: ").Append(Type).Append("\n");
115+
sb.Append(" Key: ").Append(Key).Append("\n");
116+
sb.Append(" Value: ").Append(Value).Append("\n");
117+
sb.Append(" Id: ").Append(Id).Append("\n");
118+
sb.Append(" Visible: ").Append(Visible).Append("\n");
119+
return sb.ToString();
120+
}
121+
122+
/// <summary>
123+
/// Returns the object from JSON string
124+
/// </summary>
125+
/// <returns>Metadata object</returns>
126+
public static LicenseMetadata FromJson(string json)
127+
{
128+
var obj = JsonConvert.DeserializeObject<LicenseMetadata>(json, JsonSetting.AnyOfConvertSetting);
129+
if (obj == null)
130+
return null;
131+
return obj.Type.ToLower() == obj.GetType().Name.ToLower() ? obj : null;
132+
}
133+
134+
/// <summary>
135+
/// Creates a new instance with the same properties.
136+
/// </summary>
137+
/// <returns>Metadata object</returns>
138+
public virtual LicenseMetadata DuplicateMetadata()
139+
{
140+
return FromJson(this.ToJson());
141+
}
142+
143+
/// <summary>
144+
/// Creates a new instance with the same properties.
145+
/// </summary>
146+
/// <returns>OpenAPIGenBaseModel</returns>
147+
public override OpenAPIGenBaseModel Duplicate()
148+
{
149+
return DuplicateMetadata();
150+
}
151+
152+
/// <summary>
153+
/// Creates a new instance with the same properties.
154+
/// </summary>
155+
/// <returns>OpenAPIGenBaseModel</returns>
156+
public override CryptlexBase DuplicateCryptlexBase()
157+
{
158+
return DuplicateMetadata();
159+
}
160+
161+
/// <summary>
162+
/// Returns true if objects are equal
163+
/// </summary>
164+
/// <param name="input">Object to be compared</param>
165+
/// <returns>Boolean</returns>
166+
public override bool Equals(object input)
167+
{
168+
input = input is AnyOf anyOf ? anyOf.Obj : input;
169+
return this.Equals(input as LicenseMetadata);
170+
}
171+
172+
/// <summary>
173+
/// Returns true if Metadata instances are equal
174+
/// </summary>
175+
/// <param name="input">Instance of Metadata to be compared</param>
176+
/// <returns>Boolean</returns>
177+
public bool Equals(LicenseMetadata input)
178+
{
179+
if (input == null)
180+
return false;
181+
return base.Equals(input) &&
182+
(
183+
this.Key == input.Key ||
184+
(this.Key != null &&
185+
this.Key.Equals(input.Key))
186+
) && base.Equals(input) &&
187+
(
188+
this.Value == input.Value ||
189+
(this.Value != null &&
190+
this.Value.Equals(input.Value))
191+
) && base.Equals(input) &&
192+
(
193+
this.Id == input.Id ||
194+
(this.Id != null &&
195+
this.Id.Equals(input.Id))
196+
) && base.Equals(input) &&
197+
(
198+
this.Visible == input.Visible ||
199+
(this.Visible != null &&
200+
this.Visible.Equals(input.Visible))
201+
) && base.Equals(input) &&
202+
(
203+
this.Type == input.Type ||
204+
(this.Type != null &&
205+
this.Type.Equals(input.Type))
206+
);
207+
}
208+
209+
/// <summary>
210+
/// Gets the hash code
211+
/// </summary>
212+
/// <returns>Hash code</returns>
213+
public override int GetHashCode()
214+
{
215+
unchecked // Overflow is fine, just wrap
216+
{
217+
int hashCode = base.GetHashCode();
218+
if (this.Key != null)
219+
hashCode = hashCode * 59 + this.Key.GetHashCode();
220+
if (this.Value != null)
221+
hashCode = hashCode * 59 + this.Value.GetHashCode();
222+
if (this.Id != null)
223+
hashCode = hashCode * 59 + this.Id.GetHashCode();
224+
if (this.Visible != null)
225+
hashCode = hashCode * 59 + this.Visible.GetHashCode();
226+
if (this.Type != null)
227+
hashCode = hashCode * 59 + this.Type.GetHashCode();
228+
return hashCode;
229+
}
230+
}
231+
232+
/// <summary>
233+
/// To validate all properties of the instance
234+
/// </summary>
235+
/// <param name="validationContext">Validation context</param>
236+
/// <returns>Validation Result</returns>
237+
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
238+
{
239+
foreach(var x in base.BaseValidate(validationContext)) yield return x;
240+
241+
242+
// Type (string) pattern
243+
Regex regexType = new Regex(@"^Metadata$", RegexOptions.CultureInvariant);
244+
if (false == regexType.Match(this.Type).Success)
245+
{
246+
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Type, must match a pattern of " + regexType, new [] { "Type" });
247+
}
248+
249+
yield break;
250+
}
251+
}
252+
}

src/PollinationSDK/Model/LicensePublic.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public partial class LicensePublic : License, IEquatable<LicensePublic>, IValida
3333
/// Gets or Sets Type
3434
/// </summary>
3535
[DataMember(Name="type", EmitDefaultValue=false)]
36-
public LicenseType Type { get; set; }
36+
public LicenseType LicenseType { get; set; }
3737
/// <summary>
3838
/// Initializes a new instance of the <see cref="LicensePublic" /> class.
3939
/// </summary>
@@ -68,7 +68,7 @@ protected LicensePublic()
6868
/// <param name="url">A URL to the license used for the package..</param>
6969
public LicensePublic
7070
(
71-
string name, string id, DateTime createdAt, DateTime updatedAt, string key, bool revoked, bool suspended, int totalActivations, int totalDeactivations, int validity, int allowedActivations, int serverSyncGracePeriod, int serverSyncInterval, int leaseDuration, string productId, List<Metadata> metadata, LicenseType type, // Required parameters
71+
string name, string id, DateTime createdAt, DateTime updatedAt, string key, bool revoked, bool suspended, int totalActivations, int totalDeactivations, int validity, int allowedActivations, int serverSyncGracePeriod, int serverSyncInterval, int leaseDuration, string productId, List<LicenseMetadata> metadata, LicenseType type, // Required parameters
7272
Dictionary<string, string> annotations= default, string url= default, string notes= default// Optional parameters
7373
) : base(name: name, annotations: annotations, url: url)// BaseClass
7474
{
@@ -91,7 +91,7 @@ public LicensePublic
9191
this.ProductId = productId ?? throw new ArgumentNullException("productId is a required property for LicensePublic and cannot be null");
9292
// to ensure "metadata" is required (not null)
9393
this.Metadata = metadata ?? throw new ArgumentNullException("metadata is a required property for LicensePublic and cannot be null");
94-
this.Type = type;
94+
this.LicenseType = type;
9595
this.Notes = notes;
9696

9797
// Set non-required readonly properties with defaultValue
@@ -173,7 +173,7 @@ public LicensePublic
173173
/// Gets or Sets Metadata
174174
/// </summary>
175175
[DataMember(Name = "metadata", IsRequired = true, EmitDefaultValue = false)]
176-
public List<Metadata> Metadata { get; set; }
176+
public List<LicenseMetadata> Metadata { get; set; }
177177
/// <summary>
178178
/// Gets or Sets Notes
179179
/// </summary>

0 commit comments

Comments
 (0)