You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
using System ;
using TradeManageNew.APIClients.FedexApi.Services ;
namespace TradeManageNew.APIClients.FedexApi
{
public class FedexAPIClient
{
public FedexAPIClient ( FedexCredential credential )
{
if ( credential is null )
{
throw new Exception ( "凭证信息不能为空,请检查" ) ;
}
if ( string . IsNullOrEmpty ( credential . ClientId ) )
{
throw new Exception ( "ClientId不能为空, 请检查" ) ;
}
if ( string . IsNullOrEmpty ( credential . ClientSecret ) )
{
throw new Exception ( "ClientSecret不能为空, 请检查" ) ;
}
Credential = credential ;
Ship = new ShipService ( credential ) ;
RatesAndTransitTimes = new RatesAndTransitTimesService ( credential ) ;
}
public readonly FedexCredential Credential ;
#region Ship
/// <summary>
/// 官方API文档 https://developer.fedex.com.cn/api/en-us/catalog/ship/v1/docs.html
/// </summary>
public ShipService Ship { get ; }
# endregion
#region RatesAndTransitTimes
/// <summary>
/// 官方API文档 https://developer.fedex.com.cn/api/en-us/catalog/rate/v1/docs.html
/// </summary>
public RatesAndTransitTimesService RatesAndTransitTimes { get ; }
# endregion
}
}