BusinessConnection constructor

const BusinessConnection({
  1. @JsonKey(name: 'id') required String id,
  2. @JsonKey(name: 'user') required User user,
  3. @JsonKey(name: 'user_chat_id') required int userChatId,
  4. @JsonKey(name: 'date') required int date,
  5. @JsonKey(name: 'rights') required BusinessBotRights rights,
  6. @JsonKey(name: 'is_enabled') required bool isEnabled,
})

Constructs a new BusinessConnection instance with the provided parameters.

Implementation

const factory BusinessConnection({
  /// Unique identifier of the business connection.
  @JsonKey(name: 'id') required String id,

  /// Business account user that created the business connection.
  @JsonKey(name: 'user') required User user,

  /// Identifier of a private chat with the user who created the business
  /// connection. This number may have more than 32 significant bits and some
  /// programming languages may have difficulty/silent defects in interpreting
  /// it. But it has at most 52 significant bits, so a 64-bit integer or
  /// double-precision float type are safe for storing this identifier.
  @JsonKey(name: 'user_chat_id') required int userChatId,

  /// Date the connection was established in Unix time.
  @JsonKey(name: 'date') required int date,

  /// Indicates whether the bot can act on behalf of the business account in
  /// chats that were active in the last 24 hours.
  @JsonKey(name: 'rights') required BusinessBotRights rights,

  /// Indicates whether the connection is active.
  @JsonKey(name: 'is_enabled') required bool isEnabled,
}) = _BusinessConnection;