TaobaoClient

Struct TaobaoClient 

Source
pub struct TaobaoClient<T: SessionStore> { /* private fields */ }

Implementations§

Source§

impl<T: SessionStore> TaobaoClient<T>

TaobaoClient

§Example

use labrador::TaobaoClient;
async fn main() {
    let client = TaobaoClient::new("appKey", "secret");
    // Do Some Thing You Want
    // ...
}
Source

pub fn new<Q: Into<String>, S: Into<String>>( app_key: Q, secret: S, ) -> TaobaoClient<SimpleStorage>

Source

pub fn from_session<Q: Into<String>, S: Into<String>>( app_key: Q, secret: S, session: T, ) -> TaobaoClient<T>

Source

pub async fn get_material_selected( &self, request: TbMaterialSelectRequest, ) -> LabradorResult<TbMaterialSelectResponse>

获取淘宝客物料精选

§示例
 
    use labrador::TaobaoClient;
    use labrador::{TbMaterialSelectRequest};
 
    async fn main() {
        let material = TbMaterialSelectRequest::default();
        let client = TaobaoClient::new("appKey", "secret");
        match client.get_material_selected(param).await {
            Ok(res) => {}
            Err(err) => {}
        }
    }
 
Source

pub async fn search_jhs_items( &self, request: TbJhsSearchRequest, ) -> LabradorResult<TbJhsSearchResponse>

👎Deprecated

获取淘宝客聚划算搜索商品

§示例
 
    use labrador::TaobaoClient;
    use labrador::{TbJhsSearchRequest};
 
    async fn main() {
        let param = TbJhsSearchRequest::default();
        let client = TaobaoClient::new("appKey", "secret");
        match client.search_jhs_items(param).await {
            Ok(res) => {}
            Err(err) => {}
        }
    }
 
Source

pub async fn get_item_detail( &self, request: TbItemDetailRequest, ) -> LabradorResult<TbItemDetailResponse>

淘宝客商品详情查询(简版)

§示例
 
    use labrador::TaobaoClient;
    use labrador::{TbItemDetailRequest};
 
    async fn main() {
        let param = TbItemDetailRequest::default();
        let client = TaobaoClient::new("appKey", "secret");
        match client.get_item_detail(param).await {
            Ok(res) => {}
            Err(err) => {}
        }
    }
 
Source

pub async fn get_coupon_detail( &self, request: TbCouponDetailRequest, ) -> LabradorResult<TbCouponDetailResponse>

淘宝客阿里妈妈推广券详情查询

§示例
 
    use labrador::TaobaoClient;
    use labrador::{TbCouponDetailRequest};
 
    async fn main() {
        let param = TbCouponDetailRequest::default();
        let client = TaobaoClient::new("appKey", "secret");
        match client.get_coupon_detail(param).await {
            Ok(res) => {}
            Err(err) => {}
        }
    }
 
Source

pub async fn create_tpwd( &self, request: TbCreateTPwdRequest, ) -> LabradorResult<TbCreateTPwdResponse>

淘宝客淘口令生成

§示例
 
    use labrador::TaobaoClient;
    use labrador::{TbCreateTPwdRequest};
 
    async fn main() {
        let param = TbCreateTPwdRequest::default();
        let client = TaobaoClient::new("appKey", "secret");
        match client.create_tpwd(param).await {
            Ok(res) => {}
            Err(err) => {}
        }
    }
 
Source

pub async fn get_spread( &self, request: TbSpreadGetRequest, ) -> LabradorResult<TbSpreadGetResponse>

淘宝客-公用-长链转短链 输入一个原始的链接,转换得到指定的传播方式,如二维码,淘口令,短连接; 现阶段只支持短连接。

§示例

    use labrador::TaobaoClient;
    use labrador::{TbSpreadGetRequest};

    async fn main() {
        let param = TbSpreadGetRequest::default();
        let client = TaobaoClient::new("appKey", "secret");
        match client.get_spread(param).await {
            Ok(res) => {}
            Err(err) => {}
        }
    }
Source

pub async fn get_tpwd_report( &self, request: TbTPwdReportGetRequest, ) -> LabradorResult<TbTPwdReportGetResponse>

淘宝客-推广者-淘口令回流数据查询 淘宝客获取单个淘口令的回流PV、UV数据。

§示例

    use labrador::TaobaoClient;
    use labrador::{TbTPwdReportGetRequest};

    async fn main() {
        let param = TbTPwdReportGetRequest::default();
        let client = TaobaoClient::new("appKey", "secret");
        match client.get_tpwd_report(param).await {
            Ok(res) => {}
            Err(err) => {}
        }
    }
Source

pub async fn search_material( &self, request: TbMaterialSearchRequest, ) -> LabradorResult<TbMaterialSearchResponse>

淘宝客物料搜索

§示例
 
    use labrador::TaobaoClient;
    use labrador::{TbCreateTPwdRequest};
 
    async fn main() {
        let param = TbMaterialSearchRequest::default();
        let client = TaobaoClient::new("appKey", "secret");
        match client.search_material(param).await {
            Ok(res) => {}
            Err(err) => {}
        }
    }
 
Source

pub async fn get_activity_info( &self, request: TbGetActivityInfoRequest, ) -> LabradorResult<TbGetActivityInfoResponse>

淘宝客-推广者-官方活动转链 支持入参推广位和官方活动会场ID,获取活动信息和推广链接,包含推广长链接、短链接、淘口令、微信推广二维码地址等。改该API支持二方、三方类型的转链。官方活动会场ID,从淘宝客后台“我要推广-活动推广”中获取。

§示例

    use labrador::TaobaoClient;
    use labrador::{TbCreateTPwdRequest};

    async fn main() {
        let param = TbMaterialSearchRequest::default();
        let client = TaobaoClient::new("appKey", "secret");
        match client.search_material(param).await {
            Ok(res) => {}
            Err(err) => {}
        }
    }

Trait Implementations§

Source§

impl<T: Clone + SessionStore> Clone for TaobaoClient<T>

Source§

fn clone(&self) -> TaobaoClient<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug + SessionStore> Debug for TaobaoClient<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for TaobaoClient<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for TaobaoClient<T>
where T: RefUnwindSafe,

§

impl<T> Send for TaobaoClient<T>
where T: Send,

§

impl<T> Sync for TaobaoClient<T>
where T: Sync,

§

impl<T> Unpin for TaobaoClient<T>
where T: Unpin,

§

impl<T> UnwindSafe for TaobaoClient<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more