Class BaseParameters<TMatchInputType>
Base class for all parameters used in functions.
Inheritance
Implements
Namespace: EasyPost.Parameters
Assembly: EasyPost.dll
Syntax
public abstract class BaseParameters<TMatchInputType> : object, IBaseParameters where TMatchInputType : EphemeralEasyPostObject
Type Parameters
| Name | Description |
|---|---|
| TMatchInputType | The type of EphemeralEasyPostObject that will be compared against in the MatchFunction. |
Constructors
| Improve this Doc View SourceBaseParameters()
Initializes a new instance of the BaseParameters<TMatchInputType> class for a new set of request parameters.
Declaration
protected BaseParameters()
Properties
| Improve this Doc View SourceMatchFunction
A function to determine if a given object matches this parameter set. Defaults to always returning false, but can be overridden by child classes and end-users.
Declaration
public Func<TMatchInputType, bool> MatchFunction { get; set; }
Property Value
| Type | Description |
|---|---|
| Func<TMatchInputType, System.Boolean> |
Methods
| Improve this Doc View SourceMatches(TMatchInputType)
Execute the match function on a given object.
Declaration
public bool Matches(TMatchInputType obj)
Parameters
| Type | Name | Description |
|---|---|---|
| TMatchInputType | obj | The EasyPostObject to compare this parameter set against. |
Returns
| Type | Description |
|---|---|
| System.Boolean | The result of the MatchFunction. |
ToDictionary()
Convert this parameter object to a dictionary for an HTTP request.
Declaration
public virtual Dictionary<string, object> ToDictionary()
Returns
| Type | Description |
|---|---|
| Dictionary<System.String, System.Object> |
ToSubDictionary(Type)
Convert this parameters object to a sub-dictionary, for use in a parent parameter object's dictionary.
Declaration
public virtual Dictionary<string, object> ToSubDictionary(Type parentParameterObjectType)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | parentParameterObjectType | The type of the parent parameter object in which this dictionary will be embedded. |
Returns
| Type | Description |
|---|---|
| Dictionary<System.String, System.Object> |