Skip to content

Commit

Permalink
Generated PR for Release: 37.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
autobot committed May 14, 2024
1 parent 8e8d93e commit ffbbe9f
Show file tree
Hide file tree
Showing 15 changed files with 182 additions and 42 deletions.
20 changes: 10 additions & 10 deletions Square.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square", "Square/Square.csproj", "{6e3f5606-ac3a-4f31-b282-c963803ed607}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square", "Square/Square.csproj", "{6c4b5924-fd38-48fe-8c8b-d369556ee19a}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square.Tests", "Square.Tests/Square.Tests.csproj", "{3b6c7029-db3d-4724-a411-e817ac6e70e3}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square.Tests", "Square.Tests/Square.Tests.csproj", "{62caf792-09fd-43b0-abc2-f1c0ebd2e033}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6e3f5606-ac3a-4f31-b282-c963803ed607}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6e3f5606-ac3a-4f31-b282-c963803ed607}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6e3f5606-ac3a-4f31-b282-c963803ed607}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6e3f5606-ac3a-4f31-b282-c963803ed607}.Release|Any CPU.Build.0 = Release|Any CPU
{3b6c7029-db3d-4724-a411-e817ac6e70e3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3b6c7029-db3d-4724-a411-e817ac6e70e3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3b6c7029-db3d-4724-a411-e817ac6e70e3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3b6c7029-db3d-4724-a411-e817ac6e70e3}.Release|Any CPU.Build.0 = Release|Any CPU
{6c4b5924-fd38-48fe-8c8b-d369556ee19a}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6c4b5924-fd38-48fe-8c8b-d369556ee19a}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6c4b5924-fd38-48fe-8c8b-d369556ee19a}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6c4b5924-fd38-48fe-8c8b-d369556ee19a}.Release|Any CPU.Build.0 = Release|Any CPU
{62caf792-09fd-43b0-abc2-f1c0ebd2e033}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{62caf792-09fd-43b0-abc2-f1c0ebd2e033}.Debug|Any CPU.Build.0 = Debug|Any CPU
{62caf792-09fd-43b0-abc2-f1c0ebd2e033}.Release|Any CPU.ActiveCfg = Release|Any CPU
{62caf792-09fd-43b0-abc2-f1c0ebd2e033}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
62 changes: 57 additions & 5 deletions Square/Models/CatalogItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class CatalogItem
/// <param name="description">description.</param>
/// <param name="abbreviation">abbreviation.</param>
/// <param name="labelColor">label_color.</param>
/// <param name="isTaxable">is_taxable.</param>
/// <param name="availableOnline">available_online.</param>
/// <param name="availableForPickup">available_for_pickup.</param>
/// <param name="availableElectronically">available_electronically.</param>
Expand All @@ -51,6 +52,7 @@ public CatalogItem(
string description = null,
string abbreviation = null,
string labelColor = null,
bool? isTaxable = null,
bool? availableOnline = null,
bool? availableForPickup = null,
bool? availableElectronically = null,
Expand Down Expand Up @@ -78,6 +80,7 @@ public CatalogItem(
{ "description", false },
{ "abbreviation", false },
{ "label_color", false },
{ "is_taxable", false },
{ "available_online", false },
{ "available_for_pickup", false },
{ "available_electronically", false },
Expand Down Expand Up @@ -119,6 +122,12 @@ public CatalogItem(
this.LabelColor = labelColor;
}

if (isTaxable != null)
{
shouldSerialize["is_taxable"] = true;
this.IsTaxable = isTaxable;
}

if (availableOnline != null)
{
shouldSerialize["available_online"] = true;
Expand Down Expand Up @@ -220,6 +229,7 @@ internal CatalogItem(Dictionary<string, bool> shouldSerialize,
string description = null,
string abbreviation = null,
string labelColor = null,
bool? isTaxable = null,
bool? availableOnline = null,
bool? availableForPickup = null,
bool? availableElectronically = null,
Expand All @@ -246,6 +256,7 @@ internal CatalogItem(Dictionary<string, bool> shouldSerialize,
Description = description;
Abbreviation = abbreviation;
LabelColor = labelColor;
IsTaxable = isTaxable;
AvailableOnline = availableOnline;
AvailableForPickup = availableForPickup;
AvailableElectronically = availableElectronically;
Expand Down Expand Up @@ -298,6 +309,12 @@ internal CatalogItem(Dictionary<string, bool> shouldSerialize,
[JsonProperty("label_color")]
public string LabelColor { get; }

/// <summary>
/// Indicates whether the item is taxable (`true`) or non-taxable (`false`). Default is `true`.
/// </summary>
[JsonProperty("is_taxable")]
public bool? IsTaxable { get; }

/// <summary>
/// If `true`, the item can be added to shipping orders from the merchant's online store.
/// </summary>
Expand Down Expand Up @@ -503,6 +520,15 @@ public bool ShouldSerializeLabelColor()
return this.shouldSerialize["label_color"];
}

/// <summary>
/// Checks if the field should be serialized or not.
/// </summary>
/// <returns>A boolean weather the field should be serialized or not.</returns>
public bool ShouldSerializeIsTaxable()
{
return this.shouldSerialize["is_taxable"];
}

/// <summary>
/// Checks if the field should be serialized or not.
/// </summary>
Expand Down Expand Up @@ -654,6 +680,7 @@ public override bool Equals(object obj)
((this.Description == null && other.Description == null) || (this.Description?.Equals(other.Description) == true)) &&
((this.Abbreviation == null && other.Abbreviation == null) || (this.Abbreviation?.Equals(other.Abbreviation) == true)) &&
((this.LabelColor == null && other.LabelColor == null) || (this.LabelColor?.Equals(other.LabelColor) == true)) &&
((this.IsTaxable == null && other.IsTaxable == null) || (this.IsTaxable?.Equals(other.IsTaxable) == true)) &&
((this.AvailableOnline == null && other.AvailableOnline == null) || (this.AvailableOnline?.Equals(other.AvailableOnline) == true)) &&
((this.AvailableForPickup == null && other.AvailableForPickup == null) || (this.AvailableForPickup?.Equals(other.AvailableForPickup) == true)) &&
((this.AvailableElectronically == null && other.AvailableElectronically == null) || (this.AvailableElectronically?.Equals(other.AvailableElectronically) == true)) &&
Expand All @@ -679,14 +706,14 @@ public override bool Equals(object obj)
/// <inheritdoc/>
public override int GetHashCode()
{
int hashCode = -32689781;
hashCode = HashCode.Combine(this.Name, this.Description, this.Abbreviation, this.LabelColor, this.AvailableOnline, this.AvailableForPickup, this.AvailableElectronically);
int hashCode = -671057138;
hashCode = HashCode.Combine(this.Name, this.Description, this.Abbreviation, this.LabelColor, this.IsTaxable, this.AvailableOnline, this.AvailableForPickup);

hashCode = HashCode.Combine(hashCode, this.CategoryId, this.TaxIds, this.ModifierListInfo, this.Variations, this.ProductType, this.SkipModifierScreen, this.ItemOptions);
hashCode = HashCode.Combine(hashCode, this.AvailableElectronically, this.CategoryId, this.TaxIds, this.ModifierListInfo, this.Variations, this.ProductType, this.SkipModifierScreen);

hashCode = HashCode.Combine(hashCode, this.ImageIds, this.SortName, this.Categories, this.DescriptionHtml, this.DescriptionPlaintext, this.Channels, this.IsArchived);
hashCode = HashCode.Combine(hashCode, this.ItemOptions, this.ImageIds, this.SortName, this.Categories, this.DescriptionHtml, this.DescriptionPlaintext, this.Channels);

hashCode = HashCode.Combine(hashCode, this.EcomSeoData, this.FoodAndBeverageDetails, this.ReportingCategory);
hashCode = HashCode.Combine(hashCode, this.IsArchived, this.EcomSeoData, this.FoodAndBeverageDetails, this.ReportingCategory);

return hashCode;
}
Expand All @@ -700,6 +727,7 @@ protected void ToString(List<string> toStringOutput)
toStringOutput.Add($"this.Description = {(this.Description == null ? "null" : this.Description)}");
toStringOutput.Add($"this.Abbreviation = {(this.Abbreviation == null ? "null" : this.Abbreviation)}");
toStringOutput.Add($"this.LabelColor = {(this.LabelColor == null ? "null" : this.LabelColor)}");
toStringOutput.Add($"this.IsTaxable = {(this.IsTaxable == null ? "null" : this.IsTaxable.ToString())}");
toStringOutput.Add($"this.AvailableOnline = {(this.AvailableOnline == null ? "null" : this.AvailableOnline.ToString())}");
toStringOutput.Add($"this.AvailableForPickup = {(this.AvailableForPickup == null ? "null" : this.AvailableForPickup.ToString())}");
toStringOutput.Add($"this.AvailableElectronically = {(this.AvailableElectronically == null ? "null" : this.AvailableElectronically.ToString())}");
Expand Down Expand Up @@ -733,6 +761,7 @@ public Builder ToBuilder()
.Description(this.Description)
.Abbreviation(this.Abbreviation)
.LabelColor(this.LabelColor)
.IsTaxable(this.IsTaxable)
.AvailableOnline(this.AvailableOnline)
.AvailableForPickup(this.AvailableForPickup)
.AvailableElectronically(this.AvailableElectronically)
Expand Down Expand Up @@ -767,6 +796,7 @@ public class Builder
{ "description", false },
{ "abbreviation", false },
{ "label_color", false },
{ "is_taxable", false },
{ "available_online", false },
{ "available_for_pickup", false },
{ "available_electronically", false },
Expand All @@ -788,6 +818,7 @@ public class Builder
private string description;
private string abbreviation;
private string labelColor;
private bool? isTaxable;
private bool? availableOnline;
private bool? availableForPickup;
private bool? availableElectronically;
Expand Down Expand Up @@ -857,6 +888,18 @@ public Builder LabelColor(string labelColor)
return this;
}

/// <summary>
/// IsTaxable.
/// </summary>
/// <param name="isTaxable"> isTaxable. </param>
/// <returns> Builder. </returns>
public Builder IsTaxable(bool? isTaxable)
{
shouldSerialize["is_taxable"] = true;
this.isTaxable = isTaxable;
return this;
}

/// <summary>
/// AvailableOnline.
/// </summary>
Expand Down Expand Up @@ -1124,6 +1167,14 @@ public void UnsetLabelColor()
this.shouldSerialize["label_color"] = false;
}

/// <summary>
/// Marks the field to not be serailized.
/// </summary>
public void UnsetIsTaxable()
{
this.shouldSerialize["is_taxable"] = false;
}

/// <summary>
/// Marks the field to not be serailized.
/// </summary>
Expand Down Expand Up @@ -1256,6 +1307,7 @@ public CatalogItem Build()
this.description,
this.abbreviation,
this.labelColor,
this.isTaxable,
this.availableOnline,
this.availableForPickup,
this.availableElectronically,
Expand Down
68 changes: 60 additions & 8 deletions Square/Models/DestinationDetailsCardRefundDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ public class DestinationDetailsCardRefundDetails
/// </summary>
/// <param name="card">card.</param>
/// <param name="entryMethod">entry_method.</param>
/// <param name="authResultCode">auth_result_code.</param>
public DestinationDetailsCardRefundDetails(
Models.Card card = null,
string entryMethod = null)
string entryMethod = null,
string authResultCode = null)
{
shouldSerialize = new Dictionary<string, bool>
{
{ "entry_method", false }
{ "entry_method", false },
{ "auth_result_code", false }
};

this.Card = card;
Expand All @@ -40,14 +43,22 @@ public DestinationDetailsCardRefundDetails(
this.EntryMethod = entryMethod;
}

if (authResultCode != null)
{
shouldSerialize["auth_result_code"] = true;
this.AuthResultCode = authResultCode;
}

}
internal DestinationDetailsCardRefundDetails(Dictionary<string, bool> shouldSerialize,
Models.Card card = null,
string entryMethod = null)
string entryMethod = null,
string authResultCode = null)
{
this.shouldSerialize = shouldSerialize;
Card = card;
EntryMethod = entryMethod;
AuthResultCode = authResultCode;
}

/// <summary>
Expand All @@ -64,6 +75,12 @@ internal DestinationDetailsCardRefundDetails(Dictionary<string, bool> shouldSeri
[JsonProperty("entry_method")]
public string EntryMethod { get; }

/// <summary>
/// The authorization code provided by the issuer when a refund is approved.
/// </summary>
[JsonProperty("auth_result_code")]
public string AuthResultCode { get; }

/// <inheritdoc/>
public override string ToString()
{
Expand All @@ -83,6 +100,15 @@ public bool ShouldSerializeEntryMethod()
return this.shouldSerialize["entry_method"];
}

/// <summary>
/// Checks if the field should be serialized or not.
/// </summary>
/// <returns>A boolean weather the field should be serialized or not.</returns>
public bool ShouldSerializeAuthResultCode()
{
return this.shouldSerialize["auth_result_code"];
}

/// <inheritdoc/>
public override bool Equals(object obj)
{
Expand All @@ -96,14 +122,15 @@ public override bool Equals(object obj)
return true;
}
return obj is DestinationDetailsCardRefundDetails other && ((this.Card == null && other.Card == null) || (this.Card?.Equals(other.Card) == true)) &&
((this.EntryMethod == null && other.EntryMethod == null) || (this.EntryMethod?.Equals(other.EntryMethod) == true));
((this.EntryMethod == null && other.EntryMethod == null) || (this.EntryMethod?.Equals(other.EntryMethod) == true)) &&
((this.AuthResultCode == null && other.AuthResultCode == null) || (this.AuthResultCode?.Equals(other.AuthResultCode) == true));
}

/// <inheritdoc/>
public override int GetHashCode()
{
int hashCode = -862425387;
hashCode = HashCode.Combine(this.Card, this.EntryMethod);
int hashCode = 603022044;
hashCode = HashCode.Combine(this.Card, this.EntryMethod, this.AuthResultCode);

return hashCode;
}
Expand All @@ -115,6 +142,7 @@ protected void ToString(List<string> toStringOutput)
{
toStringOutput.Add($"this.Card = {(this.Card == null ? "null" : this.Card.ToString())}");
toStringOutput.Add($"this.EntryMethod = {(this.EntryMethod == null ? "null" : this.EntryMethod)}");
toStringOutput.Add($"this.AuthResultCode = {(this.AuthResultCode == null ? "null" : this.AuthResultCode)}");
}

/// <summary>
Expand All @@ -125,7 +153,8 @@ public Builder ToBuilder()
{
var builder = new Builder()
.Card(this.Card)
.EntryMethod(this.EntryMethod);
.EntryMethod(this.EntryMethod)
.AuthResultCode(this.AuthResultCode);
return builder;
}

Expand All @@ -137,10 +166,12 @@ public class Builder
private Dictionary<string, bool> shouldSerialize = new Dictionary<string, bool>
{
{ "entry_method", false },
{ "auth_result_code", false },
};

private Models.Card card;
private string entryMethod;
private string authResultCode;

/// <summary>
/// Card.
Expand All @@ -165,6 +196,18 @@ public Builder EntryMethod(string entryMethod)
return this;
}

/// <summary>
/// AuthResultCode.
/// </summary>
/// <param name="authResultCode"> authResultCode. </param>
/// <returns> Builder. </returns>
public Builder AuthResultCode(string authResultCode)
{
shouldSerialize["auth_result_code"] = true;
this.authResultCode = authResultCode;
return this;
}

/// <summary>
/// Marks the field to not be serailized.
/// </summary>
Expand All @@ -173,6 +216,14 @@ public void UnsetEntryMethod()
this.shouldSerialize["entry_method"] = false;
}

/// <summary>
/// Marks the field to not be serailized.
/// </summary>
public void UnsetAuthResultCode()
{
this.shouldSerialize["auth_result_code"] = false;
}


/// <summary>
/// Builds class object.
Expand All @@ -182,7 +233,8 @@ public DestinationDetailsCardRefundDetails Build()
{
return new DestinationDetailsCardRefundDetails(shouldSerialize,
this.card,
this.entryMethod);
this.entryMethod,
this.authResultCode);
}
}
}
Expand Down
Loading

0 comments on commit ffbbe9f

Please sign in to comment.