Skip to content

Commit 5b85c84

Browse files
author
Yang Bai
committed
[TIME-3146] Test payrollau V2 code gen
1 parent 2ebd5d0 commit 5b85c84

19 files changed

Lines changed: 1381 additions & 1 deletion

File tree

Xero.NetStandard.OAuth2/Client/ApiClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public string Serialize(object obj)
8989
String result = JsonConvert.SerializeObject(obj, _serializerSettings);
9090

9191
// when dealing with AU Payroll & Accounting API, we should convert DateTime object to Wcf Json Date String
92-
if (obj.GetType().FullName.Contains(@"Xero.NetStandard.OAuth2.Model.Accounting") || obj.GetType().FullName.Contains(@"Xero.NetStandard.OAuth2.Model.PayrollAu") )
92+
if (obj.GetType().FullName.Contains(@"Xero.NetStandard.OAuth2.Model.Accounting") || obj.GetType().FullName.Contains(@"Xero.NetStandard.OAuth2.Model.PayrollAu") || obj.GetType().FullName.Contains(@"Xero.NetStandard.OAuth2.Model.PayrollAuV2"))
9393
{
9494
string dateTimePattern = @"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z";
9595

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
/*
2+
* Xero Payroll AU API 2.0
3+
*
4+
* This is the Xero Payroll API 2.0 for orgs in Australia region.
5+
*
6+
* Contact: api@xero.com
7+
* Generated by: https://github.com/openapitools/openapi-generator.git
8+
*/
9+
10+
11+
using System;
12+
using System.Linq;
13+
using System.IO;
14+
using System.Text;
15+
using System.Text.RegularExpressions;
16+
using System.Collections;
17+
using System.Collections.Generic;
18+
using System.Collections.ObjectModel;
19+
using System.Runtime.Serialization;
20+
using Newtonsoft.Json;
21+
using Newtonsoft.Json.Converters;
22+
using System.ComponentModel.DataAnnotations;
23+
using OpenAPIDateConverter = Xero.NetStandard.OAuth2.Client.OpenAPIDateConverter;
24+
25+
namespace Xero.NetStandard.OAuth2.Model.PayrollAuV2
26+
{
27+
/// <summary>
28+
/// InvalidField
29+
/// </summary>
30+
[DataContract]
31+
public partial class InvalidField : IEquatable<InvalidField>, IValidatableObject
32+
{
33+
34+
/// <summary>
35+
/// The name of the field that caused the error
36+
/// </summary>
37+
/// <value>The name of the field that caused the error</value>
38+
[DataMember(Name="name", EmitDefaultValue=false)]
39+
public string Name { get; set; }
40+
41+
/// <summary>
42+
/// The reason the error occurred
43+
/// </summary>
44+
/// <value>The reason the error occurred</value>
45+
[DataMember(Name="reason", EmitDefaultValue=false)]
46+
public string Reason { get; set; }
47+
48+
/// <summary>
49+
/// Returns the string presentation of the object
50+
/// </summary>
51+
/// <returns>String presentation of the object</returns>
52+
public override string ToString()
53+
{
54+
var sb = new StringBuilder();
55+
sb.Append("class InvalidField {\n");
56+
sb.Append(" Name: ").Append(Name).Append("\n");
57+
sb.Append(" Reason: ").Append(Reason).Append("\n");
58+
sb.Append("}\n");
59+
return sb.ToString();
60+
}
61+
62+
/// <summary>
63+
/// Returns the JSON string presentation of the object
64+
/// </summary>
65+
/// <returns>JSON string presentation of the object</returns>
66+
public virtual string ToJson()
67+
{
68+
return JsonConvert.SerializeObject(this, Formatting.Indented);
69+
}
70+
71+
/// <summary>
72+
/// Returns true if objects are equal
73+
/// </summary>
74+
/// <param name="input">Object to be compared</param>
75+
/// <returns>Boolean</returns>
76+
public override bool Equals(object input)
77+
{
78+
return this.Equals(input as InvalidField);
79+
}
80+
81+
/// <summary>
82+
/// Returns true if InvalidField instances are equal
83+
/// </summary>
84+
/// <param name="input">Instance of InvalidField to be compared</param>
85+
/// <returns>Boolean</returns>
86+
public bool Equals(InvalidField input)
87+
{
88+
if (input == null)
89+
return false;
90+
91+
return
92+
(
93+
this.Name == input.Name ||
94+
(this.Name != null &&
95+
this.Name.Equals(input.Name))
96+
) &&
97+
(
98+
this.Reason == input.Reason ||
99+
(this.Reason != null &&
100+
this.Reason.Equals(input.Reason))
101+
);
102+
}
103+
104+
/// <summary>
105+
/// Gets the hash code
106+
/// </summary>
107+
/// <returns>Hash code</returns>
108+
public override int GetHashCode()
109+
{
110+
unchecked // Overflow is fine, just wrap
111+
{
112+
int hashCode = 41;
113+
if (this.Name != null)
114+
hashCode = hashCode * 59 + this.Name.GetHashCode();
115+
if (this.Reason != null)
116+
hashCode = hashCode * 59 + this.Reason.GetHashCode();
117+
return hashCode;
118+
}
119+
}
120+
121+
/// <summary>
122+
/// To validate all properties of the instance
123+
/// </summary>
124+
/// <param name="validationContext">Validation context</param>
125+
/// <returns>Validation Result</returns>
126+
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
127+
{
128+
yield break;
129+
}
130+
}
131+
132+
}
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
/*
2+
* Xero Payroll AU API 2.0
3+
*
4+
* This is the Xero Payroll API 2.0 for orgs in Australia region.
5+
*
6+
* Contact: api@xero.com
7+
* Generated by: https://github.com/openapitools/openapi-generator.git
8+
*/
9+
10+
11+
using System;
12+
using System.Linq;
13+
using System.IO;
14+
using System.Text;
15+
using System.Text.RegularExpressions;
16+
using System.Collections;
17+
using System.Collections.Generic;
18+
using System.Collections.ObjectModel;
19+
using System.Runtime.Serialization;
20+
using Newtonsoft.Json;
21+
using Newtonsoft.Json.Converters;
22+
using System.ComponentModel.DataAnnotations;
23+
using OpenAPIDateConverter = Xero.NetStandard.OAuth2.Client.OpenAPIDateConverter;
24+
25+
namespace Xero.NetStandard.OAuth2.Model.PayrollAuV2
26+
{
27+
/// <summary>
28+
/// Pagination
29+
/// </summary>
30+
[DataContract]
31+
public partial class Pagination : IEquatable<Pagination>, IValidatableObject
32+
{
33+
34+
/// <summary>
35+
/// Gets or Sets Page
36+
/// </summary>
37+
[DataMember(Name="page", EmitDefaultValue=false)]
38+
public int? Page { get; set; }
39+
40+
/// <summary>
41+
/// Gets or Sets PageSize
42+
/// </summary>
43+
[DataMember(Name="pageSize", EmitDefaultValue=false)]
44+
public int? PageSize { get; set; }
45+
46+
/// <summary>
47+
/// Gets or Sets PageCount
48+
/// </summary>
49+
[DataMember(Name="pageCount", EmitDefaultValue=false)]
50+
public int? PageCount { get; set; }
51+
52+
/// <summary>
53+
/// Gets or Sets ItemCount
54+
/// </summary>
55+
[DataMember(Name="itemCount", EmitDefaultValue=false)]
56+
public int? ItemCount { get; set; }
57+
58+
/// <summary>
59+
/// Returns the string presentation of the object
60+
/// </summary>
61+
/// <returns>String presentation of the object</returns>
62+
public override string ToString()
63+
{
64+
var sb = new StringBuilder();
65+
sb.Append("class Pagination {\n");
66+
sb.Append(" Page: ").Append(Page).Append("\n");
67+
sb.Append(" PageSize: ").Append(PageSize).Append("\n");
68+
sb.Append(" PageCount: ").Append(PageCount).Append("\n");
69+
sb.Append(" ItemCount: ").Append(ItemCount).Append("\n");
70+
sb.Append("}\n");
71+
return sb.ToString();
72+
}
73+
74+
/// <summary>
75+
/// Returns the JSON string presentation of the object
76+
/// </summary>
77+
/// <returns>JSON string presentation of the object</returns>
78+
public virtual string ToJson()
79+
{
80+
return JsonConvert.SerializeObject(this, Formatting.Indented);
81+
}
82+
83+
/// <summary>
84+
/// Returns true if objects are equal
85+
/// </summary>
86+
/// <param name="input">Object to be compared</param>
87+
/// <returns>Boolean</returns>
88+
public override bool Equals(object input)
89+
{
90+
return this.Equals(input as Pagination);
91+
}
92+
93+
/// <summary>
94+
/// Returns true if Pagination instances are equal
95+
/// </summary>
96+
/// <param name="input">Instance of Pagination to be compared</param>
97+
/// <returns>Boolean</returns>
98+
public bool Equals(Pagination input)
99+
{
100+
if (input == null)
101+
return false;
102+
103+
return
104+
(
105+
this.Page == input.Page ||
106+
(this.Page != null &&
107+
this.Page.Equals(input.Page))
108+
) &&
109+
(
110+
this.PageSize == input.PageSize ||
111+
(this.PageSize != null &&
112+
this.PageSize.Equals(input.PageSize))
113+
) &&
114+
(
115+
this.PageCount == input.PageCount ||
116+
(this.PageCount != null &&
117+
this.PageCount.Equals(input.PageCount))
118+
) &&
119+
(
120+
this.ItemCount == input.ItemCount ||
121+
(this.ItemCount != null &&
122+
this.ItemCount.Equals(input.ItemCount))
123+
);
124+
}
125+
126+
/// <summary>
127+
/// Gets the hash code
128+
/// </summary>
129+
/// <returns>Hash code</returns>
130+
public override int GetHashCode()
131+
{
132+
unchecked // Overflow is fine, just wrap
133+
{
134+
int hashCode = 41;
135+
if (this.Page != null)
136+
hashCode = hashCode * 59 + this.Page.GetHashCode();
137+
if (this.PageSize != null)
138+
hashCode = hashCode * 59 + this.PageSize.GetHashCode();
139+
if (this.PageCount != null)
140+
hashCode = hashCode * 59 + this.PageCount.GetHashCode();
141+
if (this.ItemCount != null)
142+
hashCode = hashCode * 59 + this.ItemCount.GetHashCode();
143+
return hashCode;
144+
}
145+
}
146+
147+
/// <summary>
148+
/// To validate all properties of the instance
149+
/// </summary>
150+
/// <param name="validationContext">Validation context</param>
151+
/// <returns>Validation Result</returns>
152+
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
153+
{
154+
yield break;
155+
}
156+
}
157+
158+
}

0 commit comments

Comments
 (0)