Skip to content

Commit

Permalink
[UST-4371] Add USST fields to Invoices and Credit Notes endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
sangeet-joy_xero committed Sep 16, 2024
1 parent 5eceee5 commit e80d152
Show file tree
Hide file tree
Showing 6 changed files with 780 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Xero.NetStandard.OAuth2/Model/Accounting/CreditNote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,13 @@ public enum StatusEnum
[DataMember(Name="Warnings", EmitDefaultValue=false)]
public List<ValidationError> Warnings { get; set; }

/// <summary>
/// An array of addresses used to auto calculate sales tax
/// </summary>
/// <value>An array of addresses used to auto calculate sales tax</value>
[DataMember(Name="InvoiceAddresses", EmitDefaultValue=false)]
public List<InvoiceAddress> InvoiceAddresses { get; set; }

/// <summary>
/// Returns the string presentation of the object
/// </summary>
Expand Down Expand Up @@ -338,6 +345,7 @@ public override string ToString()
sb.Append(" HasErrors: ").Append(HasErrors).Append("\n");
sb.Append(" ValidationErrors: ").Append(ValidationErrors).Append("\n");
sb.Append(" Warnings: ").Append(Warnings).Append("\n");
sb.Append(" InvoiceAddresses: ").Append(InvoiceAddresses).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
Expand Down Expand Up @@ -522,6 +530,12 @@ public bool Equals(CreditNote input)
this.Warnings != null &&
input.Warnings != null &&
this.Warnings.SequenceEqual(input.Warnings)
) &&
(
this.InvoiceAddresses == input.InvoiceAddresses ||
this.InvoiceAddresses != null &&
input.InvoiceAddresses != null &&
this.InvoiceAddresses.SequenceEqual(input.InvoiceAddresses)
);
}

Expand Down Expand Up @@ -590,6 +604,8 @@ public override int GetHashCode()
hashCode = hashCode * 59 + this.ValidationErrors.GetHashCode();
if (this.Warnings != null)
hashCode = hashCode * 59 + this.Warnings.GetHashCode();
if (this.InvoiceAddresses != null)
hashCode = hashCode * 59 + this.InvoiceAddresses.GetHashCode();
return hashCode;
}
}
Expand Down
16 changes: 16 additions & 0 deletions Xero.NetStandard.OAuth2/Model/Accounting/Invoice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,13 @@ public enum StatusEnum
[DataMember(Name="Warnings", EmitDefaultValue=false)]
public List<ValidationError> Warnings { get; set; }

/// <summary>
/// An array of addresses used to auto calculate sales tax
/// </summary>
/// <value>An array of addresses used to auto calculate sales tax</value>
[DataMember(Name="InvoiceAddresses", EmitDefaultValue=false)]
public List<InvoiceAddress> InvoiceAddresses { get; set; }

/// <summary>
/// Returns the string presentation of the object
/// </summary>
Expand Down Expand Up @@ -454,6 +461,7 @@ public override string ToString()
sb.Append(" StatusAttributeString: ").Append(StatusAttributeString).Append("\n");
sb.Append(" ValidationErrors: ").Append(ValidationErrors).Append("\n");
sb.Append(" Warnings: ").Append(Warnings).Append("\n");
sb.Append(" InvoiceAddresses: ").Append(InvoiceAddresses).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
Expand Down Expand Up @@ -691,6 +699,12 @@ public bool Equals(Invoice input)
this.Warnings != null &&
input.Warnings != null &&
this.Warnings.SequenceEqual(input.Warnings)
) &&
(
this.InvoiceAddresses == input.InvoiceAddresses ||
this.InvoiceAddresses != null &&
input.InvoiceAddresses != null &&
this.InvoiceAddresses.SequenceEqual(input.InvoiceAddresses)
);
}

Expand Down Expand Up @@ -779,6 +793,8 @@ public override int GetHashCode()
hashCode = hashCode * 59 + this.ValidationErrors.GetHashCode();
if (this.Warnings != null)
hashCode = hashCode * 59 + this.Warnings.GetHashCode();
if (this.InvoiceAddresses != null)
hashCode = hashCode * 59 + this.InvoiceAddresses.GetHashCode();
return hashCode;
}
}
Expand Down
255 changes: 255 additions & 0 deletions Xero.NetStandard.OAuth2/Model/Accounting/InvoiceAddress.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
/*
* Xero Accounting API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* 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;
using OpenAPIDateConverter = Xero.NetStandard.OAuth2.Client.OpenAPIDateConverter;

namespace Xero.NetStandard.OAuth2.Model.Accounting
{
/// <summary>
/// InvoiceAddress
/// </summary>
[DataContract]
public partial class InvoiceAddress : IEquatable<InvoiceAddress>, IValidatableObject
{
/// <summary>
/// Indicates whether the address is defined as origin (FROM) or destination (TO)
/// </summary>
/// <value>Indicates whether the address is defined as origin (FROM) or destination (TO)</value>
[JsonConverter(typeof(Client.CustomStringEnumConverter))]
public enum InvoiceAddressTypeEnum
{
/// <summary>
/// Enum FROM for value: FROM
/// </summary>
[EnumMember(Value = "FROM")]
FROM = 1,

/// <summary>
/// Enum TO for value: TO
/// </summary>
[EnumMember(Value = "TO")]
TO = 2

}

/// <summary>
/// Indicates whether the address is defined as origin (FROM) or destination (TO)
/// </summary>
/// <value>Indicates whether the address is defined as origin (FROM) or destination (TO)</value>
[DataMember(Name="InvoiceAddressType", EmitDefaultValue=false)]
public InvoiceAddressTypeEnum InvoiceAddressType { get; set; }

/// <summary>
/// First line of a physical address
/// </summary>
/// <value>First line of a physical address</value>
[DataMember(Name="AddressLine1", EmitDefaultValue=false)]
public string AddressLine1 { get; set; }

/// <summary>
/// Second line of a physical address
/// </summary>
/// <value>Second line of a physical address</value>
[DataMember(Name="AddressLine2", EmitDefaultValue=false)]
public string AddressLine2 { get; set; }

/// <summary>
/// Third line of a physical address
/// </summary>
/// <value>Third line of a physical address</value>
[DataMember(Name="AddressLine3", EmitDefaultValue=false)]
public string AddressLine3 { get; set; }

/// <summary>
/// Fourth line of a physical address
/// </summary>
/// <value>Fourth line of a physical address</value>
[DataMember(Name="AddressLine4", EmitDefaultValue=false)]
public string AddressLine4 { get; set; }

/// <summary>
/// City of a physical address
/// </summary>
/// <value>City of a physical address</value>
[DataMember(Name="City", EmitDefaultValue=false)]
public string City { get; set; }

/// <summary>
/// Region or state of a physical address
/// </summary>
/// <value>Region or state of a physical address</value>
[DataMember(Name="Region", EmitDefaultValue=false)]
public string Region { get; set; }

/// <summary>
/// Postal code of a physical address
/// </summary>
/// <value>Postal code of a physical address</value>
[DataMember(Name="PostalCode", EmitDefaultValue=false)]
public string PostalCode { get; set; }

/// <summary>
/// Country of a physical address
/// </summary>
/// <value>Country of a physical address</value>
[DataMember(Name="Country", EmitDefaultValue=false)]
public string Country { 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 InvoiceAddress {\n");
sb.Append(" InvoiceAddressType: ").Append(InvoiceAddressType).Append("\n");
sb.Append(" AddressLine1: ").Append(AddressLine1).Append("\n");
sb.Append(" AddressLine2: ").Append(AddressLine2).Append("\n");
sb.Append(" AddressLine3: ").Append(AddressLine3).Append("\n");
sb.Append(" AddressLine4: ").Append(AddressLine4).Append("\n");
sb.Append(" City: ").Append(City).Append("\n");
sb.Append(" Region: ").Append(Region).Append("\n");
sb.Append(" PostalCode: ").Append(PostalCode).Append("\n");
sb.Append(" Country: ").Append(Country).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 InvoiceAddress);
}

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

return
(
this.InvoiceAddressType == input.InvoiceAddressType ||
this.InvoiceAddressType.Equals(input.InvoiceAddressType)
) &&
(
this.AddressLine1 == input.AddressLine1 ||
(this.AddressLine1 != null &&
this.AddressLine1.Equals(input.AddressLine1))
) &&
(
this.AddressLine2 == input.AddressLine2 ||
(this.AddressLine2 != null &&
this.AddressLine2.Equals(input.AddressLine2))
) &&
(
this.AddressLine3 == input.AddressLine3 ||
(this.AddressLine3 != null &&
this.AddressLine3.Equals(input.AddressLine3))
) &&
(
this.AddressLine4 == input.AddressLine4 ||
(this.AddressLine4 != null &&
this.AddressLine4.Equals(input.AddressLine4))
) &&
(
this.City == input.City ||
(this.City != null &&
this.City.Equals(input.City))
) &&
(
this.Region == input.Region ||
(this.Region != null &&
this.Region.Equals(input.Region))
) &&
(
this.PostalCode == input.PostalCode ||
(this.PostalCode != null &&
this.PostalCode.Equals(input.PostalCode))
) &&
(
this.Country == input.Country ||
(this.Country != null &&
this.Country.Equals(input.Country))
);
}

/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
hashCode = hashCode * 59 + this.InvoiceAddressType.GetHashCode();
if (this.AddressLine1 != null)
hashCode = hashCode * 59 + this.AddressLine1.GetHashCode();
if (this.AddressLine2 != null)
hashCode = hashCode * 59 + this.AddressLine2.GetHashCode();
if (this.AddressLine3 != null)
hashCode = hashCode * 59 + this.AddressLine3.GetHashCode();
if (this.AddressLine4 != null)
hashCode = hashCode * 59 + this.AddressLine4.GetHashCode();
if (this.City != null)
hashCode = hashCode * 59 + this.City.GetHashCode();
if (this.Region != null)
hashCode = hashCode * 59 + this.Region.GetHashCode();
if (this.PostalCode != null)
hashCode = hashCode * 59 + this.PostalCode.GetHashCode();
if (this.Country != null)
hashCode = hashCode * 59 + this.Country.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)
{
yield break;
}
}

}
Loading

0 comments on commit e80d152

Please sign in to comment.