pub struct ExternalAgentsCallApi<'api> { /* private fields */ }
Implementations§
Source§impl<'api> ExternalAgentsCallApi<'api>
impl<'api> ExternalAgentsCallApi<'api>
Sourcepub fn create_group(
&self,
asset_id: AssetId,
perms: ExtrinsicPermissions,
) -> Result<WrappedCall>
pub fn create_group( &self, asset_id: AssetId, perms: ExtrinsicPermissions, ) -> Result<WrappedCall>
Creates a custom agent group (AG) for the given asset_id
.
The AG will have the permissions as given by perms
.
This new AG is then assigned id = AGIdSequence::get() + 1
as its AGId
,
which you can use as AgentGroup::Custom(id)
when adding agents for asset_id
.
§Arguments
assetID
the [`AssetId] to add the custom group for.perms
that the new AG will have.
§Errors
UnauthorizedAgent
iforigin
was not authorized as an agent to call this.TooLong
ifperms
had some string or list length that was too long.CounterOverflow
ifAGIdSequence::get() + 1
would exceedu32::MAX
.
§Permissions
- Asset
- Agent
Sourcepub fn set_group_permissions(
&self,
asset_id: AssetId,
id: AGId,
perms: ExtrinsicPermissions,
) -> Result<WrappedCall>
pub fn set_group_permissions( &self, asset_id: AssetId, id: AGId, perms: ExtrinsicPermissions, ) -> Result<WrappedCall>
Updates the permissions of the custom AG identified by id
, for the given asset_id
.
§Arguments
assetID
the [`AssetId] the custom AG belongs to.id
for the custom AG withinasset_id
.perms
to update the custom AG to.
§Errors
UnauthorizedAgent
iforigin
was not authorized as an agent to call this.TooLong
ifperms
had some string or list length that was too long.NoSuchAG
ifid
does not identify a custom AG.
§Permissions
- Asset
- Agent
Sourcepub fn remove_agent(
&self,
asset_id: AssetId,
agent: IdentityId,
) -> Result<WrappedCall>
pub fn remove_agent( &self, asset_id: AssetId, agent: IdentityId, ) -> Result<WrappedCall>
Remove the given agent
from asset_id
.
§Arguments
assetID
the [AssetId] that has the
agent` to remove.agent
ofasset_id
to remove.
§Errors
UnauthorizedAgent
iforigin
was not authorized as an agent to call this.NotAnAgent
ifagent
is not an agent ofasset_id
.RemovingLastFullAgent
ifagent
is the last full one.
§Permissions
- Asset
- Agent
Sourcepub fn abdicate(&self, asset_id: AssetId) -> Result<WrappedCall>
pub fn abdicate(&self, asset_id: AssetId) -> Result<WrappedCall>
Sourcepub fn change_group(
&self,
asset_id: AssetId,
agent: IdentityId,
group: AgentGroup,
) -> Result<WrappedCall>
pub fn change_group( &self, asset_id: AssetId, agent: IdentityId, group: AgentGroup, ) -> Result<WrappedCall>
Change the agent group that agent
belongs to in asset_id
.
§Arguments
assetID
the [AssetId] that has the
agent`.agent
ofasset_id
to change the group for.group
thatagent
will belong to inasset_id
.
§Errors
UnauthorizedAgent
iforigin
was not authorized as an agent to call this.NoSuchAG
ifid
does not identify a custom AG.NotAnAgent
ifagent
is not an agent ofasset_id
.RemovingLastFullAgent
ifagent
was aFull
one and is being demoted.
§Permissions
- Asset
- Agent
Sourcepub fn accept_become_agent(&self, auth_id: u64) -> Result<WrappedCall>
pub fn accept_become_agent(&self, auth_id: u64) -> Result<WrappedCall>
Accept an authorization by an agent “Alice” who issued auth_id
to also become an agent of the asset Alice specified.
§Arguments
auth_id
identifying the authorization to accept.
§Errors
AuthorizationError::Invalid
ifauth_id
does not exist for the given caller.AuthorizationError::Expired
ifauth_id
is for an auth that has expired.AuthorizationError::BadType
ifauth_id
was not for aBecomeAgent
auth type.UnauthorizedAgent
if “Alice” is not permissioned to provide the auth.NoSuchAG
if the group referred to a custom that does not exist.AlreadyAnAgent
if the caller is already an agent of the asset.
§Permissions
- Agent
Sourcepub fn create_group_and_add_auth(
&self,
asset_id: AssetId,
perms: ExtrinsicPermissions,
target: IdentityId,
expiry: Option<u64>,
) -> Result<WrappedCall>
pub fn create_group_and_add_auth( &self, asset_id: AssetId, perms: ExtrinsicPermissions, target: IdentityId, expiry: Option<u64>, ) -> Result<WrappedCall>
Sourcepub fn create_and_change_custom_group(
&self,
asset_id: AssetId,
perms: ExtrinsicPermissions,
agent: IdentityId,
) -> Result<WrappedCall>
pub fn create_and_change_custom_group( &self, asset_id: AssetId, perms: ExtrinsicPermissions, agent: IdentityId, ) -> Result<WrappedCall>
Utility extrinsic to batch create_group
and change_group
for custom groups only.
§Permissions
- Asset
- Agent
Trait Implementations§
Source§impl<'api> Clone for ExternalAgentsCallApi<'api>
impl<'api> Clone for ExternalAgentsCallApi<'api>
Source§fn clone(&self) -> ExternalAgentsCallApi<'api>
fn clone(&self) -> ExternalAgentsCallApi<'api>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<'api> Freeze for ExternalAgentsCallApi<'api>
impl<'api> !RefUnwindSafe for ExternalAgentsCallApi<'api>
impl<'api> Send for ExternalAgentsCallApi<'api>
impl<'api> Sync for ExternalAgentsCallApi<'api>
impl<'api> Unpin for ExternalAgentsCallApi<'api>
impl<'api> !UnwindSafe for ExternalAgentsCallApi<'api>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
Source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
Source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
Source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
Source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read moreSource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.Source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
Source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.