pub struct SyncExternalsystemsFieldMappingsResource<'a> { /* private fields */ }Expand description
client.sync().externalsystems().field_mappings()
Implementations§
Source§impl<'a> SyncExternalsystemsFieldMappingsResource<'a>
impl<'a> SyncExternalsystemsFieldMappingsResource<'a>
Sourcepub fn delete(
&self,
external_system_id: impl Display,
domain_type: impl Display,
) -> Result<()>
pub fn delete( &self, external_system_id: impl Display, domain_type: impl Display, ) -> Result<()>
Delete field mappings for a domain
DELETE /sync/externalsystems/{externalSystemId}/fieldmappings/{domainType}
Removes the stored field mapping and its entries for this connection and domain. A missing mapping also returns 204.
§Example
client.sync().externalsystems().field_mappings().delete(1, "status")?;Sourcepub fn get(
&self,
external_system_id: impl Display,
domain_type: impl Display,
) -> Result<FieldMapping>
pub fn get( &self, external_system_id: impl Display, domain_type: impl Display, ) -> Result<FieldMapping>
Get field mappings for a domain
GET /sync/externalsystems/{externalSystemId}/fieldmappings/{domainType}
Returns mappings in both directions. If the connection exists but no mapping is stored for the domain, returns an unsaved mapping.
§Example
let field_mapping = client.sync().externalsystems().field_mappings().get(1, "status")?;
println!("{:?}", field_mapping.id);Sourcepub fn get_nosuggestions(
&self,
external_system_id: impl Display,
domain_type: impl Display,
) -> Result<Value>
pub fn get_nosuggestions( &self, external_system_id: impl Display, domain_type: impl Display, ) -> Result<Value>
List fields without mapping suggestions
GET /sync/externalsystems/{externalSystemId}/fieldmappings/{domainType}/nosuggestions
Returns source fields whose adapter preset has no target suggestion, grouped by system. This reports preset coverage, not all unselected job fields.
§Example
let result = client.sync().externalsystems().field_mappings().get_nosuggestions(1, "status")?;
println!("{:?}", result);Sourcepub fn list(
&self,
external_system_id: impl Display,
) -> Result<Vec<FieldMapping>>
pub fn list( &self, external_system_id: impl Display, ) -> Result<Vec<FieldMapping>>
List field mappings for a connection
GET /sync/externalsystems/{externalSystemId}/fieldmappings
Lists stored domain-level field mappings. These define available translations between fields; a job separately selects which mappings to use.
§Example
for field_mapping in client.sync().externalsystems().field_mappings().list(1)? {
println!("{:?}", field_mapping.id);
}Sourcepub fn update(
&self,
external_system_id: impl Display,
domain_type: impl Display,
body: &SyncFieldMappingUpdate,
) -> Result<FieldMapping>
pub fn update( &self, external_system_id: impl Display, domain_type: impl Display, body: &SyncFieldMappingUpdate, ) -> Result<FieldMapping>
Replace field mappings for a domain
PUT /sync/externalsystems/{externalSystemId}/fieldmappings/{domainType}
Replaces both direction lists. Direction is inferred from the enclosing list.
§Example
let body = models::SyncFieldMappingUpdate {
property_mappings_es_to_master: vec![models::SyncFieldMappingEntryCreate {
from: "firstName".into(),
from_filter: "".into(),
others: serde_json::json!({}),
to: "firstName".into(),
to_filter: "".into(),
value_mapping: serde_json::json!({}),
..Default::default()
}],
property_mappings_master_to_es: vec![models::SyncFieldMappingEntryCreate {
from: "firstName".into(),
from_filter: "".into(),
others: serde_json::json!({}),
to: "firstName".into(),
to_filter: "".into(),
value_mapping: serde_json::json!({}),
..Default::default()
}],
..Default::default()
};
let result = client.sync().externalsystems().field_mappings().update(1, "status", &body)?;
println!("{:?}", result.id);