pub struct SyncConflictsResource<'a> { /* private fields */ }Expand description
client.sync().conflicts()
Implementations§
Source§impl<'a> SyncConflictsResource<'a>
impl<'a> SyncConflictsResource<'a>
Sourcepub fn create(&self, body: &SyncConflictCreate) -> Result<SyncConflicts>
pub fn create(&self, body: &SyncConflictCreate) -> Result<SyncConflicts>
Record a sync conflict
POST /sync/conflicts
Creates a conflict record. Requires “churchcore: administer persons” permission.
§Example
let body = models::SyncConflictCreate {
data: vec![models::SyncConflictDataCreate {
key: "abc123".into(),
value: "beispiel".into(),
..Default::default()
}],
entity_mapping_id: 1,
job_id: "7e31c399-91b1-4148-bfdd-6c05b557a25c".into(),
r#type: "create".into(),
..Default::default()
};
let result = client.sync().conflicts().create(&body)?;
println!("{}", result.id);Sourcepub fn delete(&self, id: impl Display) -> Result<()>
pub fn delete(&self, id: impl Display) -> Result<()>
Delete a sync conflict
DELETE /sync/conflicts/{id}
Removes the conflict record without resolving or modifying the underlying records. Missing conflicts also return 204. Requires “churchcore: administer persons” permission.
§Example
client.sync().conflicts().delete(1)?;Sourcepub fn get(&self, id: impl Display) -> Result<SyncConflicts>
pub fn get(&self, id: impl Display) -> Result<SyncConflicts>
Get a sync conflict
GET /sync/conflicts/{id}
Returns one conflict and its supporting key/value data. Requires “churchcore: administer persons” permission.
§Example
let conflict = client.sync().conflicts().get(1)?;
println!("{}", conflict.id);Sourcepub fn list(&self) -> Result<Vec<SyncConflicts>>
pub fn list(&self) -> Result<Vec<SyncConflicts>>
List sync conflicts
GET /sync/conflicts
Filters on source and domain refer to the linked entity mapping. Conflict jobId identifies the producing sync run, not a job configuration. Requires “churchcore: administer persons” permission.
Use Self::list_with to pass query parameters.
§Example
for conflict in client.sync().conflicts().list()? {
println!("{}", conflict.id);
}Sourcepub fn list_with(
&self,
query: &GetSyncConflictsQuery,
) -> Result<Vec<SyncConflicts>>
pub fn list_with( &self, query: &GetSyncConflictsQuery, ) -> Result<Vec<SyncConflicts>>
List sync conflicts
Like Self::list, with query parameters.
GET /sync/conflicts
Filters on source and domain refer to the linked entity mapping. Conflict jobId identifies the producing sync run, not a job configuration. Requires “churchcore: administer persons” permission.
Sourcepub fn list_iter(&self, query: &GetSyncConflictsQuery) -> Items<SyncConflicts> ⓘ
pub fn list_iter(&self, query: &GetSyncConflictsQuery) -> Items<SyncConflicts> ⓘ
List sync conflicts
Like Self::list_with, but lazy: each page is fetched only when the iteration reaches it.
Breaking off early saves the remaining requests.
Sourcepub fn update(
&self,
id: impl Display,
body: &SyncConflictUpdate,
) -> Result<SyncConflicts>
pub fn update( &self, id: impl Display, body: &SyncConflictUpdate, ) -> Result<SyncConflicts>
Replace a sync conflict
PUT /sync/conflicts/{id}
Replaces job, relationship, type and all conflict data. This does not modify either synchronized record. Requires “churchcore: administer persons” permission.
§Example
let body = models::SyncConflictUpdate {
data: vec![models::SyncConflictDataCreate {
key: "abc123".into(),
value: "beispiel".into(),
..Default::default()
}],
entity_mapping_id: 1,
job_id: "7e31c399-91b1-4148-bfdd-6c05b557a25c".into(),
r#type: "create".into(),
..Default::default()
};
let result = client.sync().conflicts().update(1, &body)?;
println!("{}", result.id);