pub struct WebhookRegistration {
pub topic: WebhookTopic,
pub delivery_method: WebhookDeliveryMethod,
pub include_fields: Option<Vec<String>>,
pub metafield_namespaces: Option<Vec<String>>,
pub filter: Option<String>,
/* private fields */
}Expand description
Represents a webhook registration configuration.
This struct holds the configuration for a webhook subscription, including the topic, delivery method, optional filtering options, and an optional handler for processing incoming webhooks.
§Fields
topic: The webhook topic to subscribe todelivery_method: How the webhook should be delivered (HTTP, EventBridge, or Pub/Sub)include_fields: Optional list of fields to include in the webhook payloadmetafield_namespaces: Optional list of metafield namespaces to includefilter: Optional filter string (e.g., “status:active”)handler: Optional handler for processing incoming webhooks
§Example
use shopify_sdk::webhooks::{WebhookRegistration, WebhookRegistrationBuilder, WebhookDeliveryMethod};
use shopify_sdk::rest::resources::v2025_10::common::WebhookTopic;
let registration = WebhookRegistrationBuilder::new(
WebhookTopic::OrdersCreate,
WebhookDeliveryMethod::Http {
uri: "https://example.com/webhooks/orders".to_string(),
},
)
.build();
assert!(matches!(
registration.delivery_method,
WebhookDeliveryMethod::Http { .. }
));Fields§
§topic: WebhookTopicThe webhook topic to subscribe to.
delivery_method: WebhookDeliveryMethodThe delivery method for the webhook.
Determines how webhooks are delivered: via HTTP callback, Amazon EventBridge, or Google Cloud Pub/Sub.
include_fields: Option<Vec<String>>Optional list of fields to include in the webhook payload.
When specified, only these fields will be included in the webhook payload.
metafield_namespaces: Option<Vec<String>>Optional list of metafield namespaces to include in the webhook payload.
filter: Option<String>Optional filter string for the webhook subscription.
Example: “status:active”
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WebhookRegistration
impl !RefUnwindSafe for WebhookRegistration
impl Send for WebhookRegistration
impl Sync for WebhookRegistration
impl Unpin for WebhookRegistration
impl !UnwindSafe for WebhookRegistration
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more