pub struct DbFieldsOptionsResource<'a> { /* private fields */ }Expand description
client.db_fields().options()
Implementations§
Source§impl<'a> DbFieldsOptionsResource<'a>
impl<'a> DbFieldsOptionsResource<'a>
Sourcepub fn create(
&self,
field_id: impl Display,
body: &DbFieldOptionCreate,
) -> Result<DbFieldOption>
pub fn create( &self, field_id: impl Display, body: &DbFieldOptionCreate, ) -> Result<DbFieldOption>
Create a database-field option
POST /dbfields/{fieldId}/options
Creates an option in the selected field’s backing table. Use the metadata endpoint to determine the complete request shape. Fields without a backing table do not support this operation.
§Example
let body = models::DbFieldOptionCreate {
name: Some("Vegetarian".into()),
..Default::default()
};
let result = client.db_fields().options().create(200, &body)?;
println!("{:?}", result.name);Sourcepub fn delete(
&self,
field_id: impl Display,
option_id: impl Display,
) -> Result<()>
pub fn delete( &self, field_id: impl Display, option_id: impl Display, ) -> Result<()>
Delete a database-field option
DELETE /dbfields/{fieldId}/options/{optionId}
Deletes an option row from the selected field’s backing masterdata table through the shared deletion service. References can block deletion. dryRun=true returns the deletion preview with HTTP 409 without removing the row.
Use Self::delete_with to pass query parameters.
§Example
client.db_fields().options().delete(200, 3)?;Sourcepub fn delete_with(
&self,
field_id: impl Display,
option_id: impl Display,
query: &DeleteDbfieldsFieldIdOptionsOptionIdQuery,
) -> Result<()>
pub fn delete_with( &self, field_id: impl Display, option_id: impl Display, query: &DeleteDbfieldsFieldIdOptionsOptionIdQuery, ) -> Result<()>
Delete a database-field option
Like Self::delete, with query parameters.
DELETE /dbfields/{fieldId}/options/{optionId}
Deletes an option row from the selected field’s backing masterdata table through the shared deletion service. References can block deletion. dryRun=true returns the deletion preview with HTTP 409 without removing the row.
Sourcepub fn list(&self, field_id: impl Display) -> Result<Vec<DbFieldOption>>
pub fn list(&self, field_id: impl Display) -> Result<Vec<DbFieldOption>>
List options for a database field
GET /dbfields/{fieldId}/options
Lists option rows from the field’s backing masterdata table. Rows are ordered by sortKey when available. Fields without a backing table return an empty list. Read the option metadata to interpret row keys.
§Example
for option in client.db_fields().options().list(200)? {
println!("{:?}", option.name);
}Sourcepub fn list_metadata(
&self,
field_id: impl Display,
) -> Result<Vec<DbFieldOptionColumn>>
pub fn list_metadata( &self, field_id: impl Display, ) -> Result<Vec<DbFieldOptionColumn>>
Get metadata for field options
GET /dbfields/{fieldId}/options/metadata
Describes the actual SQL columns of the selected field’s backing option table as API properties. Audit columns are omitted. Use this operation only for fields backed by a table.
§Example
for metadata in client.db_fields().options().list_metadata(200)? {
println!("{}", metadata.name);
}Sourcepub fn update(
&self,
field_id: impl Display,
option_id: impl Display,
body: &DbFieldOptionUpdate,
) -> Result<DbFieldOption>
pub fn update( &self, field_id: impl Display, option_id: impl Display, body: &DbFieldOptionUpdate, ) -> Result<DbFieldOption>
Update a database-field option
PUT /dbfields/{fieldId}/options/{optionId}
Updates an option row using all non-auto-increment columns from the metadata endpoint. This operation replaces the complete metadata-defined row and supports only fields backed by a table.
§Example
let body = models::DbFieldOptionUpdate {
name: Some("Vegetarian".into()),
..Default::default()
};
let result = client.db_fields().options().update(200, 3, &body)?;
println!("{:?}", result.name);