-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DE-874 Increase timeout to 120s by default SUB-3996 Ability to create products using the product family handle - ProductFamilyId in createProduct method is now String instead of Integer IN-3434 Add API endpoints for finding price points by handle. Move PricePoint methods from ComponentsController to ComponentPricePointsController
- Loading branch information
1 parent
6e85eaf
commit 8f0a916
Showing
29 changed files
with
2,219 additions
and
1,354 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
418 changes: 418 additions & 0 deletions
418
AdvancedBilling.Standard/Controllers/ComponentPricePointsController.cs
Large diffs are not rendered by default.
Oops, something went wrong.
354 changes: 2 additions & 352 deletions
354
AdvancedBilling.Standard/Controllers/ComponentsController.cs
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
107 changes: 107 additions & 0 deletions
107
AdvancedBilling.Standard/Models/Containers/ArchiveComponentPricePointComponentId.cs
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,107 @@ | ||
using APIMatic.Core.Utilities.Converters; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Linq; | ||
using System; | ||
|
||
namespace AdvancedBilling.Standard.Models.Containers | ||
{ | ||
/// <summary> | ||
/// This is a container class for one-of types. | ||
/// </summary> | ||
[JsonConverter( | ||
typeof(UnionTypeConverter<ArchiveComponentPricePointComponentId>), | ||
new Type[] { | ||
typeof(NumberCase), | ||
typeof(MStringCase) | ||
}, | ||
true | ||
)] | ||
public abstract class ArchiveComponentPricePointComponentId | ||
{ | ||
/// <summary> | ||
/// This is Number case. | ||
/// </summary> | ||
/// <returns> | ||
/// The ArchiveComponentPricePointComponentId instance, wrapping the provided int value. | ||
/// </returns> | ||
public static ArchiveComponentPricePointComponentId FromNumber(int number) | ||
{ | ||
return new NumberCase().Set(number); | ||
} | ||
|
||
/// <summary> | ||
/// This is String case. | ||
/// </summary> | ||
/// <returns> | ||
/// The ArchiveComponentPricePointComponentId instance, wrapping the provided string value. | ||
/// </returns> | ||
public static ArchiveComponentPricePointComponentId FromString(string mString) | ||
{ | ||
return new MStringCase().Set(mString); | ||
} | ||
|
||
/// <summary> | ||
/// Method to match from the provided one-of cases. Here parameters | ||
/// represents the callback functions for one-of type cases. All | ||
/// callback functions must have the same return type T. This typeparam T | ||
/// represents the type that will be returned after applying the selected | ||
/// callback function. | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
public abstract T Match<T>(Func<int, T> number, Func<string, T> mString); | ||
|
||
[JsonConverter(typeof(UnionTypeCaseConverter<NumberCase, int>), JTokenType.Integer)] | ||
private sealed class NumberCase : ArchiveComponentPricePointComponentId, ICaseValue<NumberCase, int> | ||
{ | ||
public int _value; | ||
|
||
public override T Match<T>(Func<int, T> number, Func<string, T> mString) | ||
{ | ||
return number(_value); | ||
} | ||
|
||
public NumberCase Set(int value) | ||
{ | ||
_value = value; | ||
return this; | ||
} | ||
|
||
public int Get() | ||
{ | ||
return _value; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return _value.ToString(); | ||
} | ||
} | ||
|
||
[JsonConverter(typeof(UnionTypeCaseConverter<MStringCase, string>), JTokenType.String, JTokenType.Null)] | ||
private sealed class MStringCase : ArchiveComponentPricePointComponentId, ICaseValue<MStringCase, string> | ||
{ | ||
public string _value; | ||
|
||
public override T Match<T>(Func<int, T> number, Func<string, T> mString) | ||
{ | ||
return mString(_value); | ||
} | ||
|
||
public MStringCase Set(string value) | ||
{ | ||
_value = value; | ||
return this; | ||
} | ||
|
||
public string Get() | ||
{ | ||
return _value; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return _value?.ToString(); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.