pub struct SyncExternalsystemsResource<'a> { /* private fields */ }Expand description
client.sync().externalsystems()
Implementations§
Source§impl<'a> SyncExternalsystemsResource<'a>
impl<'a> SyncExternalsystemsResource<'a>
pub fn adapter_proxy(&self) -> SyncExternalsystemsAdapterProxyResource<'a>
pub fn field_mappings(&self) -> SyncExternalsystemsFieldMappingsResource<'a>
pub fn job_configs(&self) -> SyncExternalsystemsJobConfigsResource<'a>
Sourcepub fn create(&self, body: &ExternalSystemCreate) -> Result<ExternalSystem>
pub fn create(&self, body: &ExternalSystemCreate) -> Result<ExternalSystem>
Create an external connection
POST /sync/externalsystems
Creates a connection using an existing adapter name and copies available field-mapping presets. Outside the trial period, the licensed connection limit is checked.
§Example
let body = models::ExternalSystemCreate {
access_header_values: serde_json::json!({}),
adapter: "churchtools".into(),
name: "Accounting system".into(),
..Default::default()
};
let result = client.sync().externalsystems().create(&body)?;
println!("{}", result.name);Sourcepub fn delete(&self, external_system_id: impl Display) -> Result<()>
pub fn delete(&self, external_system_id: impl Display) -> Result<()>
Delete an external connection
DELETE /sync/externalsystems/{externalSystemId}
Deletes the connection, its job configurations, related job logs and executions, field mappings and entity mappings. Synchronized records themselves are not deleted. Returns 204 if the connection is missing.
§Example
client.sync().externalsystems().delete(1)?;Sourcepub fn delete_entity_mappings(
&self,
external_system_id: impl Display,
) -> Result<()>
pub fn delete_entity_mappings( &self, external_system_id: impl Display, ) -> Result<()>
Delete all mappings for an external connection
DELETE /sync/externalsystems/{externalSystemId}/entitymappings
Removes all relationships belonging to the external connection. Underlying records remain. Returns 204 when no mapping exists. Requires “churchcore: administer persons” permission.
§Example
client.sync().externalsystems().delete_entity_mappings(1)?;Sourcepub fn get(&self, external_system_id: impl Display) -> Result<ExternalSystem>
pub fn get(&self, external_system_id: impl Display) -> Result<ExternalSystem>
Get an external connection
GET /sync/externalsystems/{externalSystemId}
Returns connection settings with masked access credentials.
§Example
let externalsystem = client.sync().externalsystems().get(1)?;
println!("{}", externalsystem.name);Sourcepub fn list(&self) -> Result<Vec<ExternalSystem>>
pub fn list(&self) -> Result<Vec<ExternalSystem>>
List external connections
GET /sync/externalsystems
Lists configured connections, including their adapter names and job counts. A connection identifies one external installation or account; several can use the same adapter.
§Example
for externalsystem in client.sync().externalsystems().list()? {
println!("{}", externalsystem.name);
}Sourcepub fn test(&self, external_system_id: impl Display) -> Result<()>
pub fn test(&self, external_system_id: impl Display) -> Result<()>
Test a saved external connection
POST /sync/externalsystems/{externalSystemId}/test
Calls the adapter’s connection test using the saved settings. This is a connection check, not a synchronization run.
§Example
client.sync().externalsystems().test(1)?;Sourcepub fn test_settings(
&self,
body: &SyncExternalSystemTestCreate,
) -> Result<Value>
pub fn test_settings( &self, body: &SyncExternalSystemTestCreate, ) -> Result<Value>
Test proposed external connection settings
POST /sync/externalsystems/test
Runs the adapter’s connection test without saving the supplied settings.
§Example
let body = models::SyncExternalSystemTestCreate {
access_header_values: serde_json::json!({}),
adapter: "churchtools".into(),
name: "Accounting system".into(),
..Default::default()
};
let result = client.sync().externalsystems().test_settings(&body)?;
println!("{:?}", result);Sourcepub fn update(
&self,
external_system_id: impl Display,
body: &ExternalSystemUpdate,
) -> Result<ExternalSystem>
pub fn update( &self, external_system_id: impl Display, body: &ExternalSystemUpdate, ) -> Result<ExternalSystem>
Update an external connection
PUT /sync/externalsystems/{externalSystemId}
Changes the name and adapter and merges supplied access headers.
§Example
let body = models::ExternalSystemUpdate {
access_header_values: serde_json::json!({}),
adapter: "churchtools".into(),
name: "Accounting system".into(),
id: 1,
..Default::default()
};
let result = client.sync().externalsystems().update(1, &body)?;
println!("{}", result.name);