pub struct PartyRoleClient { /* private fields */ }api-tmf669 and api only.Expand description
A client for TMF669 Party Role Management.
use rutmf::api::{Query, Transport, tmf669::PartyRoleClient};
let client = PartyRoleClient::from_host("https://mycsp.com", transport)?;
let page = client
.list_party_roles(&Query::new().filter("role", "supplier").limit(20))
.await?;Implementations§
Source§impl PartyRoleClient
impl PartyRoleClient
Sourcepub fn new(
base_url: impl Into<String>,
transport: impl Transport + 'static,
) -> Result<Self>
pub fn new( base_url: impl Into<String>, transport: impl Transport + 'static, ) -> Result<Self>
Creates a client for base_url, dispatching through transport.
§Errors
Returns Error::InvalidBaseUrl if the URL is empty.
Sourcepub fn from_host(
host: &str,
transport: impl Transport + 'static,
) -> Result<Self>
pub fn from_host( host: &str, transport: impl Transport + 'static, ) -> Result<Self>
Creates a client from a host, appending the conventional API_PATH.
§Errors
Returns Error::InvalidBaseUrl if the host is empty.
Sourcepub fn inner(&self) -> &TmfClient
pub fn inner(&self) -> &TmfClient
The underlying generic client, for operations this API does not wrap.
Sourcepub async fn list_party_roles(&self, query: &Query) -> Result<Page<PartyRole>>
pub async fn list_party_roles(&self, query: &Query) -> Result<Page<PartyRole>>
Lists a party role matching query, one page at a time.
Sourcepub fn stream_party_roles(&self, query: Query) -> PageStream<PartyRole>
pub fn stream_party_roles(&self, query: Query) -> PageStream<PartyRole>
Streams every a party role matching query, fetching pages as needed.
Sourcepub async fn get_party_role(&self, id: &str, query: &Query) -> Result<PartyRole>
pub async fn get_party_role(&self, id: &str, query: &Query) -> Result<PartyRole>
Retrieves one a party role by id.
Sourcepub async fn create_party_role(
&self,
body: &PartyRoleCreate,
) -> Result<PartyRole>
pub async fn create_party_role( &self, body: &PartyRoleCreate, ) -> Result<PartyRole>
Creates a party role (POST, the v5 _FVO body).
Sourcepub async fn update_party_role<'a>(
&self,
id: &str,
body: impl Into<Patch<'a, PartyRoleUpdate>>,
) -> Result<PartyRole>
pub async fn update_party_role<'a>( &self, id: &str, body: impl Into<Patch<'a, PartyRoleUpdate>>, ) -> Result<PartyRole>
Updates a party role (PATCH, the v5 _MVO body).
Pass &PartyRoleUpdate for a merge patch — the safe
default — or &[JsonPatchOp] for an RFC 6902 operation list. The
remaining two v5 flavours are the explicit Patch variants.
Sourcepub async fn delete_party_role(&self, id: &str) -> Result<()>
pub async fn delete_party_role(&self, id: &str) -> Result<()>
Deletes a party role by id.
Sourcepub async fn list_party_role_specifications(
&self,
query: &Query,
) -> Result<Page<PartyRoleSpecification>>
pub async fn list_party_role_specifications( &self, query: &Query, ) -> Result<Page<PartyRoleSpecification>>
Lists a party role specification matching query, one page at a time.
Sourcepub fn stream_party_role_specifications(
&self,
query: Query,
) -> PageStream<PartyRoleSpecification>
pub fn stream_party_role_specifications( &self, query: Query, ) -> PageStream<PartyRoleSpecification>
Streams every a party role specification matching query, fetching pages as needed.
Sourcepub async fn get_party_role_specification(
&self,
id: &str,
query: &Query,
) -> Result<PartyRoleSpecification>
pub async fn get_party_role_specification( &self, id: &str, query: &Query, ) -> Result<PartyRoleSpecification>
Retrieves one a party role specification by id.
Sourcepub async fn create_party_role_specification(
&self,
body: &PartyRoleSpecificationCreate,
) -> Result<PartyRoleSpecification>
pub async fn create_party_role_specification( &self, body: &PartyRoleSpecificationCreate, ) -> Result<PartyRoleSpecification>
Creates a party role specification (POST, the v5 _FVO body).
Sourcepub async fn update_party_role_specification<'a>(
&self,
id: &str,
body: impl Into<Patch<'a, PartyRoleSpecificationUpdate>>,
) -> Result<PartyRoleSpecification>
pub async fn update_party_role_specification<'a>( &self, id: &str, body: impl Into<Patch<'a, PartyRoleSpecificationUpdate>>, ) -> Result<PartyRoleSpecification>
Updates a party role specification (PATCH, the v5 _MVO body).
Pass &PartyRoleSpecificationUpdate for a merge patch — the safe
default — or &[JsonPatchOp] for an RFC 6902 operation list. The
remaining two v5 flavours are the explicit Patch variants.
Sourcepub async fn delete_party_role_specification(&self, id: &str) -> Result<()>
pub async fn delete_party_role_specification(&self, id: &str) -> Result<()>
Deletes a party role specification by id.