WebhookInfo constructor

const WebhookInfo({
  1. @JsonKey(name: 'url') required String url,
  2. @JsonKey(name: 'has_custom_certificate') required bool hasCustomCertificate,
  3. @JsonKey(name: 'pending_update_count') required int pendingUpdateCount,
  4. @JsonKey(name: 'ip_address') String? ipAddress,
  5. @JsonKey(name: 'last_error_date') int? lastErrorDate,
  6. @JsonKey(name: 'last_error_message') String? lastErrorMessage,
  7. @JsonKey(name: 'last_error_network_date') int? lastErrorNetworkDate,
  8. @JsonKey(name: 'max_connections') int? maxConnections,
  9. @JsonKey(name: 'allowed_updates') List<String>? allowedUpdates,
})

Constructs a WebhookInfo object.

Implementation

const factory WebhookInfo({
  /// Webhook URL, may be empty if webhook is not set up
  @JsonKey(name: 'url') required String url,

  /// True, if a custom certificate was provided for webhook certificate
  /// checks
  @JsonKey(name: 'has_custom_certificate') required bool hasCustomCertificate,

  /// Number of updates awaiting delivery
  @JsonKey(name: 'pending_update_count') required int pendingUpdateCount,

  /// Optional. Currently used webhook IP address
  @JsonKey(name: 'ip_address') String? ipAddress,

  /// Optional. Unix time for the most recent error that happened when trying
  /// to deliver an update via webhook
  @JsonKey(name: 'last_error_date') int? lastErrorDate,

  /// Optional. Error message in human-readable format for the most recent
  /// error that happened when trying to deliver an update via webhook
  @JsonKey(name: 'last_error_message') String? lastErrorMessage,

  /// Optional. Unix time of the most recent error that happened when trying
  /// to synchronize available updates with Telegram datacenters
  @JsonKey(name: 'last_error_network_date') int? lastErrorNetworkDate,

  /// Optional. The maximum allowed number of simultaneous HTTPS connections
  /// to the webhook for update delivery
  @JsonKey(name: 'max_connections') int? maxConnections,

  /// Optional. A list of update types the bot is subscribed to. Defaults to
  /// all update types except chat_member
  @JsonKey(name: 'allowed_updates') List<String>? allowedUpdates,
}) = _WebhookInfo;