Show / Hide Table of Contents

Class EasyPostService

Base class for all EasyPost services (collection of related methods).

Inheritance
System.Object
EasyPostService
AddressService
ApiKeyService
BatchService
RateService
ReferralCustomerService
BillingService
CarrierAccountService
CarrierMetadataService
CarrierTypeService
ClaimService
CustomsInfoService
CustomsItemService
EndShipperService
EventService
InsuranceService
LumaService
OrderService
ParcelService
PickupService
RateService
ReferralCustomerService
RefundService
ReportService
ScanFormService
ShipmentService
SmartRateService
TrackerService
UserService
WebhookService
Implements
IEasyPostService
IDisposable
Namespace: EasyPost._base
Assembly: EasyPost.dll
Syntax
public abstract class EasyPostService : object, IEasyPostService

Constructors

| Improve this Doc View Source

EasyPostService(EasyPostClient)

Initializes a new instance of the EasyPostService class.

Declaration
protected EasyPostService(EasyPostClient client)
Parameters
Type Name Description
EasyPostClient client

The EasyPostClient to use when this service makes API requests.

Fields

| Improve this Doc View Source

Client

The EasyPostClient that this service will use to make API requests.

Declaration
protected readonly EasyPostClient Client
Field Value
Type Description
EasyPostClient

Methods

| Improve this Doc View Source

Dispose()

Dispose of this object.

Declaration
public void Dispose()
| Improve this Doc View Source

Dispose(Boolean)

Dispose of this object.

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

Whether this object is being disposed.

| Improve this Doc View Source

Finalize()

Finalizes an instance of the EasyPostService class.

Declaration
protected void Finalize()
| Improve this Doc View Source

RequestAsync(Method, String, CancellationToken, Nullable<Dictionary<String, Object>>, ApiVersion)

Make a non-response HTTP request to the EasyPost API.

Declaration
protected async Task RequestAsync(Method method, string endpoint, CancellationToken cancellationToken, Dictionary<string, object>? parameters = null, ApiVersion overrideApiVersion = null)
Parameters
Type Name Description
Method method

HTTP Method to use for the request.

System.String endpoint

EasyPost API endpoint to use for the request.

CancellationToken cancellationToken

to use for the HTTP request.

System.Nullable<Dictionary<System.String, System.Object>> parameters

Optional parameters to use for the request.

ApiVersion overrideApiVersion

Override the default ApiVersion (Current) to use for the request.

Returns
Type Description
Task

None.

| Improve this Doc View Source

RequestAsync<T>(Method, String, CancellationToken, Nullable<Dictionary<String, Object>>, Nullable<String>, ApiVersion)

Make an HTTP request to the EasyPost API and deserialize the response JSON into an object.

Declaration
protected async Task<T> RequestAsync<T>(Method method, string endpoint, CancellationToken cancellationToken, Dictionary<string, object>? parameters = null, string? rootElement = null, ApiVersion overrideApiVersion = null)
    where T : class
Parameters
Type Name Description
Method method

HTTP Method to use for the request.

System.String endpoint

EasyPost API endpoint to use for the request.

CancellationToken cancellationToken

to use for the HTTP request.

System.Nullable<Dictionary<System.String, System.Object>> parameters

Optional parameters to use for the request.

System.Nullable<System.String> rootElement

Optional JSON key to start at when deserializing the resultant JSON into an object.

ApiVersion overrideApiVersion

Override the default ApiVersion (Current) to use for the request.

Returns
Type Description
Task<T>

A T-type object.

Type Parameters
Name Description
T

Type of object to return from request.

Implements

IEasyPostService
IDisposable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX