[−][src]Struct ya_client::market::MarketRequestorApi
Bindings for Requestor part of the Market API.
Implementations
impl MarketRequestorApi
[src]
pub async fn subscribe<'_, '_>(&'_ self, demand: &'_ Demand) -> Result<String>
[src]
Publishes Requestor capabilities via Demand.
Demand object can be considered an "open" or public Demand, as it is not directed at a specific Provider, but rather is sent to the market so that the matching mechanism implementation can associate relevant Offers.
Note: it is an "atomic" operation, ie. as soon as Subscription is placed, the Demand is published on the market.
pub async fn get_demands<'_>(&'_ self) -> Result<Vec<Demand>>
[src]
Fetches all active Demands which have been published by the Requestor.
pub async fn unsubscribe<'_, '_>(
&'_ self,
subscription_id: &'_ str
) -> Result<String>
[src]
&'_ self,
subscription_id: &'_ str
) -> Result<String>
Stop subscription by invalidating a previously published Demand.
pub async fn collect<'_, '_>(
&'_ self,
subscription_id: &'_ str,
timeout: Option<f32>,
maxEvents: Option<i32>
) -> Result<Vec<RequestorEvent>>
[src]
&'_ self,
subscription_id: &'_ str,
timeout: Option<f32>,
maxEvents: Option<i32>
) -> Result<Vec<RequestorEvent>>
Get events which have arrived from the market in response to the Demand
published by the Requestor via subscribe
.
Returns collection of at most max_events
RequestorEvents
or times out.
pub async fn counter_proposal<'_, '_, '_>(
&'_ self,
demand_proposal: &'_ Proposal,
subscription_id: &'_ str
) -> Result<String>
[src]
&'_ self,
demand_proposal: &'_ Proposal,
subscription_id: &'_ str
) -> Result<String>
Responds with a bespoke Demand to received Offer.
pub async fn get_proposal<'_, '_, '_>(
&'_ self,
subscription_id: &'_ str,
proposal_id: &'_ str
) -> Result<Proposal>
[src]
&'_ self,
subscription_id: &'_ str,
proposal_id: &'_ str
) -> Result<Proposal>
Fetches Proposal (Offer) with given id.
pub async fn reject_proposal<'_, '_, '_>(
&'_ self,
subscription_id: &'_ str,
proposal_id: &'_ str
) -> Result<String>
[src]
&'_ self,
subscription_id: &'_ str,
proposal_id: &'_ str
) -> Result<String>
Rejects a bespoke Demand.
pub async fn create_agreement<'_, '_>(
&'_ self,
agreement: &'_ AgreementProposal
) -> Result<String>
[src]
&'_ self,
agreement: &'_ AgreementProposal
) -> Result<String>
Creates Agreement from selected Proposal.
Initiates the Agreement handshake phase.
Formulates an Agreement artifact from the Proposal indicated by the received Proposal Id.
The Approval Expiry Date is added to Agreement artifact and implies the effective timeout on the whole Agreement Confirmation sequence.
A successful call to create_agreement
shall immediately be followed
by a confirm_agreement
and wait_for_approval
call in order to listen
for responses from the Provider.
Note: Moves given Proposal to Approved
state.
pub async fn get_agreement<'_, '_>(
&'_ self,
agreement_id: &'_ str
) -> Result<Agreement>
[src]
&'_ self,
agreement_id: &'_ str
) -> Result<Agreement>
Fetches agreement with given agreement id.
pub async fn confirm_agreement<'_, '_>(
&'_ self,
agreement_id: &'_ str
) -> Result<String>
[src]
&'_ self,
agreement_id: &'_ str
) -> Result<String>
Sends Agreement draft to the Provider.
Signs Agreement self-created via create_agreement
and sends it to the Provider.
pub async fn wait_for_approval<'_, '_>(
&'_ self,
agreement_id: &'_ str,
timeout: Option<f32>
) -> Result<String>
[src]
&'_ self,
agreement_id: &'_ str,
timeout: Option<f32>
) -> Result<String>
Waits for Agreement approval by the Provider.
This is a blocking operation. The call may be aborted by Requestor caller
code. After the call is aborted or timed out, another wait_for_approval
call can be raised on the same agreement_id
.
It returns one of the following options:
Approved
- Indicates that the Agreement has been approved by the Provider.
- The Provider is now ready to accept a request to start an Activity as described in the negotiated agreement.
- The Requestor’s corresponding
wait_for_approval
call returns Ok after this on the Provider side.
-
Rejected
- Indicates that the Provider has calledreject_agreement
, which effectively stops the Agreement handshake. The Requestor may attempt to return to the Negotiation phase by sending a new Proposal. -
Cancelled
- Indicates that the Requestor himself has calledcancel_agreement
, which effectively stops the Agreement handshake.
pub async fn cancel_agreement<'_, '_>(
&'_ self,
agreement_id: &'_ str
) -> Result<()>
[src]
&'_ self,
agreement_id: &'_ str
) -> Result<()>
Cancels agreement.
Causes the awaiting wait_for_approval
call to return with Cancelled
response.
Also the Provider's corresponding approve_agreement
returns Cancelled
.
pub async fn terminate_agreement<'_, '_>(
&'_ self,
agreement_id: &'_ str
) -> Result<String>
[src]
&'_ self,
agreement_id: &'_ str
) -> Result<String>
Terminates approved Agreement.
Trait Implementations
impl Clone for MarketRequestorApi
[src]
fn clone(&self) -> MarketRequestorApi
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl WebInterface for MarketRequestorApi
[src]
const API_URL_ENV_VAR: &'static str
[src]
const API_SUFFIX: &'static str
[src]
fn from_client(client: WebClient) -> Self
[src]
fn rebase_service_url(base_url: Rc<Url>) -> Result<Rc<Url>>
[src]
Auto Trait Implementations
impl !RefUnwindSafe for MarketRequestorApi
impl !Send for MarketRequestorApi
impl !Sync for MarketRequestorApi
impl Unpin for MarketRequestorApi
impl !UnwindSafe for MarketRequestorApi
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,