pub struct Trigger { /* private fields */ }Expand description
Trigger object representation.
§Fields and Validations
For more details, see the official documentation.
| Field | Type | Required | Validation |
|---|---|---|---|
| url | String | Yes | N/A |
| customizable_input_parameters | Vec<InputParameter> | No | N/A |
§Example
use slack_messaging::composition_objects::{types::InputParameter, Trigger};
let trigger = Trigger::builder()
.url("https://slack.com/shortcuts/Ft0123ABC456/123...xyz")
.customizable_input_parameter(
InputParameter::builder()
.name("input_parameter_a")
.value("Value for input param A")
.build()?
)
.customizable_input_parameter(
InputParameter::builder()
.name("input_parameter_b")
.value("Value for input param B")
.build()?
)
.build()?;
let expected = serde_json::json!({
"url": "https://slack.com/shortcuts/Ft0123ABC456/123...xyz",
"customizable_input_parameters": [
{
"name": "input_parameter_a",
"value": "Value for input param A"
},
{
"name": "input_parameter_b",
"value": "Value for input param B"
}
]
});
let json = serde_json::to_value(trigger).unwrap();
assert_eq!(json, expected);
// If your object has any validation errors, the build method returns Result::Err
let trigger = Trigger::builder()
.customizable_input_parameter(
InputParameter::builder()
.name("input_parameter_a")
.value("Value for input param A")
.build()?
)
.build();
assert!(trigger.is_err());Implementations§
Source§impl Trigger
impl Trigger
Sourcepub fn builder() -> TriggerBuilder
pub fn builder() -> TriggerBuilder
constract TriggerBuilder object.
Trait Implementations§
impl StructuralPartialEq for Trigger
Auto Trait Implementations§
impl Freeze for Trigger
impl RefUnwindSafe for Trigger
impl Send for Trigger
impl Sync for Trigger
impl Unpin for Trigger
impl UnwindSafe for Trigger
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)