pub struct SyncAdaptersResource<'a> { /* private fields */ }Expand description
client.sync().adapters()
Implementations§
Source§impl<'a> SyncAdaptersResource<'a>
impl<'a> SyncAdaptersResource<'a>
pub fn proxy(&self) -> SyncAdaptersProxyResource<'a>
Sourcepub fn create(&self, body: &SyncAdapterCreate) -> Result<SyncAdapter>
pub fn create(&self, body: &SyncAdapterCreate) -> Result<SyncAdapter>
Register a sync adapter
POST /sync/adapters
Registers the service URL and authentication token of an adapter. Registration does not configure an external connection.
§Example
let body = models::SyncAdapterCreate {
name: "churchtools".into(),
token: "kfghsjdlkfigblszurglizeifuz4".into(),
url: "http://localhost:8090".into(),
..Default::default()
};
let result = client.sync().adapters().create(&body)?;
println!("{}", result.name);Sourcepub fn delete(&self, id: impl Display) -> Result<()>
pub fn delete(&self, id: impl Display) -> Result<()>
Delete a sync adapter
DELETE /sync/adapters/{id}
Deletes the adapter registration. External connections referencing it block deletion.
Use Self::delete_with to pass query parameters.
§Example
client.sync().adapters().delete(1)?;Sourcepub fn delete_with(
&self,
id: impl Display,
query: &DeleteSyncAdaptersIdQuery,
) -> Result<()>
pub fn delete_with( &self, id: impl Display, query: &DeleteSyncAdaptersIdQuery, ) -> Result<()>
Delete a sync adapter
Like Self::delete, with query parameters.
DELETE /sync/adapters/{id}
Deletes the adapter registration. External connections referencing it block deletion.
Sourcepub fn get(&self, id: impl Display) -> Result<SyncAdapter>
pub fn get(&self, id: impl Display) -> Result<SyncAdapter>
Get a sync adapter
GET /sync/adapters/{id}
Returns adapter settings with a masked token.
§Example
let adapter = client.sync().adapters().get(1)?;
println!("{}", adapter.name);Sourcepub fn list(&self) -> Result<Vec<SyncAdapter>>
pub fn list(&self) -> Result<Vec<SyncAdapter>>
List sync adapters
GET /sync/adapters
Lists registered adapter services. An adapter translates between the Sync worker and a system-specific API.
§Example
for adapter in client.sync().adapters().list()? {
println!("{}", adapter.name);
}Sourcepub fn update(
&self,
id: impl Display,
body: &SyncAdapterUpdate,
) -> Result<SyncAdapter>
pub fn update( &self, id: impl Display, body: &SyncAdapterUpdate, ) -> Result<SyncAdapter>
Replace sync adapter settings
PUT /sync/adapters/{id}
Replaces the adapter name, URL and authentication token.
§Example
let body = models::SyncAdapterUpdate {
name: "churchtools".into(),
token: "kfghsjdlkfigblszurglizeifuz4".into(),
url: "http://localhost:8090".into(),
..Default::default()
};
let result = client.sync().adapters().update(1, &body)?;
println!("{}", result.name);