From ff8cf067b8328f8a49f0a2dfd69a6ae5569cda15 Mon Sep 17 00:00:00 2001 From: Wim Date: Sat, 8 Feb 2020 16:50:16 +0100 Subject: Update kekeybase/go-keybase-chat-bot vendor --- go.mod | 2 +- go.sum | 4 +- .../keybase/go-keybase-chat-bot/kbchat/chat.go | 651 +++ .../keybase/go-keybase-chat-bot/kbchat/errors.go | 36 + .../keybase/go-keybase-chat-bot/kbchat/kbchat.go | 485 +- .../keybase/go-keybase-chat-bot/kbchat/kvstore.go | 228 + .../keybase/go-keybase-chat-bot/kbchat/team.go | 53 +- .../kbchat/test_config.example.yaml | 29 +- .../go-keybase-chat-bot/kbchat/test_utils.go | 4 +- .../keybase/go-keybase-chat-bot/kbchat/types.go | 157 +- .../go-keybase-chat-bot/kbchat/types/chat1/api.go | 933 ++++ .../kbchat/types/chat1/blocking.go | 4 + .../kbchat/types/chat1/chat_ui.go | 2874 ++++++++++ .../kbchat/types/chat1/commands.go | 199 + .../kbchat/types/chat1/common.go | 2473 +++++++++ .../kbchat/types/chat1/gregor.go | 548 ++ .../kbchat/types/chat1/local.go | 5865 ++++++++++++++++++++ .../kbchat/types/chat1/notify.go | 938 ++++ .../kbchat/types/chat1/remote.go | 1250 +++++ .../kbchat/types/chat1/unfurl.go | 850 +++ .../kbchat/types/gregor1/auth.go | 20 + .../kbchat/types/gregor1/auth_internal.go | 4 + .../kbchat/types/gregor1/auth_update.go | 4 + .../kbchat/types/gregor1/common.go | 394 ++ .../kbchat/types/gregor1/incoming.go | 72 + .../kbchat/types/gregor1/outgoing.go | 4 + .../kbchat/types/gregor1/remind.go | 4 + .../kbchat/types/keybase1/account.go | 98 + .../kbchat/types/keybase1/airdrop.go | 22 + .../kbchat/types/keybase1/apiserver.go | 20 + .../kbchat/types/keybase1/appstate.go | 75 + .../kbchat/types/keybase1/audit.go | 76 + .../kbchat/types/keybase1/avatars.go | 72 + .../kbchat/types/keybase1/backend_common.go | 63 + .../kbchat/types/keybase1/badger.go | 4 + .../kbchat/types/keybase1/block.go | 153 + .../kbchat/types/keybase1/bot.go | 22 + .../kbchat/types/keybase1/btc.go | 4 + .../kbchat/types/keybase1/common.go | 1090 ++++ .../kbchat/types/keybase1/config.go | 842 +++ .../kbchat/types/keybase1/constants.go | 724 +++ .../kbchat/types/keybase1/contacts.go | 127 + .../kbchat/types/keybase1/crypto.go | 86 + .../kbchat/types/keybase1/cryptocurrency.go | 16 + .../kbchat/types/keybase1/ctl.go | 129 + .../kbchat/types/keybase1/debugging.go | 14 + .../kbchat/types/keybase1/delegate_ui_ctl.go | 4 + .../kbchat/types/keybase1/device.go | 52 + .../kbchat/types/keybase1/emails.go | 42 + .../kbchat/types/keybase1/ephemeral.go | 423 ++ .../kbchat/types/keybase1/favorite.go | 330 ++ .../kbchat/types/keybase1/featured_bot.go | 84 + .../kbchat/types/keybase1/fs.go | 34 + .../kbchat/types/keybase1/git.go | 382 ++ .../kbchat/types/keybase1/gpg_common.go | 32 + .../kbchat/types/keybase1/gpg_ui.go | 16 + .../kbchat/types/keybase1/gregor.go | 4 + .../kbchat/types/keybase1/gregor_ui.go | 37 + .../kbchat/types/keybase1/home.go | 884 +++ .../kbchat/types/keybase1/home_ui.go | 4 + .../kbchat/types/keybase1/identify.go | 145 + .../kbchat/types/keybase1/identify3.go | 4 + .../kbchat/types/keybase1/identify3_common.go | 16 + .../kbchat/types/keybase1/identify3_ui.go | 212 + .../kbchat/types/keybase1/identify_common.go | 322 ++ .../kbchat/types/keybase1/identify_ui.go | 443 ++ .../types/keybase1/implicit_team_migration.go | 4 + .../kbchat/types/keybase1/install.go | 236 + .../kbchat/types/keybase1/kbfs.go | 14 + .../kbchat/types/keybase1/kbfs_common.go | 366 ++ .../kbchat/types/keybase1/kbfs_git.go | 20 + .../kbchat/types/keybase1/kbfsmount.go | 4 + .../kbchat/types/keybase1/kex2provisionee.go | 39 + .../kbchat/types/keybase1/kex2provisionee2.go | 32 + .../kbchat/types/keybase1/kex2provisioner.go | 4 + .../kbchat/types/keybase1/kvstore.go | 150 + .../kbchat/types/keybase1/log.go | 4 + .../kbchat/types/keybase1/log_ui.go | 4 + .../kbchat/types/keybase1/login.go | 20 + .../kbchat/types/keybase1/login_ui.go | 196 + .../kbchat/types/keybase1/logsend.go | 4 + .../kbchat/types/keybase1/merkle.go | 41 + .../kbchat/types/keybase1/merkle_store.go | 40 + .../kbchat/types/keybase1/metadata.go | 175 + .../kbchat/types/keybase1/metadata_update.go | 16 + .../kbchat/types/keybase1/notify_app.go | 4 + .../kbchat/types/keybase1/notify_audit.go | 4 + .../kbchat/types/keybase1/notify_badges.go | 232 + .../types/keybase1/notify_can_user_perform.go | 4 + .../kbchat/types/keybase1/notify_ctl.go | 70 + .../kbchat/types/keybase1/notify_device_clone.go | 4 + .../kbchat/types/keybase1/notify_email.go | 4 + .../kbchat/types/keybase1/notify_ephemeral.go | 4 + .../kbchat/types/keybase1/notify_favorites.go | 4 + .../kbchat/types/keybase1/notify_featuredbots.go | 4 + .../kbchat/types/keybase1/notify_fs.go | 4 + .../kbchat/types/keybase1/notify_fs_request.go | 4 + .../kbchat/types/keybase1/notify_keyfamily.go | 4 + .../kbchat/types/keybase1/notify_paperkey.go | 4 + .../kbchat/types/keybase1/notify_pgp.go | 4 + .../kbchat/types/keybase1/notify_phone.go | 4 + .../kbchat/types/keybase1/notify_runtimestats.go | 141 + .../kbchat/types/keybase1/notify_saltpack.go | 40 + .../kbchat/types/keybase1/notify_service.go | 16 + .../kbchat/types/keybase1/notify_session.go | 4 + .../kbchat/types/keybase1/notify_team.go | 53 + .../kbchat/types/keybase1/notify_teambot.go | 4 + .../kbchat/types/keybase1/notify_tracking.go | 4 + .../kbchat/types/keybase1/notify_users.go | 4 + .../kbchat/types/keybase1/os.go | 40 + .../kbchat/types/keybase1/paperprovision.go | 4 + .../kbchat/types/keybase1/passphrase_common.go | 102 + .../kbchat/types/keybase1/pgp.go | 200 + .../kbchat/types/keybase1/pgp_ui.go | 4 + .../kbchat/types/keybase1/phone_numbers.go | 61 + .../kbchat/types/keybase1/pprof.go | 4 + .../kbchat/types/keybase1/process.go | 73 + .../kbchat/types/keybase1/prove.go | 30 + .../kbchat/types/keybase1/prove_common.go | 439 ++ .../kbchat/types/keybase1/prove_ui.go | 86 + .../kbchat/types/keybase1/provision_ui.go | 116 + .../kbchat/types/keybase1/quota.go | 20 + .../kbchat/types/keybase1/reachability.go | 47 + .../kbchat/types/keybase1/rekey.go | 169 + .../kbchat/types/keybase1/rekey_ui.go | 67 + .../kbchat/types/keybase1/reset.go | 118 + .../kbchat/types/keybase1/revoke.go | 4 + .../kbchat/types/keybase1/saltpack.go | 280 + .../kbchat/types/keybase1/saltpack_ui.go | 66 + .../kbchat/types/keybase1/scanproofs.go | 4 + .../kbchat/types/keybase1/secret_ui.go | 40 + .../kbchat/types/keybase1/secretkeys.go | 48 + .../kbchat/types/keybase1/selfprovision.go | 4 + .../kbchat/types/keybase1/session.go | 22 + .../kbchat/types/keybase1/signup.go | 20 + .../kbchat/types/keybase1/sigs.go | 74 + .../kbchat/types/keybase1/simple_fs.go | 1565 ++++++ .../kbchat/types/keybase1/stream_ui.go | 4 + .../kbchat/types/keybase1/teambot.go | 52 + .../kbchat/types/keybase1/teams.go | 3514 ++++++++++++ .../kbchat/types/keybase1/teams_ui.go | 4 + .../kbchat/types/keybase1/test.go | 64 + .../kbchat/types/keybase1/tlf.go | 4 + .../kbchat/types/keybase1/tlf_keys.go | 180 + .../kbchat/types/keybase1/track.go | 4 + .../kbchat/types/keybase1/ui.go | 37 + .../kbchat/types/keybase1/upk.go | 626 +++ .../kbchat/types/keybase1/user.go | 587 ++ .../kbchat/types/keybase1/usersearch.go | 235 + .../kbchat/types/stellar1/bundle.go | 988 ++++ .../kbchat/types/stellar1/common.go | 548 ++ .../kbchat/types/stellar1/gregor.go | 40 + .../kbchat/types/stellar1/local.go | 1311 +++++ .../kbchat/types/stellar1/notify.go | 4 + .../kbchat/types/stellar1/remote.go | 913 +++ .../kbchat/types/stellar1/ui.go | 32 + .../keybase/go-keybase-chat-bot/kbchat/wallet.go | 19 +- vendor/modules.txt | 6 +- 158 files changed, 39510 insertions(+), 554 deletions(-) create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/chat.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/errors.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/kvstore.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/api.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/blocking.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/chat_ui.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/commands.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/common.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/gregor.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/local.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/notify.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/remote.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/unfurl.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/auth.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/auth_internal.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/auth_update.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/common.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/incoming.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/outgoing.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/remind.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/account.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/airdrop.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/apiserver.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/appstate.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/audit.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/avatars.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/backend_common.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/badger.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/block.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/bot.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/btc.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/common.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/config.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/constants.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/contacts.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/crypto.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/cryptocurrency.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/ctl.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/debugging.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/delegate_ui_ctl.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/device.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/emails.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/ephemeral.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/favorite.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/featured_bot.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/fs.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/git.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/gpg_common.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/gpg_ui.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/gregor.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/gregor_ui.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/home.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/home_ui.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify3.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify3_common.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify3_ui.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify_common.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify_ui.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/implicit_team_migration.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/install.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kbfs.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kbfs_common.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kbfs_git.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kbfsmount.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kex2provisionee.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kex2provisionee2.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kex2provisioner.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kvstore.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/log.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/log_ui.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/login.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/login_ui.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/logsend.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/merkle.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/merkle_store.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/metadata.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/metadata_update.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_app.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_audit.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_badges.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_can_user_perform.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_ctl.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_device_clone.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_email.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_ephemeral.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_favorites.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_featuredbots.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_fs.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_fs_request.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_keyfamily.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_paperkey.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_pgp.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_phone.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_runtimestats.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_saltpack.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_service.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_session.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_team.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_teambot.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_tracking.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_users.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/os.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/paperprovision.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/passphrase_common.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/pgp.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/pgp_ui.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/phone_numbers.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/pprof.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/process.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/prove.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/prove_common.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/prove_ui.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/provision_ui.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/quota.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/reachability.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/rekey.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/rekey_ui.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/reset.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/revoke.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/saltpack.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/saltpack_ui.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/scanproofs.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/secret_ui.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/secretkeys.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/selfprovision.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/session.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/signup.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/sigs.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/simple_fs.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/stream_ui.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/teambot.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/teams.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/teams_ui.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/test.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/tlf.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/tlf_keys.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/track.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/ui.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/upk.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/user.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/usersearch.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/bundle.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/common.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/gregor.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/local.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/notify.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/remote.go create mode 100644 vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/ui.go diff --git a/go.mod b/go.mod index 6f6cddcb..0da4e539 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/hashicorp/golang-lru v0.5.3 github.com/hpcloud/tail v1.0.0 // indirect github.com/jpillora/backoff v1.0.0 - github.com/keybase/go-keybase-chat-bot v0.0.0-20190816161829-561f10822eb2 + github.com/keybase/go-keybase-chat-bot v0.0.0-20200207200343-9aca502dc88a github.com/labstack/echo/v4 v4.1.13 github.com/lrstanley/girc v0.0.0-20190801035559-4fc93959e1a7 github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20190210153444-cc9d05784d5d diff --git a/go.sum b/go.sum index 8d15de15..e2512f4f 100644 --- a/go.sum +++ b/go.sum @@ -100,8 +100,8 @@ github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfV github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1 h1:PJPDf8OUfOK1bb/NeTKd4f1QXZItOX389VN3B6qC8ro= github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= -github.com/keybase/go-keybase-chat-bot v0.0.0-20190816161829-561f10822eb2 h1:zacJswvfPqUSGdcBXJzKvLN/dB1UjDGDvDesMBBzoA4= -github.com/keybase/go-keybase-chat-bot v0.0.0-20190816161829-561f10822eb2/go.mod h1:vNc28YFzigVJod0j5EbuTtRIe7swx8vodh2yA4jZ2s8= +github.com/keybase/go-keybase-chat-bot v0.0.0-20200207200343-9aca502dc88a h1:vwIVtvtOEn0edqYFeSTklvSmZG9WrnG5EywouKzZs1s= +github.com/keybase/go-keybase-chat-bot v0.0.0-20200207200343-9aca502dc88a/go.mod h1:vNc28YFzigVJod0j5EbuTtRIe7swx8vodh2yA4jZ2s8= github.com/keybase/go-ps v0.0.0-20161005175911-668c8856d999 h1:2d+FLQbz4xRTi36DO1qYNUwfORax9XcQ0jhbO81Vago= github.com/keybase/go-ps v0.0.0-20161005175911-668c8856d999/go.mod h1:hY+WOq6m2FpbvyrI93sMaypsttvaIL5nhVR92dTMUcQ= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/chat.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/chat.go new file mode 100644 index 00000000..3eca02cd --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/chat.go @@ -0,0 +1,651 @@ +package kbchat + +import ( + "encoding/json" + "errors" + "fmt" + + "github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1" + "github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1" +) + +type Thread struct { + Result chat1.Thread `json:"result"` + Error *Error `json:"error,omitempty"` +} + +type Inbox struct { + Result Result `json:"result"` + Error *Error `json:"error,omitempty"` +} + +type sendMessageBody struct { + Body string +} + +type sendMessageOptions struct { + Channel chat1.ChatChannel `json:"channel,omitempty"` + ConversationID chat1.ConvIDStr `json:"conversation_id,omitempty"` + Message sendMessageBody `json:",omitempty"` + Filename string `json:"filename,omitempty"` + Title string `json:"title,omitempty"` + MsgID chat1.MessageID `json:"message_id,omitempty"` + ConfirmLumenSend bool `json:"confirm_lumen_send"` + ReplyTo *chat1.MessageID `json:"reply_to,omitempty"` +} + +type sendMessageParams struct { + Options sendMessageOptions +} + +type sendMessageArg struct { + Method string + Params sendMessageParams +} + +func newSendArg(options sendMessageOptions) sendMessageArg { + return sendMessageArg{ + Method: "send", + Params: sendMessageParams{ + Options: options, + }, + } +} + +// GetConversations reads all conversations from the current user's inbox. +func (a *API) GetConversations(unreadOnly bool) ([]chat1.ConvSummary, error) { + apiInput := fmt.Sprintf(`{"method":"list", "params": { "options": { "unread_only": %v}}}`, unreadOnly) + output, err := a.doFetch(apiInput) + if err != nil { + return nil, err + } + + var inbox Inbox + if err := json.Unmarshal(output, &inbox); err != nil { + return nil, err + } else if inbox.Error != nil { + return nil, errors.New(inbox.Error.Message) + } + return inbox.Result.Convs, nil +} + +func (a *API) GetConversation(convID chat1.ConvIDStr) (res chat1.ConvSummary, err error) { + apiInput := fmt.Sprintf(`{"method":"list", "params": { "options": { "conversation_id": "%s"}}}`, convID) + output, err := a.doFetch(apiInput) + if err != nil { + return res, err + } + + var inbox Inbox + if err := json.Unmarshal(output, &inbox); err != nil { + return res, err + } else if inbox.Error != nil { + return res, errors.New(inbox.Error.Message) + } else if len(inbox.Result.Convs) == 0 { + return res, errors.New("conversation not found") + } + return inbox.Result.Convs[0], nil +} + +// GetTextMessages fetches all text messages from a given channel. Optionally can filter +// ont unread status. +func (a *API) GetTextMessages(channel chat1.ChatChannel, unreadOnly bool) ([]chat1.MsgSummary, error) { + channelBytes, err := json.Marshal(channel) + if err != nil { + return nil, err + } + apiInput := fmt.Sprintf(`{"method": "read", "params": {"options": {"channel": %s}}}`, string(channelBytes)) + output, err := a.doFetch(apiInput) + if err != nil { + return nil, err + } + + var thread Thread + + if err := json.Unmarshal(output, &thread); err != nil { + return nil, fmt.Errorf("unable to decode thread: %v", err) + } else if thread.Error != nil { + return nil, errors.New(thread.Error.Message) + } + + var res []chat1.MsgSummary + for _, msg := range thread.Result.Messages { + if msg.Msg.Content.TypeName == "text" { + res = append(res, *msg.Msg) + } + } + + return res, nil +} + +func (a *API) SendMessage(channel chat1.ChatChannel, body string, args ...interface{}) (SendResponse, error) { + arg := newSendArg(sendMessageOptions{ + Channel: channel, + Message: sendMessageBody{ + Body: fmt.Sprintf(body, args...), + }, + }) + return a.doSend(arg) +} + +func (a *API) Broadcast(body string, args ...interface{}) (SendResponse, error) { + return a.SendMessage(chat1.ChatChannel{ + Name: a.GetUsername(), + Public: true, + }, fmt.Sprintf(body, args...)) +} + +func (a *API) SendMessageByConvID(convID chat1.ConvIDStr, body string, args ...interface{}) (SendResponse, error) { + arg := newSendArg(sendMessageOptions{ + ConversationID: convID, + Message: sendMessageBody{ + Body: fmt.Sprintf(body, args...), + }, + }) + return a.doSend(arg) +} + +// SendMessageByTlfName sends a message on the given TLF name +func (a *API) SendMessageByTlfName(tlfName string, body string, args ...interface{}) (SendResponse, error) { + arg := newSendArg(sendMessageOptions{ + Channel: chat1.ChatChannel{ + Name: tlfName, + }, + Message: sendMessageBody{ + Body: fmt.Sprintf(body, args...), + }, + }) + return a.doSend(arg) +} + +func (a *API) SendMessageByTeamName(teamName string, inChannel *string, body string, args ...interface{}) (SendResponse, error) { + channel := "general" + if inChannel != nil { + channel = *inChannel + } + arg := newSendArg(sendMessageOptions{ + Channel: chat1.ChatChannel{ + MembersType: "team", + Name: teamName, + TopicName: channel, + }, + Message: sendMessageBody{ + Body: fmt.Sprintf(body, args...), + }, + }) + return a.doSend(arg) +} + +func (a *API) SendReply(channel chat1.ChatChannel, replyTo *chat1.MessageID, body string, args ...interface{}) (SendResponse, error) { + arg := newSendArg(sendMessageOptions{ + Channel: channel, + Message: sendMessageBody{ + Body: fmt.Sprintf(body, args...), + }, + ReplyTo: replyTo, + }) + return a.doSend(arg) +} + +func (a *API) SendReplyByConvID(convID chat1.ConvIDStr, replyTo *chat1.MessageID, body string, args ...interface{}) (SendResponse, error) { + arg := newSendArg(sendMessageOptions{ + ConversationID: convID, + Message: sendMessageBody{ + Body: fmt.Sprintf(body, args...), + }, + ReplyTo: replyTo, + }) + return a.doSend(arg) +} + +func (a *API) SendReplyByTlfName(tlfName string, replyTo *chat1.MessageID, body string, args ...interface{}) (SendResponse, error) { + arg := newSendArg(sendMessageOptions{ + Channel: chat1.ChatChannel{ + Name: tlfName, + }, + Message: sendMessageBody{ + Body: fmt.Sprintf(body, args...), + }, + ReplyTo: replyTo, + }) + return a.doSend(arg) +} + +func (a *API) SendAttachmentByTeam(teamName string, inChannel *string, filename string, title string) (SendResponse, error) { + channel := "general" + if inChannel != nil { + channel = *inChannel + } + arg := sendMessageArg{ + Method: "attach", + Params: sendMessageParams{ + Options: sendMessageOptions{ + Channel: chat1.ChatChannel{ + MembersType: "team", + Name: teamName, + TopicName: channel, + }, + Filename: filename, + Title: title, + }, + }, + } + return a.doSend(arg) +} + +func (a *API) SendAttachmentByConvID(convID chat1.ConvIDStr, filename string, title string) (SendResponse, error) { + arg := sendMessageArg{ + Method: "attach", + Params: sendMessageParams{ + Options: sendMessageOptions{ + ConversationID: convID, + Filename: filename, + Title: title, + }, + }, + } + return a.doSend(arg) +} + +//////////////////////////////////////////////////////// +// React to chat /////////////////////////////////////// +//////////////////////////////////////////////////////// + +type reactionOptions struct { + ConversationID chat1.ConvIDStr `json:"conversation_id"` + Message sendMessageBody + MsgID chat1.MessageID `json:"message_id"` + Channel chat1.ChatChannel `json:"channel"` +} + +type reactionParams struct { + Options reactionOptions +} + +type reactionArg struct { + Method string + Params reactionParams +} + +func newReactionArg(options reactionOptions) reactionArg { + return reactionArg{ + Method: "reaction", + Params: reactionParams{Options: options}, + } +} + +func (a *API) ReactByChannel(channel chat1.ChatChannel, msgID chat1.MessageID, reaction string) (SendResponse, error) { + arg := newReactionArg(reactionOptions{ + Message: sendMessageBody{Body: reaction}, + MsgID: msgID, + Channel: channel, + }) + return a.doSend(arg) +} + +func (a *API) ReactByConvID(convID chat1.ConvIDStr, msgID chat1.MessageID, reaction string) (SendResponse, error) { + arg := newReactionArg(reactionOptions{ + Message: sendMessageBody{Body: reaction}, + MsgID: msgID, + ConversationID: convID, + }) + return a.doSend(arg) +} + +func (a *API) EditByConvID(convID chat1.ConvIDStr, msgID chat1.MessageID, text string) (SendResponse, error) { + arg := reactionArg{ + Method: "edit", + Params: reactionParams{Options: reactionOptions{ + Message: sendMessageBody{Body: text}, + MsgID: msgID, + ConversationID: convID, + }}, + } + return a.doSend(arg) +} + +//////////////////////////////////////////////////////// +// Manage channels ///////////////////////////////////// +//////////////////////////////////////////////////////// + +type ChannelsList struct { + Result Result `json:"result"` + Error *Error `json:"error,omitempty"` +} + +type JoinChannel struct { + Error *Error `json:"error,omitempty"` + Result chat1.EmptyRes `json:"result"` +} + +type LeaveChannel struct { + Error *Error `json:"error,omitempty"` + Result chat1.EmptyRes `json:"result"` +} + +func (a *API) ListChannels(teamName string) ([]string, error) { + apiInput := fmt.Sprintf(`{"method": "listconvsonname", "params": {"options": {"topic_type": "CHAT", "members_type": "team", "name": "%s"}}}`, teamName) + output, err := a.doFetch(apiInput) + if err != nil { + return nil, err + } + + var channelsList ChannelsList + if err := json.Unmarshal(output, &channelsList); err != nil { + return nil, err + } else if channelsList.Error != nil { + return nil, errors.New(channelsList.Error.Message) + } + + var channels []string + for _, conv := range channelsList.Result.Convs { + channels = append(channels, conv.Channel.TopicName) + } + return channels, nil +} + +func (a *API) JoinChannel(teamName string, channelName string) (chat1.EmptyRes, error) { + empty := chat1.EmptyRes{} + + apiInput := fmt.Sprintf(`{"method": "join", "params": {"options": {"channel": {"name": "%s", "members_type": "team", "topic_name": "%s"}}}}`, teamName, channelName) + output, err := a.doFetch(apiInput) + if err != nil { + return empty, err + } + + joinChannel := JoinChannel{} + err = json.Unmarshal(output, &joinChannel) + if err != nil { + return empty, fmt.Errorf("failed to parse output from keybase team api: %v", err) + } else if joinChannel.Error != nil { + return empty, errors.New(joinChannel.Error.Message) + } + + return joinChannel.Result, nil +} + +func (a *API) LeaveChannel(teamName string, channelName string) (chat1.EmptyRes, error) { + empty := chat1.EmptyRes{} + + apiInput := fmt.Sprintf(`{"method": "leave", "params": {"options": {"channel": {"name": "%s", "members_type": "team", "topic_name": "%s"}}}}`, teamName, channelName) + output, err := a.doFetch(apiInput) + if err != nil { + return empty, err + } + + leaveChannel := LeaveChannel{} + err = json.Unmarshal(output, &leaveChannel) + if err != nil { + return empty, fmt.Errorf("failed to parse output from keybase team api: %v", err) + } else if leaveChannel.Error != nil { + return empty, errors.New(leaveChannel.Error.Message) + } + + return leaveChannel.Result, nil +} + +//////////////////////////////////////////////////////// +// Send lumens in chat ///////////////////////////////// +//////////////////////////////////////////////////////// + +func (a *API) InChatSend(channel chat1.ChatChannel, body string, args ...interface{}) (SendResponse, error) { + arg := newSendArg(sendMessageOptions{ + Channel: channel, + Message: sendMessageBody{ + Body: fmt.Sprintf(body, args...), + }, + ConfirmLumenSend: true, + }) + return a.doSend(arg) +} + +func (a *API) InChatSendByConvID(convID chat1.ConvIDStr, body string, args ...interface{}) (SendResponse, error) { + arg := newSendArg(sendMessageOptions{ + ConversationID: convID, + Message: sendMessageBody{ + Body: fmt.Sprintf(body, args...), + }, + ConfirmLumenSend: true, + }) + return a.doSend(arg) +} + +func (a *API) InChatSendByTlfName(tlfName string, body string, args ...interface{}) (SendResponse, error) { + arg := newSendArg(sendMessageOptions{ + Channel: chat1.ChatChannel{ + Name: tlfName, + }, + Message: sendMessageBody{ + Body: fmt.Sprintf(body, args...), + }, + ConfirmLumenSend: true, + }) + return a.doSend(arg) +} + +//////////////////////////////////////////////////////// +// Misc commands /////////////////////////////////////// +//////////////////////////////////////////////////////// + +type Advertisement struct { + Alias string `json:"alias,omitempty"` + Advertisements []chat1.AdvertiseCommandAPIParam +} + +type ListCommandsResponse struct { + Result struct { + Commands []chat1.UserBotCommandOutput `json:"commands"` + } `json:"result"` + Error *Error `json:"error,omitempty"` +} + +type advertiseCmdsParams struct { + Options Advertisement +} + +type advertiseCmdsMsgArg struct { + Method string + Params advertiseCmdsParams +} + +func newAdvertiseCmdsMsgArg(ad Advertisement) advertiseCmdsMsgArg { + return advertiseCmdsMsgArg{ + Method: "advertisecommands", + Params: advertiseCmdsParams{ + Options: ad, + }, + } +} + +func (a *API) AdvertiseCommands(ad Advertisement) (SendResponse, error) { + return a.doSend(newAdvertiseCmdsMsgArg(ad)) +} + +func (a *API) ClearCommands() error { + arg := struct { + Method string + }{ + Method: "clearcommands", + } + _, err := a.doSend(arg) + return err +} + +type listCmdsOptions struct { + Channel chat1.ChatChannel `json:"channel,omitempty"` + ConversationID chat1.ConvIDStr `json:"conversation_id,omitempty"` +} + +type listCmdsParams struct { + Options listCmdsOptions +} + +type listCmdsArg struct { + Method string + Params listCmdsParams +} + +func newListCmdsArg(options listCmdsOptions) listCmdsArg { + return listCmdsArg{ + Method: "listcommands", + Params: listCmdsParams{ + Options: options, + }, + } +} + +func (a *API) ListCommands(channel chat1.ChatChannel) ([]chat1.UserBotCommandOutput, error) { + arg := newListCmdsArg(listCmdsOptions{ + Channel: channel, + }) + return a.listCommands(arg) +} + +func (a *API) ListCommandsByConvID(convID chat1.ConvIDStr) ([]chat1.UserBotCommandOutput, error) { + arg := newListCmdsArg(listCmdsOptions{ + ConversationID: convID, + }) + return a.listCommands(arg) +} + +func (a *API) listCommands(arg listCmdsArg) ([]chat1.UserBotCommandOutput, error) { + bArg, err := json.Marshal(arg) + if err != nil { + return nil, err + } + output, err := a.doFetch(string(bArg)) + if err != nil { + return nil, err + } + var res ListCommandsResponse + if err := json.Unmarshal(output, &res); err != nil { + return nil, err + } else if res.Error != nil { + return nil, errors.New(res.Error.Message) + } + return res.Result.Commands, nil +} + +type listMembersOptions struct { + Channel chat1.ChatChannel `json:"channel,omitempty"` + ConversationID chat1.ConvIDStr `json:"conversation_id,omitempty"` +} + +type listMembersParams struct { + Options listMembersOptions +} + +type listMembersArg struct { + Method string + Params listMembersParams +} + +func newListMembersArg(options listMembersOptions) listMembersArg { + return listMembersArg{ + Method: "listmembers", + Params: listMembersParams{ + Options: options, + }, + } +} + +func (a *API) ListMembers(channel chat1.ChatChannel) (keybase1.TeamMembersDetails, error) { + arg := newListMembersArg(listMembersOptions{ + Channel: channel, + }) + return a.listMembers(arg) +} + +func (a *API) ListMembersByConvID(conversationID chat1.ConvIDStr) (keybase1.TeamMembersDetails, error) { + arg := newListMembersArg(listMembersOptions{ + ConversationID: conversationID, + }) + return a.listMembers(arg) +} + +func (a *API) listMembers(arg listMembersArg) (res keybase1.TeamMembersDetails, err error) { + bArg, err := json.Marshal(arg) + if err != nil { + return res, err + } + output, err := a.doFetch(string(bArg)) + if err != nil { + return res, err + } + members := ListTeamMembers{} + err = json.Unmarshal(output, &members) + if err != nil { + return res, UnmarshalError{err} + } + if members.Error.Message != "" { + return res, members.Error + } + return members.Result.Members, nil +} + +type GetMessagesResult struct { + Result struct { + Messages []chat1.Message `json:"messages"` + } `json:"result"` + Error *Error `json:"error,omitempty"` +} + +type getMessagesOptions struct { + Channel chat1.ChatChannel `json:"channel,omitempty"` + ConversationID chat1.ConvIDStr `json:"conversation_id,omitempty"` + MessageIDs []chat1.MessageID `json:"message_ids,omitempty"` +} + +type getMessagesParams struct { + Options getMessagesOptions +} + +type getMessagesArg struct { + Method string + Params getMessagesParams +} + +func newGetMessagesArg(options getMessagesOptions) getMessagesArg { + return getMessagesArg{ + Method: "get", + Params: getMessagesParams{ + Options: options, + }, + } +} + +func (a *API) GetMessages(channel chat1.ChatChannel, msgIDs []chat1.MessageID) ([]chat1.Message, error) { + arg := newGetMessagesArg(getMessagesOptions{ + Channel: channel, + MessageIDs: msgIDs, + }) + return a.getMessages(arg) +} + +func (a *API) GetMessagesByConvID(conversationID chat1.ConvIDStr, msgIDs []chat1.MessageID) ([]chat1.Message, error) { + arg := newGetMessagesArg(getMessagesOptions{ + ConversationID: conversationID, + MessageIDs: msgIDs, + }) + return a.getMessages(arg) +} + +func (a *API) getMessages(arg getMessagesArg) ([]chat1.Message, error) { + bArg, err := json.Marshal(arg) + if err != nil { + return nil, err + } + output, err := a.doFetch(string(bArg)) + if err != nil { + return nil, err + } + var res GetMessagesResult + err = json.Unmarshal(output, &res) + if err != nil { + return nil, UnmarshalError{err} + } + if res.Error != nil { + return nil, res.Error + } + return res.Result.Messages, nil +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/errors.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/errors.go new file mode 100644 index 00000000..2b8e929d --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/errors.go @@ -0,0 +1,36 @@ +package kbchat + +import "fmt" + +type ErrorCode int + +const ( + RevisionErrorCode ErrorCode = 2760 + DeleteNonExistentErrorCode ErrorCode = 2762 +) + +// Error is for unmarshaling CLI json responses +type Error struct { + Code ErrorCode `json:"code"` + Message string `json:"message"` +} + +func (e Error) Error() string { + return fmt.Sprintf("received error response from keybase api: %s", e.Message) +} + +type APIError struct { + err error +} + +func (e APIError) Error() string { + return fmt.Sprintf("failed to call keybase api: %v", e.err) +} + +type UnmarshalError struct { + err error +} + +func (e UnmarshalError) Error() string { + return fmt.Sprintf("failed to parse output from keybase api: %v", e.err) +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/kbchat.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/kbchat.go index c735052c..0a74dd90 100644 --- a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/kbchat.go +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/kbchat.go @@ -6,21 +6,26 @@ import ( "errors" "fmt" "io" + "io/ioutil" "log" "os/exec" "strings" "sync" "time" + + "github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1" + "github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1" ) // API is the main object used for communicating with the Keybase JSON API type API struct { sync.Mutex - apiInput io.Writer - apiOutput *bufio.Reader - apiCmd *exec.Cmd - username string - runOpts RunOptions + apiInput io.Writer + apiOutput *bufio.Reader + apiCmd *exec.Cmd + username string + runOpts RunOptions + subscriptions []*NewSubscription } func getUsername(runOpts RunOptions) (username string, err error) { @@ -40,9 +45,10 @@ func getUsername(runOpts RunOptions) (username string, err error) { doneCh <- errors.New("unable to find Keybase username") return } - toks := strings.Fields(scanner.Text()) + text := scanner.Text() + toks := strings.Fields(text) if len(toks) != 2 { - doneCh <- errors.New("invalid Keybase username output") + doneCh <- fmt.Errorf("invalid Keybase username output: %q", text) return } username = toks[1] @@ -71,6 +77,10 @@ type RunOptions struct { HomeDir string Oneshot *OneshotOptions StartService bool + // Have the bot send/receive typing notifications + EnableTyping bool + // Disable bot lite mode + DisableBotLiteMode bool } func (r RunOptions) Location() string { @@ -100,6 +110,10 @@ func Start(runOpts RunOptions) (*API, error) { return api, nil } +func (a *API) Command(args ...string) *exec.Cmd { + return a.runOpts.Command(args...) +} + func (a *API) auth() (string, error) { username, err := getUsername(a.runOpts) if err == nil { @@ -132,17 +146,28 @@ func (a *API) startPipes() (err error) { a.Lock() defer a.Unlock() if a.apiCmd != nil { - a.apiCmd.Process.Kill() + if err := a.apiCmd.Process.Kill(); err != nil { + return err + } } a.apiCmd = nil if a.runOpts.StartService { - a.runOpts.Command("service").Start() + args := []string{fmt.Sprintf("-enable-bot-lite-mode=%v", a.runOpts.DisableBotLiteMode), "service"} + if err := a.runOpts.Command(args...).Start(); err != nil { + return err + } } if a.username, err = a.auth(); err != nil { return err } + + cmd := a.runOpts.Command("chat", "notification-settings", fmt.Sprintf("-disable-typing=%v", !a.runOpts.EnableTyping)) + if err = cmd.Run(); err != nil { + return err + } + a.apiCmd = a.runOpts.Command("chat", "api") if a.apiInput, err = a.apiCmd.StdinPipe(); err != nil { return err @@ -168,73 +193,11 @@ func (a *API) getAPIPipesLocked() (io.Writer, *bufio.Reader, error) { return a.apiInput, a.apiOutput, nil } -// GetConversations reads all conversations from the current user's inbox. -func (a *API) GetConversations(unreadOnly bool) ([]Conversation, error) { - apiInput := fmt.Sprintf(`{"method":"list", "params": { "options": { "unread_only": %v}}}`, unreadOnly) - output, err := a.doFetch(apiInput) - if err != nil { - return nil, err - } - - var inbox Inbox - if err := json.Unmarshal(output, &inbox); err != nil { - return nil, err - } - return inbox.Result.Convs, nil -} - -// GetTextMessages fetches all text messages from a given channel. Optionally can filter -// ont unread status. -func (a *API) GetTextMessages(channel Channel, unreadOnly bool) ([]Message, error) { - channelBytes, err := json.Marshal(channel) - if err != nil { - return nil, err - } - apiInput := fmt.Sprintf(`{"method": "read", "params": {"options": {"channel": %s}}}`, string(channelBytes)) - output, err := a.doFetch(apiInput) - if err != nil { - return nil, err - } - - var thread Thread - - if err := json.Unmarshal(output, &thread); err != nil { - return nil, fmt.Errorf("unable to decode thread: %s", err.Error()) - } - - var res []Message - for _, msg := range thread.Result.Messages { - if msg.Msg.Content.Type == "text" { - res = append(res, msg.Msg) - } - } - - return res, nil -} - -type sendMessageBody struct { - Body string -} - -type sendMessageOptions struct { - Channel Channel `json:"channel,omitempty"` - ConversationID string `json:"conversation_id,omitempty"` - Message sendMessageBody `json:",omitempty"` - Filename string `json:"filename,omitempty"` - Title string `json:"title,omitempty"` - MsgID int `json:"message_id,omitempty"` -} - -type sendMessageParams struct { - Options sendMessageOptions -} - -type sendMessageArg struct { - Method string - Params sendMessageParams +func (a *API) GetUsername() string { + return a.username } -func (a *API) doSend(arg interface{}) (response SendResponse, err error) { +func (a *API) doSend(arg interface{}) (resp SendResponse, err error) { a.Lock() defer a.Unlock() @@ -253,10 +216,12 @@ func (a *API) doSend(arg interface{}) (response SendResponse, err error) { if err != nil { return SendResponse{}, err } - if err := json.Unmarshal(responseRaw, &response); err != nil { - return SendResponse{}, fmt.Errorf("failed to decode API response: %s", err) + if err := json.Unmarshal(responseRaw, &resp); err != nil { + return resp, fmt.Errorf("failed to decode API response: %s", err) + } else if resp.Error != nil { + return resp, errors.New(resp.Error.Message) } - return response, nil + return resp, nil } func (a *API) doFetch(apiInput string) ([]byte, error) { @@ -278,234 +243,121 @@ func (a *API) doFetch(apiInput string) ([]byte, error) { return byteOutput, nil } -func (a *API) SendMessage(channel Channel, body string) (SendResponse, error) { - arg := sendMessageArg{ - Method: "send", - Params: sendMessageParams{ - Options: sendMessageOptions{ - Channel: channel, - Message: sendMessageBody{ - Body: body, - }, - }, - }, - } - return a.doSend(arg) -} - -func (a *API) SendMessageByConvID(convID string, body string) (SendResponse, error) { - arg := sendMessageArg{ - Method: "send", - Params: sendMessageParams{ - Options: sendMessageOptions{ - ConversationID: convID, - Message: sendMessageBody{ - Body: body, - }, - }, - }, - } - return a.doSend(arg) -} - -// SendMessageByTlfName sends a message on the given TLF name -func (a *API) SendMessageByTlfName(tlfName string, body string) (SendResponse, error) { - arg := sendMessageArg{ - Method: "send", - Params: sendMessageParams{ - Options: sendMessageOptions{ - Channel: Channel{ - Name: tlfName, - }, - Message: sendMessageBody{ - Body: body, - }, - }, - }, - } - return a.doSend(arg) -} - -func (a *API) SendMessageByTeamName(teamName string, body string, inChannel *string) (SendResponse, error) { - channel := "general" - if inChannel != nil { - channel = *inChannel - } - arg := sendMessageArg{ - Method: "send", - Params: sendMessageParams{ - Options: sendMessageOptions{ - Channel: Channel{ - MembersType: "team", - Name: teamName, - TopicName: channel, - }, - Message: sendMessageBody{ - Body: body, - }, - }, - }, - } - return a.doSend(arg) -} - -func (a *API) SendAttachmentByTeam(teamName string, filename string, title string, inChannel *string) (SendResponse, error) { - channel := "general" - if inChannel != nil { - channel = *inChannel - } - arg := sendMessageArg{ - Method: "attach", - Params: sendMessageParams{ - Options: sendMessageOptions{ - Channel: Channel{ - MembersType: "team", - Name: teamName, - TopicName: channel, - }, - Filename: filename, - Title: title, - }, - }, - } - return a.doSend(arg) -} - -type reactionOptions struct { - ConversationID string `json:"conversation_id"` - Message sendMessageBody - MsgID int `json:"message_id"` - Channel Channel `json:"channel"` -} - -type reactionParams struct { - Options reactionOptions -} - -type reactionArg struct { - Method string - Params reactionParams -} - -func newReactionArg(options reactionOptions) reactionArg { - return reactionArg{ - Method: "reaction", - Params: reactionParams{Options: options}, - } -} - -func (a *API) ReactByChannel(channel Channel, msgID int, reaction string) (SendResponse, error) { - arg := newReactionArg(reactionOptions{ - Message: sendMessageBody{Body: reaction}, - MsgID: msgID, - Channel: channel, - }) - return a.doSend(arg) -} - -func (a *API) ReactByConvID(convID string, msgID int, reaction string) (SendResponse, error) { - arg := newReactionArg(reactionOptions{ - Message: sendMessageBody{Body: reaction}, - MsgID: msgID, - ConversationID: convID, - }) - return a.doSend(arg) -} - -type advertiseParams struct { - Options Advertisement -} - -type advertiseMsgArg struct { - Method string - Params advertiseParams -} - -func newAdvertiseMsgArg(ad Advertisement) advertiseMsgArg { - return advertiseMsgArg{ - Method: "advertisecommands", - Params: advertiseParams{ - Options: ad, - }, - } -} - -func (a *API) AdvertiseCommands(ad Advertisement) (SendResponse, error) { - return a.doSend(newAdvertiseMsgArg(ad)) -} - -func (a *API) Username() string { - return a.username -} - // SubscriptionMessage contains a message and conversation object type SubscriptionMessage struct { - Message Message - Conversation Conversation + Message chat1.MsgSummary + Conversation chat1.ConvSummary +} + +type SubscriptionConversation struct { + Conversation chat1.ConvSummary } type SubscriptionWalletEvent struct { - Payment Payment + Payment stellar1.PaymentDetailsLocal } // NewSubscription has methods to control the background message fetcher loop type NewSubscription struct { + sync.Mutex + newMsgsCh <-chan SubscriptionMessage + newConvsCh <-chan SubscriptionConversation newWalletCh <-chan SubscriptionWalletEvent errorCh <-chan error + running bool shutdownCh chan struct{} } // Read blocks until a new message arrives -func (m NewSubscription) Read() (SubscriptionMessage, error) { +func (m *NewSubscription) Read() (SubscriptionMessage, error) { select { case msg := <-m.newMsgsCh: return msg, nil case err := <-m.errorCh: return SubscriptionMessage{}, err + case <-m.shutdownCh: + return SubscriptionMessage{}, errors.New("Subscription shutdown") + } +} + +func (m *NewSubscription) ReadNewConvs() (SubscriptionConversation, error) { + select { + case conv := <-m.newConvsCh: + return conv, nil + case err := <-m.errorCh: + return SubscriptionConversation{}, err + case <-m.shutdownCh: + return SubscriptionConversation{}, errors.New("Subscription shutdown") } } // Read blocks until a new message arrives -func (m NewSubscription) ReadWallet() (SubscriptionWalletEvent, error) { +func (m *NewSubscription) ReadWallet() (SubscriptionWalletEvent, error) { select { case msg := <-m.newWalletCh: return msg, nil case err := <-m.errorCh: return SubscriptionWalletEvent{}, err + case <-m.shutdownCh: + return SubscriptionWalletEvent{}, errors.New("Subscription shutdown") } } // Shutdown terminates the background process -func (m NewSubscription) Shutdown() { - m.shutdownCh <- struct{}{} +func (m *NewSubscription) Shutdown() { + m.Lock() + defer m.Unlock() + if m.running { + close(m.shutdownCh) + m.running = false + } } type ListenOptions struct { Wallet bool + Convs bool +} + +type PaymentHolder struct { + Payment stellar1.PaymentDetailsLocal `json:"notification"` +} + +type TypeHolder struct { + Type string `json:"type"` } // ListenForNewTextMessages proxies to Listen without wallet events -func (a *API) ListenForNewTextMessages() (NewSubscription, error) { +func (a *API) ListenForNewTextMessages() (*NewSubscription, error) { opts := ListenOptions{Wallet: false} return a.Listen(opts) } +func (a *API) registerSubscription(sub *NewSubscription) { + a.Lock() + defer a.Unlock() + a.subscriptions = append(a.subscriptions, sub) +} + // Listen fires of a background loop and puts chat messages and wallet // events into channels -func (a *API) Listen(opts ListenOptions) (NewSubscription, error) { - newMsgCh := make(chan SubscriptionMessage, 100) +func (a *API) Listen(opts ListenOptions) (*NewSubscription, error) { + newMsgsCh := make(chan SubscriptionMessage, 100) + newConvsCh := make(chan SubscriptionConversation, 100) newWalletCh := make(chan SubscriptionWalletEvent, 100) errorCh := make(chan error, 100) shutdownCh := make(chan struct{}) done := make(chan struct{}) - sub := NewSubscription{ - newMsgsCh: newMsgCh, + sub := &NewSubscription{ + newMsgsCh: newMsgsCh, + newConvsCh: newConvsCh, newWalletCh: newWalletCh, shutdownCh: shutdownCh, errorCh: errorCh, + running: true, } + a.registerSubscription(sub) pause := 2 * time.Second readScanner := func(boutput *bufio.Scanner) { for { @@ -518,28 +370,44 @@ func (a *API) Listen(opts ListenOptions) (NewSubscription, error) { } switch typeHolder.Type { case "chat": - var holder MessageHolder - if err := json.Unmarshal([]byte(t), &holder); err != nil { + var notification chat1.MsgNotification + if err := json.Unmarshal([]byte(t), ¬ification); err != nil { errorCh <- err break } - subscriptionMessage := SubscriptionMessage{ - Message: holder.Msg, - Conversation: Conversation{ - ID: holder.Msg.ConversationID, - Channel: holder.Msg.Channel, - }, + if notification.Error != nil { + log.Printf("error message received: %s", *notification.Error) + } else if notification.Msg != nil { + subscriptionMessage := SubscriptionMessage{ + Message: *notification.Msg, + Conversation: chat1.ConvSummary{ + Id: notification.Msg.ConvID, + Channel: notification.Msg.Channel, + }, + } + newMsgsCh <- subscriptionMessage + } + case "chat_conv": + var notification chat1.ConvNotification + if err := json.Unmarshal([]byte(t), ¬ification); err != nil { + errorCh <- err + break + } + if notification.Error != nil { + log.Printf("error message received: %s", *notification.Error) + } else if notification.Conv != nil { + subscriptionConv := SubscriptionConversation{ + Conversation: *notification.Conv, + } + newConvsCh <- subscriptionConv } - newMsgCh <- subscriptionMessage case "wallet": var holder PaymentHolder if err := json.Unmarshal([]byte(t), &holder); err != nil { errorCh <- err break } - subscriptionPayment := SubscriptionWalletEvent{ - Payment: holder.Payment, - } + subscriptionPayment := SubscriptionWalletEvent(holder) newWalletCh <- subscriptionPayment default: continue @@ -552,6 +420,13 @@ func (a *API) Listen(opts ListenOptions) (NewSubscription, error) { maxAttempts := 1800 go func() { for { + select { + case <-shutdownCh: + log.Printf("Listen: received shutdown") + return + default: + } + if attempts >= maxAttempts { panic("Listen: failed to auth, giving up") } @@ -565,6 +440,9 @@ func (a *API) Listen(opts ListenOptions) (NewSubscription, error) { if opts.Wallet { cmdElements = append(cmdElements, "--wallet") } + if opts.Convs { + cmdElements = append(cmdElements, "--convs") + } p := a.runOpts.Command(cmdElements...) output, err := p.StdoutPipe() if err != nil { @@ -572,6 +450,12 @@ func (a *API) Listen(opts ListenOptions) (NewSubscription, error) { time.Sleep(pause) continue } + stderr, err := p.StderrPipe() + if err != nil { + log.Printf("Listen: failed to listen to stderr: %s", err) + time.Sleep(pause) + continue + } boutput := bufio.NewScanner(output) if err := p.Start(); err != nil { log.Printf("Listen: failed to make listen scanner: %s", err) @@ -581,78 +465,19 @@ func (a *API) Listen(opts ListenOptions) (NewSubscription, error) { attempts = 0 go readScanner(boutput) <-done - p.Wait() + if err := p.Wait(); err != nil { + stderrBytes, rerr := ioutil.ReadAll(stderr) + if rerr != nil { + stderrBytes = []byte("failed to get stderr") + } + log.Printf("Listen: failed to Wait for command: %s (```%s```)", err, stderrBytes) + } time.Sleep(pause) } }() return sub, nil } -func (a *API) GetUsername() string { - return a.username -} - -func (a *API) ListChannels(teamName string) ([]string, error) { - apiInput := fmt.Sprintf(`{"method": "listconvsonname", "params": {"options": {"topic_type": "CHAT", "members_type": "team", "name": "%s"}}}`, teamName) - output, err := a.doFetch(apiInput) - if err != nil { - return nil, err - } - - var channelsList ChannelsList - if err := json.Unmarshal(output, &channelsList); err != nil { - return nil, err - } - - var channels []string - for _, conv := range channelsList.Result.Convs { - channels = append(channels, conv.Channel.TopicName) - } - return channels, nil -} - -func (a *API) JoinChannel(teamName string, channelName string) (JoinChannelResult, error) { - empty := JoinChannelResult{} - - apiInput := fmt.Sprintf(`{"method": "join", "params": {"options": {"channel": {"name": "%s", "members_type": "team", "topic_name": "%s"}}}}`, teamName, channelName) - output, err := a.doFetch(apiInput) - if err != nil { - return empty, err - } - - joinChannel := JoinChannel{} - err = json.Unmarshal(output, &joinChannel) - if err != nil { - return empty, fmt.Errorf("failed to parse output from keybase team api: %v", err) - } - if joinChannel.Error.Message != "" { - return empty, fmt.Errorf("received error from keybase team api: %s", joinChannel.Error.Message) - } - - return joinChannel.Result, nil -} - -func (a *API) LeaveChannel(teamName string, channelName string) (LeaveChannelResult, error) { - empty := LeaveChannelResult{} - - apiInput := fmt.Sprintf(`{"method": "leave", "params": {"options": {"channel": {"name": "%s", "members_type": "team", "topic_name": "%s"}}}}`, teamName, channelName) - output, err := a.doFetch(apiInput) - if err != nil { - return empty, err - } - - leaveChannel := LeaveChannel{} - err = json.Unmarshal(output, &leaveChannel) - if err != nil { - return empty, fmt.Errorf("failed to parse output from keybase team api: %v", err) - } - if leaveChannel.Error.Message != "" { - return empty, fmt.Errorf("received error from keybase team api: %s", leaveChannel.Error.Message) - } - - return leaveChannel.Result, nil -} - func (a *API) LogSend(feedback string) error { feedback = "go-keybase-chat-bot log send\n" + "username: " + a.GetUsername() + "\n" + @@ -675,6 +500,12 @@ func (a *API) LogSend(feedback string) error { } func (a *API) Shutdown() error { + a.Lock() + defer a.Unlock() + for _, sub := range a.subscriptions { + sub.Shutdown() + } + if a.runOpts.Oneshot != nil { err := a.runOpts.Command("logout", "--force").Run() if err != nil { diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/kvstore.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/kvstore.go new file mode 100644 index 00000000..d7112936 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/kvstore.go @@ -0,0 +1,228 @@ +package kbchat + +import ( + "encoding/json" + "strings" + + "github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1" +) + +type kvstoreMethod string + +type kvstoreOptions struct { + Team *string `json:"team"` + Namespace *string `json:"namespace,omitempty"` + EntryKey *string `json:"entryKey,omitempty"` + EntryValue *string `json:"entryValue,omitempty"` + Revision *int `json:"revision,omitempty"` +} + +type kvstoreParams struct { + Options kvstoreOptions `json:"options"` +} + +type kvstoreAPIReq struct { + Method kvstoreMethod `json:"method"` + Params kvstoreParams `json:"params"` +} + +type GetEntryRes struct { + Result keybase1.KVGetResult `json:"result"` + Error Error `json:"error,omitempty"` +} + +type PutEntryRes struct { + Result keybase1.KVPutResult `json:"result"` + Error Error `json:"error,omitempty"` +} + +type DeleteEntryRes struct { + Result keybase1.KVDeleteEntryResult `json:"result"` + Error Error `json:"error,omitempty"` +} + +type ListNamespacesRes struct { + Result keybase1.KVListNamespaceResult `json:"result"` + Error Error `json:"error,omitempty"` +} + +type ListEntryKeysRes struct { + Result keybase1.KVListEntryResult `json:"result"` + Error Error `json:"error,omitempty"` +} + +type KVStoreAPI interface { + PutEntry(teamName *string, namespace string, entryKey string, entryValue string) (keybase1.KVPutResult, error) + PutEntryWithRevision(teamName *string, namespace string, entryKey string, entryValue string, revision int) (keybase1.KVPutResult, error) + DeleteEntry(teamName *string, namespace string, entryKey string) (keybase1.KVDeleteEntryResult, error) + DeleteEntryWithRevision(teamName *string, namespace string, entryKey string, revision int) (keybase1.KVDeleteEntryResult, error) + GetEntry(teamName *string, namespace string, entryKey string) (keybase1.KVGetResult, error) + ListNamespaces(teamName *string) (keybase1.KVListNamespaceResult, error) + ListEntryKeys(teamName *string, namespace string) (keybase1.KVListEntryResult, error) +} + +func (a *API) PutEntry(teamName *string, namespace string, entryKey string, entryValue string) (result keybase1.KVPutResult, err error) { + return a.PutEntryWithRevision(teamName, namespace, entryKey, entryValue, 0) +} + +func (a *API) PutEntryWithRevision(teamName *string, namespace string, entryKey string, entryValue string, revision int) (result keybase1.KVPutResult, err error) { + + opts := kvstoreOptions{ + Team: teamName, + Namespace: &namespace, + EntryKey: &entryKey, + EntryValue: &entryValue, + } + if revision != 0 { + opts.Revision = &revision + } + args := kvstoreAPIReq{Method: "put", Params: kvstoreParams{Options: opts}} + apiInput, err := json.Marshal(args) + if err != nil { + return result, err + } + + cmd := a.runOpts.Command("kvstore", "api") + cmd.Stdin = strings.NewReader(string(apiInput)) + bytes, err := cmd.Output() + if err != nil { + return result, APIError{err} + } + + entry := PutEntryRes{} + err = json.Unmarshal(bytes, &entry) + if err != nil { + return result, UnmarshalError{err} + } + if entry.Error.Message != "" { + return result, entry.Error + } + return entry.Result, nil +} + +func (a *API) DeleteEntry(teamName *string, namespace string, entryKey string) (result keybase1.KVDeleteEntryResult, err error) { + return a.DeleteEntryWithRevision(teamName, namespace, entryKey, 0) +} + +func (a *API) DeleteEntryWithRevision(teamName *string, namespace string, entryKey string, revision int) (result keybase1.KVDeleteEntryResult, err error) { + + opts := kvstoreOptions{ + Team: teamName, + Namespace: &namespace, + EntryKey: &entryKey, + } + if revision != 0 { + opts.Revision = &revision + } + args := kvstoreAPIReq{Method: "del", Params: kvstoreParams{Options: opts}} + apiInput, err := json.Marshal(args) + if err != nil { + return result, err + } + + cmd := a.runOpts.Command("kvstore", "api") + cmd.Stdin = strings.NewReader(string(apiInput)) + bytes, err := cmd.Output() + if err != nil { + return result, APIError{err} + } + + entry := DeleteEntryRes{} + err = json.Unmarshal(bytes, &entry) + if err != nil { + return result, UnmarshalError{err} + } + if entry.Error.Message != "" { + return result, entry.Error + } + return entry.Result, nil +} + +func (a *API) GetEntry(teamName *string, namespace string, entryKey string) (result keybase1.KVGetResult, err error) { + + opts := kvstoreOptions{ + Team: teamName, + Namespace: &namespace, + EntryKey: &entryKey, + } + args := kvstoreAPIReq{Method: "get", Params: kvstoreParams{Options: opts}} + apiInput, err := json.Marshal(args) + if err != nil { + return result, err + } + cmd := a.runOpts.Command("kvstore", "api") + cmd.Stdin = strings.NewReader(string(apiInput)) + bytes, err := cmd.Output() + if err != nil { + return result, APIError{err} + } + + entry := GetEntryRes{} + err = json.Unmarshal(bytes, &entry) + if err != nil { + return result, UnmarshalError{err} + } + if entry.Error.Message != "" { + return result, entry.Error + } + return entry.Result, nil +} + +func (a *API) ListNamespaces(teamName *string) (result keybase1.KVListNamespaceResult, err error) { + + opts := kvstoreOptions{ + Team: teamName, + } + args := kvstoreAPIReq{Method: "list", Params: kvstoreParams{Options: opts}} + apiInput, err := json.Marshal(args) + if err != nil { + return result, err + } + + cmd := a.runOpts.Command("kvstore", "api") + cmd.Stdin = strings.NewReader(string(apiInput)) + bytes, err := cmd.Output() + if err != nil { + return result, APIError{err} + } + + var namespaces ListNamespacesRes + err = json.Unmarshal(bytes, &namespaces) + if err != nil { + return result, UnmarshalError{err} + } + if namespaces.Error.Message != "" { + return result, namespaces.Error + } + return namespaces.Result, nil +} + +func (a *API) ListEntryKeys(teamName *string, namespace string) (result keybase1.KVListEntryResult, err error) { + + opts := kvstoreOptions{ + Team: teamName, + Namespace: &namespace, + } + args := kvstoreAPIReq{Method: "list", Params: kvstoreParams{Options: opts}} + apiInput, err := json.Marshal(args) + if err != nil { + return result, err + } + + cmd := a.runOpts.Command("kvstore", "api") + cmd.Stdin = strings.NewReader(string(apiInput)) + bytes, err := cmd.Output() + if err != nil { + return result, APIError{err} + } + + entryKeys := ListEntryKeysRes{} + err = json.Unmarshal(bytes, &entryKeys) + if err != nil { + return result, UnmarshalError{err} + } + if entryKeys.Error.Message != "" { + return result, entryKeys.Error + } + return entryKeys.Result, nil +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/team.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/team.go index 89c55c4f..0f9d9524 100644 --- a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/team.go +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/team.go @@ -4,22 +4,13 @@ import ( "encoding/json" "fmt" "strings" + + "github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1" ) type ListTeamMembers struct { - Result ListTeamMembersResult `json:"result"` - Error Error `json:"error"` -} - -type ListTeamMembersResult struct { - Members ListTeamMembersResultMembers `json:"members"` -} - -type ListTeamMembersResultMembers struct { - Owners []ListMembersOutputMembersCategory `json:"owners"` - Admins []ListMembersOutputMembersCategory `json:"admins"` - Writers []ListMembersOutputMembersCategory `json:"writers"` - Readers []ListMembersOutputMembersCategory `json:"readers"` + Result keybase1.TeamDetails `json:"result"` + Error Error `json:"error"` } type ListMembersOutputMembersCategory struct { @@ -28,62 +19,46 @@ type ListMembersOutputMembersCategory struct { } type ListUserMemberships struct { - Result ListUserMembershipsResult `json:"result"` - Error Error `json:"error"` + Result keybase1.AnnotatedTeamList `json:"result"` + Error Error `json:"error"` } -type ListUserMembershipsResult struct { - Teams []ListUserMembershipsResultTeam `json:"teams"` -} - -type ListUserMembershipsResultTeam struct { - TeamName string `json:"fq_name"` - IsImplicitTeam bool `json:"is_implicit_team"` - IsOpenTeam bool `json:"is_open_team"` - Role int `json:"role"` - MemberCount int `json:"member_count"` -} - -func (a *API) ListMembersOfTeam(teamName string) (ListTeamMembersResultMembers, error) { - empty := ListTeamMembersResultMembers{} - +func (a *API) ListMembersOfTeam(teamName string) (res keybase1.TeamMembersDetails, err error) { apiInput := fmt.Sprintf(`{"method": "list-team-memberships", "params": {"options": {"team": "%s"}}}`, teamName) cmd := a.runOpts.Command("team", "api") cmd.Stdin = strings.NewReader(apiInput) bytes, err := cmd.CombinedOutput() if err != nil { - return empty, fmt.Errorf("failed to call keybase team api: %v", err) + return res, APIError{err} } members := ListTeamMembers{} err = json.Unmarshal(bytes, &members) if err != nil { - return empty, fmt.Errorf("failed to parse output from keybase team api: %v", err) + return res, UnmarshalError{err} } if members.Error.Message != "" { - return empty, fmt.Errorf("received error from keybase team api: %s", members.Error.Message) + return res, members.Error } return members.Result.Members, nil } -func (a *API) ListUserMemberships(username string) ([]ListUserMembershipsResultTeam, error) { - empty := []ListUserMembershipsResultTeam{} - +func (a *API) ListUserMemberships(username string) ([]keybase1.AnnotatedMemberInfo, error) { apiInput := fmt.Sprintf(`{"method": "list-user-memberships", "params": {"options": {"username": "%s"}}}`, username) cmd := a.runOpts.Command("team", "api") cmd.Stdin = strings.NewReader(apiInput) bytes, err := cmd.CombinedOutput() if err != nil { - return empty, fmt.Errorf("failed to call keybase team api: %v", err) + return nil, APIError{err} } members := ListUserMemberships{} err = json.Unmarshal(bytes, &members) if err != nil { - return empty, fmt.Errorf("failed to parse output from keybase team api: %v", err) + return nil, UnmarshalError{err} } if members.Error.Message != "" { - return empty, fmt.Errorf("received error from keybase team api: %s", members.Error.Message) + return nil, members.Error } return members.Result.Teams, nil } diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/test_config.example.yaml b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/test_config.example.yaml index 87078ed1..1f467962 100644 --- a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/test_config.example.yaml +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/test_config.example.yaml @@ -1,16 +1,17 @@ # Rename this file to `test_config.yaml` -config: - bots: - alice: - username: "alice" - paperkey: "foo bar car..." - bob: - username: "bob" - paperkey: "one two three four..." - teams: - acme: - # A real team that you add your alice1 and bob1 into - name: "acme" - # The channel to use - topicname: "mysupercoolchannel" +keybase: "/path/to/keybase" +bots: + # Alice should have an active Stellar account with a little bit of XLM in it + alice: + username: "alice" + paperkey: "foo bar car..." + bob: + username: "bob" + paperkey: "one two three four..." +teams: + acme: + # A real team that you add your alice and bob into + name: "acme" + # The channel to use + topicname: "mysupercoolchannel" diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/test_utils.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/test_utils.go index 1a163951..5d079a1c 100644 --- a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/test_utils.go +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/test_utils.go @@ -41,9 +41,7 @@ func copyFile(t *testing.T, source, dest string) { // Creates the working directory and copies over the keybase binary in PATH. // We do this to avoid any version mismatch issues. -func prepWorkingDir(t *testing.T, workingDir string) string { - kbLocation := whichKeybase(t) - +func prepWorkingDir(t *testing.T, workingDir string, kbLocation string) string { err := os.Mkdir(workingDir, 0777) require.NoError(t, err) kbDestination := path.Join(workingDir, "keybase") diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types.go index 74a81646..882e511c 100644 --- a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types.go +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types.go @@ -1,159 +1,14 @@ package kbchat -type Sender struct { - Uid string `json:"uid"` - Username string `json:"username"` - DeviceID string `json:"device_id"` - DeviceName string `json:"device_name"` -} - -type Channel struct { - Name string `json:"name"` - Public bool `json:"public"` - TopicType string `json:"topic_type"` - TopicName string `json:"topic_name"` - MembersType string `json:"members_type"` -} - -type Conversation struct { - ID string `json:"id"` - Unread bool `json:"unread"` - Channel Channel `json:"channel"` -} - -type PaymentHolder struct { - Payment Payment `json:"notification"` -} - -type Payment struct { - TxID string `json:"txID"` - StatusDescription string `json:"statusDescription"` - FromAccountID string `json:"fromAccountID"` - FromUsername string `json:"fromUsername"` - ToAccountID string `json:"toAccountID"` - ToUsername string `json:"toUsername"` - AmountDescription string `json:"amountDescription"` - WorthAtSendTime string `json:"worthAtSendTime"` - ExternalTxURL string `json:"externalTxURL"` -} +import ( + "github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1" +) type Result struct { - Convs []Conversation `json:"conversations"` -} - -type Inbox struct { - Result Result `json:"result"` -} - -type ChannelsList struct { - Result Result `json:"result"` -} - -type MsgPaymentDetails struct { - ResultType int `json:"resultTyp"` // 0 good. 1 error - PaymentID string `json:"sent"` -} - -type MsgPayment struct { - Username string `json:"username"` - PaymentText string `json:"paymentText"` - Details MsgPaymentDetails `json:"result"` -} - -type Text struct { - Body string `json:"body"` - Payments []MsgPayment `json:"payments"` - ReplyTo int `json:"replyTo"` -} - -type Content struct { - Type string `json:"type"` - Text Text `json:"text"` -} - -type Message struct { - Content Content `json:"content"` - Sender Sender `json:"sender"` - Channel Channel `json:"channel"` - ConversationID string `json:"conversation_id"` - MsgID int `json:"id"` -} - -type SendResult struct { - MsgID int `json:"id"` + Convs []chat1.ConvSummary `json:"conversations"` } type SendResponse struct { - Result SendResult `json:"result"` -} - -type TypeHolder struct { - Type string `json:"type"` -} - -type MessageHolder struct { - Msg Message `json:"msg"` - Source string `json:"source"` -} - -type ThreadResult struct { - Messages []MessageHolder `json:"messages"` -} - -type Thread struct { - Result ThreadResult `json:"result"` -} - -type CommandExtendedDescription struct { - Title string `json:"title"` - DesktopBody string `json:"desktop_body"` - MobileBody string `json:"mobile_body"` -} - -type Command struct { - Name string `json:"name"` - Description string `json:"description"` - Usage string `json:"usage"` - ExtendedDescription *CommandExtendedDescription `json:"extended_description,omitempty"` -} - -type CommandsAdvertisement struct { - Typ string `json:"type"` - Commands []Command - TeamName string `json:"team_name,omitempty"` -} - -type Advertisement struct { - Alias string `json:"alias,omitempty"` - Advertisements []CommandsAdvertisement -} - -type Error struct { - Code int `json:"code"` - Message string `json:"message"` -} - -type JoinChannel struct { - Error Error `json:"error"` - Result JoinChannelResult `json:"result"` -} - -type JoinChannelResult struct { - RateLimit []RateLimit `json:"ratelimits"` -} - -type LeaveChannel struct { - Error Error `json:"error"` - Result LeaveChannelResult `json:"result"` -} - -type LeaveChannelResult struct { - RateLimit []RateLimit `json:"ratelimits"` -} - -type RateLimit struct { - Tank string `json:"tank"` - Capacity int `json:"capacity"` - Reset int `json:"reset"` - Gas int `json:"gas"` + Result chat1.SendRes `json:"result"` + Error *Error `json:"error,omitempty"` } diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/api.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/api.go new file mode 100644 index 00000000..678d2ab3 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/api.go @@ -0,0 +1,933 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/chat1/api.avdl + +package chat1 + +import ( + gregor1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1" + keybase1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1" +) + +type ConvIDStr string + +func (o ConvIDStr) DeepCopy() ConvIDStr { + return o +} + +type TLFIDStr string + +func (o TLFIDStr) DeepCopy() TLFIDStr { + return o +} + +type FlipGameIDStr string + +func (o FlipGameIDStr) DeepCopy() FlipGameIDStr { + return o +} + +type RateLimitRes struct { + Tank string `codec:"tank" json:"tank"` + Capacity int `codec:"capacity" json:"capacity"` + Reset int `codec:"reset" json:"reset"` + Gas int `codec:"gas" json:"gas"` +} + +func (o RateLimitRes) DeepCopy() RateLimitRes { + return RateLimitRes{ + Tank: o.Tank, + Capacity: o.Capacity, + Reset: o.Reset, + Gas: o.Gas, + } +} + +// A Keybase chat channel. This can be a channel in a team, or just an informal channel between two users. +// name: the name of the team or comma-separated list of participants +type ChatChannel struct { + Name string `codec:"name" json:"name"` + Public bool `codec:"public,omitempty" json:"public,omitempty"` + MembersType string `codec:"membersType,omitempty" json:"members_type,omitempty"` + TopicType string `codec:"topicType,omitempty" json:"topic_type,omitempty"` + TopicName string `codec:"topicName,omitempty" json:"topic_name,omitempty"` +} + +func (o ChatChannel) DeepCopy() ChatChannel { + return ChatChannel{ + Name: o.Name, + Public: o.Public, + MembersType: o.MembersType, + TopicType: o.TopicType, + TopicName: o.TopicName, + } +} + +// A chat message. The content goes in the `body` property! +type ChatMessage struct { + Body string `codec:"body" json:"body"` +} + +func (o ChatMessage) DeepCopy() ChatMessage { + return ChatMessage{ + Body: o.Body, + } +} + +type MsgSender struct { + Uid keybase1.UID `codec:"uid" json:"uid"` + Username string `codec:"username,omitempty" json:"username,omitempty"` + DeviceID keybase1.DeviceID `codec:"deviceID" json:"device_id"` + DeviceName string `codec:"deviceName,omitempty" json:"device_name,omitempty"` +} + +func (o MsgSender) DeepCopy() MsgSender { + return MsgSender{ + Uid: o.Uid.DeepCopy(), + Username: o.Username, + DeviceID: o.DeviceID.DeepCopy(), + DeviceName: o.DeviceName, + } +} + +type MsgBotInfo struct { + BotUID keybase1.UID `codec:"botUID" json:"bot_uid"` + BotUsername string `codec:"botUsername,omitempty" json:"bot_username,omitempty"` +} + +func (o MsgBotInfo) DeepCopy() MsgBotInfo { + return MsgBotInfo{ + BotUID: o.BotUID.DeepCopy(), + BotUsername: o.BotUsername, + } +} + +type MsgFlipContent struct { + Text string `codec:"text" json:"text"` + GameID FlipGameIDStr `codec:"gameID" json:"game_id"` + FlipConvID ConvIDStr `codec:"flipConvID" json:"flip_conv_id"` + UserMentions []KnownUserMention `codec:"userMentions" json:"user_mentions"` + TeamMentions []KnownTeamMention `codec:"teamMentions" json:"team_mentions"` +} + +func (o MsgFlipContent) DeepCopy() MsgFlipContent { + return MsgFlipContent{ + Text: o.Text, + GameID: o.GameID.DeepCopy(), + FlipConvID: o.FlipConvID.DeepCopy(), + UserMentions: (func(x []KnownUserMention) []KnownUserMention { + if x == nil { + return nil + } + ret := make([]KnownUserMention, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.UserMentions), + TeamMentions: (func(x []KnownTeamMention) []KnownTeamMention { + if x == nil { + return nil + } + ret := make([]KnownTeamMention, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.TeamMentions), + } +} + +type MsgContent struct { + TypeName string `codec:"typeName" json:"type"` + Text *MessageText `codec:"text,omitempty" json:"text,omitempty"` + Attachment *MessageAttachment `codec:"attachment,omitempty" json:"attachment,omitempty"` + Edit *MessageEdit `codec:"edit,omitempty" json:"edit,omitempty"` + Reaction *MessageReaction `codec:"reaction,omitempty" json:"reaction,omitempty"` + Delete *MessageDelete `codec:"delete,omitempty" json:"delete,omitempty"` + Metadata *MessageConversationMetadata `codec:"metadata,omitempty" json:"metadata,omitempty"` + Headline *MessageHeadline `codec:"headline,omitempty" json:"headline,omitempty"` + AttachmentUploaded *MessageAttachmentUploaded `codec:"attachmentUploaded,omitempty" json:"attachment_uploaded,omitempty"` + System *MessageSystem `codec:"system,omitempty" json:"system,omitempty"` + SendPayment *MessageSendPayment `codec:"sendPayment,omitempty" json:"send_payment,omitempty"` + RequestPayment *MessageRequestPayment `codec:"requestPayment,omitempty" json:"request_payment,omitempty"` + Unfurl *MessageUnfurl `codec:"unfurl,omitempty" json:"unfurl,omitempty"` + Flip *MsgFlipContent `codec:"flip,omitempty" json:"flip,omitempty"` +} + +func (o MsgContent) DeepCopy() MsgContent { + return MsgContent{ + TypeName: o.TypeName, + Text: (func(x *MessageText) *MessageText { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Text), + Attachment: (func(x *MessageAttachment) *MessageAttachment { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Attachment), + Edit: (func(x *MessageEdit) *MessageEdit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Edit), + Reaction: (func(x *MessageReaction) *MessageReaction { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Reaction), + Delete: (func(x *MessageDelete) *MessageDelete { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Delete), + Metadata: (func(x *MessageConversationMetadata) *MessageConversationMetadata { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Metadata), + Headline: (func(x *MessageHeadline) *MessageHeadline { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Headline), + AttachmentUploaded: (func(x *MessageAttachmentUploaded) *MessageAttachmentUploaded { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.AttachmentUploaded), + System: (func(x *MessageSystem) *MessageSystem { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.System), + SendPayment: (func(x *MessageSendPayment) *MessageSendPayment { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.SendPayment), + RequestPayment: (func(x *MessageRequestPayment) *MessageRequestPayment { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RequestPayment), + Unfurl: (func(x *MessageUnfurl) *MessageUnfurl { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Unfurl), + Flip: (func(x *MsgFlipContent) *MsgFlipContent { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Flip), + } +} + +type MsgSummary struct { + Id MessageID `codec:"id" json:"id"` + ConvID ConvIDStr `codec:"convID" json:"conversation_id"` + Channel ChatChannel `codec:"channel" json:"channel"` + Sender MsgSender `codec:"sender" json:"sender"` + SentAt int64 `codec:"sentAt" json:"sent_at"` + SentAtMs int64 `codec:"sentAtMs" json:"sent_at_ms"` + Content MsgContent `codec:"content" json:"content"` + Prev []MessagePreviousPointer `codec:"prev" json:"prev"` + Unread bool `codec:"unread" json:"unread"` + RevokedDevice bool `codec:"revokedDevice,omitempty" json:"revoked_device,omitempty"` + Offline bool `codec:"offline,omitempty" json:"offline,omitempty"` + KbfsEncrypted bool `codec:"kbfsEncrypted,omitempty" json:"kbfs_encrypted,omitempty"` + IsEphemeral bool `codec:"isEphemeral,omitempty" json:"is_ephemeral,omitempty"` + IsEphemeralExpired bool `codec:"isEphemeralExpired,omitempty" json:"is_ephemeral_expired,omitempty"` + ETime gregor1.Time `codec:"eTime,omitempty" json:"e_time,omitempty"` + Reactions *ReactionMap `codec:"reactions,omitempty" json:"reactions,omitempty"` + HasPairwiseMacs bool `codec:"hasPairwiseMacs,omitempty" json:"has_pairwise_macs,omitempty"` + AtMentionUsernames []string `codec:"atMentionUsernames,omitempty" json:"at_mention_usernames,omitempty"` + ChannelMention string `codec:"channelMention,omitempty" json:"channel_mention,omitempty"` + ChannelNameMentions []UIChannelNameMention `codec:"channelNameMentions,omitempty" json:"channel_name_mentions,omitempty"` + BotInfo *MsgBotInfo `codec:"botInfo,omitempty" json:"bot_info,omitempty"` +} + +func (o MsgSummary) DeepCopy() MsgSummary { + return MsgSummary{ + Id: o.Id.DeepCopy(), + ConvID: o.ConvID.DeepCopy(), + Channel: o.Channel.DeepCopy(), + Sender: o.Sender.DeepCopy(), + SentAt: o.SentAt, + SentAtMs: o.SentAtMs, + Content: o.Content.DeepCopy(), + Prev: (func(x []MessagePreviousPointer) []MessagePreviousPointer { + if x == nil { + return nil + } + ret := make([]MessagePreviousPointer, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Prev), + Unread: o.Unread, + RevokedDevice: o.RevokedDevice, + Offline: o.Offline, + KbfsEncrypted: o.KbfsEncrypted, + IsEphemeral: o.IsEphemeral, + IsEphemeralExpired: o.IsEphemeralExpired, + ETime: o.ETime.DeepCopy(), + Reactions: (func(x *ReactionMap) *ReactionMap { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Reactions), + HasPairwiseMacs: o.HasPairwiseMacs, + AtMentionUsernames: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.AtMentionUsernames), + ChannelMention: o.ChannelMention, + ChannelNameMentions: (func(x []UIChannelNameMention) []UIChannelNameMention { + if x == nil { + return nil + } + ret := make([]UIChannelNameMention, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ChannelNameMentions), + BotInfo: (func(x *MsgBotInfo) *MsgBotInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.BotInfo), + } +} + +type Message struct { + Msg *MsgSummary `codec:"msg,omitempty" json:"msg,omitempty"` + Error *string `codec:"error,omitempty" json:"error,omitempty"` +} + +func (o Message) DeepCopy() Message { + return Message{ + Msg: (func(x *MsgSummary) *MsgSummary { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Msg), + Error: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Error), + } +} + +type Thread struct { + Messages []Message `codec:"messages" json:"messages"` + Pagination *Pagination `codec:"pagination,omitempty" json:"pagination,omitempty"` + Offline bool `codec:"offline,omitempty" json:"offline,omitempty"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures,omitempty" json:"identify_failures,omitempty"` + RateLimits []RateLimitRes `codec:"rateLimits,omitempty" json:"ratelimits,omitempty"` +} + +func (o Thread) DeepCopy() Thread { + return Thread{ + Messages: (func(x []Message) []Message { + if x == nil { + return nil + } + ret := make([]Message, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Messages), + Pagination: (func(x *Pagination) *Pagination { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Pagination), + Offline: o.Offline, + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + RateLimits: (func(x []RateLimitRes) []RateLimitRes { + if x == nil { + return nil + } + ret := make([]RateLimitRes, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +// A chat conversation. This is essentially a chat channel plus some additional metadata. +type ConvSummary struct { + Id ConvIDStr `codec:"id" json:"id"` + Channel ChatChannel `codec:"channel" json:"channel"` + IsDefaultConv bool `codec:"isDefaultConv" json:"is_default_conv"` + Unread bool `codec:"unread" json:"unread"` + ActiveAt int64 `codec:"activeAt" json:"active_at"` + ActiveAtMs int64 `codec:"activeAtMs" json:"active_at_ms"` + MemberStatus string `codec:"memberStatus" json:"member_status"` + ResetUsers []string `codec:"resetUsers,omitempty" json:"reset_users,omitempty"` + FinalizeInfo *ConversationFinalizeInfo `codec:"finalizeInfo,omitempty" json:"finalize_info,omitempty"` + Supersedes []string `codec:"supersedes,omitempty" json:"supersedes,omitempty"` + SupersededBy []string `codec:"supersededBy,omitempty" json:"superseded_by,omitempty"` + Error string `codec:"error,omitempty" json:"error,omitempty"` + CreatorInfo *ConversationCreatorInfoLocal `codec:"creatorInfo,omitempty" json:"creator_info,omitempty"` +} + +func (o ConvSummary) DeepCopy() ConvSummary { + return ConvSummary{ + Id: o.Id.DeepCopy(), + Channel: o.Channel.DeepCopy(), + IsDefaultConv: o.IsDefaultConv, + Unread: o.Unread, + ActiveAt: o.ActiveAt, + ActiveAtMs: o.ActiveAtMs, + MemberStatus: o.MemberStatus, + ResetUsers: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.ResetUsers), + FinalizeInfo: (func(x *ConversationFinalizeInfo) *ConversationFinalizeInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.FinalizeInfo), + Supersedes: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Supersedes), + SupersededBy: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.SupersededBy), + Error: o.Error, + CreatorInfo: (func(x *ConversationCreatorInfoLocal) *ConversationCreatorInfoLocal { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.CreatorInfo), + } +} + +type ChatList struct { + Conversations []ConvSummary `codec:"conversations" json:"conversations"` + Offline bool `codec:"offline" json:"offline"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures,omitempty" json:"identify_failures,omitempty"` + RateLimits []RateLimitRes `codec:"rateLimits,omitempty" json:"ratelimits,omitempty"` +} + +func (o ChatList) DeepCopy() ChatList { + return ChatList{ + Conversations: (func(x []ConvSummary) []ConvSummary { + if x == nil { + return nil + } + ret := make([]ConvSummary, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Conversations), + Offline: o.Offline, + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + RateLimits: (func(x []RateLimitRes) []RateLimitRes { + if x == nil { + return nil + } + ret := make([]RateLimitRes, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +type SendRes struct { + Message string `codec:"message" json:"message"` + MessageID *MessageID `codec:"messageID,omitempty" json:"id,omitempty"` + OutboxID *OutboxID `codec:"outboxID,omitempty" json:"outbox_id,omitempty"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures,omitempty" json:"identify_failures,omitempty"` + RateLimits []RateLimitRes `codec:"rateLimits,omitempty" json:"ratelimits,omitempty"` +} + +func (o SendRes) DeepCopy() SendRes { + return SendRes{ + Message: o.Message, + MessageID: (func(x *MessageID) *MessageID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.MessageID), + OutboxID: (func(x *OutboxID) *OutboxID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.OutboxID), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + RateLimits: (func(x []RateLimitRes) []RateLimitRes { + if x == nil { + return nil + } + ret := make([]RateLimitRes, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +type SearchInboxResOutput struct { + Results *ChatSearchInboxResults `codec:"results,omitempty" json:"results,omitempty"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures,omitempty" json:"identify_failures,omitempty"` + RateLimits []RateLimitRes `codec:"rateLimits,omitempty" json:"ratelimits,omitempty"` +} + +func (o SearchInboxResOutput) DeepCopy() SearchInboxResOutput { + return SearchInboxResOutput{ + Results: (func(x *ChatSearchInboxResults) *ChatSearchInboxResults { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Results), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + RateLimits: (func(x []RateLimitRes) []RateLimitRes { + if x == nil { + return nil + } + ret := make([]RateLimitRes, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +type RegexpRes struct { + Hits []ChatSearchHit `codec:"hits" json:"hits"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures,omitempty" json:"identify_failures,omitempty"` + RateLimits []RateLimitRes `codec:"rateLimits,omitempty" json:"ratelimits,omitempty"` +} + +func (o RegexpRes) DeepCopy() RegexpRes { + return RegexpRes{ + Hits: (func(x []ChatSearchHit) []ChatSearchHit { + if x == nil { + return nil + } + ret := make([]ChatSearchHit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Hits), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + RateLimits: (func(x []RateLimitRes) []RateLimitRes { + if x == nil { + return nil + } + ret := make([]RateLimitRes, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +type NewConvRes struct { + Id ConvIDStr `codec:"id" json:"id"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures,omitempty" json:"identify_failures,omitempty"` + RateLimits []RateLimitRes `codec:"rateLimits,omitempty" json:"ratelimits,omitempty"` +} + +func (o NewConvRes) DeepCopy() NewConvRes { + return NewConvRes{ + Id: o.Id.DeepCopy(), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + RateLimits: (func(x []RateLimitRes) []RateLimitRes { + if x == nil { + return nil + } + ret := make([]RateLimitRes, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +type ListCommandsRes struct { + Commands []UserBotCommandOutput `codec:"commands" json:"commands"` + RateLimits []RateLimitRes `codec:"rateLimits,omitempty" json:"ratelimits,omitempty"` +} + +func (o ListCommandsRes) DeepCopy() ListCommandsRes { + return ListCommandsRes{ + Commands: (func(x []UserBotCommandOutput) []UserBotCommandOutput { + if x == nil { + return nil + } + ret := make([]UserBotCommandOutput, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Commands), + RateLimits: (func(x []RateLimitRes) []RateLimitRes { + if x == nil { + return nil + } + ret := make([]RateLimitRes, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +type EmptyRes struct { + RateLimits []RateLimitRes `codec:"rateLimits,omitempty" json:"ratelimits,omitempty"` +} + +func (o EmptyRes) DeepCopy() EmptyRes { + return EmptyRes{ + RateLimits: (func(x []RateLimitRes) []RateLimitRes { + if x == nil { + return nil + } + ret := make([]RateLimitRes, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +type MsgNotification struct { + Type string `codec:"type" json:"type"` + Source string `codec:"source" json:"source"` + Msg *MsgSummary `codec:"msg,omitempty" json:"msg,omitempty"` + Error *string `codec:"error,omitempty" json:"error,omitempty"` + Pagination *UIPagination `codec:"pagination,omitempty" json:"pagination,omitempty"` +} + +func (o MsgNotification) DeepCopy() MsgNotification { + return MsgNotification{ + Type: o.Type, + Source: o.Source, + Msg: (func(x *MsgSummary) *MsgSummary { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Msg), + Error: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Error), + Pagination: (func(x *UIPagination) *UIPagination { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Pagination), + } +} + +type ConvNotification struct { + Type string `codec:"type" json:"type"` + Conv *ConvSummary `codec:"conv,omitempty" json:"conv,omitempty"` + Error *string `codec:"error,omitempty" json:"error,omitempty"` +} + +func (o ConvNotification) DeepCopy() ConvNotification { + return ConvNotification{ + Type: o.Type, + Conv: (func(x *ConvSummary) *ConvSummary { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Conv), + Error: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Error), + } +} + +type AdvertiseCommandAPIParam struct { + Typ string `codec:"typ" json:"type"` + Commands []UserBotCommandInput `codec:"commands" json:"commands"` + TeamName string `codec:"teamName,omitempty" json:"team_name,omitempty"` +} + +func (o AdvertiseCommandAPIParam) DeepCopy() AdvertiseCommandAPIParam { + return AdvertiseCommandAPIParam{ + Typ: o.Typ, + Commands: (func(x []UserBotCommandInput) []UserBotCommandInput { + if x == nil { + return nil + } + ret := make([]UserBotCommandInput, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Commands), + TeamName: o.TeamName, + } +} + +type ResetConvMemberAPI struct { + ConversationID ConvIDStr `codec:"conversationID" json:"conversationID"` + Username string `codec:"username" json:"username"` +} + +func (o ResetConvMemberAPI) DeepCopy() ResetConvMemberAPI { + return ResetConvMemberAPI{ + ConversationID: o.ConversationID.DeepCopy(), + Username: o.Username, + } +} + +type GetResetConvMembersRes struct { + Members []ResetConvMemberAPI `codec:"members" json:"members"` + RateLimits []RateLimitRes `codec:"rateLimits" json:"rateLimits"` +} + +func (o GetResetConvMembersRes) DeepCopy() GetResetConvMembersRes { + return GetResetConvMembersRes{ + Members: (func(x []ResetConvMemberAPI) []ResetConvMemberAPI { + if x == nil { + return nil + } + ret := make([]ResetConvMemberAPI, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Members), + RateLimits: (func(x []RateLimitRes) []RateLimitRes { + if x == nil { + return nil + } + ret := make([]RateLimitRes, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +type DeviceInfo struct { + DeviceID keybase1.DeviceID `codec:"deviceID" json:"id"` + DeviceDescription string `codec:"deviceDescription" json:"description"` + DeviceType string `codec:"deviceType" json:"type"` + DeviceCtime int64 `codec:"deviceCtime" json:"ctime"` +} + +func (o DeviceInfo) DeepCopy() DeviceInfo { + return DeviceInfo{ + DeviceID: o.DeviceID.DeepCopy(), + DeviceDescription: o.DeviceDescription, + DeviceType: o.DeviceType, + DeviceCtime: o.DeviceCtime, + } +} + +type GetDeviceInfoRes struct { + Devices []DeviceInfo `codec:"devices" json:"devices"` +} + +func (o GetDeviceInfoRes) DeepCopy() GetDeviceInfoRes { + return GetDeviceInfoRes{ + Devices: (func(x []DeviceInfo) []DeviceInfo { + if x == nil { + return nil + } + ret := make([]DeviceInfo, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Devices), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/blocking.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/blocking.go new file mode 100644 index 00000000..37c5c78a --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/blocking.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/chat1/blocking.avdl + +package chat1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/chat_ui.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/chat_ui.go new file mode 100644 index 00000000..1a908099 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/chat_ui.go @@ -0,0 +1,2874 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/chat1/chat_ui.avdl + +package chat1 + +import ( + "errors" + "fmt" + + gregor1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1" + keybase1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1" + stellar1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1" +) + +type UIPagination struct { + Next string `codec:"next" json:"next"` + Previous string `codec:"previous" json:"previous"` + Num int `codec:"num" json:"num"` + Last bool `codec:"last" json:"last"` +} + +func (o UIPagination) DeepCopy() UIPagination { + return UIPagination{ + Next: o.Next, + Previous: o.Previous, + Num: o.Num, + Last: o.Last, + } +} + +type UIInboxSmallTeamRow struct { + ConvID ConvIDStr `codec:"convID" json:"convID"` + Name string `codec:"name" json:"name"` + Time gregor1.Time `codec:"time" json:"time"` + Snippet *string `codec:"snippet,omitempty" json:"snippet,omitempty"` + SnippetDecoration SnippetDecoration `codec:"snippetDecoration" json:"snippetDecoration"` + Draft *string `codec:"draft,omitempty" json:"draft,omitempty"` + IsMuted bool `codec:"isMuted" json:"isMuted"` + IsTeam bool `codec:"isTeam" json:"isTeam"` +} + +func (o UIInboxSmallTeamRow) DeepCopy() UIInboxSmallTeamRow { + return UIInboxSmallTeamRow{ + ConvID: o.ConvID.DeepCopy(), + Name: o.Name, + Time: o.Time.DeepCopy(), + Snippet: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Snippet), + SnippetDecoration: o.SnippetDecoration.DeepCopy(), + Draft: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Draft), + IsMuted: o.IsMuted, + IsTeam: o.IsTeam, + } +} + +type UIInboxBigTeamRowTyp int + +const ( + UIInboxBigTeamRowTyp_LABEL UIInboxBigTeamRowTyp = 1 + UIInboxBigTeamRowTyp_CHANNEL UIInboxBigTeamRowTyp = 2 +) + +func (o UIInboxBigTeamRowTyp) DeepCopy() UIInboxBigTeamRowTyp { return o } + +var UIInboxBigTeamRowTypMap = map[string]UIInboxBigTeamRowTyp{ + "LABEL": 1, + "CHANNEL": 2, +} + +var UIInboxBigTeamRowTypRevMap = map[UIInboxBigTeamRowTyp]string{ + 1: "LABEL", + 2: "CHANNEL", +} + +func (e UIInboxBigTeamRowTyp) String() string { + if v, ok := UIInboxBigTeamRowTypRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UIInboxBigTeamChannelRow struct { + ConvID ConvIDStr `codec:"convID" json:"convID"` + Teamname string `codec:"teamname" json:"teamname"` + Channelname string `codec:"channelname" json:"channelname"` + Draft *string `codec:"draft,omitempty" json:"draft,omitempty"` + IsMuted bool `codec:"isMuted" json:"isMuted"` +} + +func (o UIInboxBigTeamChannelRow) DeepCopy() UIInboxBigTeamChannelRow { + return UIInboxBigTeamChannelRow{ + ConvID: o.ConvID.DeepCopy(), + Teamname: o.Teamname, + Channelname: o.Channelname, + Draft: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Draft), + IsMuted: o.IsMuted, + } +} + +type UIInboxBigTeamLabelRow struct { + Name string `codec:"name" json:"name"` + Id TLFIDStr `codec:"id" json:"id"` +} + +func (o UIInboxBigTeamLabelRow) DeepCopy() UIInboxBigTeamLabelRow { + return UIInboxBigTeamLabelRow{ + Name: o.Name, + Id: o.Id.DeepCopy(), + } +} + +type UIInboxBigTeamRow struct { + State__ UIInboxBigTeamRowTyp `codec:"state" json:"state"` + Label__ *UIInboxBigTeamLabelRow `codec:"label,omitempty" json:"label,omitempty"` + Channel__ *UIInboxBigTeamChannelRow `codec:"channel,omitempty" json:"channel,omitempty"` +} + +func (o *UIInboxBigTeamRow) State() (ret UIInboxBigTeamRowTyp, err error) { + switch o.State__ { + case UIInboxBigTeamRowTyp_LABEL: + if o.Label__ == nil { + err = errors.New("unexpected nil value for Label__") + return ret, err + } + case UIInboxBigTeamRowTyp_CHANNEL: + if o.Channel__ == nil { + err = errors.New("unexpected nil value for Channel__") + return ret, err + } + } + return o.State__, nil +} + +func (o UIInboxBigTeamRow) Label() (res UIInboxBigTeamLabelRow) { + if o.State__ != UIInboxBigTeamRowTyp_LABEL { + panic("wrong case accessed") + } + if o.Label__ == nil { + return + } + return *o.Label__ +} + +func (o UIInboxBigTeamRow) Channel() (res UIInboxBigTeamChannelRow) { + if o.State__ != UIInboxBigTeamRowTyp_CHANNEL { + panic("wrong case accessed") + } + if o.Channel__ == nil { + return + } + return *o.Channel__ +} + +func NewUIInboxBigTeamRowWithLabel(v UIInboxBigTeamLabelRow) UIInboxBigTeamRow { + return UIInboxBigTeamRow{ + State__: UIInboxBigTeamRowTyp_LABEL, + Label__: &v, + } +} + +func NewUIInboxBigTeamRowWithChannel(v UIInboxBigTeamChannelRow) UIInboxBigTeamRow { + return UIInboxBigTeamRow{ + State__: UIInboxBigTeamRowTyp_CHANNEL, + Channel__: &v, + } +} + +func (o UIInboxBigTeamRow) DeepCopy() UIInboxBigTeamRow { + return UIInboxBigTeamRow{ + State__: o.State__.DeepCopy(), + Label__: (func(x *UIInboxBigTeamLabelRow) *UIInboxBigTeamLabelRow { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Label__), + Channel__: (func(x *UIInboxBigTeamChannelRow) *UIInboxBigTeamChannelRow { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Channel__), + } +} + +type UIInboxReselectInfo struct { + OldConvID ConvIDStr `codec:"oldConvID" json:"oldConvID"` + NewConvID *ConvIDStr `codec:"newConvID,omitempty" json:"newConvID,omitempty"` +} + +func (o UIInboxReselectInfo) DeepCopy() UIInboxReselectInfo { + return UIInboxReselectInfo{ + OldConvID: o.OldConvID.DeepCopy(), + NewConvID: (func(x *ConvIDStr) *ConvIDStr { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.NewConvID), + } +} + +type UIInboxLayout struct { + TotalSmallTeams int `codec:"totalSmallTeams" json:"totalSmallTeams"` + SmallTeams []UIInboxSmallTeamRow `codec:"smallTeams" json:"smallTeams"` + BigTeams []UIInboxBigTeamRow `codec:"bigTeams" json:"bigTeams"` + ReselectInfo *UIInboxReselectInfo `codec:"reselectInfo,omitempty" json:"reselectInfo,omitempty"` + WidgetList []UIInboxSmallTeamRow `codec:"widgetList" json:"widgetList"` +} + +func (o UIInboxLayout) DeepCopy() UIInboxLayout { + return UIInboxLayout{ + TotalSmallTeams: o.TotalSmallTeams, + SmallTeams: (func(x []UIInboxSmallTeamRow) []UIInboxSmallTeamRow { + if x == nil { + return nil + } + ret := make([]UIInboxSmallTeamRow, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.SmallTeams), + BigTeams: (func(x []UIInboxBigTeamRow) []UIInboxBigTeamRow { + if x == nil { + return nil + } + ret := make([]UIInboxBigTeamRow, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.BigTeams), + ReselectInfo: (func(x *UIInboxReselectInfo) *UIInboxReselectInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ReselectInfo), + WidgetList: (func(x []UIInboxSmallTeamRow) []UIInboxSmallTeamRow { + if x == nil { + return nil + } + ret := make([]UIInboxSmallTeamRow, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.WidgetList), + } +} + +type UnverifiedInboxUIItemMetadata struct { + ChannelName string `codec:"channelName" json:"channelName"` + Headline string `codec:"headline" json:"headline"` + HeadlineDecorated string `codec:"headlineDecorated" json:"headlineDecorated"` + Snippet string `codec:"snippet" json:"snippet"` + SnippetDecoration SnippetDecoration `codec:"snippetDecoration" json:"snippetDecoration"` + WriterNames []string `codec:"writerNames" json:"writerNames"` + ResetParticipants []string `codec:"resetParticipants" json:"resetParticipants"` +} + +func (o UnverifiedInboxUIItemMetadata) DeepCopy() UnverifiedInboxUIItemMetadata { + return UnverifiedInboxUIItemMetadata{ + ChannelName: o.ChannelName, + Headline: o.Headline, + HeadlineDecorated: o.HeadlineDecorated, + Snippet: o.Snippet, + SnippetDecoration: o.SnippetDecoration.DeepCopy(), + WriterNames: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.WriterNames), + ResetParticipants: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.ResetParticipants), + } +} + +type UnverifiedInboxUIItem struct { + ConvID ConvIDStr `codec:"convID" json:"convID"` + TlfID TLFIDStr `codec:"tlfID" json:"tlfID"` + TopicType TopicType `codec:"topicType" json:"topicType"` + IsPublic bool `codec:"isPublic" json:"isPublic"` + IsDefaultConv bool `codec:"isDefaultConv" json:"isDefaultConv"` + Name string `codec:"name" json:"name"` + Visibility keybase1.TLFVisibility `codec:"visibility" json:"visibility"` + Status ConversationStatus `codec:"status" json:"status"` + MembersType ConversationMembersType `codec:"membersType" json:"membersType"` + MemberStatus ConversationMemberStatus `codec:"memberStatus" json:"memberStatus"` + TeamType TeamType `codec:"teamType" json:"teamType"` + Notifications *ConversationNotificationInfo `codec:"notifications,omitempty" json:"notifications,omitempty"` + Time gregor1.Time `codec:"time" json:"time"` + Version ConversationVers `codec:"version" json:"version"` + LocalVersion LocalConversationVers `codec:"localVersion" json:"localVersion"` + ConvRetention *RetentionPolicy `codec:"convRetention,omitempty" json:"convRetention,omitempty"` + TeamRetention *RetentionPolicy `codec:"teamRetention,omitempty" json:"teamRetention,omitempty"` + MaxMsgID MessageID `codec:"maxMsgID" json:"maxMsgID"` + MaxVisibleMsgID MessageID `codec:"maxVisibleMsgID" json:"maxVisibleMsgID"` + ReadMsgID MessageID `codec:"readMsgID" json:"readMsgID"` + LocalMetadata *UnverifiedInboxUIItemMetadata `codec:"localMetadata,omitempty" json:"localMetadata,omitempty"` + Draft *string `codec:"draft,omitempty" json:"draft,omitempty"` + FinalizeInfo *ConversationFinalizeInfo `codec:"finalizeInfo,omitempty" json:"finalizeInfo,omitempty"` + Supersedes []ConversationMetadata `codec:"supersedes" json:"supersedes"` + SupersededBy []ConversationMetadata `codec:"supersededBy" json:"supersededBy"` + Commands ConversationCommandGroups `codec:"commands" json:"commands"` +} + +func (o UnverifiedInboxUIItem) DeepCopy() UnverifiedInboxUIItem { + return UnverifiedInboxUIItem{ + ConvID: o.ConvID.DeepCopy(), + TlfID: o.TlfID.DeepCopy(), + TopicType: o.TopicType.DeepCopy(), + IsPublic: o.IsPublic, + IsDefaultConv: o.IsDefaultConv, + Name: o.Name, + Visibility: o.Visibility.DeepCopy(), + Status: o.Status.DeepCopy(), + MembersType: o.MembersType.DeepCopy(), + MemberStatus: o.MemberStatus.DeepCopy(), + TeamType: o.TeamType.DeepCopy(), + Notifications: (func(x *ConversationNotificationInfo) *ConversationNotificationInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Notifications), + Time: o.Time.DeepCopy(), + Version: o.Version.DeepCopy(), + LocalVersion: o.LocalVersion.DeepCopy(), + ConvRetention: (func(x *RetentionPolicy) *RetentionPolicy { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ConvRetention), + TeamRetention: (func(x *RetentionPolicy) *RetentionPolicy { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.TeamRetention), + MaxMsgID: o.MaxMsgID.DeepCopy(), + MaxVisibleMsgID: o.MaxVisibleMsgID.DeepCopy(), + ReadMsgID: o.ReadMsgID.DeepCopy(), + LocalMetadata: (func(x *UnverifiedInboxUIItemMetadata) *UnverifiedInboxUIItemMetadata { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.LocalMetadata), + Draft: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Draft), + FinalizeInfo: (func(x *ConversationFinalizeInfo) *ConversationFinalizeInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.FinalizeInfo), + Supersedes: (func(x []ConversationMetadata) []ConversationMetadata { + if x == nil { + return nil + } + ret := make([]ConversationMetadata, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Supersedes), + SupersededBy: (func(x []ConversationMetadata) []ConversationMetadata { + if x == nil { + return nil + } + ret := make([]ConversationMetadata, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.SupersededBy), + Commands: o.Commands.DeepCopy(), + } +} + +type UnverifiedInboxUIItems struct { + Items []UnverifiedInboxUIItem `codec:"items" json:"items"` + Offline bool `codec:"offline" json:"offline"` +} + +func (o UnverifiedInboxUIItems) DeepCopy() UnverifiedInboxUIItems { + return UnverifiedInboxUIItems{ + Items: (func(x []UnverifiedInboxUIItem) []UnverifiedInboxUIItem { + if x == nil { + return nil + } + ret := make([]UnverifiedInboxUIItem, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Items), + Offline: o.Offline, + } +} + +type UIParticipantType int + +const ( + UIParticipantType_NONE UIParticipantType = 0 + UIParticipantType_USER UIParticipantType = 1 + UIParticipantType_PHONENO UIParticipantType = 2 + UIParticipantType_EMAIL UIParticipantType = 3 +) + +func (o UIParticipantType) DeepCopy() UIParticipantType { return o } + +var UIParticipantTypeMap = map[string]UIParticipantType{ + "NONE": 0, + "USER": 1, + "PHONENO": 2, + "EMAIL": 3, +} + +var UIParticipantTypeRevMap = map[UIParticipantType]string{ + 0: "NONE", + 1: "USER", + 2: "PHONENO", + 3: "EMAIL", +} + +func (e UIParticipantType) String() string { + if v, ok := UIParticipantTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UIParticipant struct { + Type UIParticipantType `codec:"type" json:"type"` + Assertion string `codec:"assertion" json:"assertion"` + InConvName bool `codec:"inConvName" json:"inConvName"` + FullName *string `codec:"fullName,omitempty" json:"fullName,omitempty"` + ContactName *string `codec:"contactName,omitempty" json:"contactName,omitempty"` +} + +func (o UIParticipant) DeepCopy() UIParticipant { + return UIParticipant{ + Type: o.Type.DeepCopy(), + Assertion: o.Assertion, + InConvName: o.InConvName, + FullName: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.FullName), + ContactName: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.ContactName), + } +} + +type UIPinnedMessage struct { + Message UIMessage `codec:"message" json:"message"` + PinnerUsername string `codec:"pinnerUsername" json:"pinnerUsername"` +} + +func (o UIPinnedMessage) DeepCopy() UIPinnedMessage { + return UIPinnedMessage{ + Message: o.Message.DeepCopy(), + PinnerUsername: o.PinnerUsername, + } +} + +type InboxUIItem struct { + ConvID ConvIDStr `codec:"convID" json:"convID"` + TlfID TLFIDStr `codec:"tlfID" json:"tlfID"` + TopicType TopicType `codec:"topicType" json:"topicType"` + IsPublic bool `codec:"isPublic" json:"isPublic"` + IsEmpty bool `codec:"isEmpty" json:"isEmpty"` + IsDefaultConv bool `codec:"isDefaultConv" json:"isDefaultConv"` + Name string `codec:"name" json:"name"` + Snippet string `codec:"snippet" json:"snippet"` + SnippetDecoration SnippetDecoration `codec:"snippetDecoration" json:"snippetDecoration"` + Channel string `codec:"channel" json:"channel"` + Headline string `codec:"headline" json:"headline"` + HeadlineDecorated string `codec:"headlineDecorated" json:"headlineDecorated"` + Draft *string `codec:"draft,omitempty" json:"draft,omitempty"` + Visibility keybase1.TLFVisibility `codec:"visibility" json:"visibility"` + Participants []UIParticipant `codec:"participants" json:"participants"` + ResetParticipants []string `codec:"resetParticipants" json:"resetParticipants"` + Status ConversationStatus `codec:"status" json:"status"` + MembersType ConversationMembersType `codec:"membersType" json:"membersType"` + MemberStatus ConversationMemberStatus `codec:"memberStatus" json:"memberStatus"` + TeamType TeamType `codec:"teamType" json:"teamType"` + Time gregor1.Time `codec:"time" json:"time"` + Notifications *ConversationNotificationInfo `codec:"notifications,omitempty" json:"notifications,omitempty"` + CreatorInfo *ConversationCreatorInfoLocal `codec:"creatorInfo,omitempty" json:"creatorInfo,omitempty"` + Version ConversationVers `codec:"version" json:"version"` + LocalVersion LocalConversationVers `codec:"localVersion" json:"localVersion"` + MaxMsgID MessageID `codec:"maxMsgID" json:"maxMsgID"` + MaxVisibleMsgID MessageID `codec:"maxVisibleMsgID" json:"maxVisibleMsgID"` + ReadMsgID MessageID `codec:"readMsgID" json:"readMsgID"` + ConvRetention *RetentionPolicy `codec:"convRetention,omitempty" json:"convRetention,omitempty"` + TeamRetention *RetentionPolicy `codec:"teamRetention,omitempty" json:"teamRetention,omitempty"` + ConvSettings *ConversationSettingsLocal `codec:"convSettings,omitempty" json:"convSettings,omitempty"` + FinalizeInfo *ConversationFinalizeInfo `codec:"finalizeInfo,omitempty" json:"finalizeInfo,omitempty"` + Supersedes []ConversationMetadata `codec:"supersedes" json:"supersedes"` + SupersededBy []ConversationMetadata `codec:"supersededBy" json:"supersededBy"` + Commands ConversationCommandGroups `codec:"commands" json:"commands"` + BotCommands ConversationCommandGroups `codec:"botCommands" json:"botCommands"` + BotAliases map[string]string `codec:"botAliases" json:"botAliases"` + PinnedMsg *UIPinnedMessage `codec:"pinnedMsg,omitempty" json:"pinnedMsg,omitempty"` +} + +func (o InboxUIItem) DeepCopy() InboxUIItem { + return InboxUIItem{ + ConvID: o.ConvID.DeepCopy(), + TlfID: o.TlfID.DeepCopy(), + TopicType: o.TopicType.DeepCopy(), + IsPublic: o.IsPublic, + IsEmpty: o.IsEmpty, + IsDefaultConv: o.IsDefaultConv, + Name: o.Name, + Snippet: o.Snippet, + SnippetDecoration: o.SnippetDecoration.DeepCopy(), + Channel: o.Channel, + Headline: o.Headline, + HeadlineDecorated: o.HeadlineDecorated, + Draft: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Draft), + Visibility: o.Visibility.DeepCopy(), + Participants: (func(x []UIParticipant) []UIParticipant { + if x == nil { + return nil + } + ret := make([]UIParticipant, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Participants), + ResetParticipants: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.ResetParticipants), + Status: o.Status.DeepCopy(), + MembersType: o.MembersType.DeepCopy(), + MemberStatus: o.MemberStatus.DeepCopy(), + TeamType: o.TeamType.DeepCopy(), + Time: o.Time.DeepCopy(), + Notifications: (func(x *ConversationNotificationInfo) *ConversationNotificationInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Notifications), + CreatorInfo: (func(x *ConversationCreatorInfoLocal) *ConversationCreatorInfoLocal { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.CreatorInfo), + Version: o.Version.DeepCopy(), + LocalVersion: o.LocalVersion.DeepCopy(), + MaxMsgID: o.MaxMsgID.DeepCopy(), + MaxVisibleMsgID: o.MaxVisibleMsgID.DeepCopy(), + ReadMsgID: o.ReadMsgID.DeepCopy(), + ConvRetention: (func(x *RetentionPolicy) *RetentionPolicy { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ConvRetention), + TeamRetention: (func(x *RetentionPolicy) *RetentionPolicy { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.TeamRetention), + ConvSettings: (func(x *ConversationSettingsLocal) *ConversationSettingsLocal { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ConvSettings), + FinalizeInfo: (func(x *ConversationFinalizeInfo) *ConversationFinalizeInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.FinalizeInfo), + Supersedes: (func(x []ConversationMetadata) []ConversationMetadata { + if x == nil { + return nil + } + ret := make([]ConversationMetadata, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Supersedes), + SupersededBy: (func(x []ConversationMetadata) []ConversationMetadata { + if x == nil { + return nil + } + ret := make([]ConversationMetadata, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.SupersededBy), + Commands: o.Commands.DeepCopy(), + BotCommands: o.BotCommands.DeepCopy(), + BotAliases: (func(x map[string]string) map[string]string { + if x == nil { + return nil + } + ret := make(map[string]string, len(x)) + for k, v := range x { + kCopy := k + vCopy := v + ret[kCopy] = vCopy + } + return ret + })(o.BotAliases), + PinnedMsg: (func(x *UIPinnedMessage) *UIPinnedMessage { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.PinnedMsg), + } +} + +type InboxUIItemError struct { + Typ ConversationErrorType `codec:"typ" json:"typ"` + Message string `codec:"message" json:"message"` + UnverifiedTLFName string `codec:"unverifiedTLFName" json:"unverifiedTLFName"` + RekeyInfo *ConversationErrorRekey `codec:"rekeyInfo,omitempty" json:"rekeyInfo,omitempty"` + RemoteConv UnverifiedInboxUIItem `codec:"remoteConv" json:"remoteConv"` +} + +func (o InboxUIItemError) DeepCopy() InboxUIItemError { + return InboxUIItemError{ + Typ: o.Typ.DeepCopy(), + Message: o.Message, + UnverifiedTLFName: o.UnverifiedTLFName, + RekeyInfo: (func(x *ConversationErrorRekey) *ConversationErrorRekey { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RekeyInfo), + RemoteConv: o.RemoteConv.DeepCopy(), + } +} + +type InboxUIItems struct { + Items []InboxUIItem `codec:"items" json:"items"` + Offline bool `codec:"offline" json:"offline"` +} + +func (o InboxUIItems) DeepCopy() InboxUIItems { + return InboxUIItems{ + Items: (func(x []InboxUIItem) []InboxUIItem { + if x == nil { + return nil + } + ret := make([]InboxUIItem, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Items), + Offline: o.Offline, + } +} + +type UIChannelNameMention struct { + Name string `codec:"name" json:"name"` + ConvID ConvIDStr `codec:"convID" json:"convID"` +} + +func (o UIChannelNameMention) DeepCopy() UIChannelNameMention { + return UIChannelNameMention{ + Name: o.Name, + ConvID: o.ConvID.DeepCopy(), + } +} + +type UIAssetUrlInfo struct { + PreviewUrl string `codec:"previewUrl" json:"previewUrl"` + FullUrl string `codec:"fullUrl" json:"fullUrl"` + FullUrlCached bool `codec:"fullUrlCached" json:"fullUrlCached"` + MimeType string `codec:"mimeType" json:"mimeType"` + VideoDuration *string `codec:"videoDuration,omitempty" json:"videoDuration,omitempty"` + InlineVideoPlayable bool `codec:"inlineVideoPlayable" json:"inlineVideoPlayable"` +} + +func (o UIAssetUrlInfo) DeepCopy() UIAssetUrlInfo { + return UIAssetUrlInfo{ + PreviewUrl: o.PreviewUrl, + FullUrl: o.FullUrl, + FullUrlCached: o.FullUrlCached, + MimeType: o.MimeType, + VideoDuration: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.VideoDuration), + InlineVideoPlayable: o.InlineVideoPlayable, + } +} + +type UIPaymentInfo struct { + AccountID *stellar1.AccountID `codec:"accountID,omitempty" json:"accountID,omitempty"` + AmountDescription string `codec:"amountDescription" json:"amountDescription"` + Worth string `codec:"worth" json:"worth"` + WorthAtSendTime string `codec:"worthAtSendTime" json:"worthAtSendTime"` + Delta stellar1.BalanceDelta `codec:"delta" json:"delta"` + Note string `codec:"note" json:"note"` + PaymentID stellar1.PaymentID `codec:"paymentID" json:"paymentID"` + Status stellar1.PaymentStatus `codec:"status" json:"status"` + StatusDescription string `codec:"statusDescription" json:"statusDescription"` + StatusDetail string `codec:"statusDetail" json:"statusDetail"` + ShowCancel bool `codec:"showCancel" json:"showCancel"` + FromUsername string `codec:"fromUsername" json:"fromUsername"` + ToUsername string `codec:"toUsername" json:"toUsername"` + SourceAmount string `codec:"sourceAmount" json:"sourceAmount"` + SourceAsset stellar1.Asset `codec:"sourceAsset" json:"sourceAsset"` + IssuerDescription string `codec:"issuerDescription" json:"issuerDescription"` +} + +func (o UIPaymentInfo) DeepCopy() UIPaymentInfo { + return UIPaymentInfo{ + AccountID: (func(x *stellar1.AccountID) *stellar1.AccountID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.AccountID), + AmountDescription: o.AmountDescription, + Worth: o.Worth, + WorthAtSendTime: o.WorthAtSendTime, + Delta: o.Delta.DeepCopy(), + Note: o.Note, + PaymentID: o.PaymentID.DeepCopy(), + Status: o.Status.DeepCopy(), + StatusDescription: o.StatusDescription, + StatusDetail: o.StatusDetail, + ShowCancel: o.ShowCancel, + FromUsername: o.FromUsername, + ToUsername: o.ToUsername, + SourceAmount: o.SourceAmount, + SourceAsset: o.SourceAsset.DeepCopy(), + IssuerDescription: o.IssuerDescription, + } +} + +type UIRequestInfo struct { + Amount string `codec:"amount" json:"amount"` + AmountDescription string `codec:"amountDescription" json:"amountDescription"` + Asset *stellar1.Asset `codec:"asset,omitempty" json:"asset,omitempty"` + Currency *stellar1.OutsideCurrencyCode `codec:"currency,omitempty" json:"currency,omitempty"` + WorthAtRequestTime string `codec:"worthAtRequestTime" json:"worthAtRequestTime"` + Status stellar1.RequestStatus `codec:"status" json:"status"` +} + +func (o UIRequestInfo) DeepCopy() UIRequestInfo { + return UIRequestInfo{ + Amount: o.Amount, + AmountDescription: o.AmountDescription, + Asset: (func(x *stellar1.Asset) *stellar1.Asset { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Asset), + Currency: (func(x *stellar1.OutsideCurrencyCode) *stellar1.OutsideCurrencyCode { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Currency), + WorthAtRequestTime: o.WorthAtRequestTime, + Status: o.Status.DeepCopy(), + } +} + +type UIMessageUnfurlInfo struct { + UnfurlMessageID MessageID `codec:"unfurlMessageID" json:"unfurlMessageID"` + Url string `codec:"url" json:"url"` + Unfurl UnfurlDisplay `codec:"unfurl" json:"unfurl"` + IsCollapsed bool `codec:"isCollapsed" json:"isCollapsed"` +} + +func (o UIMessageUnfurlInfo) DeepCopy() UIMessageUnfurlInfo { + return UIMessageUnfurlInfo{ + UnfurlMessageID: o.UnfurlMessageID.DeepCopy(), + Url: o.Url, + Unfurl: o.Unfurl.DeepCopy(), + IsCollapsed: o.IsCollapsed, + } +} + +type UIMessageValid struct { + MessageID MessageID `codec:"messageID" json:"messageID"` + Ctime gregor1.Time `codec:"ctime" json:"ctime"` + OutboxID *string `codec:"outboxID,omitempty" json:"outboxID,omitempty"` + MessageBody MessageBody `codec:"messageBody" json:"messageBody"` + DecoratedTextBody *string `codec:"decoratedTextBody,omitempty" json:"decoratedTextBody,omitempty"` + BodySummary string `codec:"bodySummary" json:"bodySummary"` + SenderUsername string `codec:"senderUsername" json:"senderUsername"` + SenderDeviceName string `codec:"senderDeviceName" json:"senderDeviceName"` + SenderDeviceType string `codec:"senderDeviceType" json:"senderDeviceType"` + SenderUID gregor1.UID `codec:"senderUID" json:"senderUID"` + SenderDeviceID gregor1.DeviceID `codec:"senderDeviceID" json:"senderDeviceID"` + Superseded bool `codec:"superseded" json:"superseded"` + AssetUrlInfo *UIAssetUrlInfo `codec:"assetUrlInfo,omitempty" json:"assetUrlInfo,omitempty"` + SenderDeviceRevokedAt *gregor1.Time `codec:"senderDeviceRevokedAt,omitempty" json:"senderDeviceRevokedAt,omitempty"` + AtMentions []string `codec:"atMentions" json:"atMentions"` + ChannelMention ChannelMention `codec:"channelMention" json:"channelMention"` + ChannelNameMentions []UIChannelNameMention `codec:"channelNameMentions" json:"channelNameMentions"` + IsEphemeral bool `codec:"isEphemeral" json:"isEphemeral"` + IsEphemeralExpired bool `codec:"isEphemeralExpired" json:"isEphemeralExpired"` + ExplodedBy *string `codec:"explodedBy,omitempty" json:"explodedBy,omitempty"` + Etime gregor1.Time `codec:"etime" json:"etime"` + Reactions ReactionMap `codec:"reactions" json:"reactions"` + HasPairwiseMacs bool `codec:"hasPairwiseMacs" json:"hasPairwiseMacs"` + PaymentInfos []UIPaymentInfo `codec:"paymentInfos" json:"paymentInfos"` + RequestInfo *UIRequestInfo `codec:"requestInfo,omitempty" json:"requestInfo,omitempty"` + Unfurls []UIMessageUnfurlInfo `codec:"unfurls" json:"unfurls"` + IsCollapsed bool `codec:"isCollapsed" json:"isCollapsed"` + FlipGameID *FlipGameIDStr `codec:"flipGameID,omitempty" json:"flipGameID,omitempty"` + IsDeleteable bool `codec:"isDeleteable" json:"isDeleteable"` + IsEditable bool `codec:"isEditable" json:"isEditable"` + ReplyTo *UIMessage `codec:"replyTo,omitempty" json:"replyTo,omitempty"` + PinnedMessageID *MessageID `codec:"pinnedMessageID,omitempty" json:"pinnedMessageID,omitempty"` + BotUsername string `codec:"botUsername" json:"botUsername"` +} + +func (o UIMessageValid) DeepCopy() UIMessageValid { + return UIMessageValid{ + MessageID: o.MessageID.DeepCopy(), + Ctime: o.Ctime.DeepCopy(), + OutboxID: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.OutboxID), + MessageBody: o.MessageBody.DeepCopy(), + DecoratedTextBody: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.DecoratedTextBody), + BodySummary: o.BodySummary, + SenderUsername: o.SenderUsername, + SenderDeviceName: o.SenderDeviceName, + SenderDeviceType: o.SenderDeviceType, + SenderUID: o.SenderUID.DeepCopy(), + SenderDeviceID: o.SenderDeviceID.DeepCopy(), + Superseded: o.Superseded, + AssetUrlInfo: (func(x *UIAssetUrlInfo) *UIAssetUrlInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.AssetUrlInfo), + SenderDeviceRevokedAt: (func(x *gregor1.Time) *gregor1.Time { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.SenderDeviceRevokedAt), + AtMentions: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.AtMentions), + ChannelMention: o.ChannelMention.DeepCopy(), + ChannelNameMentions: (func(x []UIChannelNameMention) []UIChannelNameMention { + if x == nil { + return nil + } + ret := make([]UIChannelNameMention, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ChannelNameMentions), + IsEphemeral: o.IsEphemeral, + IsEphemeralExpired: o.IsEphemeralExpired, + ExplodedBy: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.ExplodedBy), + Etime: o.Etime.DeepCopy(), + Reactions: o.Reactions.DeepCopy(), + HasPairwiseMacs: o.HasPairwiseMacs, + PaymentInfos: (func(x []UIPaymentInfo) []UIPaymentInfo { + if x == nil { + return nil + } + ret := make([]UIPaymentInfo, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.PaymentInfos), + RequestInfo: (func(x *UIRequestInfo) *UIRequestInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RequestInfo), + Unfurls: (func(x []UIMessageUnfurlInfo) []UIMessageUnfurlInfo { + if x == nil { + return nil + } + ret := make([]UIMessageUnfurlInfo, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Unfurls), + IsCollapsed: o.IsCollapsed, + FlipGameID: (func(x *FlipGameIDStr) *FlipGameIDStr { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.FlipGameID), + IsDeleteable: o.IsDeleteable, + IsEditable: o.IsEditable, + ReplyTo: (func(x *UIMessage) *UIMessage { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ReplyTo), + PinnedMessageID: (func(x *MessageID) *MessageID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.PinnedMessageID), + BotUsername: o.BotUsername, + } +} + +type UIMessageOutbox struct { + State OutboxState `codec:"state" json:"state"` + OutboxID string `codec:"outboxID" json:"outboxID"` + MessageType MessageType `codec:"messageType" json:"messageType"` + Body string `codec:"body" json:"body"` + DecoratedTextBody *string `codec:"decoratedTextBody,omitempty" json:"decoratedTextBody,omitempty"` + Ctime gregor1.Time `codec:"ctime" json:"ctime"` + Ordinal float64 `codec:"ordinal" json:"ordinal"` + IsEphemeral bool `codec:"isEphemeral" json:"isEphemeral"` + FlipGameID *FlipGameIDStr `codec:"flipGameID,omitempty" json:"flipGameID,omitempty"` + ReplyTo *UIMessage `codec:"replyTo,omitempty" json:"replyTo,omitempty"` + Filename string `codec:"filename" json:"filename"` + Title string `codec:"title" json:"title"` + Preview *MakePreviewRes `codec:"preview,omitempty" json:"preview,omitempty"` +} + +func (o UIMessageOutbox) DeepCopy() UIMessageOutbox { + return UIMessageOutbox{ + State: o.State.DeepCopy(), + OutboxID: o.OutboxID, + MessageType: o.MessageType.DeepCopy(), + Body: o.Body, + DecoratedTextBody: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.DecoratedTextBody), + Ctime: o.Ctime.DeepCopy(), + Ordinal: o.Ordinal, + IsEphemeral: o.IsEphemeral, + FlipGameID: (func(x *FlipGameIDStr) *FlipGameIDStr { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.FlipGameID), + ReplyTo: (func(x *UIMessage) *UIMessage { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ReplyTo), + Filename: o.Filename, + Title: o.Title, + Preview: (func(x *MakePreviewRes) *MakePreviewRes { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Preview), + } +} + +type UIMessageJourneycard struct { + Ordinal float64 `codec:"ordinal" json:"ordinal"` + CardType JourneycardType `codec:"cardType" json:"cardType"` + HighlightMsgID MessageID `codec:"highlightMsgID" json:"highlightMsgID"` + OpenTeam bool `codec:"openTeam" json:"openTeam"` +} + +func (o UIMessageJourneycard) DeepCopy() UIMessageJourneycard { + return UIMessageJourneycard{ + Ordinal: o.Ordinal, + CardType: o.CardType.DeepCopy(), + HighlightMsgID: o.HighlightMsgID.DeepCopy(), + OpenTeam: o.OpenTeam, + } +} + +type MessageUnboxedState int + +const ( + MessageUnboxedState_VALID MessageUnboxedState = 1 + MessageUnboxedState_ERROR MessageUnboxedState = 2 + MessageUnboxedState_OUTBOX MessageUnboxedState = 3 + MessageUnboxedState_PLACEHOLDER MessageUnboxedState = 4 + MessageUnboxedState_JOURNEYCARD MessageUnboxedState = 5 +) + +func (o MessageUnboxedState) DeepCopy() MessageUnboxedState { return o } + +var MessageUnboxedStateMap = map[string]MessageUnboxedState{ + "VALID": 1, + "ERROR": 2, + "OUTBOX": 3, + "PLACEHOLDER": 4, + "JOURNEYCARD": 5, +} + +var MessageUnboxedStateRevMap = map[MessageUnboxedState]string{ + 1: "VALID", + 2: "ERROR", + 3: "OUTBOX", + 4: "PLACEHOLDER", + 5: "JOURNEYCARD", +} + +func (e MessageUnboxedState) String() string { + if v, ok := MessageUnboxedStateRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UIMessage struct { + State__ MessageUnboxedState `codec:"state" json:"state"` + Valid__ *UIMessageValid `codec:"valid,omitempty" json:"valid,omitempty"` + Error__ *MessageUnboxedError `codec:"error,omitempty" json:"error,omitempty"` + Outbox__ *UIMessageOutbox `codec:"outbox,omitempty" json:"outbox,omitempty"` + Placeholder__ *MessageUnboxedPlaceholder `codec:"placeholder,omitempty" json:"placeholder,omitempty"` + Journeycard__ *UIMessageJourneycard `codec:"journeycard,omitempty" json:"journeycard,omitempty"` +} + +func (o *UIMessage) State() (ret MessageUnboxedState, err error) { + switch o.State__ { + case MessageUnboxedState_VALID: + if o.Valid__ == nil { + err = errors.New("unexpected nil value for Valid__") + return ret, err + } + case MessageUnboxedState_ERROR: + if o.Error__ == nil { + err = errors.New("unexpected nil value for Error__") + return ret, err + } + case MessageUnboxedState_OUTBOX: + if o.Outbox__ == nil { + err = errors.New("unexpected nil value for Outbox__") + return ret, err + } + case MessageUnboxedState_PLACEHOLDER: + if o.Placeholder__ == nil { + err = errors.New("unexpected nil value for Placeholder__") + return ret, err + } + case MessageUnboxedState_JOURNEYCARD: + if o.Journeycard__ == nil { + err = errors.New("unexpected nil value for Journeycard__") + return ret, err + } + } + return o.State__, nil +} + +func (o UIMessage) Valid() (res UIMessageValid) { + if o.State__ != MessageUnboxedState_VALID { + panic("wrong case accessed") + } + if o.Valid__ == nil { + return + } + return *o.Valid__ +} + +func (o UIMessage) Error() (res MessageUnboxedError) { + if o.State__ != MessageUnboxedState_ERROR { + panic("wrong case accessed") + } + if o.Error__ == nil { + return + } + return *o.Error__ +} + +func (o UIMessage) Outbox() (res UIMessageOutbox) { + if o.State__ != MessageUnboxedState_OUTBOX { + panic("wrong case accessed") + } + if o.Outbox__ == nil { + return + } + return *o.Outbox__ +} + +func (o UIMessage) Placeholder() (res MessageUnboxedPlaceholder) { + if o.State__ != MessageUnboxedState_PLACEHOLDER { + panic("wrong case accessed") + } + if o.Placeholder__ == nil { + return + } + return *o.Placeholder__ +} + +func (o UIMessage) Journeycard() (res UIMessageJourneycard) { + if o.State__ != MessageUnboxedState_JOURNEYCARD { + panic("wrong case accessed") + } + if o.Journeycard__ == nil { + return + } + return *o.Journeycard__ +} + +func NewUIMessageWithValid(v UIMessageValid) UIMessage { + return UIMessage{ + State__: MessageUnboxedState_VALID, + Valid__: &v, + } +} + +func NewUIMessageWithError(v MessageUnboxedError) UIMessage { + return UIMessage{ + State__: MessageUnboxedState_ERROR, + Error__: &v, + } +} + +func NewUIMessageWithOutbox(v UIMessageOutbox) UIMessage { + return UIMessage{ + State__: MessageUnboxedState_OUTBOX, + Outbox__: &v, + } +} + +func NewUIMessageWithPlaceholder(v MessageUnboxedPlaceholder) UIMessage { + return UIMessage{ + State__: MessageUnboxedState_PLACEHOLDER, + Placeholder__: &v, + } +} + +func NewUIMessageWithJourneycard(v UIMessageJourneycard) UIMessage { + return UIMessage{ + State__: MessageUnboxedState_JOURNEYCARD, + Journeycard__: &v, + } +} + +func (o UIMessage) DeepCopy() UIMessage { + return UIMessage{ + State__: o.State__.DeepCopy(), + Valid__: (func(x *UIMessageValid) *UIMessageValid { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Valid__), + Error__: (func(x *MessageUnboxedError) *MessageUnboxedError { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Error__), + Outbox__: (func(x *UIMessageOutbox) *UIMessageOutbox { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Outbox__), + Placeholder__: (func(x *MessageUnboxedPlaceholder) *MessageUnboxedPlaceholder { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Placeholder__), + Journeycard__: (func(x *UIMessageJourneycard) *UIMessageJourneycard { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Journeycard__), + } +} + +type UIMessages struct { + Messages []UIMessage `codec:"messages" json:"messages"` + Pagination *UIPagination `codec:"pagination,omitempty" json:"pagination,omitempty"` +} + +func (o UIMessages) DeepCopy() UIMessages { + return UIMessages{ + Messages: (func(x []UIMessage) []UIMessage { + if x == nil { + return nil + } + ret := make([]UIMessage, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Messages), + Pagination: (func(x *UIPagination) *UIPagination { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Pagination), + } +} + +type UITeamMention struct { + InTeam bool `codec:"inTeam" json:"inTeam"` + Open bool `codec:"open" json:"open"` + Description *string `codec:"description,omitempty" json:"description,omitempty"` + NumMembers *int `codec:"numMembers,omitempty" json:"numMembers,omitempty"` + PublicAdmins []string `codec:"publicAdmins" json:"publicAdmins"` + ConvID *ConvIDStr `codec:"convID,omitempty" json:"convID,omitempty"` +} + +func (o UITeamMention) DeepCopy() UITeamMention { + return UITeamMention{ + InTeam: o.InTeam, + Open: o.Open, + Description: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Description), + NumMembers: (func(x *int) *int { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.NumMembers), + PublicAdmins: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.PublicAdmins), + ConvID: (func(x *ConvIDStr) *ConvIDStr { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ConvID), + } +} + +type UITextDecorationTyp int + +const ( + UITextDecorationTyp_PAYMENT UITextDecorationTyp = 0 + UITextDecorationTyp_ATMENTION UITextDecorationTyp = 1 + UITextDecorationTyp_CHANNELNAMEMENTION UITextDecorationTyp = 2 + UITextDecorationTyp_MAYBEMENTION UITextDecorationTyp = 3 + UITextDecorationTyp_LINK UITextDecorationTyp = 4 + UITextDecorationTyp_MAILTO UITextDecorationTyp = 5 + UITextDecorationTyp_KBFSPATH UITextDecorationTyp = 6 +) + +func (o UITextDecorationTyp) DeepCopy() UITextDecorationTyp { return o } + +var UITextDecorationTypMap = map[string]UITextDecorationTyp{ + "PAYMENT": 0, + "ATMENTION": 1, + "CHANNELNAMEMENTION": 2, + "MAYBEMENTION": 3, + "LINK": 4, + "MAILTO": 5, + "KBFSPATH": 6, +} + +var UITextDecorationTypRevMap = map[UITextDecorationTyp]string{ + 0: "PAYMENT", + 1: "ATMENTION", + 2: "CHANNELNAMEMENTION", + 3: "MAYBEMENTION", + 4: "LINK", + 5: "MAILTO", + 6: "KBFSPATH", +} + +func (e UITextDecorationTyp) String() string { + if v, ok := UITextDecorationTypRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UIMaybeMentionStatus int + +const ( + UIMaybeMentionStatus_UNKNOWN UIMaybeMentionStatus = 0 + UIMaybeMentionStatus_USER UIMaybeMentionStatus = 1 + UIMaybeMentionStatus_TEAM UIMaybeMentionStatus = 2 + UIMaybeMentionStatus_NOTHING UIMaybeMentionStatus = 3 +) + +func (o UIMaybeMentionStatus) DeepCopy() UIMaybeMentionStatus { return o } + +var UIMaybeMentionStatusMap = map[string]UIMaybeMentionStatus{ + "UNKNOWN": 0, + "USER": 1, + "TEAM": 2, + "NOTHING": 3, +} + +var UIMaybeMentionStatusRevMap = map[UIMaybeMentionStatus]string{ + 0: "UNKNOWN", + 1: "USER", + 2: "TEAM", + 3: "NOTHING", +} + +func (e UIMaybeMentionStatus) String() string { + if v, ok := UIMaybeMentionStatusRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UILinkDecoration struct { + Url string `codec:"url" json:"url"` + Punycode string `codec:"punycode" json:"punycode"` +} + +func (o UILinkDecoration) DeepCopy() UILinkDecoration { + return UILinkDecoration{ + Url: o.Url, + Punycode: o.Punycode, + } +} + +type UIMaybeMentionInfo struct { + Status__ UIMaybeMentionStatus `codec:"status" json:"status"` + Team__ *UITeamMention `codec:"team,omitempty" json:"team,omitempty"` +} + +func (o *UIMaybeMentionInfo) Status() (ret UIMaybeMentionStatus, err error) { + switch o.Status__ { + case UIMaybeMentionStatus_TEAM: + if o.Team__ == nil { + err = errors.New("unexpected nil value for Team__") + return ret, err + } + } + return o.Status__, nil +} + +func (o UIMaybeMentionInfo) Team() (res UITeamMention) { + if o.Status__ != UIMaybeMentionStatus_TEAM { + panic("wrong case accessed") + } + if o.Team__ == nil { + return + } + return *o.Team__ +} + +func NewUIMaybeMentionInfoWithUnknown() UIMaybeMentionInfo { + return UIMaybeMentionInfo{ + Status__: UIMaybeMentionStatus_UNKNOWN, + } +} + +func NewUIMaybeMentionInfoWithUser() UIMaybeMentionInfo { + return UIMaybeMentionInfo{ + Status__: UIMaybeMentionStatus_USER, + } +} + +func NewUIMaybeMentionInfoWithTeam(v UITeamMention) UIMaybeMentionInfo { + return UIMaybeMentionInfo{ + Status__: UIMaybeMentionStatus_TEAM, + Team__: &v, + } +} + +func NewUIMaybeMentionInfoWithNothing() UIMaybeMentionInfo { + return UIMaybeMentionInfo{ + Status__: UIMaybeMentionStatus_NOTHING, + } +} + +func (o UIMaybeMentionInfo) DeepCopy() UIMaybeMentionInfo { + return UIMaybeMentionInfo{ + Status__: o.Status__.DeepCopy(), + Team__: (func(x *UITeamMention) *UITeamMention { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Team__), + } +} + +type UITextDecoration struct { + Typ__ UITextDecorationTyp `codec:"typ" json:"typ"` + Payment__ *TextPayment `codec:"payment,omitempty" json:"payment,omitempty"` + Atmention__ *string `codec:"atmention,omitempty" json:"atmention,omitempty"` + Channelnamemention__ *UIChannelNameMention `codec:"channelnamemention,omitempty" json:"channelnamemention,omitempty"` + Maybemention__ *MaybeMention `codec:"maybemention,omitempty" json:"maybemention,omitempty"` + Link__ *UILinkDecoration `codec:"link,omitempty" json:"link,omitempty"` + Mailto__ *UILinkDecoration `codec:"mailto,omitempty" json:"mailto,omitempty"` + Kbfspath__ *KBFSPath `codec:"kbfspath,omitempty" json:"kbfspath,omitempty"` +} + +func (o *UITextDecoration) Typ() (ret UITextDecorationTyp, err error) { + switch o.Typ__ { + case UITextDecorationTyp_PAYMENT: + if o.Payment__ == nil { + err = errors.New("unexpected nil value for Payment__") + return ret, err + } + case UITextDecorationTyp_ATMENTION: + if o.Atmention__ == nil { + err = errors.New("unexpected nil value for Atmention__") + return ret, err + } + case UITextDecorationTyp_CHANNELNAMEMENTION: + if o.Channelnamemention__ == nil { + err = errors.New("unexpected nil value for Channelnamemention__") + return ret, err + } + case UITextDecorationTyp_MAYBEMENTION: + if o.Maybemention__ == nil { + err = errors.New("unexpected nil value for Maybemention__") + return ret, err + } + case UITextDecorationTyp_LINK: + if o.Link__ == nil { + err = errors.New("unexpected nil value for Link__") + return ret, err + } + case UITextDecorationTyp_MAILTO: + if o.Mailto__ == nil { + err = errors.New("unexpected nil value for Mailto__") + return ret, err + } + case UITextDecorationTyp_KBFSPATH: + if o.Kbfspath__ == nil { + err = errors.New("unexpected nil value for Kbfspath__") + return ret, err + } + } + return o.Typ__, nil +} + +func (o UITextDecoration) Payment() (res TextPayment) { + if o.Typ__ != UITextDecorationTyp_PAYMENT { + panic("wrong case accessed") + } + if o.Payment__ == nil { + return + } + return *o.Payment__ +} + +func (o UITextDecoration) Atmention() (res string) { + if o.Typ__ != UITextDecorationTyp_ATMENTION { + panic("wrong case accessed") + } + if o.Atmention__ == nil { + return + } + return *o.Atmention__ +} + +func (o UITextDecoration) Channelnamemention() (res UIChannelNameMention) { + if o.Typ__ != UITextDecorationTyp_CHANNELNAMEMENTION { + panic("wrong case accessed") + } + if o.Channelnamemention__ == nil { + return + } + return *o.Channelnamemention__ +} + +func (o UITextDecoration) Maybemention() (res MaybeMention) { + if o.Typ__ != UITextDecorationTyp_MAYBEMENTION { + panic("wrong case accessed") + } + if o.Maybemention__ == nil { + return + } + return *o.Maybemention__ +} + +func (o UITextDecoration) Link() (res UILinkDecoration) { + if o.Typ__ != UITextDecorationTyp_LINK { + panic("wrong case accessed") + } + if o.Link__ == nil { + return + } + return *o.Link__ +} + +func (o UITextDecoration) Mailto() (res UILinkDecoration) { + if o.Typ__ != UITextDecorationTyp_MAILTO { + panic("wrong case accessed") + } + if o.Mailto__ == nil { + return + } + return *o.Mailto__ +} + +func (o UITextDecoration) Kbfspath() (res KBFSPath) { + if o.Typ__ != UITextDecorationTyp_KBFSPATH { + panic("wrong case accessed") + } + if o.Kbfspath__ == nil { + return + } + return *o.Kbfspath__ +} + +func NewUITextDecorationWithPayment(v TextPayment) UITextDecoration { + return UITextDecoration{ + Typ__: UITextDecorationTyp_PAYMENT, + Payment__: &v, + } +} + +func NewUITextDecorationWithAtmention(v string) UITextDecoration { + return UITextDecoration{ + Typ__: UITextDecorationTyp_ATMENTION, + Atmention__: &v, + } +} + +func NewUITextDecorationWithChannelnamemention(v UIChannelNameMention) UITextDecoration { + return UITextDecoration{ + Typ__: UITextDecorationTyp_CHANNELNAMEMENTION, + Channelnamemention__: &v, + } +} + +func NewUITextDecorationWithMaybemention(v MaybeMention) UITextDecoration { + return UITextDecoration{ + Typ__: UITextDecorationTyp_MAYBEMENTION, + Maybemention__: &v, + } +} + +func NewUITextDecorationWithLink(v UILinkDecoration) UITextDecoration { + return UITextDecoration{ + Typ__: UITextDecorationTyp_LINK, + Link__: &v, + } +} + +func NewUITextDecorationWithMailto(v UILinkDecoration) UITextDecoration { + return UITextDecoration{ + Typ__: UITextDecorationTyp_MAILTO, + Mailto__: &v, + } +} + +func NewUITextDecorationWithKbfspath(v KBFSPath) UITextDecoration { + return UITextDecoration{ + Typ__: UITextDecorationTyp_KBFSPATH, + Kbfspath__: &v, + } +} + +func (o UITextDecoration) DeepCopy() UITextDecoration { + return UITextDecoration{ + Typ__: o.Typ__.DeepCopy(), + Payment__: (func(x *TextPayment) *TextPayment { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Payment__), + Atmention__: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Atmention__), + Channelnamemention__: (func(x *UIChannelNameMention) *UIChannelNameMention { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Channelnamemention__), + Maybemention__: (func(x *MaybeMention) *MaybeMention { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Maybemention__), + Link__: (func(x *UILinkDecoration) *UILinkDecoration { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Link__), + Mailto__: (func(x *UILinkDecoration) *UILinkDecoration { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Mailto__), + Kbfspath__: (func(x *KBFSPath) *KBFSPath { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Kbfspath__), + } +} + +type UIChatThreadStatusTyp int + +const ( + UIChatThreadStatusTyp_NONE UIChatThreadStatusTyp = 0 + UIChatThreadStatusTyp_SERVER UIChatThreadStatusTyp = 1 + UIChatThreadStatusTyp_VALIDATING UIChatThreadStatusTyp = 2 + UIChatThreadStatusTyp_VALIDATED UIChatThreadStatusTyp = 3 +) + +func (o UIChatThreadStatusTyp) DeepCopy() UIChatThreadStatusTyp { return o } + +var UIChatThreadStatusTypMap = map[string]UIChatThreadStatusTyp{ + "NONE": 0, + "SERVER": 1, + "VALIDATING": 2, + "VALIDATED": 3, +} + +var UIChatThreadStatusTypRevMap = map[UIChatThreadStatusTyp]string{ + 0: "NONE", + 1: "SERVER", + 2: "VALIDATING", + 3: "VALIDATED", +} + +func (e UIChatThreadStatusTyp) String() string { + if v, ok := UIChatThreadStatusTypRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UIChatThreadStatus struct { + Typ__ UIChatThreadStatusTyp `codec:"typ" json:"typ"` + Validating__ *int `codec:"validating,omitempty" json:"validating,omitempty"` +} + +func (o *UIChatThreadStatus) Typ() (ret UIChatThreadStatusTyp, err error) { + switch o.Typ__ { + case UIChatThreadStatusTyp_VALIDATING: + if o.Validating__ == nil { + err = errors.New("unexpected nil value for Validating__") + return ret, err + } + } + return o.Typ__, nil +} + +func (o UIChatThreadStatus) Validating() (res int) { + if o.Typ__ != UIChatThreadStatusTyp_VALIDATING { + panic("wrong case accessed") + } + if o.Validating__ == nil { + return + } + return *o.Validating__ +} + +func NewUIChatThreadStatusWithNone() UIChatThreadStatus { + return UIChatThreadStatus{ + Typ__: UIChatThreadStatusTyp_NONE, + } +} + +func NewUIChatThreadStatusWithServer() UIChatThreadStatus { + return UIChatThreadStatus{ + Typ__: UIChatThreadStatusTyp_SERVER, + } +} + +func NewUIChatThreadStatusWithValidating(v int) UIChatThreadStatus { + return UIChatThreadStatus{ + Typ__: UIChatThreadStatusTyp_VALIDATING, + Validating__: &v, + } +} + +func NewUIChatThreadStatusWithValidated() UIChatThreadStatus { + return UIChatThreadStatus{ + Typ__: UIChatThreadStatusTyp_VALIDATED, + } +} + +func (o UIChatThreadStatus) DeepCopy() UIChatThreadStatus { + return UIChatThreadStatus{ + Typ__: o.Typ__.DeepCopy(), + Validating__: (func(x *int) *int { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Validating__), + } +} + +type UIChatSearchConvHit struct { + ConvID ConvIDStr `codec:"convID" json:"convID"` + TeamType TeamType `codec:"teamType" json:"teamType"` + Name string `codec:"name" json:"name"` + Mtime gregor1.Time `codec:"mtime" json:"mtime"` +} + +func (o UIChatSearchConvHit) DeepCopy() UIChatSearchConvHit { + return UIChatSearchConvHit{ + ConvID: o.ConvID.DeepCopy(), + TeamType: o.TeamType.DeepCopy(), + Name: o.Name, + Mtime: o.Mtime.DeepCopy(), + } +} + +type UIChatSearchConvHits struct { + Hits []UIChatSearchConvHit `codec:"hits" json:"hits"` + UnreadMatches bool `codec:"unreadMatches" json:"unreadMatches"` +} + +func (o UIChatSearchConvHits) DeepCopy() UIChatSearchConvHits { + return UIChatSearchConvHits{ + Hits: (func(x []UIChatSearchConvHit) []UIChatSearchConvHit { + if x == nil { + return nil + } + ret := make([]UIChatSearchConvHit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Hits), + UnreadMatches: o.UnreadMatches, + } +} + +type UIChatPayment struct { + Username string `codec:"username" json:"username"` + FullName string `codec:"fullName" json:"fullName"` + XlmAmount string `codec:"xlmAmount" json:"xlmAmount"` + Error *string `codec:"error,omitempty" json:"error,omitempty"` + DisplayAmount *string `codec:"displayAmount,omitempty" json:"displayAmount,omitempty"` +} + +func (o UIChatPayment) DeepCopy() UIChatPayment { + return UIChatPayment{ + Username: o.Username, + FullName: o.FullName, + XlmAmount: o.XlmAmount, + Error: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Error), + DisplayAmount: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.DisplayAmount), + } +} + +type UIChatPaymentSummary struct { + XlmTotal string `codec:"xlmTotal" json:"xlmTotal"` + DisplayTotal string `codec:"displayTotal" json:"displayTotal"` + Payments []UIChatPayment `codec:"payments" json:"payments"` +} + +func (o UIChatPaymentSummary) DeepCopy() UIChatPaymentSummary { + return UIChatPaymentSummary{ + XlmTotal: o.XlmTotal, + DisplayTotal: o.DisplayTotal, + Payments: (func(x []UIChatPayment) []UIChatPayment { + if x == nil { + return nil + } + ret := make([]UIChatPayment, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Payments), + } +} + +type GiphySearchResult struct { + TargetUrl string `codec:"targetUrl" json:"targetUrl"` + PreviewUrl string `codec:"previewUrl" json:"previewUrl"` + PreviewWidth int `codec:"previewWidth" json:"previewWidth"` + PreviewHeight int `codec:"previewHeight" json:"previewHeight"` + PreviewIsVideo bool `codec:"previewIsVideo" json:"previewIsVideo"` +} + +func (o GiphySearchResult) DeepCopy() GiphySearchResult { + return GiphySearchResult{ + TargetUrl: o.TargetUrl, + PreviewUrl: o.PreviewUrl, + PreviewWidth: o.PreviewWidth, + PreviewHeight: o.PreviewHeight, + PreviewIsVideo: o.PreviewIsVideo, + } +} + +type GiphySearchResults struct { + Results []GiphySearchResult `codec:"results" json:"results"` + GalleryUrl string `codec:"galleryUrl" json:"galleryUrl"` +} + +func (o GiphySearchResults) DeepCopy() GiphySearchResults { + return GiphySearchResults{ + Results: (func(x []GiphySearchResult) []GiphySearchResult { + if x == nil { + return nil + } + ret := make([]GiphySearchResult, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Results), + GalleryUrl: o.GalleryUrl, + } +} + +type UICoinFlipPhase int + +const ( + UICoinFlipPhase_COMMITMENT UICoinFlipPhase = 0 + UICoinFlipPhase_REVEALS UICoinFlipPhase = 1 + UICoinFlipPhase_COMPLETE UICoinFlipPhase = 2 + UICoinFlipPhase_ERROR UICoinFlipPhase = 3 +) + +func (o UICoinFlipPhase) DeepCopy() UICoinFlipPhase { return o } + +var UICoinFlipPhaseMap = map[string]UICoinFlipPhase{ + "COMMITMENT": 0, + "REVEALS": 1, + "COMPLETE": 2, + "ERROR": 3, +} + +var UICoinFlipPhaseRevMap = map[UICoinFlipPhase]string{ + 0: "COMMITMENT", + 1: "REVEALS", + 2: "COMPLETE", + 3: "ERROR", +} + +func (e UICoinFlipPhase) String() string { + if v, ok := UICoinFlipPhaseRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UICoinFlipErrorParticipant struct { + User string `codec:"user" json:"user"` + Device string `codec:"device" json:"device"` +} + +func (o UICoinFlipErrorParticipant) DeepCopy() UICoinFlipErrorParticipant { + return UICoinFlipErrorParticipant{ + User: o.User, + Device: o.Device, + } +} + +type UICoinFlipAbsenteeError struct { + Absentees []UICoinFlipErrorParticipant `codec:"absentees" json:"absentees"` +} + +func (o UICoinFlipAbsenteeError) DeepCopy() UICoinFlipAbsenteeError { + return UICoinFlipAbsenteeError{ + Absentees: (func(x []UICoinFlipErrorParticipant) []UICoinFlipErrorParticipant { + if x == nil { + return nil + } + ret := make([]UICoinFlipErrorParticipant, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Absentees), + } +} + +type UICoinFlipErrorTyp int + +const ( + UICoinFlipErrorTyp_GENERIC UICoinFlipErrorTyp = 0 + UICoinFlipErrorTyp_ABSENTEE UICoinFlipErrorTyp = 1 + UICoinFlipErrorTyp_TIMEOUT UICoinFlipErrorTyp = 2 + UICoinFlipErrorTyp_ABORTED UICoinFlipErrorTyp = 3 + UICoinFlipErrorTyp_DUPREG UICoinFlipErrorTyp = 4 + UICoinFlipErrorTyp_DUPCOMMITCOMPLETE UICoinFlipErrorTyp = 5 + UICoinFlipErrorTyp_DUPREVEAL UICoinFlipErrorTyp = 6 + UICoinFlipErrorTyp_COMMITMISMATCH UICoinFlipErrorTyp = 7 +) + +func (o UICoinFlipErrorTyp) DeepCopy() UICoinFlipErrorTyp { return o } + +var UICoinFlipErrorTypMap = map[string]UICoinFlipErrorTyp{ + "GENERIC": 0, + "ABSENTEE": 1, + "TIMEOUT": 2, + "ABORTED": 3, + "DUPREG": 4, + "DUPCOMMITCOMPLETE": 5, + "DUPREVEAL": 6, + "COMMITMISMATCH": 7, +} + +var UICoinFlipErrorTypRevMap = map[UICoinFlipErrorTyp]string{ + 0: "GENERIC", + 1: "ABSENTEE", + 2: "TIMEOUT", + 3: "ABORTED", + 4: "DUPREG", + 5: "DUPCOMMITCOMPLETE", + 6: "DUPREVEAL", + 7: "COMMITMISMATCH", +} + +func (e UICoinFlipErrorTyp) String() string { + if v, ok := UICoinFlipErrorTypRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UICoinFlipError struct { + Typ__ UICoinFlipErrorTyp `codec:"typ" json:"typ"` + Generic__ *string `codec:"generic,omitempty" json:"generic,omitempty"` + Absentee__ *UICoinFlipAbsenteeError `codec:"absentee,omitempty" json:"absentee,omitempty"` + Dupreg__ *UICoinFlipErrorParticipant `codec:"dupreg,omitempty" json:"dupreg,omitempty"` + Dupcommitcomplete__ *UICoinFlipErrorParticipant `codec:"dupcommitcomplete,omitempty" json:"dupcommitcomplete,omitempty"` + Dupreveal__ *UICoinFlipErrorParticipant `codec:"dupreveal,omitempty" json:"dupreveal,omitempty"` + Commitmismatch__ *UICoinFlipErrorParticipant `codec:"commitmismatch,omitempty" json:"commitmismatch,omitempty"` +} + +func (o *UICoinFlipError) Typ() (ret UICoinFlipErrorTyp, err error) { + switch o.Typ__ { + case UICoinFlipErrorTyp_GENERIC: + if o.Generic__ == nil { + err = errors.New("unexpected nil value for Generic__") + return ret, err + } + case UICoinFlipErrorTyp_ABSENTEE: + if o.Absentee__ == nil { + err = errors.New("unexpected nil value for Absentee__") + return ret, err + } + case UICoinFlipErrorTyp_DUPREG: + if o.Dupreg__ == nil { + err = errors.New("unexpected nil value for Dupreg__") + return ret, err + } + case UICoinFlipErrorTyp_DUPCOMMITCOMPLETE: + if o.Dupcommitcomplete__ == nil { + err = errors.New("unexpected nil value for Dupcommitcomplete__") + return ret, err + } + case UICoinFlipErrorTyp_DUPREVEAL: + if o.Dupreveal__ == nil { + err = errors.New("unexpected nil value for Dupreveal__") + return ret, err + } + case UICoinFlipErrorTyp_COMMITMISMATCH: + if o.Commitmismatch__ == nil { + err = errors.New("unexpected nil value for Commitmismatch__") + return ret, err + } + } + return o.Typ__, nil +} + +func (o UICoinFlipError) Generic() (res string) { + if o.Typ__ != UICoinFlipErrorTyp_GENERIC { + panic("wrong case accessed") + } + if o.Generic__ == nil { + return + } + return *o.Generic__ +} + +func (o UICoinFlipError) Absentee() (res UICoinFlipAbsenteeError) { + if o.Typ__ != UICoinFlipErrorTyp_ABSENTEE { + panic("wrong case accessed") + } + if o.Absentee__ == nil { + return + } + return *o.Absentee__ +} + +func (o UICoinFlipError) Dupreg() (res UICoinFlipErrorParticipant) { + if o.Typ__ != UICoinFlipErrorTyp_DUPREG { + panic("wrong case accessed") + } + if o.Dupreg__ == nil { + return + } + return *o.Dupreg__ +} + +func (o UICoinFlipError) Dupcommitcomplete() (res UICoinFlipErrorParticipant) { + if o.Typ__ != UICoinFlipErrorTyp_DUPCOMMITCOMPLETE { + panic("wrong case accessed") + } + if o.Dupcommitcomplete__ == nil { + return + } + return *o.Dupcommitcomplete__ +} + +func (o UICoinFlipError) Dupreveal() (res UICoinFlipErrorParticipant) { + if o.Typ__ != UICoinFlipErrorTyp_DUPREVEAL { + panic("wrong case accessed") + } + if o.Dupreveal__ == nil { + return + } + return *o.Dupreveal__ +} + +func (o UICoinFlipError) Commitmismatch() (res UICoinFlipErrorParticipant) { + if o.Typ__ != UICoinFlipErrorTyp_COMMITMISMATCH { + panic("wrong case accessed") + } + if o.Commitmismatch__ == nil { + return + } + return *o.Commitmismatch__ +} + +func NewUICoinFlipErrorWithGeneric(v string) UICoinFlipError { + return UICoinFlipError{ + Typ__: UICoinFlipErrorTyp_GENERIC, + Generic__: &v, + } +} + +func NewUICoinFlipErrorWithAbsentee(v UICoinFlipAbsenteeError) UICoinFlipError { + return UICoinFlipError{ + Typ__: UICoinFlipErrorTyp_ABSENTEE, + Absentee__: &v, + } +} + +func NewUICoinFlipErrorWithTimeout() UICoinFlipError { + return UICoinFlipError{ + Typ__: UICoinFlipErrorTyp_TIMEOUT, + } +} + +func NewUICoinFlipErrorWithAborted() UICoinFlipError { + return UICoinFlipError{ + Typ__: UICoinFlipErrorTyp_ABORTED, + } +} + +func NewUICoinFlipErrorWithDupreg(v UICoinFlipErrorParticipant) UICoinFlipError { + return UICoinFlipError{ + Typ__: UICoinFlipErrorTyp_DUPREG, + Dupreg__: &v, + } +} + +func NewUICoinFlipErrorWithDupcommitcomplete(v UICoinFlipErrorParticipant) UICoinFlipError { + return UICoinFlipError{ + Typ__: UICoinFlipErrorTyp_DUPCOMMITCOMPLETE, + Dupcommitcomplete__: &v, + } +} + +func NewUICoinFlipErrorWithDupreveal(v UICoinFlipErrorParticipant) UICoinFlipError { + return UICoinFlipError{ + Typ__: UICoinFlipErrorTyp_DUPREVEAL, + Dupreveal__: &v, + } +} + +func NewUICoinFlipErrorWithCommitmismatch(v UICoinFlipErrorParticipant) UICoinFlipError { + return UICoinFlipError{ + Typ__: UICoinFlipErrorTyp_COMMITMISMATCH, + Commitmismatch__: &v, + } +} + +func (o UICoinFlipError) DeepCopy() UICoinFlipError { + return UICoinFlipError{ + Typ__: o.Typ__.DeepCopy(), + Generic__: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Generic__), + Absentee__: (func(x *UICoinFlipAbsenteeError) *UICoinFlipAbsenteeError { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Absentee__), + Dupreg__: (func(x *UICoinFlipErrorParticipant) *UICoinFlipErrorParticipant { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Dupreg__), + Dupcommitcomplete__: (func(x *UICoinFlipErrorParticipant) *UICoinFlipErrorParticipant { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Dupcommitcomplete__), + Dupreveal__: (func(x *UICoinFlipErrorParticipant) *UICoinFlipErrorParticipant { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Dupreveal__), + Commitmismatch__: (func(x *UICoinFlipErrorParticipant) *UICoinFlipErrorParticipant { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Commitmismatch__), + } +} + +type UICoinFlipResultTyp int + +const ( + UICoinFlipResultTyp_NUMBER UICoinFlipResultTyp = 0 + UICoinFlipResultTyp_SHUFFLE UICoinFlipResultTyp = 1 + UICoinFlipResultTyp_DECK UICoinFlipResultTyp = 2 + UICoinFlipResultTyp_HANDS UICoinFlipResultTyp = 3 + UICoinFlipResultTyp_COIN UICoinFlipResultTyp = 4 +) + +func (o UICoinFlipResultTyp) DeepCopy() UICoinFlipResultTyp { return o } + +var UICoinFlipResultTypMap = map[string]UICoinFlipResultTyp{ + "NUMBER": 0, + "SHUFFLE": 1, + "DECK": 2, + "HANDS": 3, + "COIN": 4, +} + +var UICoinFlipResultTypRevMap = map[UICoinFlipResultTyp]string{ + 0: "NUMBER", + 1: "SHUFFLE", + 2: "DECK", + 3: "HANDS", + 4: "COIN", +} + +func (e UICoinFlipResultTyp) String() string { + if v, ok := UICoinFlipResultTypRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UICoinFlipHand struct { + Target string `codec:"target" json:"target"` + Hand []int `codec:"hand" json:"hand"` +} + +func (o UICoinFlipHand) DeepCopy() UICoinFlipHand { + return UICoinFlipHand{ + Target: o.Target, + Hand: (func(x []int) []int { + if x == nil { + return nil + } + ret := make([]int, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Hand), + } +} + +type UICoinFlipResult struct { + Typ__ UICoinFlipResultTyp `codec:"typ" json:"typ"` + Number__ *string `codec:"number,omitempty" json:"number,omitempty"` + Shuffle__ *[]string `codec:"shuffle,omitempty" json:"shuffle,omitempty"` + Deck__ *[]int `codec:"deck,omitempty" json:"deck,omitempty"` + Hands__ *[]UICoinFlipHand `codec:"hands,omitempty" json:"hands,omitempty"` + Coin__ *bool `codec:"coin,omitempty" json:"coin,omitempty"` +} + +func (o *UICoinFlipResult) Typ() (ret UICoinFlipResultTyp, err error) { + switch o.Typ__ { + case UICoinFlipResultTyp_NUMBER: + if o.Number__ == nil { + err = errors.New("unexpected nil value for Number__") + return ret, err + } + case UICoinFlipResultTyp_SHUFFLE: + if o.Shuffle__ == nil { + err = errors.New("unexpected nil value for Shuffle__") + return ret, err + } + case UICoinFlipResultTyp_DECK: + if o.Deck__ == nil { + err = errors.New("unexpected nil value for Deck__") + return ret, err + } + case UICoinFlipResultTyp_HANDS: + if o.Hands__ == nil { + err = errors.New("unexpected nil value for Hands__") + return ret, err + } + case UICoinFlipResultTyp_COIN: + if o.Coin__ == nil { + err = errors.New("unexpected nil value for Coin__") + return ret, err + } + } + return o.Typ__, nil +} + +func (o UICoinFlipResult) Number() (res string) { + if o.Typ__ != UICoinFlipResultTyp_NUMBER { + panic("wrong case accessed") + } + if o.Number__ == nil { + return + } + return *o.Number__ +} + +func (o UICoinFlipResult) Shuffle() (res []string) { + if o.Typ__ != UICoinFlipResultTyp_SHUFFLE { + panic("wrong case accessed") + } + if o.Shuffle__ == nil { + return + } + return *o.Shuffle__ +} + +func (o UICoinFlipResult) Deck() (res []int) { + if o.Typ__ != UICoinFlipResultTyp_DECK { + panic("wrong case accessed") + } + if o.Deck__ == nil { + return + } + return *o.Deck__ +} + +func (o UICoinFlipResult) Hands() (res []UICoinFlipHand) { + if o.Typ__ != UICoinFlipResultTyp_HANDS { + panic("wrong case accessed") + } + if o.Hands__ == nil { + return + } + return *o.Hands__ +} + +func (o UICoinFlipResult) Coin() (res bool) { + if o.Typ__ != UICoinFlipResultTyp_COIN { + panic("wrong case accessed") + } + if o.Coin__ == nil { + return + } + return *o.Coin__ +} + +func NewUICoinFlipResultWithNumber(v string) UICoinFlipResult { + return UICoinFlipResult{ + Typ__: UICoinFlipResultTyp_NUMBER, + Number__: &v, + } +} + +func NewUICoinFlipResultWithShuffle(v []string) UICoinFlipResult { + return UICoinFlipResult{ + Typ__: UICoinFlipResultTyp_SHUFFLE, + Shuffle__: &v, + } +} + +func NewUICoinFlipResultWithDeck(v []int) UICoinFlipResult { + return UICoinFlipResult{ + Typ__: UICoinFlipResultTyp_DECK, + Deck__: &v, + } +} + +func NewUICoinFlipResultWithHands(v []UICoinFlipHand) UICoinFlipResult { + return UICoinFlipResult{ + Typ__: UICoinFlipResultTyp_HANDS, + Hands__: &v, + } +} + +func NewUICoinFlipResultWithCoin(v bool) UICoinFlipResult { + return UICoinFlipResult{ + Typ__: UICoinFlipResultTyp_COIN, + Coin__: &v, + } +} + +func (o UICoinFlipResult) DeepCopy() UICoinFlipResult { + return UICoinFlipResult{ + Typ__: o.Typ__.DeepCopy(), + Number__: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Number__), + Shuffle__: (func(x *[]string) *[]string { + if x == nil { + return nil + } + tmp := (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })((*x)) + return &tmp + })(o.Shuffle__), + Deck__: (func(x *[]int) *[]int { + if x == nil { + return nil + } + tmp := (func(x []int) []int { + if x == nil { + return nil + } + ret := make([]int, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })((*x)) + return &tmp + })(o.Deck__), + Hands__: (func(x *[]UICoinFlipHand) *[]UICoinFlipHand { + if x == nil { + return nil + } + tmp := (func(x []UICoinFlipHand) []UICoinFlipHand { + if x == nil { + return nil + } + ret := make([]UICoinFlipHand, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })((*x)) + return &tmp + })(o.Hands__), + Coin__: (func(x *bool) *bool { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Coin__), + } +} + +type UICoinFlipParticipant struct { + Uid string `codec:"uid" json:"uid"` + DeviceID string `codec:"deviceID" json:"deviceID"` + Username string `codec:"username" json:"username"` + DeviceName string `codec:"deviceName" json:"deviceName"` + Commitment string `codec:"commitment" json:"commitment"` + Reveal *string `codec:"reveal,omitempty" json:"reveal,omitempty"` +} + +func (o UICoinFlipParticipant) DeepCopy() UICoinFlipParticipant { + return UICoinFlipParticipant{ + Uid: o.Uid, + DeviceID: o.DeviceID, + Username: o.Username, + DeviceName: o.DeviceName, + Commitment: o.Commitment, + Reveal: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Reveal), + } +} + +type UICoinFlipStatus struct { + GameID FlipGameIDStr `codec:"gameID" json:"gameID"` + Phase UICoinFlipPhase `codec:"phase" json:"phase"` + ProgressText string `codec:"progressText" json:"progressText"` + ResultText string `codec:"resultText" json:"resultText"` + CommitmentVisualization string `codec:"commitmentVisualization" json:"commitmentVisualization"` + RevealVisualization string `codec:"revealVisualization" json:"revealVisualization"` + Participants []UICoinFlipParticipant `codec:"participants" json:"participants"` + ErrorInfo *UICoinFlipError `codec:"errorInfo,omitempty" json:"errorInfo,omitempty"` + ResultInfo *UICoinFlipResult `codec:"resultInfo,omitempty" json:"resultInfo,omitempty"` +} + +func (o UICoinFlipStatus) DeepCopy() UICoinFlipStatus { + return UICoinFlipStatus{ + GameID: o.GameID.DeepCopy(), + Phase: o.Phase.DeepCopy(), + ProgressText: o.ProgressText, + ResultText: o.ResultText, + CommitmentVisualization: o.CommitmentVisualization, + RevealVisualization: o.RevealVisualization, + Participants: (func(x []UICoinFlipParticipant) []UICoinFlipParticipant { + if x == nil { + return nil + } + ret := make([]UICoinFlipParticipant, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Participants), + ErrorInfo: (func(x *UICoinFlipError) *UICoinFlipError { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ErrorInfo), + ResultInfo: (func(x *UICoinFlipResult) *UICoinFlipResult { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ResultInfo), + } +} + +type UICommandMarkdown struct { + Body string `codec:"body" json:"body"` + Title *string `codec:"title,omitempty" json:"title,omitempty"` +} + +func (o UICommandMarkdown) DeepCopy() UICommandMarkdown { + return UICommandMarkdown{ + Body: o.Body, + Title: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Title), + } +} + +type LocationWatchID uint64 + +func (o LocationWatchID) DeepCopy() LocationWatchID { + return o +} + +type UIWatchPositionPerm int + +const ( + UIWatchPositionPerm_BASE UIWatchPositionPerm = 0 + UIWatchPositionPerm_ALWAYS UIWatchPositionPerm = 1 +) + +func (o UIWatchPositionPerm) DeepCopy() UIWatchPositionPerm { return o } + +var UIWatchPositionPermMap = map[string]UIWatchPositionPerm{ + "BASE": 0, + "ALWAYS": 1, +} + +var UIWatchPositionPermRevMap = map[UIWatchPositionPerm]string{ + 0: "BASE", + 1: "ALWAYS", +} + +func (e UIWatchPositionPerm) String() string { + if v, ok := UIWatchPositionPermRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UICommandStatusDisplayTyp int + +const ( + UICommandStatusDisplayTyp_STATUS UICommandStatusDisplayTyp = 0 + UICommandStatusDisplayTyp_WARNING UICommandStatusDisplayTyp = 1 + UICommandStatusDisplayTyp_ERROR UICommandStatusDisplayTyp = 2 +) + +func (o UICommandStatusDisplayTyp) DeepCopy() UICommandStatusDisplayTyp { return o } + +var UICommandStatusDisplayTypMap = map[string]UICommandStatusDisplayTyp{ + "STATUS": 0, + "WARNING": 1, + "ERROR": 2, +} + +var UICommandStatusDisplayTypRevMap = map[UICommandStatusDisplayTyp]string{ + 0: "STATUS", + 1: "WARNING", + 2: "ERROR", +} + +func (e UICommandStatusDisplayTyp) String() string { + if v, ok := UICommandStatusDisplayTypRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UICommandStatusActionTyp int + +const ( + UICommandStatusActionTyp_APPSETTINGS UICommandStatusActionTyp = 0 +) + +func (o UICommandStatusActionTyp) DeepCopy() UICommandStatusActionTyp { return o } + +var UICommandStatusActionTypMap = map[string]UICommandStatusActionTyp{ + "APPSETTINGS": 0, +} + +var UICommandStatusActionTypRevMap = map[UICommandStatusActionTyp]string{ + 0: "APPSETTINGS", +} + +func (e UICommandStatusActionTyp) String() string { + if v, ok := UICommandStatusActionTypRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UIBotCommandsUpdateStatusTyp int + +const ( + UIBotCommandsUpdateStatusTyp_UPTODATE UIBotCommandsUpdateStatusTyp = 0 + UIBotCommandsUpdateStatusTyp_UPDATING UIBotCommandsUpdateStatusTyp = 1 + UIBotCommandsUpdateStatusTyp_FAILED UIBotCommandsUpdateStatusTyp = 2 + UIBotCommandsUpdateStatusTyp_BLANK UIBotCommandsUpdateStatusTyp = 3 +) + +func (o UIBotCommandsUpdateStatusTyp) DeepCopy() UIBotCommandsUpdateStatusTyp { return o } + +var UIBotCommandsUpdateStatusTypMap = map[string]UIBotCommandsUpdateStatusTyp{ + "UPTODATE": 0, + "UPDATING": 1, + "FAILED": 2, + "BLANK": 3, +} + +var UIBotCommandsUpdateStatusTypRevMap = map[UIBotCommandsUpdateStatusTyp]string{ + 0: "UPTODATE", + 1: "UPDATING", + 2: "FAILED", + 3: "BLANK", +} + +func (e UIBotCommandsUpdateStatusTyp) String() string { + if v, ok := UIBotCommandsUpdateStatusTypRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UIBotCommandsUpdateSettings struct { + Settings map[string]keybase1.TeamBotSettings `codec:"settings" json:"settings"` +} + +func (o UIBotCommandsUpdateSettings) DeepCopy() UIBotCommandsUpdateSettings { + return UIBotCommandsUpdateSettings{ + Settings: (func(x map[string]keybase1.TeamBotSettings) map[string]keybase1.TeamBotSettings { + if x == nil { + return nil + } + ret := make(map[string]keybase1.TeamBotSettings, len(x)) + for k, v := range x { + kCopy := k + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.Settings), + } +} + +type UIBotCommandsUpdateStatus struct { + Typ__ UIBotCommandsUpdateStatusTyp `codec:"typ" json:"typ"` + Uptodate__ *UIBotCommandsUpdateSettings `codec:"uptodate,omitempty" json:"uptodate,omitempty"` +} + +func (o *UIBotCommandsUpdateStatus) Typ() (ret UIBotCommandsUpdateStatusTyp, err error) { + switch o.Typ__ { + case UIBotCommandsUpdateStatusTyp_UPTODATE: + if o.Uptodate__ == nil { + err = errors.New("unexpected nil value for Uptodate__") + return ret, err + } + } + return o.Typ__, nil +} + +func (o UIBotCommandsUpdateStatus) Uptodate() (res UIBotCommandsUpdateSettings) { + if o.Typ__ != UIBotCommandsUpdateStatusTyp_UPTODATE { + panic("wrong case accessed") + } + if o.Uptodate__ == nil { + return + } + return *o.Uptodate__ +} + +func NewUIBotCommandsUpdateStatusWithUptodate(v UIBotCommandsUpdateSettings) UIBotCommandsUpdateStatus { + return UIBotCommandsUpdateStatus{ + Typ__: UIBotCommandsUpdateStatusTyp_UPTODATE, + Uptodate__: &v, + } +} + +func NewUIBotCommandsUpdateStatusWithUpdating() UIBotCommandsUpdateStatus { + return UIBotCommandsUpdateStatus{ + Typ__: UIBotCommandsUpdateStatusTyp_UPDATING, + } +} + +func NewUIBotCommandsUpdateStatusWithFailed() UIBotCommandsUpdateStatus { + return UIBotCommandsUpdateStatus{ + Typ__: UIBotCommandsUpdateStatusTyp_FAILED, + } +} + +func NewUIBotCommandsUpdateStatusWithBlank() UIBotCommandsUpdateStatus { + return UIBotCommandsUpdateStatus{ + Typ__: UIBotCommandsUpdateStatusTyp_BLANK, + } +} + +func (o UIBotCommandsUpdateStatus) DeepCopy() UIBotCommandsUpdateStatus { + return UIBotCommandsUpdateStatus{ + Typ__: o.Typ__.DeepCopy(), + Uptodate__: (func(x *UIBotCommandsUpdateSettings) *UIBotCommandsUpdateSettings { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Uptodate__), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/commands.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/commands.go new file mode 100644 index 00000000..f6d4d556 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/commands.go @@ -0,0 +1,199 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/chat1/commands.avdl + +package chat1 + +import ( + "errors" + "fmt" +) + +type ConversationCommand struct { + Description string `codec:"description" json:"description"` + Name string `codec:"name" json:"name"` + Usage string `codec:"usage" json:"usage"` + HasHelpText bool `codec:"hasHelpText" json:"hasHelpText"` + Username *string `codec:"username,omitempty" json:"username,omitempty"` +} + +func (o ConversationCommand) DeepCopy() ConversationCommand { + return ConversationCommand{ + Description: o.Description, + Name: o.Name, + Usage: o.Usage, + HasHelpText: o.HasHelpText, + Username: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Username), + } +} + +type ConversationCommandGroupsTyp int + +const ( + ConversationCommandGroupsTyp_BUILTIN ConversationCommandGroupsTyp = 0 + ConversationCommandGroupsTyp_CUSTOM ConversationCommandGroupsTyp = 1 + ConversationCommandGroupsTyp_NONE ConversationCommandGroupsTyp = 2 +) + +func (o ConversationCommandGroupsTyp) DeepCopy() ConversationCommandGroupsTyp { return o } + +var ConversationCommandGroupsTypMap = map[string]ConversationCommandGroupsTyp{ + "BUILTIN": 0, + "CUSTOM": 1, + "NONE": 2, +} + +var ConversationCommandGroupsTypRevMap = map[ConversationCommandGroupsTyp]string{ + 0: "BUILTIN", + 1: "CUSTOM", + 2: "NONE", +} + +func (e ConversationCommandGroupsTyp) String() string { + if v, ok := ConversationCommandGroupsTypRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ConversationBuiltinCommandTyp int + +const ( + ConversationBuiltinCommandTyp_NONE ConversationBuiltinCommandTyp = 0 + ConversationBuiltinCommandTyp_ADHOC ConversationBuiltinCommandTyp = 1 + ConversationBuiltinCommandTyp_SMALLTEAM ConversationBuiltinCommandTyp = 2 + ConversationBuiltinCommandTyp_BIGTEAM ConversationBuiltinCommandTyp = 3 + ConversationBuiltinCommandTyp_BIGTEAMGENERAL ConversationBuiltinCommandTyp = 4 +) + +func (o ConversationBuiltinCommandTyp) DeepCopy() ConversationBuiltinCommandTyp { return o } + +var ConversationBuiltinCommandTypMap = map[string]ConversationBuiltinCommandTyp{ + "NONE": 0, + "ADHOC": 1, + "SMALLTEAM": 2, + "BIGTEAM": 3, + "BIGTEAMGENERAL": 4, +} + +var ConversationBuiltinCommandTypRevMap = map[ConversationBuiltinCommandTyp]string{ + 0: "NONE", + 1: "ADHOC", + 2: "SMALLTEAM", + 3: "BIGTEAM", + 4: "BIGTEAMGENERAL", +} + +func (e ConversationBuiltinCommandTyp) String() string { + if v, ok := ConversationBuiltinCommandTypRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ConversationCommandGroupsCustom struct { + Commands []ConversationCommand `codec:"commands" json:"commands"` +} + +func (o ConversationCommandGroupsCustom) DeepCopy() ConversationCommandGroupsCustom { + return ConversationCommandGroupsCustom{ + Commands: (func(x []ConversationCommand) []ConversationCommand { + if x == nil { + return nil + } + ret := make([]ConversationCommand, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Commands), + } +} + +type ConversationCommandGroups struct { + Typ__ ConversationCommandGroupsTyp `codec:"typ" json:"typ"` + Builtin__ *ConversationBuiltinCommandTyp `codec:"builtin,omitempty" json:"builtin,omitempty"` + Custom__ *ConversationCommandGroupsCustom `codec:"custom,omitempty" json:"custom,omitempty"` +} + +func (o *ConversationCommandGroups) Typ() (ret ConversationCommandGroupsTyp, err error) { + switch o.Typ__ { + case ConversationCommandGroupsTyp_BUILTIN: + if o.Builtin__ == nil { + err = errors.New("unexpected nil value for Builtin__") + return ret, err + } + case ConversationCommandGroupsTyp_CUSTOM: + if o.Custom__ == nil { + err = errors.New("unexpected nil value for Custom__") + return ret, err + } + } + return o.Typ__, nil +} + +func (o ConversationCommandGroups) Builtin() (res ConversationBuiltinCommandTyp) { + if o.Typ__ != ConversationCommandGroupsTyp_BUILTIN { + panic("wrong case accessed") + } + if o.Builtin__ == nil { + return + } + return *o.Builtin__ +} + +func (o ConversationCommandGroups) Custom() (res ConversationCommandGroupsCustom) { + if o.Typ__ != ConversationCommandGroupsTyp_CUSTOM { + panic("wrong case accessed") + } + if o.Custom__ == nil { + return + } + return *o.Custom__ +} + +func NewConversationCommandGroupsWithBuiltin(v ConversationBuiltinCommandTyp) ConversationCommandGroups { + return ConversationCommandGroups{ + Typ__: ConversationCommandGroupsTyp_BUILTIN, + Builtin__: &v, + } +} + +func NewConversationCommandGroupsWithCustom(v ConversationCommandGroupsCustom) ConversationCommandGroups { + return ConversationCommandGroups{ + Typ__: ConversationCommandGroupsTyp_CUSTOM, + Custom__: &v, + } +} + +func NewConversationCommandGroupsWithNone() ConversationCommandGroups { + return ConversationCommandGroups{ + Typ__: ConversationCommandGroupsTyp_NONE, + } +} + +func (o ConversationCommandGroups) DeepCopy() ConversationCommandGroups { + return ConversationCommandGroups{ + Typ__: o.Typ__.DeepCopy(), + Builtin__: (func(x *ConversationBuiltinCommandTyp) *ConversationBuiltinCommandTyp { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Builtin__), + Custom__: (func(x *ConversationCommandGroupsCustom) *ConversationCommandGroupsCustom { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Custom__), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/common.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/common.go new file mode 100644 index 00000000..60eff96d --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/common.go @@ -0,0 +1,2473 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/chat1/common.avdl + +package chat1 + +import ( + "errors" + "fmt" + + gregor1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1" + keybase1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1" +) + +type ThreadID []byte + +func (o ThreadID) DeepCopy() ThreadID { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type MessageID uint + +func (o MessageID) DeepCopy() MessageID { + return o +} + +type TLFConvOrdinal uint + +func (o TLFConvOrdinal) DeepCopy() TLFConvOrdinal { + return o +} + +type TopicID []byte + +func (o TopicID) DeepCopy() TopicID { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type ConversationID []byte + +func (o ConversationID) DeepCopy() ConversationID { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type TLFID []byte + +func (o TLFID) DeepCopy() TLFID { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type Hash []byte + +func (o Hash) DeepCopy() Hash { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type InboxVers uint64 + +func (o InboxVers) DeepCopy() InboxVers { + return o +} + +type LocalConversationVers uint64 + +func (o LocalConversationVers) DeepCopy() LocalConversationVers { + return o +} + +type ConversationVers uint64 + +func (o ConversationVers) DeepCopy() ConversationVers { + return o +} + +type OutboxID []byte + +func (o OutboxID) DeepCopy() OutboxID { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type TopicNameState []byte + +func (o TopicNameState) DeepCopy() TopicNameState { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type FlipGameID []byte + +func (o FlipGameID) DeepCopy() FlipGameID { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type InboxVersInfo struct { + Uid gregor1.UID `codec:"uid" json:"uid"` + Vers InboxVers `codec:"vers" json:"vers"` +} + +func (o InboxVersInfo) DeepCopy() InboxVersInfo { + return InboxVersInfo{ + Uid: o.Uid.DeepCopy(), + Vers: o.Vers.DeepCopy(), + } +} + +type ConversationExistence int + +const ( + ConversationExistence_ACTIVE ConversationExistence = 0 + ConversationExistence_ARCHIVED ConversationExistence = 1 + ConversationExistence_DELETED ConversationExistence = 2 + ConversationExistence_ABANDONED ConversationExistence = 3 +) + +func (o ConversationExistence) DeepCopy() ConversationExistence { return o } + +var ConversationExistenceMap = map[string]ConversationExistence{ + "ACTIVE": 0, + "ARCHIVED": 1, + "DELETED": 2, + "ABANDONED": 3, +} + +var ConversationExistenceRevMap = map[ConversationExistence]string{ + 0: "ACTIVE", + 1: "ARCHIVED", + 2: "DELETED", + 3: "ABANDONED", +} + +func (e ConversationExistence) String() string { + if v, ok := ConversationExistenceRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ConversationMembersType int + +const ( + ConversationMembersType_KBFS ConversationMembersType = 0 + ConversationMembersType_TEAM ConversationMembersType = 1 + ConversationMembersType_IMPTEAMNATIVE ConversationMembersType = 2 + ConversationMembersType_IMPTEAMUPGRADE ConversationMembersType = 3 +) + +func (o ConversationMembersType) DeepCopy() ConversationMembersType { return o } + +var ConversationMembersTypeMap = map[string]ConversationMembersType{ + "KBFS": 0, + "TEAM": 1, + "IMPTEAMNATIVE": 2, + "IMPTEAMUPGRADE": 3, +} + +var ConversationMembersTypeRevMap = map[ConversationMembersType]string{ + 0: "KBFS", + 1: "TEAM", + 2: "IMPTEAMNATIVE", + 3: "IMPTEAMUPGRADE", +} + +func (e ConversationMembersType) String() string { + if v, ok := ConversationMembersTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type SyncInboxResType int + +const ( + SyncInboxResType_CURRENT SyncInboxResType = 0 + SyncInboxResType_INCREMENTAL SyncInboxResType = 1 + SyncInboxResType_CLEAR SyncInboxResType = 2 +) + +func (o SyncInboxResType) DeepCopy() SyncInboxResType { return o } + +var SyncInboxResTypeMap = map[string]SyncInboxResType{ + "CURRENT": 0, + "INCREMENTAL": 1, + "CLEAR": 2, +} + +var SyncInboxResTypeRevMap = map[SyncInboxResType]string{ + 0: "CURRENT", + 1: "INCREMENTAL", + 2: "CLEAR", +} + +func (e SyncInboxResType) String() string { + if v, ok := SyncInboxResTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type MessageType int + +const ( + MessageType_NONE MessageType = 0 + MessageType_TEXT MessageType = 1 + MessageType_ATTACHMENT MessageType = 2 + MessageType_EDIT MessageType = 3 + MessageType_DELETE MessageType = 4 + MessageType_METADATA MessageType = 5 + MessageType_TLFNAME MessageType = 6 + MessageType_HEADLINE MessageType = 7 + MessageType_ATTACHMENTUPLOADED MessageType = 8 + MessageType_JOIN MessageType = 9 + MessageType_LEAVE MessageType = 10 + MessageType_SYSTEM MessageType = 11 + MessageType_DELETEHISTORY MessageType = 12 + MessageType_REACTION MessageType = 13 + MessageType_SENDPAYMENT MessageType = 14 + MessageType_REQUESTPAYMENT MessageType = 15 + MessageType_UNFURL MessageType = 16 + MessageType_FLIP MessageType = 17 + MessageType_PIN MessageType = 18 +) + +func (o MessageType) DeepCopy() MessageType { return o } + +var MessageTypeMap = map[string]MessageType{ + "NONE": 0, + "TEXT": 1, + "ATTACHMENT": 2, + "EDIT": 3, + "DELETE": 4, + "METADATA": 5, + "TLFNAME": 6, + "HEADLINE": 7, + "ATTACHMENTUPLOADED": 8, + "JOIN": 9, + "LEAVE": 10, + "SYSTEM": 11, + "DELETEHISTORY": 12, + "REACTION": 13, + "SENDPAYMENT": 14, + "REQUESTPAYMENT": 15, + "UNFURL": 16, + "FLIP": 17, + "PIN": 18, +} + +var MessageTypeRevMap = map[MessageType]string{ + 0: "NONE", + 1: "TEXT", + 2: "ATTACHMENT", + 3: "EDIT", + 4: "DELETE", + 5: "METADATA", + 6: "TLFNAME", + 7: "HEADLINE", + 8: "ATTACHMENTUPLOADED", + 9: "JOIN", + 10: "LEAVE", + 11: "SYSTEM", + 12: "DELETEHISTORY", + 13: "REACTION", + 14: "SENDPAYMENT", + 15: "REQUESTPAYMENT", + 16: "UNFURL", + 17: "FLIP", + 18: "PIN", +} + +type TopicType int + +const ( + TopicType_NONE TopicType = 0 + TopicType_CHAT TopicType = 1 + TopicType_DEV TopicType = 2 + TopicType_KBFSFILEEDIT TopicType = 3 +) + +func (o TopicType) DeepCopy() TopicType { return o } + +var TopicTypeMap = map[string]TopicType{ + "NONE": 0, + "CHAT": 1, + "DEV": 2, + "KBFSFILEEDIT": 3, +} + +var TopicTypeRevMap = map[TopicType]string{ + 0: "NONE", + 1: "CHAT", + 2: "DEV", + 3: "KBFSFILEEDIT", +} + +type TeamType int + +const ( + TeamType_NONE TeamType = 0 + TeamType_SIMPLE TeamType = 1 + TeamType_COMPLEX TeamType = 2 +) + +func (o TeamType) DeepCopy() TeamType { return o } + +var TeamTypeMap = map[string]TeamType{ + "NONE": 0, + "SIMPLE": 1, + "COMPLEX": 2, +} + +var TeamTypeRevMap = map[TeamType]string{ + 0: "NONE", + 1: "SIMPLE", + 2: "COMPLEX", +} + +func (e TeamType) String() string { + if v, ok := TeamTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type NotificationKind int + +const ( + NotificationKind_GENERIC NotificationKind = 0 + NotificationKind_ATMENTION NotificationKind = 1 +) + +func (o NotificationKind) DeepCopy() NotificationKind { return o } + +var NotificationKindMap = map[string]NotificationKind{ + "GENERIC": 0, + "ATMENTION": 1, +} + +var NotificationKindRevMap = map[NotificationKind]string{ + 0: "GENERIC", + 1: "ATMENTION", +} + +type GlobalAppNotificationSetting int + +const ( + GlobalAppNotificationSetting_NEWMESSAGES GlobalAppNotificationSetting = 0 + GlobalAppNotificationSetting_PLAINTEXTMOBILE GlobalAppNotificationSetting = 1 + GlobalAppNotificationSetting_PLAINTEXTDESKTOP GlobalAppNotificationSetting = 2 + GlobalAppNotificationSetting_DEFAULTSOUNDMOBILE GlobalAppNotificationSetting = 3 + GlobalAppNotificationSetting_DISABLETYPING GlobalAppNotificationSetting = 4 +) + +func (o GlobalAppNotificationSetting) DeepCopy() GlobalAppNotificationSetting { return o } + +var GlobalAppNotificationSettingMap = map[string]GlobalAppNotificationSetting{ + "NEWMESSAGES": 0, + "PLAINTEXTMOBILE": 1, + "PLAINTEXTDESKTOP": 2, + "DEFAULTSOUNDMOBILE": 3, + "DISABLETYPING": 4, +} + +var GlobalAppNotificationSettingRevMap = map[GlobalAppNotificationSetting]string{ + 0: "NEWMESSAGES", + 1: "PLAINTEXTMOBILE", + 2: "PLAINTEXTDESKTOP", + 3: "DEFAULTSOUNDMOBILE", + 4: "DISABLETYPING", +} + +func (e GlobalAppNotificationSetting) String() string { + if v, ok := GlobalAppNotificationSettingRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type GlobalAppNotificationSettings struct { + Settings map[GlobalAppNotificationSetting]bool `codec:"settings" json:"settings"` +} + +func (o GlobalAppNotificationSettings) DeepCopy() GlobalAppNotificationSettings { + return GlobalAppNotificationSettings{ + Settings: (func(x map[GlobalAppNotificationSetting]bool) map[GlobalAppNotificationSetting]bool { + if x == nil { + return nil + } + ret := make(map[GlobalAppNotificationSetting]bool, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v + ret[kCopy] = vCopy + } + return ret + })(o.Settings), + } +} + +type ConversationStatus int + +const ( + ConversationStatus_UNFILED ConversationStatus = 0 + ConversationStatus_FAVORITE ConversationStatus = 1 + ConversationStatus_IGNORED ConversationStatus = 2 + ConversationStatus_BLOCKED ConversationStatus = 3 + ConversationStatus_MUTED ConversationStatus = 4 + ConversationStatus_REPORTED ConversationStatus = 5 +) + +func (o ConversationStatus) DeepCopy() ConversationStatus { return o } + +var ConversationStatusMap = map[string]ConversationStatus{ + "UNFILED": 0, + "FAVORITE": 1, + "IGNORED": 2, + "BLOCKED": 3, + "MUTED": 4, + "REPORTED": 5, +} + +var ConversationStatusRevMap = map[ConversationStatus]string{ + 0: "UNFILED", + 1: "FAVORITE", + 2: "IGNORED", + 3: "BLOCKED", + 4: "MUTED", + 5: "REPORTED", +} + +func (e ConversationStatus) String() string { + if v, ok := ConversationStatusRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ConversationMember struct { + Uid gregor1.UID `codec:"uid" json:"uid"` + ConvID ConversationID `codec:"convID" json:"convID"` + TopicType TopicType `codec:"topicType" json:"topicType"` +} + +func (o ConversationMember) DeepCopy() ConversationMember { + return ConversationMember{ + Uid: o.Uid.DeepCopy(), + ConvID: o.ConvID.DeepCopy(), + TopicType: o.TopicType.DeepCopy(), + } +} + +type ConversationIDMessageIDPair struct { + ConvID ConversationID `codec:"convID" json:"convID"` + MsgID MessageID `codec:"msgID" json:"msgID"` +} + +func (o ConversationIDMessageIDPair) DeepCopy() ConversationIDMessageIDPair { + return ConversationIDMessageIDPair{ + ConvID: o.ConvID.DeepCopy(), + MsgID: o.MsgID.DeepCopy(), + } +} + +type ConversationIDMessageIDPairs struct { + Pairs []ConversationIDMessageIDPair `codec:"pairs" json:"pairs"` +} + +func (o ConversationIDMessageIDPairs) DeepCopy() ConversationIDMessageIDPairs { + return ConversationIDMessageIDPairs{ + Pairs: (func(x []ConversationIDMessageIDPair) []ConversationIDMessageIDPair { + if x == nil { + return nil + } + ret := make([]ConversationIDMessageIDPair, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Pairs), + } +} + +type ChannelNameMention struct { + ConvID ConversationID `codec:"convID" json:"convID"` + TopicName string `codec:"topicName" json:"topicName"` +} + +func (o ChannelNameMention) DeepCopy() ChannelNameMention { + return ChannelNameMention{ + ConvID: o.ConvID.DeepCopy(), + TopicName: o.TopicName, + } +} + +type KBFSPath struct { + StartIndex int `codec:"startIndex" json:"startIndex"` + RawPath string `codec:"rawPath" json:"rawPath"` + StandardPath string `codec:"standardPath" json:"standardPath"` + PathInfo keybase1.KBFSPathInfo `codec:"pathInfo" json:"pathInfo"` +} + +func (o KBFSPath) DeepCopy() KBFSPath { + return KBFSPath{ + StartIndex: o.StartIndex, + RawPath: o.RawPath, + StandardPath: o.StandardPath, + PathInfo: o.PathInfo.DeepCopy(), + } +} + +type ConversationMemberStatus int + +const ( + ConversationMemberStatus_ACTIVE ConversationMemberStatus = 0 + ConversationMemberStatus_REMOVED ConversationMemberStatus = 1 + ConversationMemberStatus_LEFT ConversationMemberStatus = 2 + ConversationMemberStatus_PREVIEW ConversationMemberStatus = 3 + ConversationMemberStatus_RESET ConversationMemberStatus = 4 + ConversationMemberStatus_NEVER_JOINED ConversationMemberStatus = 5 +) + +func (o ConversationMemberStatus) DeepCopy() ConversationMemberStatus { return o } + +var ConversationMemberStatusMap = map[string]ConversationMemberStatus{ + "ACTIVE": 0, + "REMOVED": 1, + "LEFT": 2, + "PREVIEW": 3, + "RESET": 4, + "NEVER_JOINED": 5, +} + +var ConversationMemberStatusRevMap = map[ConversationMemberStatus]string{ + 0: "ACTIVE", + 1: "REMOVED", + 2: "LEFT", + 3: "PREVIEW", + 4: "RESET", + 5: "NEVER_JOINED", +} + +func (e ConversationMemberStatus) String() string { + if v, ok := ConversationMemberStatusRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type Pagination struct { + Next []byte `codec:"next,omitempty" json:"next,omitempty"` + Previous []byte `codec:"previous,omitempty" json:"previous,omitempty"` + Num int `codec:"num" json:"num"` + Last bool `codec:"last,omitempty" json:"last,omitempty"` + ForceFirstPage bool `codec:"forceFirstPage,omitempty" json:"forceFirstPage,omitempty"` +} + +func (o Pagination) DeepCopy() Pagination { + return Pagination{ + Next: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.Next), + Previous: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.Previous), + Num: o.Num, + Last: o.Last, + ForceFirstPage: o.ForceFirstPage, + } +} + +type RateLimit struct { + Name string `codec:"name" json:"name"` + CallsRemaining int `codec:"callsRemaining" json:"callsRemaining"` + WindowReset int `codec:"windowReset" json:"windowReset"` + MaxCalls int `codec:"maxCalls" json:"maxCalls"` +} + +func (o RateLimit) DeepCopy() RateLimit { + return RateLimit{ + Name: o.Name, + CallsRemaining: o.CallsRemaining, + WindowReset: o.WindowReset, + MaxCalls: o.MaxCalls, + } +} + +type GetInboxQuery struct { + ConvID *ConversationID `codec:"convID,omitempty" json:"convID,omitempty"` + TopicType *TopicType `codec:"topicType,omitempty" json:"topicType,omitempty"` + TlfID *TLFID `codec:"tlfID,omitempty" json:"tlfID,omitempty"` + TlfVisibility *keybase1.TLFVisibility `codec:"tlfVisibility,omitempty" json:"tlfVisibility,omitempty"` + Before *gregor1.Time `codec:"before,omitempty" json:"before,omitempty"` + After *gregor1.Time `codec:"after,omitempty" json:"after,omitempty"` + OneChatTypePerTLF *bool `codec:"oneChatTypePerTLF,omitempty" json:"oneChatTypePerTLF,omitempty"` + TopicName *string `codec:"topicName,omitempty" json:"topicName,omitempty"` + Status []ConversationStatus `codec:"status" json:"status"` + MemberStatus []ConversationMemberStatus `codec:"memberStatus" json:"memberStatus"` + Existences []ConversationExistence `codec:"existences" json:"existences"` + MembersTypes []ConversationMembersType `codec:"membersTypes" json:"membersTypes"` + ConvIDs []ConversationID `codec:"convIDs" json:"convIDs"` + UnreadOnly bool `codec:"unreadOnly" json:"unreadOnly"` + ReadOnly bool `codec:"readOnly" json:"readOnly"` + ComputeActiveList bool `codec:"computeActiveList" json:"computeActiveList"` + SummarizeMaxMsgs bool `codec:"summarizeMaxMsgs" json:"summarizeMaxMsgs"` + SkipBgLoads bool `codec:"skipBgLoads" json:"skipBgLoads"` + AllowUnseenQuery bool `codec:"allowUnseenQuery" json:"allowUnseenQuery"` +} + +func (o GetInboxQuery) DeepCopy() GetInboxQuery { + return GetInboxQuery{ + ConvID: (func(x *ConversationID) *ConversationID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ConvID), + TopicType: (func(x *TopicType) *TopicType { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.TopicType), + TlfID: (func(x *TLFID) *TLFID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.TlfID), + TlfVisibility: (func(x *keybase1.TLFVisibility) *keybase1.TLFVisibility { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.TlfVisibility), + Before: (func(x *gregor1.Time) *gregor1.Time { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Before), + After: (func(x *gregor1.Time) *gregor1.Time { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.After), + OneChatTypePerTLF: (func(x *bool) *bool { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.OneChatTypePerTLF), + TopicName: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.TopicName), + Status: (func(x []ConversationStatus) []ConversationStatus { + if x == nil { + return nil + } + ret := make([]ConversationStatus, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Status), + MemberStatus: (func(x []ConversationMemberStatus) []ConversationMemberStatus { + if x == nil { + return nil + } + ret := make([]ConversationMemberStatus, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.MemberStatus), + Existences: (func(x []ConversationExistence) []ConversationExistence { + if x == nil { + return nil + } + ret := make([]ConversationExistence, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Existences), + MembersTypes: (func(x []ConversationMembersType) []ConversationMembersType { + if x == nil { + return nil + } + ret := make([]ConversationMembersType, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.MembersTypes), + ConvIDs: (func(x []ConversationID) []ConversationID { + if x == nil { + return nil + } + ret := make([]ConversationID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ConvIDs), + UnreadOnly: o.UnreadOnly, + ReadOnly: o.ReadOnly, + ComputeActiveList: o.ComputeActiveList, + SummarizeMaxMsgs: o.SummarizeMaxMsgs, + SkipBgLoads: o.SkipBgLoads, + AllowUnseenQuery: o.AllowUnseenQuery, + } +} + +type ConversationIDTriple struct { + Tlfid TLFID `codec:"tlfid" json:"tlfid"` + TopicType TopicType `codec:"topicType" json:"topicType"` + TopicID TopicID `codec:"topicID" json:"topicID"` +} + +func (o ConversationIDTriple) DeepCopy() ConversationIDTriple { + return ConversationIDTriple{ + Tlfid: o.Tlfid.DeepCopy(), + TopicType: o.TopicType.DeepCopy(), + TopicID: o.TopicID.DeepCopy(), + } +} + +type ConversationFinalizeInfo struct { + ResetUser string `codec:"resetUser" json:"resetUser"` + ResetDate string `codec:"resetDate" json:"resetDate"` + ResetFull string `codec:"resetFull" json:"resetFull"` + ResetTimestamp gregor1.Time `codec:"resetTimestamp" json:"resetTimestamp"` +} + +func (o ConversationFinalizeInfo) DeepCopy() ConversationFinalizeInfo { + return ConversationFinalizeInfo{ + ResetUser: o.ResetUser, + ResetDate: o.ResetDate, + ResetFull: o.ResetFull, + ResetTimestamp: o.ResetTimestamp.DeepCopy(), + } +} + +type ConversationResolveInfo struct { + NewTLFName string `codec:"newTLFName" json:"newTLFName"` +} + +func (o ConversationResolveInfo) DeepCopy() ConversationResolveInfo { + return ConversationResolveInfo{ + NewTLFName: o.NewTLFName, + } +} + +type Expunge struct { + Upto MessageID `codec:"upto" json:"upto"` + Basis MessageID `codec:"basis" json:"basis"` +} + +func (o Expunge) DeepCopy() Expunge { + return Expunge{ + Upto: o.Upto.DeepCopy(), + Basis: o.Basis.DeepCopy(), + } +} + +type ConversationMetadata struct { + IdTriple ConversationIDTriple `codec:"idTriple" json:"idTriple"` + ConversationID ConversationID `codec:"conversationID" json:"conversationID"` + Visibility keybase1.TLFVisibility `codec:"visibility" json:"visibility"` + Status ConversationStatus `codec:"status" json:"status"` + MembersType ConversationMembersType `codec:"membersType" json:"membersType"` + TeamType TeamType `codec:"teamType" json:"teamType"` + Existence ConversationExistence `codec:"existence" json:"existence"` + Version ConversationVers `codec:"version" json:"version"` + LocalVersion LocalConversationVers `codec:"localVersion" json:"localVersion"` + FinalizeInfo *ConversationFinalizeInfo `codec:"finalizeInfo,omitempty" json:"finalizeInfo,omitempty"` + Supersedes []ConversationMetadata `codec:"supersedes" json:"supersedes"` + SupersededBy []ConversationMetadata `codec:"supersededBy" json:"supersededBy"` + ActiveList []gregor1.UID `codec:"activeList" json:"activeList"` + AllList []gregor1.UID `codec:"allList" json:"allList"` + ResetList []gregor1.UID `codec:"resetList" json:"resetList"` + IsDefaultConv bool `codec:"d" json:"isDefaultConv"` +} + +func (o ConversationMetadata) DeepCopy() ConversationMetadata { + return ConversationMetadata{ + IdTriple: o.IdTriple.DeepCopy(), + ConversationID: o.ConversationID.DeepCopy(), + Visibility: o.Visibility.DeepCopy(), + Status: o.Status.DeepCopy(), + MembersType: o.MembersType.DeepCopy(), + TeamType: o.TeamType.DeepCopy(), + Existence: o.Existence.DeepCopy(), + Version: o.Version.DeepCopy(), + LocalVersion: o.LocalVersion.DeepCopy(), + FinalizeInfo: (func(x *ConversationFinalizeInfo) *ConversationFinalizeInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.FinalizeInfo), + Supersedes: (func(x []ConversationMetadata) []ConversationMetadata { + if x == nil { + return nil + } + ret := make([]ConversationMetadata, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Supersedes), + SupersededBy: (func(x []ConversationMetadata) []ConversationMetadata { + if x == nil { + return nil + } + ret := make([]ConversationMetadata, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.SupersededBy), + ActiveList: (func(x []gregor1.UID) []gregor1.UID { + if x == nil { + return nil + } + ret := make([]gregor1.UID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ActiveList), + AllList: (func(x []gregor1.UID) []gregor1.UID { + if x == nil { + return nil + } + ret := make([]gregor1.UID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.AllList), + ResetList: (func(x []gregor1.UID) []gregor1.UID { + if x == nil { + return nil + } + ret := make([]gregor1.UID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ResetList), + IsDefaultConv: o.IsDefaultConv, + } +} + +type ConversationNotificationInfo struct { + ChannelWide bool `codec:"channelWide" json:"channelWide"` + Settings map[keybase1.DeviceType]map[NotificationKind]bool `codec:"settings" json:"settings"` +} + +func (o ConversationNotificationInfo) DeepCopy() ConversationNotificationInfo { + return ConversationNotificationInfo{ + ChannelWide: o.ChannelWide, + Settings: (func(x map[keybase1.DeviceType]map[NotificationKind]bool) map[keybase1.DeviceType]map[NotificationKind]bool { + if x == nil { + return nil + } + ret := make(map[keybase1.DeviceType]map[NotificationKind]bool, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := (func(x map[NotificationKind]bool) map[NotificationKind]bool { + if x == nil { + return nil + } + ret := make(map[NotificationKind]bool, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v + ret[kCopy] = vCopy + } + return ret + })(v) + ret[kCopy] = vCopy + } + return ret + })(o.Settings), + } +} + +type ConversationReaderInfo struct { + Mtime gregor1.Time `codec:"mtime" json:"mtime"` + ReadMsgid MessageID `codec:"readMsgid" json:"readMsgid"` + MaxMsgid MessageID `codec:"maxMsgid" json:"maxMsgid"` + Status ConversationMemberStatus `codec:"status" json:"status"` + UntrustedTeamRole keybase1.TeamRole `codec:"untrustedTeamRole" json:"untrustedTeamRole"` + Journeycard *ConversationJourneycardInfo `codec:"jc,omitempty" json:"jc,omitempty"` +} + +func (o ConversationReaderInfo) DeepCopy() ConversationReaderInfo { + return ConversationReaderInfo{ + Mtime: o.Mtime.DeepCopy(), + ReadMsgid: o.ReadMsgid.DeepCopy(), + MaxMsgid: o.MaxMsgid.DeepCopy(), + Status: o.Status.DeepCopy(), + UntrustedTeamRole: o.UntrustedTeamRole.DeepCopy(), + Journeycard: (func(x *ConversationJourneycardInfo) *ConversationJourneycardInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Journeycard), + } +} + +type ConversationJourneycardInfo struct { + WelcomeEligible bool `codec:"w" json:"w"` +} + +func (o ConversationJourneycardInfo) DeepCopy() ConversationJourneycardInfo { + return ConversationJourneycardInfo{ + WelcomeEligible: o.WelcomeEligible, + } +} + +type ConversationCreatorInfo struct { + Ctime gregor1.Time `codec:"ctime" json:"ctime"` + Uid gregor1.UID `codec:"uid" json:"uid"` +} + +func (o ConversationCreatorInfo) DeepCopy() ConversationCreatorInfo { + return ConversationCreatorInfo{ + Ctime: o.Ctime.DeepCopy(), + Uid: o.Uid.DeepCopy(), + } +} + +type ConversationCreatorInfoLocal struct { + Ctime gregor1.Time `codec:"ctime" json:"ctime"` + Username string `codec:"username" json:"username"` +} + +func (o ConversationCreatorInfoLocal) DeepCopy() ConversationCreatorInfoLocal { + return ConversationCreatorInfoLocal{ + Ctime: o.Ctime.DeepCopy(), + Username: o.Username, + } +} + +type ConversationMinWriterRoleInfo struct { + Uid gregor1.UID `codec:"uid" json:"uid"` + Role keybase1.TeamRole `codec:"role" json:"role"` +} + +func (o ConversationMinWriterRoleInfo) DeepCopy() ConversationMinWriterRoleInfo { + return ConversationMinWriterRoleInfo{ + Uid: o.Uid.DeepCopy(), + Role: o.Role.DeepCopy(), + } +} + +type ConversationSettings struct { + MinWriterRoleInfo *ConversationMinWriterRoleInfo `codec:"mwr,omitempty" json:"mwr,omitempty"` +} + +func (o ConversationSettings) DeepCopy() ConversationSettings { + return ConversationSettings{ + MinWriterRoleInfo: (func(x *ConversationMinWriterRoleInfo) *ConversationMinWriterRoleInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.MinWriterRoleInfo), + } +} + +type Conversation struct { + Metadata ConversationMetadata `codec:"metadata" json:"metadata"` + ReaderInfo *ConversationReaderInfo `codec:"readerInfo,omitempty" json:"readerInfo,omitempty"` + Notifications *ConversationNotificationInfo `codec:"notifications,omitempty" json:"notifications,omitempty"` + MaxMsgs []MessageBoxed `codec:"maxMsgs" json:"maxMsgs"` + MaxMsgSummaries []MessageSummary `codec:"maxMsgSummaries" json:"maxMsgSummaries"` + CreatorInfo *ConversationCreatorInfo `codec:"creatorInfo,omitempty" json:"creatorInfo,omitempty"` + PinnedMsg *MessageID `codec:"pinnedMsg,omitempty" json:"pinnedMsg,omitempty"` + Expunge Expunge `codec:"expunge" json:"expunge"` + ConvRetention *RetentionPolicy `codec:"convRetention,omitempty" json:"convRetention,omitempty"` + TeamRetention *RetentionPolicy `codec:"teamRetention,omitempty" json:"teamRetention,omitempty"` + ConvSettings *ConversationSettings `codec:"cs,omitempty" json:"cs,omitempty"` +} + +func (o Conversation) DeepCopy() Conversation { + return Conversation{ + Metadata: o.Metadata.DeepCopy(), + ReaderInfo: (func(x *ConversationReaderInfo) *ConversationReaderInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ReaderInfo), + Notifications: (func(x *ConversationNotificationInfo) *ConversationNotificationInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Notifications), + MaxMsgs: (func(x []MessageBoxed) []MessageBoxed { + if x == nil { + return nil + } + ret := make([]MessageBoxed, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.MaxMsgs), + MaxMsgSummaries: (func(x []MessageSummary) []MessageSummary { + if x == nil { + return nil + } + ret := make([]MessageSummary, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.MaxMsgSummaries), + CreatorInfo: (func(x *ConversationCreatorInfo) *ConversationCreatorInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.CreatorInfo), + PinnedMsg: (func(x *MessageID) *MessageID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.PinnedMsg), + Expunge: o.Expunge.DeepCopy(), + ConvRetention: (func(x *RetentionPolicy) *RetentionPolicy { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ConvRetention), + TeamRetention: (func(x *RetentionPolicy) *RetentionPolicy { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.TeamRetention), + ConvSettings: (func(x *ConversationSettings) *ConversationSettings { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ConvSettings), + } +} + +type MessageSummary struct { + MsgID MessageID `codec:"msgID" json:"msgID"` + MessageType MessageType `codec:"messageType" json:"messageType"` + TlfName string `codec:"tlfName" json:"tlfName"` + TlfPublic bool `codec:"tlfPublic" json:"tlfPublic"` + Ctime gregor1.Time `codec:"ctime" json:"ctime"` +} + +func (o MessageSummary) DeepCopy() MessageSummary { + return MessageSummary{ + MsgID: o.MsgID.DeepCopy(), + MessageType: o.MessageType.DeepCopy(), + TlfName: o.TlfName, + TlfPublic: o.TlfPublic, + Ctime: o.Ctime.DeepCopy(), + } +} + +type Reaction struct { + Ctime gregor1.Time `codec:"ctime" json:"ctime"` + ReactionMsgID MessageID `codec:"reactionMsgID" json:"reactionMsgID"` +} + +func (o Reaction) DeepCopy() Reaction { + return Reaction{ + Ctime: o.Ctime.DeepCopy(), + ReactionMsgID: o.ReactionMsgID.DeepCopy(), + } +} + +type ReactionMap struct { + Reactions map[string]map[string]Reaction `codec:"reactions" json:"reactions"` +} + +func (o ReactionMap) DeepCopy() ReactionMap { + return ReactionMap{ + Reactions: (func(x map[string]map[string]Reaction) map[string]map[string]Reaction { + if x == nil { + return nil + } + ret := make(map[string]map[string]Reaction, len(x)) + for k, v := range x { + kCopy := k + vCopy := (func(x map[string]Reaction) map[string]Reaction { + if x == nil { + return nil + } + ret := make(map[string]Reaction, len(x)) + for k, v := range x { + kCopy := k + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(v) + ret[kCopy] = vCopy + } + return ret + })(o.Reactions), + } +} + +type MessageServerHeader struct { + MessageID MessageID `codec:"messageID" json:"messageID"` + SupersededBy MessageID `codec:"supersededBy" json:"supersededBy"` + ReactionIDs []MessageID `codec:"r" json:"r"` + UnfurlIDs []MessageID `codec:"u" json:"u"` + Replies []MessageID `codec:"replies" json:"replies"` + Ctime gregor1.Time `codec:"ctime" json:"ctime"` + Now gregor1.Time `codec:"n" json:"n"` + Rtime *gregor1.Time `codec:"rt,omitempty" json:"rt,omitempty"` +} + +func (o MessageServerHeader) DeepCopy() MessageServerHeader { + return MessageServerHeader{ + MessageID: o.MessageID.DeepCopy(), + SupersededBy: o.SupersededBy.DeepCopy(), + ReactionIDs: (func(x []MessageID) []MessageID { + if x == nil { + return nil + } + ret := make([]MessageID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ReactionIDs), + UnfurlIDs: (func(x []MessageID) []MessageID { + if x == nil { + return nil + } + ret := make([]MessageID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.UnfurlIDs), + Replies: (func(x []MessageID) []MessageID { + if x == nil { + return nil + } + ret := make([]MessageID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Replies), + Ctime: o.Ctime.DeepCopy(), + Now: o.Now.DeepCopy(), + Rtime: (func(x *gregor1.Time) *gregor1.Time { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Rtime), + } +} + +type MessagePreviousPointer struct { + Id MessageID `codec:"id" json:"id"` + Hash Hash `codec:"hash" json:"hash"` +} + +func (o MessagePreviousPointer) DeepCopy() MessagePreviousPointer { + return MessagePreviousPointer{ + Id: o.Id.DeepCopy(), + Hash: o.Hash.DeepCopy(), + } +} + +type OutboxInfo struct { + Prev MessageID `codec:"prev" json:"prev"` + ComposeTime gregor1.Time `codec:"composeTime" json:"composeTime"` +} + +func (o OutboxInfo) DeepCopy() OutboxInfo { + return OutboxInfo{ + Prev: o.Prev.DeepCopy(), + ComposeTime: o.ComposeTime.DeepCopy(), + } +} + +type MsgEphemeralMetadata struct { + Lifetime gregor1.DurationSec `codec:"l" json:"l"` + Generation keybase1.EkGeneration `codec:"g" json:"g"` + ExplodedBy *string `codec:"u,omitempty" json:"u,omitempty"` +} + +func (o MsgEphemeralMetadata) DeepCopy() MsgEphemeralMetadata { + return MsgEphemeralMetadata{ + Lifetime: o.Lifetime.DeepCopy(), + Generation: o.Generation.DeepCopy(), + ExplodedBy: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.ExplodedBy), + } +} + +type EphemeralPurgeInfo struct { + ConvID ConversationID `codec:"c" json:"c"` + IsActive bool `codec:"a" json:"a"` + NextPurgeTime gregor1.Time `codec:"n" json:"n"` + MinUnexplodedID MessageID `codec:"e" json:"e"` +} + +func (o EphemeralPurgeInfo) DeepCopy() EphemeralPurgeInfo { + return EphemeralPurgeInfo{ + ConvID: o.ConvID.DeepCopy(), + IsActive: o.IsActive, + NextPurgeTime: o.NextPurgeTime.DeepCopy(), + MinUnexplodedID: o.MinUnexplodedID.DeepCopy(), + } +} + +type MessageClientHeader struct { + Conv ConversationIDTriple `codec:"conv" json:"conv"` + TlfName string `codec:"tlfName" json:"tlfName"` + TlfPublic bool `codec:"tlfPublic" json:"tlfPublic"` + MessageType MessageType `codec:"messageType" json:"messageType"` + Supersedes MessageID `codec:"supersedes" json:"supersedes"` + KbfsCryptKeysUsed *bool `codec:"kbfsCryptKeysUsed,omitempty" json:"kbfsCryptKeysUsed,omitempty"` + Deletes []MessageID `codec:"deletes" json:"deletes"` + Prev []MessagePreviousPointer `codec:"prev" json:"prev"` + DeleteHistory *MessageDeleteHistory `codec:"deleteHistory,omitempty" json:"deleteHistory,omitempty"` + Sender gregor1.UID `codec:"sender" json:"sender"` + SenderDevice gregor1.DeviceID `codec:"senderDevice" json:"senderDevice"` + MerkleRoot *MerkleRoot `codec:"merkleRoot,omitempty" json:"merkleRoot,omitempty"` + OutboxID *OutboxID `codec:"outboxID,omitempty" json:"outboxID,omitempty"` + OutboxInfo *OutboxInfo `codec:"outboxInfo,omitempty" json:"outboxInfo,omitempty"` + EphemeralMetadata *MsgEphemeralMetadata `codec:"em,omitempty" json:"em,omitempty"` + PairwiseMacs map[keybase1.KID][]byte `codec:"pm" json:"pm"` + BotUID *gregor1.UID `codec:"b,omitempty" json:"b,omitempty"` +} + +func (o MessageClientHeader) DeepCopy() MessageClientHeader { + return MessageClientHeader{ + Conv: o.Conv.DeepCopy(), + TlfName: o.TlfName, + TlfPublic: o.TlfPublic, + MessageType: o.MessageType.DeepCopy(), + Supersedes: o.Supersedes.DeepCopy(), + KbfsCryptKeysUsed: (func(x *bool) *bool { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.KbfsCryptKeysUsed), + Deletes: (func(x []MessageID) []MessageID { + if x == nil { + return nil + } + ret := make([]MessageID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Deletes), + Prev: (func(x []MessagePreviousPointer) []MessagePreviousPointer { + if x == nil { + return nil + } + ret := make([]MessagePreviousPointer, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Prev), + DeleteHistory: (func(x *MessageDeleteHistory) *MessageDeleteHistory { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.DeleteHistory), + Sender: o.Sender.DeepCopy(), + SenderDevice: o.SenderDevice.DeepCopy(), + MerkleRoot: (func(x *MerkleRoot) *MerkleRoot { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.MerkleRoot), + OutboxID: (func(x *OutboxID) *OutboxID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.OutboxID), + OutboxInfo: (func(x *OutboxInfo) *OutboxInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.OutboxInfo), + EphemeralMetadata: (func(x *MsgEphemeralMetadata) *MsgEphemeralMetadata { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.EphemeralMetadata), + PairwiseMacs: (func(x map[keybase1.KID][]byte) map[keybase1.KID][]byte { + if x == nil { + return nil + } + ret := make(map[keybase1.KID][]byte, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(v) + ret[kCopy] = vCopy + } + return ret + })(o.PairwiseMacs), + BotUID: (func(x *gregor1.UID) *gregor1.UID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.BotUID), + } +} + +type MessageClientHeaderVerified struct { + Conv ConversationIDTriple `codec:"conv" json:"conv"` + TlfName string `codec:"tlfName" json:"tlfName"` + TlfPublic bool `codec:"tlfPublic" json:"tlfPublic"` + MessageType MessageType `codec:"messageType" json:"messageType"` + Prev []MessagePreviousPointer `codec:"prev" json:"prev"` + Sender gregor1.UID `codec:"sender" json:"sender"` + SenderDevice gregor1.DeviceID `codec:"senderDevice" json:"senderDevice"` + KbfsCryptKeysUsed *bool `codec:"kbfsCryptKeysUsed,omitempty" json:"kbfsCryptKeysUsed,omitempty"` + MerkleRoot *MerkleRoot `codec:"merkleRoot,omitempty" json:"merkleRoot,omitempty"` + OutboxID *OutboxID `codec:"outboxID,omitempty" json:"outboxID,omitempty"` + OutboxInfo *OutboxInfo `codec:"outboxInfo,omitempty" json:"outboxInfo,omitempty"` + EphemeralMetadata *MsgEphemeralMetadata `codec:"em,omitempty" json:"em,omitempty"` + Rtime gregor1.Time `codec:"rt" json:"rt"` + HasPairwiseMacs bool `codec:"pm" json:"pm"` + BotUID *gregor1.UID `codec:"b,omitempty" json:"b,omitempty"` +} + +func (o MessageClientHeaderVerified) DeepCopy() MessageClientHeaderVerified { + return MessageClientHeaderVerified{ + Conv: o.Conv.DeepCopy(), + TlfName: o.TlfName, + TlfPublic: o.TlfPublic, + MessageType: o.MessageType.DeepCopy(), + Prev: (func(x []MessagePreviousPointer) []MessagePreviousPointer { + if x == nil { + return nil + } + ret := make([]MessagePreviousPointer, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Prev), + Sender: o.Sender.DeepCopy(), + SenderDevice: o.SenderDevice.DeepCopy(), + KbfsCryptKeysUsed: (func(x *bool) *bool { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.KbfsCryptKeysUsed), + MerkleRoot: (func(x *MerkleRoot) *MerkleRoot { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.MerkleRoot), + OutboxID: (func(x *OutboxID) *OutboxID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.OutboxID), + OutboxInfo: (func(x *OutboxInfo) *OutboxInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.OutboxInfo), + EphemeralMetadata: (func(x *MsgEphemeralMetadata) *MsgEphemeralMetadata { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.EphemeralMetadata), + Rtime: o.Rtime.DeepCopy(), + HasPairwiseMacs: o.HasPairwiseMacs, + BotUID: (func(x *gregor1.UID) *gregor1.UID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.BotUID), + } +} + +type EncryptedData struct { + V int `codec:"v" json:"v"` + E []byte `codec:"e" json:"e"` + N []byte `codec:"n" json:"n"` +} + +func (o EncryptedData) DeepCopy() EncryptedData { + return EncryptedData{ + V: o.V, + E: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.E), + N: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.N), + } +} + +type SignEncryptedData struct { + V int `codec:"v" json:"v"` + E []byte `codec:"e" json:"e"` + N []byte `codec:"n" json:"n"` +} + +func (o SignEncryptedData) DeepCopy() SignEncryptedData { + return SignEncryptedData{ + V: o.V, + E: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.E), + N: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.N), + } +} + +type SealedData struct { + V int `codec:"v" json:"v"` + E []byte `codec:"e" json:"e"` + N []byte `codec:"n" json:"n"` +} + +func (o SealedData) DeepCopy() SealedData { + return SealedData{ + V: o.V, + E: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.E), + N: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.N), + } +} + +type SignatureInfo struct { + V int `codec:"v" json:"v"` + S []byte `codec:"s" json:"s"` + K []byte `codec:"k" json:"k"` +} + +func (o SignatureInfo) DeepCopy() SignatureInfo { + return SignatureInfo{ + V: o.V, + S: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.S), + K: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.K), + } +} + +type MerkleRoot struct { + Seqno int64 `codec:"seqno" json:"seqno"` + Hash []byte `codec:"hash" json:"hash"` +} + +func (o MerkleRoot) DeepCopy() MerkleRoot { + return MerkleRoot{ + Seqno: o.Seqno, + Hash: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.Hash), + } +} + +type InboxResType int + +const ( + InboxResType_VERSIONHIT InboxResType = 0 + InboxResType_FULL InboxResType = 1 +) + +func (o InboxResType) DeepCopy() InboxResType { return o } + +var InboxResTypeMap = map[string]InboxResType{ + "VERSIONHIT": 0, + "FULL": 1, +} + +var InboxResTypeRevMap = map[InboxResType]string{ + 0: "VERSIONHIT", + 1: "FULL", +} + +func (e InboxResType) String() string { + if v, ok := InboxResTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type InboxViewFull struct { + Vers InboxVers `codec:"vers" json:"vers"` + Conversations []Conversation `codec:"conversations" json:"conversations"` + Pagination *Pagination `codec:"pagination,omitempty" json:"pagination,omitempty"` +} + +func (o InboxViewFull) DeepCopy() InboxViewFull { + return InboxViewFull{ + Vers: o.Vers.DeepCopy(), + Conversations: (func(x []Conversation) []Conversation { + if x == nil { + return nil + } + ret := make([]Conversation, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Conversations), + Pagination: (func(x *Pagination) *Pagination { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Pagination), + } +} + +type InboxView struct { + Rtype__ InboxResType `codec:"rtype" json:"rtype"` + Full__ *InboxViewFull `codec:"full,omitempty" json:"full,omitempty"` +} + +func (o *InboxView) Rtype() (ret InboxResType, err error) { + switch o.Rtype__ { + case InboxResType_FULL: + if o.Full__ == nil { + err = errors.New("unexpected nil value for Full__") + return ret, err + } + } + return o.Rtype__, nil +} + +func (o InboxView) Full() (res InboxViewFull) { + if o.Rtype__ != InboxResType_FULL { + panic("wrong case accessed") + } + if o.Full__ == nil { + return + } + return *o.Full__ +} + +func NewInboxViewWithVersionhit() InboxView { + return InboxView{ + Rtype__: InboxResType_VERSIONHIT, + } +} + +func NewInboxViewWithFull(v InboxViewFull) InboxView { + return InboxView{ + Rtype__: InboxResType_FULL, + Full__: &v, + } +} + +func (o InboxView) DeepCopy() InboxView { + return InboxView{ + Rtype__: o.Rtype__.DeepCopy(), + Full__: (func(x *InboxViewFull) *InboxViewFull { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Full__), + } +} + +type RetentionPolicyType int + +const ( + RetentionPolicyType_NONE RetentionPolicyType = 0 + RetentionPolicyType_RETAIN RetentionPolicyType = 1 + RetentionPolicyType_EXPIRE RetentionPolicyType = 2 + RetentionPolicyType_INHERIT RetentionPolicyType = 3 + RetentionPolicyType_EPHEMERAL RetentionPolicyType = 4 +) + +func (o RetentionPolicyType) DeepCopy() RetentionPolicyType { return o } + +var RetentionPolicyTypeMap = map[string]RetentionPolicyType{ + "NONE": 0, + "RETAIN": 1, + "EXPIRE": 2, + "INHERIT": 3, + "EPHEMERAL": 4, +} + +var RetentionPolicyTypeRevMap = map[RetentionPolicyType]string{ + 0: "NONE", + 1: "RETAIN", + 2: "EXPIRE", + 3: "INHERIT", + 4: "EPHEMERAL", +} + +func (e RetentionPolicyType) String() string { + if v, ok := RetentionPolicyTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type RetentionPolicy struct { + Typ__ RetentionPolicyType `codec:"typ" json:"typ"` + Retain__ *RpRetain `codec:"retain,omitempty" json:"retain,omitempty"` + Expire__ *RpExpire `codec:"expire,omitempty" json:"expire,omitempty"` + Inherit__ *RpInherit `codec:"inherit,omitempty" json:"inherit,omitempty"` + Ephemeral__ *RpEphemeral `codec:"ephemeral,omitempty" json:"ephemeral,omitempty"` +} + +func (o *RetentionPolicy) Typ() (ret RetentionPolicyType, err error) { + switch o.Typ__ { + case RetentionPolicyType_RETAIN: + if o.Retain__ == nil { + err = errors.New("unexpected nil value for Retain__") + return ret, err + } + case RetentionPolicyType_EXPIRE: + if o.Expire__ == nil { + err = errors.New("unexpected nil value for Expire__") + return ret, err + } + case RetentionPolicyType_INHERIT: + if o.Inherit__ == nil { + err = errors.New("unexpected nil value for Inherit__") + return ret, err + } + case RetentionPolicyType_EPHEMERAL: + if o.Ephemeral__ == nil { + err = errors.New("unexpected nil value for Ephemeral__") + return ret, err + } + } + return o.Typ__, nil +} + +func (o RetentionPolicy) Retain() (res RpRetain) { + if o.Typ__ != RetentionPolicyType_RETAIN { + panic("wrong case accessed") + } + if o.Retain__ == nil { + return + } + return *o.Retain__ +} + +func (o RetentionPolicy) Expire() (res RpExpire) { + if o.Typ__ != RetentionPolicyType_EXPIRE { + panic("wrong case accessed") + } + if o.Expire__ == nil { + return + } + return *o.Expire__ +} + +func (o RetentionPolicy) Inherit() (res RpInherit) { + if o.Typ__ != RetentionPolicyType_INHERIT { + panic("wrong case accessed") + } + if o.Inherit__ == nil { + return + } + return *o.Inherit__ +} + +func (o RetentionPolicy) Ephemeral() (res RpEphemeral) { + if o.Typ__ != RetentionPolicyType_EPHEMERAL { + panic("wrong case accessed") + } + if o.Ephemeral__ == nil { + return + } + return *o.Ephemeral__ +} + +func NewRetentionPolicyWithRetain(v RpRetain) RetentionPolicy { + return RetentionPolicy{ + Typ__: RetentionPolicyType_RETAIN, + Retain__: &v, + } +} + +func NewRetentionPolicyWithExpire(v RpExpire) RetentionPolicy { + return RetentionPolicy{ + Typ__: RetentionPolicyType_EXPIRE, + Expire__: &v, + } +} + +func NewRetentionPolicyWithInherit(v RpInherit) RetentionPolicy { + return RetentionPolicy{ + Typ__: RetentionPolicyType_INHERIT, + Inherit__: &v, + } +} + +func NewRetentionPolicyWithEphemeral(v RpEphemeral) RetentionPolicy { + return RetentionPolicy{ + Typ__: RetentionPolicyType_EPHEMERAL, + Ephemeral__: &v, + } +} + +func (o RetentionPolicy) DeepCopy() RetentionPolicy { + return RetentionPolicy{ + Typ__: o.Typ__.DeepCopy(), + Retain__: (func(x *RpRetain) *RpRetain { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Retain__), + Expire__: (func(x *RpExpire) *RpExpire { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Expire__), + Inherit__: (func(x *RpInherit) *RpInherit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Inherit__), + Ephemeral__: (func(x *RpEphemeral) *RpEphemeral { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Ephemeral__), + } +} + +type RpRetain struct { +} + +func (o RpRetain) DeepCopy() RpRetain { + return RpRetain{} +} + +type RpExpire struct { + Age gregor1.DurationSec `codec:"age" json:"age"` +} + +func (o RpExpire) DeepCopy() RpExpire { + return RpExpire{ + Age: o.Age.DeepCopy(), + } +} + +type RpInherit struct { +} + +func (o RpInherit) DeepCopy() RpInherit { + return RpInherit{} +} + +type RpEphemeral struct { + Age gregor1.DurationSec `codec:"age" json:"age"` +} + +func (o RpEphemeral) DeepCopy() RpEphemeral { + return RpEphemeral{ + Age: o.Age.DeepCopy(), + } +} + +type GetThreadReason int + +const ( + GetThreadReason_GENERAL GetThreadReason = 0 + GetThreadReason_PUSH GetThreadReason = 1 + GetThreadReason_FOREGROUND GetThreadReason = 2 + GetThreadReason_BACKGROUNDCONVLOAD GetThreadReason = 3 + GetThreadReason_FIXRETRY GetThreadReason = 4 + GetThreadReason_PREPARE GetThreadReason = 5 + GetThreadReason_SEARCHER GetThreadReason = 6 + GetThreadReason_INDEXED_SEARCH GetThreadReason = 7 + GetThreadReason_KBFSFILEACTIVITY GetThreadReason = 8 + GetThreadReason_COINFLIP GetThreadReason = 9 + GetThreadReason_BOTCOMMANDS GetThreadReason = 10 +) + +func (o GetThreadReason) DeepCopy() GetThreadReason { return o } + +var GetThreadReasonMap = map[string]GetThreadReason{ + "GENERAL": 0, + "PUSH": 1, + "FOREGROUND": 2, + "BACKGROUNDCONVLOAD": 3, + "FIXRETRY": 4, + "PREPARE": 5, + "SEARCHER": 6, + "INDEXED_SEARCH": 7, + "KBFSFILEACTIVITY": 8, + "COINFLIP": 9, + "BOTCOMMANDS": 10, +} + +var GetThreadReasonRevMap = map[GetThreadReason]string{ + 0: "GENERAL", + 1: "PUSH", + 2: "FOREGROUND", + 3: "BACKGROUNDCONVLOAD", + 4: "FIXRETRY", + 5: "PREPARE", + 6: "SEARCHER", + 7: "INDEXED_SEARCH", + 8: "KBFSFILEACTIVITY", + 9: "COINFLIP", + 10: "BOTCOMMANDS", +} + +func (e GetThreadReason) String() string { + if v, ok := GetThreadReasonRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ReIndexingMode int + +const ( + ReIndexingMode_NONE ReIndexingMode = 0 + ReIndexingMode_PRESEARCH_SYNC ReIndexingMode = 1 + ReIndexingMode_POSTSEARCH_SYNC ReIndexingMode = 2 +) + +func (o ReIndexingMode) DeepCopy() ReIndexingMode { return o } + +var ReIndexingModeMap = map[string]ReIndexingMode{ + "NONE": 0, + "PRESEARCH_SYNC": 1, + "POSTSEARCH_SYNC": 2, +} + +var ReIndexingModeRevMap = map[ReIndexingMode]string{ + 0: "NONE", + 1: "PRESEARCH_SYNC", + 2: "POSTSEARCH_SYNC", +} + +func (e ReIndexingMode) String() string { + if v, ok := ReIndexingModeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type SearchOpts struct { + IsRegex bool `codec:"isRegex" json:"isRegex"` + SentBy string `codec:"sentBy" json:"sentBy"` + SentTo string `codec:"sentTo" json:"sentTo"` + MatchMentions bool `codec:"matchMentions" json:"matchMentions"` + SentBefore gregor1.Time `codec:"sentBefore" json:"sentBefore"` + SentAfter gregor1.Time `codec:"sentAfter" json:"sentAfter"` + MaxHits int `codec:"maxHits" json:"maxHits"` + MaxMessages int `codec:"maxMessages" json:"maxMessages"` + BeforeContext int `codec:"beforeContext" json:"beforeContext"` + AfterContext int `codec:"afterContext" json:"afterContext"` + InitialPagination *Pagination `codec:"initialPagination,omitempty" json:"initialPagination,omitempty"` + ReindexMode ReIndexingMode `codec:"reindexMode" json:"reindexMode"` + MaxConvsSearched int `codec:"maxConvsSearched" json:"maxConvsSearched"` + MaxConvsHit int `codec:"maxConvsHit" json:"maxConvsHit"` + ConvID *ConversationID `codec:"convID,omitempty" json:"convID,omitempty"` + MaxNameConvs int `codec:"maxNameConvs" json:"maxNameConvs"` +} + +func (o SearchOpts) DeepCopy() SearchOpts { + return SearchOpts{ + IsRegex: o.IsRegex, + SentBy: o.SentBy, + SentTo: o.SentTo, + MatchMentions: o.MatchMentions, + SentBefore: o.SentBefore.DeepCopy(), + SentAfter: o.SentAfter.DeepCopy(), + MaxHits: o.MaxHits, + MaxMessages: o.MaxMessages, + BeforeContext: o.BeforeContext, + AfterContext: o.AfterContext, + InitialPagination: (func(x *Pagination) *Pagination { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.InitialPagination), + ReindexMode: o.ReindexMode.DeepCopy(), + MaxConvsSearched: o.MaxConvsSearched, + MaxConvsHit: o.MaxConvsHit, + ConvID: (func(x *ConversationID) *ConversationID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ConvID), + MaxNameConvs: o.MaxNameConvs, + } +} + +type EmptyStruct struct { +} + +func (o EmptyStruct) DeepCopy() EmptyStruct { + return EmptyStruct{} +} + +type ChatSearchMatch struct { + StartIndex int `codec:"startIndex" json:"startIndex"` + EndIndex int `codec:"endIndex" json:"endIndex"` + Match string `codec:"match" json:"match"` +} + +func (o ChatSearchMatch) DeepCopy() ChatSearchMatch { + return ChatSearchMatch{ + StartIndex: o.StartIndex, + EndIndex: o.EndIndex, + Match: o.Match, + } +} + +type ChatSearchHit struct { + BeforeMessages []UIMessage `codec:"beforeMessages" json:"beforeMessages"` + HitMessage UIMessage `codec:"hitMessage" json:"hitMessage"` + AfterMessages []UIMessage `codec:"afterMessages" json:"afterMessages"` + Matches []ChatSearchMatch `codec:"matches" json:"matches"` +} + +func (o ChatSearchHit) DeepCopy() ChatSearchHit { + return ChatSearchHit{ + BeforeMessages: (func(x []UIMessage) []UIMessage { + if x == nil { + return nil + } + ret := make([]UIMessage, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.BeforeMessages), + HitMessage: o.HitMessage.DeepCopy(), + AfterMessages: (func(x []UIMessage) []UIMessage { + if x == nil { + return nil + } + ret := make([]UIMessage, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.AfterMessages), + Matches: (func(x []ChatSearchMatch) []ChatSearchMatch { + if x == nil { + return nil + } + ret := make([]ChatSearchMatch, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Matches), + } +} + +type ChatSearchInboxHit struct { + ConvID ConversationID `codec:"convID" json:"convID"` + TeamType TeamType `codec:"teamType" json:"teamType"` + ConvName string `codec:"convName" json:"convName"` + Query string `codec:"query" json:"query"` + Time gregor1.Time `codec:"time" json:"time"` + Hits []ChatSearchHit `codec:"hits" json:"hits"` +} + +func (o ChatSearchInboxHit) DeepCopy() ChatSearchInboxHit { + return ChatSearchInboxHit{ + ConvID: o.ConvID.DeepCopy(), + TeamType: o.TeamType.DeepCopy(), + ConvName: o.ConvName, + Query: o.Query, + Time: o.Time.DeepCopy(), + Hits: (func(x []ChatSearchHit) []ChatSearchHit { + if x == nil { + return nil + } + ret := make([]ChatSearchHit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Hits), + } +} + +type ChatSearchInboxResults struct { + Hits []ChatSearchInboxHit `codec:"hits" json:"hits"` + PercentIndexed int `codec:"percentIndexed" json:"percentIndexed"` +} + +func (o ChatSearchInboxResults) DeepCopy() ChatSearchInboxResults { + return ChatSearchInboxResults{ + Hits: (func(x []ChatSearchInboxHit) []ChatSearchInboxHit { + if x == nil { + return nil + } + ret := make([]ChatSearchInboxHit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Hits), + PercentIndexed: o.PercentIndexed, + } +} + +type ChatSearchInboxDone struct { + NumHits int `codec:"numHits" json:"numHits"` + NumConvs int `codec:"numConvs" json:"numConvs"` + PercentIndexed int `codec:"percentIndexed" json:"percentIndexed"` + Delegated bool `codec:"delegated" json:"delegated"` +} + +func (o ChatSearchInboxDone) DeepCopy() ChatSearchInboxDone { + return ChatSearchInboxDone{ + NumHits: o.NumHits, + NumConvs: o.NumConvs, + PercentIndexed: o.PercentIndexed, + Delegated: o.Delegated, + } +} + +type ChatSearchIndexStatus struct { + PercentIndexed int `codec:"percentIndexed" json:"percentIndexed"` +} + +func (o ChatSearchIndexStatus) DeepCopy() ChatSearchIndexStatus { + return ChatSearchIndexStatus{ + PercentIndexed: o.PercentIndexed, + } +} + +type AssetMetadataImage struct { + Width int `codec:"width" json:"width"` + Height int `codec:"height" json:"height"` + AudioAmps []float64 `codec:"audioAmps" json:"audioAmps"` +} + +func (o AssetMetadataImage) DeepCopy() AssetMetadataImage { + return AssetMetadataImage{ + Width: o.Width, + Height: o.Height, + AudioAmps: (func(x []float64) []float64 { + if x == nil { + return nil + } + ret := make([]float64, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.AudioAmps), + } +} + +type AssetMetadataVideo struct { + Width int `codec:"width" json:"width"` + Height int `codec:"height" json:"height"` + DurationMs int `codec:"durationMs" json:"durationMs"` + IsAudio bool `codec:"isAudio" json:"isAudio"` +} + +func (o AssetMetadataVideo) DeepCopy() AssetMetadataVideo { + return AssetMetadataVideo{ + Width: o.Width, + Height: o.Height, + DurationMs: o.DurationMs, + IsAudio: o.IsAudio, + } +} + +type AssetMetadataType int + +const ( + AssetMetadataType_NONE AssetMetadataType = 0 + AssetMetadataType_IMAGE AssetMetadataType = 1 + AssetMetadataType_VIDEO AssetMetadataType = 2 +) + +func (o AssetMetadataType) DeepCopy() AssetMetadataType { return o } + +var AssetMetadataTypeMap = map[string]AssetMetadataType{ + "NONE": 0, + "IMAGE": 1, + "VIDEO": 2, +} + +var AssetMetadataTypeRevMap = map[AssetMetadataType]string{ + 0: "NONE", + 1: "IMAGE", + 2: "VIDEO", +} + +type AssetMetadata struct { + AssetType__ AssetMetadataType `codec:"assetType" json:"assetType"` + Image__ *AssetMetadataImage `codec:"image,omitempty" json:"image,omitempty"` + Video__ *AssetMetadataVideo `codec:"video,omitempty" json:"video,omitempty"` +} + +func (o *AssetMetadata) AssetType() (ret AssetMetadataType, err error) { + switch o.AssetType__ { + case AssetMetadataType_IMAGE: + if o.Image__ == nil { + err = errors.New("unexpected nil value for Image__") + return ret, err + } + case AssetMetadataType_VIDEO: + if o.Video__ == nil { + err = errors.New("unexpected nil value for Video__") + return ret, err + } + } + return o.AssetType__, nil +} + +func (o AssetMetadata) Image() (res AssetMetadataImage) { + if o.AssetType__ != AssetMetadataType_IMAGE { + panic("wrong case accessed") + } + if o.Image__ == nil { + return + } + return *o.Image__ +} + +func (o AssetMetadata) Video() (res AssetMetadataVideo) { + if o.AssetType__ != AssetMetadataType_VIDEO { + panic("wrong case accessed") + } + if o.Video__ == nil { + return + } + return *o.Video__ +} + +func NewAssetMetadataWithImage(v AssetMetadataImage) AssetMetadata { + return AssetMetadata{ + AssetType__: AssetMetadataType_IMAGE, + Image__: &v, + } +} + +func NewAssetMetadataWithVideo(v AssetMetadataVideo) AssetMetadata { + return AssetMetadata{ + AssetType__: AssetMetadataType_VIDEO, + Video__: &v, + } +} + +func (o AssetMetadata) DeepCopy() AssetMetadata { + return AssetMetadata{ + AssetType__: o.AssetType__.DeepCopy(), + Image__: (func(x *AssetMetadataImage) *AssetMetadataImage { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Image__), + Video__: (func(x *AssetMetadataVideo) *AssetMetadataVideo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Video__), + } +} + +type AssetTag int + +const ( + AssetTag_PRIMARY AssetTag = 0 +) + +func (o AssetTag) DeepCopy() AssetTag { return o } + +var AssetTagMap = map[string]AssetTag{ + "PRIMARY": 0, +} + +var AssetTagRevMap = map[AssetTag]string{ + 0: "PRIMARY", +} + +type Asset struct { + Filename string `codec:"filename" json:"filename"` + Region string `codec:"region" json:"region"` + Endpoint string `codec:"endpoint" json:"endpoint"` + Bucket string `codec:"bucket" json:"bucket"` + Path string `codec:"path" json:"path"` + Size int64 `codec:"size" json:"size"` + MimeType string `codec:"mimeType" json:"mimeType"` + EncHash Hash `codec:"encHash" json:"encHash"` + Key []byte `codec:"key" json:"key"` + VerifyKey []byte `codec:"verifyKey" json:"verifyKey"` + Title string `codec:"title" json:"title"` + Nonce []byte `codec:"nonce" json:"nonce"` + Metadata AssetMetadata `codec:"metadata" json:"metadata"` + Tag AssetTag `codec:"tag" json:"tag"` +} + +func (o Asset) DeepCopy() Asset { + return Asset{ + Filename: o.Filename, + Region: o.Region, + Endpoint: o.Endpoint, + Bucket: o.Bucket, + Path: o.Path, + Size: o.Size, + MimeType: o.MimeType, + EncHash: o.EncHash.DeepCopy(), + Key: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.Key), + VerifyKey: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.VerifyKey), + Title: o.Title, + Nonce: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.Nonce), + Metadata: o.Metadata.DeepCopy(), + Tag: o.Tag.DeepCopy(), + } +} + +type BotCommandsAdvertisementTyp int + +const ( + BotCommandsAdvertisementTyp_PUBLIC BotCommandsAdvertisementTyp = 0 + BotCommandsAdvertisementTyp_TLFID_MEMBERS BotCommandsAdvertisementTyp = 1 + BotCommandsAdvertisementTyp_TLFID_CONVS BotCommandsAdvertisementTyp = 2 +) + +func (o BotCommandsAdvertisementTyp) DeepCopy() BotCommandsAdvertisementTyp { return o } + +var BotCommandsAdvertisementTypMap = map[string]BotCommandsAdvertisementTyp{ + "PUBLIC": 0, + "TLFID_MEMBERS": 1, + "TLFID_CONVS": 2, +} + +var BotCommandsAdvertisementTypRevMap = map[BotCommandsAdvertisementTyp]string{ + 0: "PUBLIC", + 1: "TLFID_MEMBERS", + 2: "TLFID_CONVS", +} + +func (e BotCommandsAdvertisementTyp) String() string { + if v, ok := BotCommandsAdvertisementTypRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type TeamMember struct { + Uid gregor1.UID `codec:"uid" json:"uid"` + Role keybase1.TeamRole `codec:"role" json:"role"` + Status keybase1.TeamMemberStatus `codec:"status" json:"status"` +} + +func (o TeamMember) DeepCopy() TeamMember { + return TeamMember{ + Uid: o.Uid.DeepCopy(), + Role: o.Role.DeepCopy(), + Status: o.Status.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/gregor.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/gregor.go new file mode 100644 index 00000000..30e78484 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/gregor.go @@ -0,0 +1,548 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/chat1/gregor.avdl + +package chat1 + +import ( + gregor1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1" + keybase1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1" +) + +type GenericPayload struct { + Action string `codec:"Action" json:"Action"` + InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"` + ConvID ConversationID `codec:"convID" json:"convID"` + TopicType TopicType `codec:"topicType" json:"topicType"` + UnreadUpdate *UnreadUpdate `codec:"unreadUpdate,omitempty" json:"unreadUpdate,omitempty"` +} + +func (o GenericPayload) DeepCopy() GenericPayload { + return GenericPayload{ + Action: o.Action, + InboxVers: o.InboxVers.DeepCopy(), + ConvID: o.ConvID.DeepCopy(), + TopicType: o.TopicType.DeepCopy(), + UnreadUpdate: (func(x *UnreadUpdate) *UnreadUpdate { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.UnreadUpdate), + } +} + +type NewConversationPayload struct { + Action string `codec:"Action" json:"Action"` + ConvID ConversationID `codec:"convID" json:"convID"` + InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"` + TopicType TopicType `codec:"topicType" json:"topicType"` + UnreadUpdate *UnreadUpdate `codec:"unreadUpdate,omitempty" json:"unreadUpdate,omitempty"` +} + +func (o NewConversationPayload) DeepCopy() NewConversationPayload { + return NewConversationPayload{ + Action: o.Action, + ConvID: o.ConvID.DeepCopy(), + InboxVers: o.InboxVers.DeepCopy(), + TopicType: o.TopicType.DeepCopy(), + UnreadUpdate: (func(x *UnreadUpdate) *UnreadUpdate { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.UnreadUpdate), + } +} + +type NewMessagePayload struct { + Action string `codec:"Action" json:"Action"` + ConvID ConversationID `codec:"convID" json:"convID"` + Message MessageBoxed `codec:"message" json:"message"` + InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"` + TopicType TopicType `codec:"topicType" json:"topicType"` + UnreadUpdate *UnreadUpdate `codec:"unreadUpdate,omitempty" json:"unreadUpdate,omitempty"` + UntrustedTeamRole keybase1.TeamRole `codec:"untrustedTeamRole" json:"untrustedTeamRole"` + MaxMsgs []MessageSummary `codec:"maxMsgs" json:"maxMsgs"` +} + +func (o NewMessagePayload) DeepCopy() NewMessagePayload { + return NewMessagePayload{ + Action: o.Action, + ConvID: o.ConvID.DeepCopy(), + Message: o.Message.DeepCopy(), + InboxVers: o.InboxVers.DeepCopy(), + TopicType: o.TopicType.DeepCopy(), + UnreadUpdate: (func(x *UnreadUpdate) *UnreadUpdate { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.UnreadUpdate), + UntrustedTeamRole: o.UntrustedTeamRole.DeepCopy(), + MaxMsgs: (func(x []MessageSummary) []MessageSummary { + if x == nil { + return nil + } + ret := make([]MessageSummary, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.MaxMsgs), + } +} + +type ReadMessagePayload struct { + Action string `codec:"Action" json:"Action"` + ConvID ConversationID `codec:"convID" json:"convID"` + MsgID MessageID `codec:"msgID" json:"msgID"` + InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"` + TopicType TopicType `codec:"topicType" json:"topicType"` + UnreadUpdate *UnreadUpdate `codec:"unreadUpdate,omitempty" json:"unreadUpdate,omitempty"` +} + +func (o ReadMessagePayload) DeepCopy() ReadMessagePayload { + return ReadMessagePayload{ + Action: o.Action, + ConvID: o.ConvID.DeepCopy(), + MsgID: o.MsgID.DeepCopy(), + InboxVers: o.InboxVers.DeepCopy(), + TopicType: o.TopicType.DeepCopy(), + UnreadUpdate: (func(x *UnreadUpdate) *UnreadUpdate { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.UnreadUpdate), + } +} + +type SetStatusPayload struct { + Action string `codec:"Action" json:"Action"` + ConvID ConversationID `codec:"convID" json:"convID"` + Status ConversationStatus `codec:"status" json:"status"` + InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"` + TopicType TopicType `codec:"topicType" json:"topicType"` + UnreadUpdate *UnreadUpdate `codec:"unreadUpdate,omitempty" json:"unreadUpdate,omitempty"` +} + +func (o SetStatusPayload) DeepCopy() SetStatusPayload { + return SetStatusPayload{ + Action: o.Action, + ConvID: o.ConvID.DeepCopy(), + Status: o.Status.DeepCopy(), + InboxVers: o.InboxVers.DeepCopy(), + TopicType: o.TopicType.DeepCopy(), + UnreadUpdate: (func(x *UnreadUpdate) *UnreadUpdate { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.UnreadUpdate), + } +} + +type TeamTypePayload struct { + Action string `codec:"Action" json:"Action"` + ConvID ConversationID `codec:"convID" json:"convID"` + TeamType TeamType `codec:"teamType" json:"teamType"` + InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"` + TopicType TopicType `codec:"topicType" json:"topicType"` + UnreadUpdate *UnreadUpdate `codec:"unreadUpdate,omitempty" json:"unreadUpdate,omitempty"` +} + +func (o TeamTypePayload) DeepCopy() TeamTypePayload { + return TeamTypePayload{ + Action: o.Action, + ConvID: o.ConvID.DeepCopy(), + TeamType: o.TeamType.DeepCopy(), + InboxVers: o.InboxVers.DeepCopy(), + TopicType: o.TopicType.DeepCopy(), + UnreadUpdate: (func(x *UnreadUpdate) *UnreadUpdate { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.UnreadUpdate), + } +} + +type SetAppNotificationSettingsPayload struct { + Action string `codec:"Action" json:"Action"` + ConvID ConversationID `codec:"convID" json:"convID"` + InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"` + Settings ConversationNotificationInfo `codec:"settings" json:"settings"` + TopicType TopicType `codec:"topicType" json:"topicType"` + UnreadUpdate *UnreadUpdate `codec:"unreadUpdate,omitempty" json:"unreadUpdate,omitempty"` +} + +func (o SetAppNotificationSettingsPayload) DeepCopy() SetAppNotificationSettingsPayload { + return SetAppNotificationSettingsPayload{ + Action: o.Action, + ConvID: o.ConvID.DeepCopy(), + InboxVers: o.InboxVers.DeepCopy(), + Settings: o.Settings.DeepCopy(), + TopicType: o.TopicType.DeepCopy(), + UnreadUpdate: (func(x *UnreadUpdate) *UnreadUpdate { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.UnreadUpdate), + } +} + +type ExpungePayload struct { + Action string `codec:"Action" json:"Action"` + ConvID ConversationID `codec:"convID" json:"convID"` + InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"` + Expunge Expunge `codec:"expunge" json:"expunge"` + MaxMsgs []MessageSummary `codec:"maxMsgs" json:"maxMsgs"` + TopicType TopicType `codec:"topicType" json:"topicType"` + UnreadUpdate *UnreadUpdate `codec:"unreadUpdate,omitempty" json:"unreadUpdate,omitempty"` +} + +func (o ExpungePayload) DeepCopy() ExpungePayload { + return ExpungePayload{ + Action: o.Action, + ConvID: o.ConvID.DeepCopy(), + InboxVers: o.InboxVers.DeepCopy(), + Expunge: o.Expunge.DeepCopy(), + MaxMsgs: (func(x []MessageSummary) []MessageSummary { + if x == nil { + return nil + } + ret := make([]MessageSummary, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.MaxMsgs), + TopicType: o.TopicType.DeepCopy(), + UnreadUpdate: (func(x *UnreadUpdate) *UnreadUpdate { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.UnreadUpdate), + } +} + +type UnreadUpdate struct { + ConvID ConversationID `codec:"convID" json:"convID"` + UnreadMessages int `codec:"unreadMessages" json:"unreadMessages"` + UnreadNotifyingMessages map[keybase1.DeviceType]int `codec:"unreadNotifyingMessages" json:"unreadNotifyingMessages"` + CompatUnreadMessages int `codec:"UnreadMessages" json:"UnreadMessages"` + Diff bool `codec:"diff" json:"diff"` +} + +func (o UnreadUpdate) DeepCopy() UnreadUpdate { + return UnreadUpdate{ + ConvID: o.ConvID.DeepCopy(), + UnreadMessages: o.UnreadMessages, + UnreadNotifyingMessages: (func(x map[keybase1.DeviceType]int) map[keybase1.DeviceType]int { + if x == nil { + return nil + } + ret := make(map[keybase1.DeviceType]int, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v + ret[kCopy] = vCopy + } + return ret + })(o.UnreadNotifyingMessages), + CompatUnreadMessages: o.CompatUnreadMessages, + Diff: o.Diff, + } +} + +type TLFFinalizeUpdate struct { + FinalizeInfo ConversationFinalizeInfo `codec:"finalizeInfo" json:"finalizeInfo"` + ConvIDs []ConversationID `codec:"convIDs" json:"convIDs"` + InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"` +} + +func (o TLFFinalizeUpdate) DeepCopy() TLFFinalizeUpdate { + return TLFFinalizeUpdate{ + FinalizeInfo: o.FinalizeInfo.DeepCopy(), + ConvIDs: (func(x []ConversationID) []ConversationID { + if x == nil { + return nil + } + ret := make([]ConversationID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ConvIDs), + InboxVers: o.InboxVers.DeepCopy(), + } +} + +type TLFResolveUpdate struct { + ConvID ConversationID `codec:"convID" json:"convID"` + InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"` +} + +func (o TLFResolveUpdate) DeepCopy() TLFResolveUpdate { + return TLFResolveUpdate{ + ConvID: o.ConvID.DeepCopy(), + InboxVers: o.InboxVers.DeepCopy(), + } +} + +type RemoteUserTypingUpdate struct { + Uid gregor1.UID `codec:"uid" json:"uid"` + DeviceID gregor1.DeviceID `codec:"deviceID" json:"deviceID"` + ConvID ConversationID `codec:"convID" json:"convID"` + Typing bool `codec:"typing" json:"typing"` + TeamType TeamType `codec:"t" json:"teamType"` +} + +func (o RemoteUserTypingUpdate) DeepCopy() RemoteUserTypingUpdate { + return RemoteUserTypingUpdate{ + Uid: o.Uid.DeepCopy(), + DeviceID: o.DeviceID.DeepCopy(), + ConvID: o.ConvID.DeepCopy(), + Typing: o.Typing, + TeamType: o.TeamType.DeepCopy(), + } +} + +type TeamMemberRoleUpdate struct { + TlfID TLFID `codec:"tlfID" json:"tlfID"` + Role keybase1.TeamRole `codec:"role" json:"role"` +} + +func (o TeamMemberRoleUpdate) DeepCopy() TeamMemberRoleUpdate { + return TeamMemberRoleUpdate{ + TlfID: o.TlfID.DeepCopy(), + Role: o.Role.DeepCopy(), + } +} + +type UpdateConversationMembership struct { + InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"` + TeamMemberRoleUpdate *TeamMemberRoleUpdate `codec:"teamMemberRoleUpdate,omitempty" json:"teamMemberRoleUpdate,omitempty"` + Joined []ConversationMember `codec:"joined" json:"joined"` + Removed []ConversationMember `codec:"removed" json:"removed"` + Reset []ConversationMember `codec:"reset" json:"reset"` + Previewed []ConversationID `codec:"previewed" json:"previewed"` + UnreadUpdate *UnreadUpdate `codec:"unreadUpdate,omitempty" json:"unreadUpdate,omitempty"` + UnreadUpdates []UnreadUpdate `codec:"unreadUpdates" json:"unreadUpdates"` +} + +func (o UpdateConversationMembership) DeepCopy() UpdateConversationMembership { + return UpdateConversationMembership{ + InboxVers: o.InboxVers.DeepCopy(), + TeamMemberRoleUpdate: (func(x *TeamMemberRoleUpdate) *TeamMemberRoleUpdate { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.TeamMemberRoleUpdate), + Joined: (func(x []ConversationMember) []ConversationMember { + if x == nil { + return nil + } + ret := make([]ConversationMember, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Joined), + Removed: (func(x []ConversationMember) []ConversationMember { + if x == nil { + return nil + } + ret := make([]ConversationMember, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Removed), + Reset: (func(x []ConversationMember) []ConversationMember { + if x == nil { + return nil + } + ret := make([]ConversationMember, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Reset), + Previewed: (func(x []ConversationID) []ConversationID { + if x == nil { + return nil + } + ret := make([]ConversationID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Previewed), + UnreadUpdate: (func(x *UnreadUpdate) *UnreadUpdate { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.UnreadUpdate), + UnreadUpdates: (func(x []UnreadUpdate) []UnreadUpdate { + if x == nil { + return nil + } + ret := make([]UnreadUpdate, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.UnreadUpdates), + } +} + +type ConversationUpdate struct { + ConvID ConversationID `codec:"convID" json:"convID"` + Existence ConversationExistence `codec:"existence" json:"existence"` +} + +func (o ConversationUpdate) DeepCopy() ConversationUpdate { + return ConversationUpdate{ + ConvID: o.ConvID.DeepCopy(), + Existence: o.Existence.DeepCopy(), + } +} + +type UpdateConversations struct { + InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"` + ConvUpdates []ConversationUpdate `codec:"convUpdates" json:"convUpdates"` +} + +func (o UpdateConversations) DeepCopy() UpdateConversations { + return UpdateConversations{ + InboxVers: o.InboxVers.DeepCopy(), + ConvUpdates: (func(x []ConversationUpdate) []ConversationUpdate { + if x == nil { + return nil + } + ret := make([]ConversationUpdate, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ConvUpdates), + } +} + +type TeamChannelUpdate struct { + TeamID TLFID `codec:"teamID" json:"teamID"` +} + +func (o TeamChannelUpdate) DeepCopy() TeamChannelUpdate { + return TeamChannelUpdate{ + TeamID: o.TeamID.DeepCopy(), + } +} + +type SetConvRetentionUpdate struct { + InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"` + ConvID ConversationID `codec:"convID" json:"convID"` + Policy RetentionPolicy `codec:"policy" json:"policy"` +} + +func (o SetConvRetentionUpdate) DeepCopy() SetConvRetentionUpdate { + return SetConvRetentionUpdate{ + InboxVers: o.InboxVers.DeepCopy(), + ConvID: o.ConvID.DeepCopy(), + Policy: o.Policy.DeepCopy(), + } +} + +type SetTeamRetentionUpdate struct { + InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"` + TeamID keybase1.TeamID `codec:"teamID" json:"teamID"` + Policy RetentionPolicy `codec:"policy" json:"policy"` +} + +func (o SetTeamRetentionUpdate) DeepCopy() SetTeamRetentionUpdate { + return SetTeamRetentionUpdate{ + InboxVers: o.InboxVers.DeepCopy(), + TeamID: o.TeamID.DeepCopy(), + Policy: o.Policy.DeepCopy(), + } +} + +type SetConvSettingsUpdate struct { + InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"` + ConvID ConversationID `codec:"convID" json:"convID"` + ConvSettings *ConversationSettings `codec:"convSettings,omitempty" json:"convSettings,omitempty"` +} + +func (o SetConvSettingsUpdate) DeepCopy() SetConvSettingsUpdate { + return SetConvSettingsUpdate{ + InboxVers: o.InboxVers.DeepCopy(), + ConvID: o.ConvID.DeepCopy(), + ConvSettings: (func(x *ConversationSettings) *ConversationSettings { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ConvSettings), + } +} + +type KBFSImpteamUpgradeUpdate struct { + ConvID ConversationID `codec:"convID" json:"convID"` + InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"` + TopicType TopicType `codec:"topicType" json:"topicType"` +} + +func (o KBFSImpteamUpgradeUpdate) DeepCopy() KBFSImpteamUpgradeUpdate { + return KBFSImpteamUpgradeUpdate{ + ConvID: o.ConvID.DeepCopy(), + InboxVers: o.InboxVers.DeepCopy(), + TopicType: o.TopicType.DeepCopy(), + } +} + +type SubteamRenameUpdate struct { + ConvIDs []ConversationID `codec:"convIDs" json:"convIDs"` + InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"` +} + +func (o SubteamRenameUpdate) DeepCopy() SubteamRenameUpdate { + return SubteamRenameUpdate{ + ConvIDs: (func(x []ConversationID) []ConversationID { + if x == nil { + return nil + } + ret := make([]ConversationID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ConvIDs), + InboxVers: o.InboxVers.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/local.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/local.go new file mode 100644 index 00000000..d9ae8815 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/local.go @@ -0,0 +1,5865 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/chat1/local.avdl + +package chat1 + +import ( + "errors" + "fmt" + + gregor1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1" + keybase1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1" + stellar1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1" +) + +type VersionKind string + +func (o VersionKind) DeepCopy() VersionKind { + return o +} + +type TextPaymentResultTyp int + +const ( + TextPaymentResultTyp_SENT TextPaymentResultTyp = 0 + TextPaymentResultTyp_ERROR TextPaymentResultTyp = 1 +) + +func (o TextPaymentResultTyp) DeepCopy() TextPaymentResultTyp { return o } + +var TextPaymentResultTypMap = map[string]TextPaymentResultTyp{ + "SENT": 0, + "ERROR": 1, +} + +var TextPaymentResultTypRevMap = map[TextPaymentResultTyp]string{ + 0: "SENT", + 1: "ERROR", +} + +func (e TextPaymentResultTyp) String() string { + if v, ok := TextPaymentResultTypRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type TextPaymentResult struct { + ResultTyp__ TextPaymentResultTyp `codec:"resultTyp" json:"resultTyp"` + Error__ *string `codec:"error,omitempty" json:"error,omitempty"` + Sent__ *stellar1.PaymentID `codec:"sent,omitempty" json:"sent,omitempty"` +} + +func (o *TextPaymentResult) ResultTyp() (ret TextPaymentResultTyp, err error) { + switch o.ResultTyp__ { + case TextPaymentResultTyp_ERROR: + if o.Error__ == nil { + err = errors.New("unexpected nil value for Error__") + return ret, err + } + case TextPaymentResultTyp_SENT: + if o.Sent__ == nil { + err = errors.New("unexpected nil value for Sent__") + return ret, err + } + } + return o.ResultTyp__, nil +} + +func (o TextPaymentResult) Error() (res string) { + if o.ResultTyp__ != TextPaymentResultTyp_ERROR { + panic("wrong case accessed") + } + if o.Error__ == nil { + return + } + return *o.Error__ +} + +func (o TextPaymentResult) Sent() (res stellar1.PaymentID) { + if o.ResultTyp__ != TextPaymentResultTyp_SENT { + panic("wrong case accessed") + } + if o.Sent__ == nil { + return + } + return *o.Sent__ +} + +func NewTextPaymentResultWithError(v string) TextPaymentResult { + return TextPaymentResult{ + ResultTyp__: TextPaymentResultTyp_ERROR, + Error__: &v, + } +} + +func NewTextPaymentResultWithSent(v stellar1.PaymentID) TextPaymentResult { + return TextPaymentResult{ + ResultTyp__: TextPaymentResultTyp_SENT, + Sent__: &v, + } +} + +func (o TextPaymentResult) DeepCopy() TextPaymentResult { + return TextPaymentResult{ + ResultTyp__: o.ResultTyp__.DeepCopy(), + Error__: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Error__), + Sent__: (func(x *stellar1.PaymentID) *stellar1.PaymentID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Sent__), + } +} + +type TextPayment struct { + Username string `codec:"username" json:"username"` + PaymentText string `codec:"paymentText" json:"paymentText"` + Result TextPaymentResult `codec:"result" json:"result"` +} + +func (o TextPayment) DeepCopy() TextPayment { + return TextPayment{ + Username: o.Username, + PaymentText: o.PaymentText, + Result: o.Result.DeepCopy(), + } +} + +type KnownUserMention struct { + Text string `codec:"text" json:"text"` + Uid gregor1.UID `codec:"uid" json:"uid"` +} + +func (o KnownUserMention) DeepCopy() KnownUserMention { + return KnownUserMention{ + Text: o.Text, + Uid: o.Uid.DeepCopy(), + } +} + +type KnownTeamMention struct { + Name string `codec:"name" json:"name"` + Channel string `codec:"channel" json:"channel"` +} + +func (o KnownTeamMention) DeepCopy() KnownTeamMention { + return KnownTeamMention{ + Name: o.Name, + Channel: o.Channel, + } +} + +type MaybeMention struct { + Name string `codec:"name" json:"name"` + Channel string `codec:"channel" json:"channel"` +} + +func (o MaybeMention) DeepCopy() MaybeMention { + return MaybeMention{ + Name: o.Name, + Channel: o.Channel, + } +} + +type Coordinate struct { + Lat float64 `codec:"lat" json:"lat"` + Lon float64 `codec:"lon" json:"lon"` + Accuracy float64 `codec:"accuracy" json:"accuracy"` +} + +func (o Coordinate) DeepCopy() Coordinate { + return Coordinate{ + Lat: o.Lat, + Lon: o.Lon, + Accuracy: o.Accuracy, + } +} + +type LiveLocation struct { + EndTime gregor1.Time `codec:"endTime" json:"endTime"` +} + +func (o LiveLocation) DeepCopy() LiveLocation { + return LiveLocation{ + EndTime: o.EndTime.DeepCopy(), + } +} + +type MessageText struct { + Body string `codec:"body" json:"body"` + Payments []TextPayment `codec:"payments" json:"payments"` + ReplyTo *MessageID `codec:"replyTo,omitempty" json:"replyTo,omitempty"` + ReplyToUID *gregor1.UID `codec:"replyToUID,omitempty" json:"replyToUID,omitempty"` + UserMentions []KnownUserMention `codec:"userMentions" json:"userMentions"` + TeamMentions []KnownTeamMention `codec:"teamMentions" json:"teamMentions"` + LiveLocation *LiveLocation `codec:"liveLocation,omitempty" json:"liveLocation,omitempty"` +} + +func (o MessageText) DeepCopy() MessageText { + return MessageText{ + Body: o.Body, + Payments: (func(x []TextPayment) []TextPayment { + if x == nil { + return nil + } + ret := make([]TextPayment, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Payments), + ReplyTo: (func(x *MessageID) *MessageID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ReplyTo), + ReplyToUID: (func(x *gregor1.UID) *gregor1.UID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ReplyToUID), + UserMentions: (func(x []KnownUserMention) []KnownUserMention { + if x == nil { + return nil + } + ret := make([]KnownUserMention, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.UserMentions), + TeamMentions: (func(x []KnownTeamMention) []KnownTeamMention { + if x == nil { + return nil + } + ret := make([]KnownTeamMention, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.TeamMentions), + LiveLocation: (func(x *LiveLocation) *LiveLocation { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.LiveLocation), + } +} + +type MessageConversationMetadata struct { + ConversationTitle string `codec:"conversationTitle" json:"conversationTitle"` +} + +func (o MessageConversationMetadata) DeepCopy() MessageConversationMetadata { + return MessageConversationMetadata{ + ConversationTitle: o.ConversationTitle, + } +} + +type MessageEdit struct { + MessageID MessageID `codec:"messageID" json:"messageID"` + Body string `codec:"body" json:"body"` + UserMentions []KnownUserMention `codec:"userMentions" json:"userMentions"` + TeamMentions []KnownTeamMention `codec:"teamMentions" json:"teamMentions"` +} + +func (o MessageEdit) DeepCopy() MessageEdit { + return MessageEdit{ + MessageID: o.MessageID.DeepCopy(), + Body: o.Body, + UserMentions: (func(x []KnownUserMention) []KnownUserMention { + if x == nil { + return nil + } + ret := make([]KnownUserMention, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.UserMentions), + TeamMentions: (func(x []KnownTeamMention) []KnownTeamMention { + if x == nil { + return nil + } + ret := make([]KnownTeamMention, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.TeamMentions), + } +} + +type MessageDelete struct { + MessageIDs []MessageID `codec:"messageIDs" json:"messageIDs"` +} + +func (o MessageDelete) DeepCopy() MessageDelete { + return MessageDelete{ + MessageIDs: (func(x []MessageID) []MessageID { + if x == nil { + return nil + } + ret := make([]MessageID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.MessageIDs), + } +} + +type MessageHeadline struct { + Headline string `codec:"headline" json:"headline"` +} + +func (o MessageHeadline) DeepCopy() MessageHeadline { + return MessageHeadline{ + Headline: o.Headline, + } +} + +type MessageFlip struct { + Text string `codec:"text" json:"text"` + GameID FlipGameID `codec:"gameID" json:"gameID"` + FlipConvID ConversationID `codec:"flipConvID" json:"flipConvID"` + UserMentions []KnownUserMention `codec:"userMentions" json:"userMentions"` + TeamMentions []KnownTeamMention `codec:"teamMentions" json:"teamMentions"` +} + +func (o MessageFlip) DeepCopy() MessageFlip { + return MessageFlip{ + Text: o.Text, + GameID: o.GameID.DeepCopy(), + FlipConvID: o.FlipConvID.DeepCopy(), + UserMentions: (func(x []KnownUserMention) []KnownUserMention { + if x == nil { + return nil + } + ret := make([]KnownUserMention, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.UserMentions), + TeamMentions: (func(x []KnownTeamMention) []KnownTeamMention { + if x == nil { + return nil + } + ret := make([]KnownTeamMention, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.TeamMentions), + } +} + +type MessagePin struct { + MsgID MessageID `codec:"msgID" json:"msgID"` +} + +func (o MessagePin) DeepCopy() MessagePin { + return MessagePin{ + MsgID: o.MsgID.DeepCopy(), + } +} + +type MessageSystemType int + +const ( + MessageSystemType_ADDEDTOTEAM MessageSystemType = 0 + MessageSystemType_INVITEADDEDTOTEAM MessageSystemType = 1 + MessageSystemType_COMPLEXTEAM MessageSystemType = 2 + MessageSystemType_CREATETEAM MessageSystemType = 3 + MessageSystemType_GITPUSH MessageSystemType = 4 + MessageSystemType_CHANGEAVATAR MessageSystemType = 5 + MessageSystemType_CHANGERETENTION MessageSystemType = 6 + MessageSystemType_BULKADDTOCONV MessageSystemType = 7 + MessageSystemType_SBSRESOLVE MessageSystemType = 8 +) + +func (o MessageSystemType) DeepCopy() MessageSystemType { return o } + +var MessageSystemTypeMap = map[string]MessageSystemType{ + "ADDEDTOTEAM": 0, + "INVITEADDEDTOTEAM": 1, + "COMPLEXTEAM": 2, + "CREATETEAM": 3, + "GITPUSH": 4, + "CHANGEAVATAR": 5, + "CHANGERETENTION": 6, + "BULKADDTOCONV": 7, + "SBSRESOLVE": 8, +} + +var MessageSystemTypeRevMap = map[MessageSystemType]string{ + 0: "ADDEDTOTEAM", + 1: "INVITEADDEDTOTEAM", + 2: "COMPLEXTEAM", + 3: "CREATETEAM", + 4: "GITPUSH", + 5: "CHANGEAVATAR", + 6: "CHANGERETENTION", + 7: "BULKADDTOCONV", + 8: "SBSRESOLVE", +} + +func (e MessageSystemType) String() string { + if v, ok := MessageSystemTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type MessageSystemAddedToTeam struct { + Team string `codec:"team" json:"team"` + Adder string `codec:"adder" json:"adder"` + Addee string `codec:"addee" json:"addee"` + Role keybase1.TeamRole `codec:"role" json:"role"` + BulkAdds []string `codec:"bulkAdds" json:"bulkAdds"` + Owners []string `codec:"owners" json:"owners"` + Admins []string `codec:"admins" json:"admins"` + Writers []string `codec:"writers" json:"writers"` + Readers []string `codec:"readers" json:"readers"` + Bots []string `codec:"bots" json:"bots"` + RestrictedBots []string `codec:"restrictedBots" json:"restrictedBots"` +} + +func (o MessageSystemAddedToTeam) DeepCopy() MessageSystemAddedToTeam { + return MessageSystemAddedToTeam{ + Team: o.Team, + Adder: o.Adder, + Addee: o.Addee, + Role: o.Role.DeepCopy(), + BulkAdds: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.BulkAdds), + Owners: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Owners), + Admins: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Admins), + Writers: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Writers), + Readers: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Readers), + Bots: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Bots), + RestrictedBots: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.RestrictedBots), + } +} + +type MessageSystemInviteAddedToTeam struct { + Team string `codec:"team" json:"team"` + Inviter string `codec:"inviter" json:"inviter"` + Invitee string `codec:"invitee" json:"invitee"` + Adder string `codec:"adder" json:"adder"` + InviteType keybase1.TeamInviteCategory `codec:"inviteType" json:"inviteType"` + Role keybase1.TeamRole `codec:"role" json:"role"` +} + +func (o MessageSystemInviteAddedToTeam) DeepCopy() MessageSystemInviteAddedToTeam { + return MessageSystemInviteAddedToTeam{ + Team: o.Team, + Inviter: o.Inviter, + Invitee: o.Invitee, + Adder: o.Adder, + InviteType: o.InviteType.DeepCopy(), + Role: o.Role.DeepCopy(), + } +} + +type MessageSystemComplexTeam struct { + Team string `codec:"team" json:"team"` +} + +func (o MessageSystemComplexTeam) DeepCopy() MessageSystemComplexTeam { + return MessageSystemComplexTeam{ + Team: o.Team, + } +} + +type MessageSystemCreateTeam struct { + Team string `codec:"team" json:"team"` + Creator string `codec:"creator" json:"creator"` +} + +func (o MessageSystemCreateTeam) DeepCopy() MessageSystemCreateTeam { + return MessageSystemCreateTeam{ + Team: o.Team, + Creator: o.Creator, + } +} + +type MessageSystemGitPush struct { + Team string `codec:"team" json:"team"` + Pusher string `codec:"pusher" json:"pusher"` + RepoName string `codec:"repoName" json:"repoName"` + RepoID keybase1.RepoID `codec:"repoID" json:"repoID"` + Refs []keybase1.GitRefMetadata `codec:"refs" json:"refs"` + PushType keybase1.GitPushType `codec:"pushType" json:"pushType"` + PreviousRepoName string `codec:"previousRepoName" json:"previousRepoName"` +} + +func (o MessageSystemGitPush) DeepCopy() MessageSystemGitPush { + return MessageSystemGitPush{ + Team: o.Team, + Pusher: o.Pusher, + RepoName: o.RepoName, + RepoID: o.RepoID.DeepCopy(), + Refs: (func(x []keybase1.GitRefMetadata) []keybase1.GitRefMetadata { + if x == nil { + return nil + } + ret := make([]keybase1.GitRefMetadata, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Refs), + PushType: o.PushType.DeepCopy(), + PreviousRepoName: o.PreviousRepoName, + } +} + +type MessageSystemChangeAvatar struct { + Team string `codec:"team" json:"team"` + User string `codec:"user" json:"user"` +} + +func (o MessageSystemChangeAvatar) DeepCopy() MessageSystemChangeAvatar { + return MessageSystemChangeAvatar{ + Team: o.Team, + User: o.User, + } +} + +type MessageSystemChangeRetention struct { + IsTeam bool `codec:"isTeam" json:"isTeam"` + IsInherit bool `codec:"isInherit" json:"isInherit"` + MembersType ConversationMembersType `codec:"membersType" json:"membersType"` + Policy RetentionPolicy `codec:"policy" json:"policy"` + User string `codec:"user" json:"user"` +} + +func (o MessageSystemChangeRetention) DeepCopy() MessageSystemChangeRetention { + return MessageSystemChangeRetention{ + IsTeam: o.IsTeam, + IsInherit: o.IsInherit, + MembersType: o.MembersType.DeepCopy(), + Policy: o.Policy.DeepCopy(), + User: o.User, + } +} + +type MessageSystemBulkAddToConv struct { + Usernames []string `codec:"usernames" json:"usernames"` +} + +func (o MessageSystemBulkAddToConv) DeepCopy() MessageSystemBulkAddToConv { + return MessageSystemBulkAddToConv{ + Usernames: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Usernames), + } +} + +type MessageSystemSbsResolve struct { + AssertionService string `codec:"assertionService" json:"assertionService"` + AssertionUsername string `codec:"assertionUsername" json:"assertionUsername"` + Prover string `codec:"prover" json:"prover"` +} + +func (o MessageSystemSbsResolve) DeepCopy() MessageSystemSbsResolve { + return MessageSystemSbsResolve{ + AssertionService: o.AssertionService, + AssertionUsername: o.AssertionUsername, + Prover: o.Prover, + } +} + +type MessageSystem struct { + SystemType__ MessageSystemType `codec:"systemType" json:"systemType"` + Addedtoteam__ *MessageSystemAddedToTeam `codec:"addedtoteam,omitempty" json:"addedtoteam,omitempty"` + Inviteaddedtoteam__ *MessageSystemInviteAddedToTeam `codec:"inviteaddedtoteam,omitempty" json:"inviteaddedtoteam,omitempty"` + Complexteam__ *MessageSystemComplexTeam `codec:"complexteam,omitempty" json:"complexteam,omitempty"` + Createteam__ *MessageSystemCreateTeam `codec:"createteam,omitempty" json:"createteam,omitempty"` + Gitpush__ *MessageSystemGitPush `codec:"gitpush,omitempty" json:"gitpush,omitempty"` + Changeavatar__ *MessageSystemChangeAvatar `codec:"changeavatar,omitempty" json:"changeavatar,omitempty"` + Changeretention__ *MessageSystemChangeRetention `codec:"changeretention,omitempty" json:"changeretention,omitempty"` + Bulkaddtoconv__ *MessageSystemBulkAddToConv `codec:"bulkaddtoconv,omitempty" json:"bulkaddtoconv,omitempty"` + Sbsresolve__ *MessageSystemSbsResolve `codec:"sbsresolve,omitempty" json:"sbsresolve,omitempty"` +} + +func (o *MessageSystem) SystemType() (ret MessageSystemType, err error) { + switch o.SystemType__ { + case MessageSystemType_ADDEDTOTEAM: + if o.Addedtoteam__ == nil { + err = errors.New("unexpected nil value for Addedtoteam__") + return ret, err + } + case MessageSystemType_INVITEADDEDTOTEAM: + if o.Inviteaddedtoteam__ == nil { + err = errors.New("unexpected nil value for Inviteaddedtoteam__") + return ret, err + } + case MessageSystemType_COMPLEXTEAM: + if o.Complexteam__ == nil { + err = errors.New("unexpected nil value for Complexteam__") + return ret, err + } + case MessageSystemType_CREATETEAM: + if o.Createteam__ == nil { + err = errors.New("unexpected nil value for Createteam__") + return ret, err + } + case MessageSystemType_GITPUSH: + if o.Gitpush__ == nil { + err = errors.New("unexpected nil value for Gitpush__") + return ret, err + } + case MessageSystemType_CHANGEAVATAR: + if o.Changeavatar__ == nil { + err = errors.New("unexpected nil value for Changeavatar__") + return ret, err + } + case MessageSystemType_CHANGERETENTION: + if o.Changeretention__ == nil { + err = errors.New("unexpected nil value for Changeretention__") + return ret, err + } + case MessageSystemType_BULKADDTOCONV: + if o.Bulkaddtoconv__ == nil { + err = errors.New("unexpected nil value for Bulkaddtoconv__") + return ret, err + } + case MessageSystemType_SBSRESOLVE: + if o.Sbsresolve__ == nil { + err = errors.New("unexpected nil value for Sbsresolve__") + return ret, err + } + } + return o.SystemType__, nil +} + +func (o MessageSystem) Addedtoteam() (res MessageSystemAddedToTeam) { + if o.SystemType__ != MessageSystemType_ADDEDTOTEAM { + panic("wrong case accessed") + } + if o.Addedtoteam__ == nil { + return + } + return *o.Addedtoteam__ +} + +func (o MessageSystem) Inviteaddedtoteam() (res MessageSystemInviteAddedToTeam) { + if o.SystemType__ != MessageSystemType_INVITEADDEDTOTEAM { + panic("wrong case accessed") + } + if o.Inviteaddedtoteam__ == nil { + return + } + return *o.Inviteaddedtoteam__ +} + +func (o MessageSystem) Complexteam() (res MessageSystemComplexTeam) { + if o.SystemType__ != MessageSystemType_COMPLEXTEAM { + panic("wrong case accessed") + } + if o.Complexteam__ == nil { + return + } + return *o.Complexteam__ +} + +func (o MessageSystem) Createteam() (res MessageSystemCreateTeam) { + if o.SystemType__ != MessageSystemType_CREATETEAM { + panic("wrong case accessed") + } + if o.Createteam__ == nil { + return + } + return *o.Createteam__ +} + +func (o MessageSystem) Gitpush() (res MessageSystemGitPush) { + if o.SystemType__ != MessageSystemType_GITPUSH { + panic("wrong case accessed") + } + if o.Gitpush__ == nil { + return + } + return *o.Gitpush__ +} + +func (o MessageSystem) Changeavatar() (res MessageSystemChangeAvatar) { + if o.SystemType__ != MessageSystemType_CHANGEAVATAR { + panic("wrong case accessed") + } + if o.Changeavatar__ == nil { + return + } + return *o.Changeavatar__ +} + +func (o MessageSystem) Changeretention() (res MessageSystemChangeRetention) { + if o.SystemType__ != MessageSystemType_CHANGERETENTION { + panic("wrong case accessed") + } + if o.Changeretention__ == nil { + return + } + return *o.Changeretention__ +} + +func (o MessageSystem) Bulkaddtoconv() (res MessageSystemBulkAddToConv) { + if o.SystemType__ != MessageSystemType_BULKADDTOCONV { + panic("wrong case accessed") + } + if o.Bulkaddtoconv__ == nil { + return + } + return *o.Bulkaddtoconv__ +} + +func (o MessageSystem) Sbsresolve() (res MessageSystemSbsResolve) { + if o.SystemType__ != MessageSystemType_SBSRESOLVE { + panic("wrong case accessed") + } + if o.Sbsresolve__ == nil { + return + } + return *o.Sbsresolve__ +} + +func NewMessageSystemWithAddedtoteam(v MessageSystemAddedToTeam) MessageSystem { + return MessageSystem{ + SystemType__: MessageSystemType_ADDEDTOTEAM, + Addedtoteam__: &v, + } +} + +func NewMessageSystemWithInviteaddedtoteam(v MessageSystemInviteAddedToTeam) MessageSystem { + return MessageSystem{ + SystemType__: MessageSystemType_INVITEADDEDTOTEAM, + Inviteaddedtoteam__: &v, + } +} + +func NewMessageSystemWithComplexteam(v MessageSystemComplexTeam) MessageSystem { + return MessageSystem{ + SystemType__: MessageSystemType_COMPLEXTEAM, + Complexteam__: &v, + } +} + +func NewMessageSystemWithCreateteam(v MessageSystemCreateTeam) MessageSystem { + return MessageSystem{ + SystemType__: MessageSystemType_CREATETEAM, + Createteam__: &v, + } +} + +func NewMessageSystemWithGitpush(v MessageSystemGitPush) MessageSystem { + return MessageSystem{ + SystemType__: MessageSystemType_GITPUSH, + Gitpush__: &v, + } +} + +func NewMessageSystemWithChangeavatar(v MessageSystemChangeAvatar) MessageSystem { + return MessageSystem{ + SystemType__: MessageSystemType_CHANGEAVATAR, + Changeavatar__: &v, + } +} + +func NewMessageSystemWithChangeretention(v MessageSystemChangeRetention) MessageSystem { + return MessageSystem{ + SystemType__: MessageSystemType_CHANGERETENTION, + Changeretention__: &v, + } +} + +func NewMessageSystemWithBulkaddtoconv(v MessageSystemBulkAddToConv) MessageSystem { + return MessageSystem{ + SystemType__: MessageSystemType_BULKADDTOCONV, + Bulkaddtoconv__: &v, + } +} + +func NewMessageSystemWithSbsresolve(v MessageSystemSbsResolve) MessageSystem { + return MessageSystem{ + SystemType__: MessageSystemType_SBSRESOLVE, + Sbsresolve__: &v, + } +} + +func (o MessageSystem) DeepCopy() MessageSystem { + return MessageSystem{ + SystemType__: o.SystemType__.DeepCopy(), + Addedtoteam__: (func(x *MessageSystemAddedToTeam) *MessageSystemAddedToTeam { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Addedtoteam__), + Inviteaddedtoteam__: (func(x *MessageSystemInviteAddedToTeam) *MessageSystemInviteAddedToTeam { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Inviteaddedtoteam__), + Complexteam__: (func(x *MessageSystemComplexTeam) *MessageSystemComplexTeam { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Complexteam__), + Createteam__: (func(x *MessageSystemCreateTeam) *MessageSystemCreateTeam { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Createteam__), + Gitpush__: (func(x *MessageSystemGitPush) *MessageSystemGitPush { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Gitpush__), + Changeavatar__: (func(x *MessageSystemChangeAvatar) *MessageSystemChangeAvatar { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Changeavatar__), + Changeretention__: (func(x *MessageSystemChangeRetention) *MessageSystemChangeRetention { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Changeretention__), + Bulkaddtoconv__: (func(x *MessageSystemBulkAddToConv) *MessageSystemBulkAddToConv { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Bulkaddtoconv__), + Sbsresolve__: (func(x *MessageSystemSbsResolve) *MessageSystemSbsResolve { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Sbsresolve__), + } +} + +type MessageDeleteHistory struct { + Upto MessageID `codec:"upto" json:"upto"` +} + +func (o MessageDeleteHistory) DeepCopy() MessageDeleteHistory { + return MessageDeleteHistory{ + Upto: o.Upto.DeepCopy(), + } +} + +type MessageAttachment struct { + Object Asset `codec:"object" json:"object"` + Preview *Asset `codec:"preview,omitempty" json:"preview,omitempty"` + Previews []Asset `codec:"previews" json:"previews"` + Metadata []byte `codec:"metadata" json:"metadata"` + Uploaded bool `codec:"uploaded" json:"uploaded"` +} + +func (o MessageAttachment) DeepCopy() MessageAttachment { + return MessageAttachment{ + Object: o.Object.DeepCopy(), + Preview: (func(x *Asset) *Asset { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Preview), + Previews: (func(x []Asset) []Asset { + if x == nil { + return nil + } + ret := make([]Asset, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Previews), + Metadata: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.Metadata), + Uploaded: o.Uploaded, + } +} + +type MessageAttachmentUploaded struct { + MessageID MessageID `codec:"messageID" json:"messageID"` + Object Asset `codec:"object" json:"object"` + Previews []Asset `codec:"previews" json:"previews"` + Metadata []byte `codec:"metadata" json:"metadata"` +} + +func (o MessageAttachmentUploaded) DeepCopy() MessageAttachmentUploaded { + return MessageAttachmentUploaded{ + MessageID: o.MessageID.DeepCopy(), + Object: o.Object.DeepCopy(), + Previews: (func(x []Asset) []Asset { + if x == nil { + return nil + } + ret := make([]Asset, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Previews), + Metadata: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.Metadata), + } +} + +type MessageJoin struct { + Joiners []string `codec:"joiners" json:"joiners"` + Leavers []string `codec:"leavers" json:"leavers"` +} + +func (o MessageJoin) DeepCopy() MessageJoin { + return MessageJoin{ + Joiners: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Joiners), + Leavers: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Leavers), + } +} + +type MessageLeave struct { +} + +func (o MessageLeave) DeepCopy() MessageLeave { + return MessageLeave{} +} + +type MessageReaction struct { + MessageID MessageID `codec:"m" json:"m"` + Body string `codec:"b" json:"b"` +} + +func (o MessageReaction) DeepCopy() MessageReaction { + return MessageReaction{ + MessageID: o.MessageID.DeepCopy(), + Body: o.Body, + } +} + +type MessageSendPayment struct { + PaymentID stellar1.PaymentID `codec:"paymentID" json:"paymentID"` +} + +func (o MessageSendPayment) DeepCopy() MessageSendPayment { + return MessageSendPayment{ + PaymentID: o.PaymentID.DeepCopy(), + } +} + +type MessageRequestPayment struct { + RequestID stellar1.KeybaseRequestID `codec:"requestID" json:"requestID"` + Note string `codec:"note" json:"note"` +} + +func (o MessageRequestPayment) DeepCopy() MessageRequestPayment { + return MessageRequestPayment{ + RequestID: o.RequestID.DeepCopy(), + Note: o.Note, + } +} + +type MessageUnfurl struct { + Unfurl UnfurlResult `codec:"unfurl" json:"unfurl"` + MessageID MessageID `codec:"messageID" json:"messageID"` +} + +func (o MessageUnfurl) DeepCopy() MessageUnfurl { + return MessageUnfurl{ + Unfurl: o.Unfurl.DeepCopy(), + MessageID: o.MessageID.DeepCopy(), + } +} + +type MessageBody struct { + MessageType__ MessageType `codec:"messageType" json:"messageType"` + Text__ *MessageText `codec:"text,omitempty" json:"text,omitempty"` + Attachment__ *MessageAttachment `codec:"attachment,omitempty" json:"attachment,omitempty"` + Edit__ *MessageEdit `codec:"edit,omitempty" json:"edit,omitempty"` + Delete__ *MessageDelete `codec:"delete,omitempty" json:"delete,omitempty"` + Metadata__ *MessageConversationMetadata `codec:"metadata,omitempty" json:"metadata,omitempty"` + Headline__ *MessageHeadline `codec:"headline,omitempty" json:"headline,omitempty"` + Attachmentuploaded__ *MessageAttachmentUploaded `codec:"attachmentuploaded,omitempty" json:"attachmentuploaded,omitempty"` + Join__ *MessageJoin `codec:"join,omitempty" json:"join,omitempty"` + Leave__ *MessageLeave `codec:"leave,omitempty" json:"leave,omitempty"` + System__ *MessageSystem `codec:"system,omitempty" json:"system,omitempty"` + Deletehistory__ *MessageDeleteHistory `codec:"deletehistory,omitempty" json:"deletehistory,omitempty"` + Reaction__ *MessageReaction `codec:"reaction,omitempty" json:"reaction,omitempty"` + Sendpayment__ *MessageSendPayment `codec:"sendpayment,omitempty" json:"sendpayment,omitempty"` + Requestpayment__ *MessageRequestPayment `codec:"requestpayment,omitempty" json:"requestpayment,omitempty"` + Unfurl__ *MessageUnfurl `codec:"unfurl,omitempty" json:"unfurl,omitempty"` + Flip__ *MessageFlip `codec:"flip,omitempty" json:"flip,omitempty"` + Pin__ *MessagePin `codec:"pin,omitempty" json:"pin,omitempty"` +} + +func (o *MessageBody) MessageType() (ret MessageType, err error) { + switch o.MessageType__ { + case MessageType_TEXT: + if o.Text__ == nil { + err = errors.New("unexpected nil value for Text__") + return ret, err + } + case MessageType_ATTACHMENT: + if o.Attachment__ == nil { + err = errors.New("unexpected nil value for Attachment__") + return ret, err + } + case MessageType_EDIT: + if o.Edit__ == nil { + err = errors.New("unexpected nil value for Edit__") + return ret, err + } + case MessageType_DELETE: + if o.Delete__ == nil { + err = errors.New("unexpected nil value for Delete__") + return ret, err + } + case MessageType_METADATA: + if o.Metadata__ == nil { + err = errors.New("unexpected nil value for Metadata__") + return ret, err + } + case MessageType_HEADLINE: + if o.Headline__ == nil { + err = errors.New("unexpected nil value for Headline__") + return ret, err + } + case MessageType_ATTACHMENTUPLOADED: + if o.Attachmentuploaded__ == nil { + err = errors.New("unexpected nil value for Attachmentuploaded__") + return ret, err + } + case MessageType_JOIN: + if o.Join__ == nil { + err = errors.New("unexpected nil value for Join__") + return ret, err + } + case MessageType_LEAVE: + if o.Leave__ == nil { + err = errors.New("unexpected nil value for Leave__") + return ret, err + } + case MessageType_SYSTEM: + if o.System__ == nil { + err = errors.New("unexpected nil value for System__") + return ret, err + } + case MessageType_DELETEHISTORY: + if o.Deletehistory__ == nil { + err = errors.New("unexpected nil value for Deletehistory__") + return ret, err + } + case MessageType_REACTION: + if o.Reaction__ == nil { + err = errors.New("unexpected nil value for Reaction__") + return ret, err + } + case MessageType_SENDPAYMENT: + if o.Sendpayment__ == nil { + err = errors.New("unexpected nil value for Sendpayment__") + return ret, err + } + case MessageType_REQUESTPAYMENT: + if o.Requestpayment__ == nil { + err = errors.New("unexpected nil value for Requestpayment__") + return ret, err + } + case MessageType_UNFURL: + if o.Unfurl__ == nil { + err = errors.New("unexpected nil value for Unfurl__") + return ret, err + } + case MessageType_FLIP: + if o.Flip__ == nil { + err = errors.New("unexpected nil value for Flip__") + return ret, err + } + case MessageType_PIN: + if o.Pin__ == nil { + err = errors.New("unexpected nil value for Pin__") + return ret, err + } + } + return o.MessageType__, nil +} + +func (o MessageBody) Text() (res MessageText) { + if o.MessageType__ != MessageType_TEXT { + panic("wrong case accessed") + } + if o.Text__ == nil { + return + } + return *o.Text__ +} + +func (o MessageBody) Attachment() (res MessageAttachment) { + if o.MessageType__ != MessageType_ATTACHMENT { + panic("wrong case accessed") + } + if o.Attachment__ == nil { + return + } + return *o.Attachment__ +} + +func (o MessageBody) Edit() (res MessageEdit) { + if o.MessageType__ != MessageType_EDIT { + panic("wrong case accessed") + } + if o.Edit__ == nil { + return + } + return *o.Edit__ +} + +func (o MessageBody) Delete() (res MessageDelete) { + if o.MessageType__ != MessageType_DELETE { + panic("wrong case accessed") + } + if o.Delete__ == nil { + return + } + return *o.Delete__ +} + +func (o MessageBody) Metadata() (res MessageConversationMetadata) { + if o.MessageType__ != MessageType_METADATA { + panic("wrong case accessed") + } + if o.Metadata__ == nil { + return + } + return *o.Metadata__ +} + +func (o MessageBody) Headline() (res MessageHeadline) { + if o.MessageType__ != MessageType_HEADLINE { + panic("wrong case accessed") + } + if o.Headline__ == nil { + return + } + return *o.Headline__ +} + +func (o MessageBody) Attachmentuploaded() (res MessageAttachmentUploaded) { + if o.MessageType__ != MessageType_ATTACHMENTUPLOADED { + panic("wrong case accessed") + } + if o.Attachmentuploaded__ == nil { + return + } + return *o.Attachmentuploaded__ +} + +func (o MessageBody) Join() (res MessageJoin) { + if o.MessageType__ != MessageType_JOIN { + panic("wrong case accessed") + } + if o.Join__ == nil { + return + } + return *o.Join__ +} + +func (o MessageBody) Leave() (res MessageLeave) { + if o.MessageType__ != MessageType_LEAVE { + panic("wrong case accessed") + } + if o.Leave__ == nil { + return + } + return *o.Leave__ +} + +func (o MessageBody) System() (res MessageSystem) { + if o.MessageType__ != MessageType_SYSTEM { + panic("wrong case accessed") + } + if o.System__ == nil { + return + } + return *o.System__ +} + +func (o MessageBody) Deletehistory() (res MessageDeleteHistory) { + if o.MessageType__ != MessageType_DELETEHISTORY { + panic("wrong case accessed") + } + if o.Deletehistory__ == nil { + return + } + return *o.Deletehistory__ +} + +func (o MessageBody) Reaction() (res MessageReaction) { + if o.MessageType__ != MessageType_REACTION { + panic("wrong case accessed") + } + if o.Reaction__ == nil { + return + } + return *o.Reaction__ +} + +func (o MessageBody) Sendpayment() (res MessageSendPayment) { + if o.MessageType__ != MessageType_SENDPAYMENT { + panic("wrong case accessed") + } + if o.Sendpayment__ == nil { + return + } + return *o.Sendpayment__ +} + +func (o MessageBody) Requestpayment() (res MessageRequestPayment) { + if o.MessageType__ != MessageType_REQUESTPAYMENT { + panic("wrong case accessed") + } + if o.Requestpayment__ == nil { + return + } + return *o.Requestpayment__ +} + +func (o MessageBody) Unfurl() (res MessageUnfurl) { + if o.MessageType__ != MessageType_UNFURL { + panic("wrong case accessed") + } + if o.Unfurl__ == nil { + return + } + return *o.Unfurl__ +} + +func (o MessageBody) Flip() (res MessageFlip) { + if o.MessageType__ != MessageType_FLIP { + panic("wrong case accessed") + } + if o.Flip__ == nil { + return + } + return *o.Flip__ +} + +func (o MessageBody) Pin() (res MessagePin) { + if o.MessageType__ != MessageType_PIN { + panic("wrong case accessed") + } + if o.Pin__ == nil { + return + } + return *o.Pin__ +} + +func NewMessageBodyWithText(v MessageText) MessageBody { + return MessageBody{ + MessageType__: MessageType_TEXT, + Text__: &v, + } +} + +func NewMessageBodyWithAttachment(v MessageAttachment) MessageBody { + return MessageBody{ + MessageType__: MessageType_ATTACHMENT, + Attachment__: &v, + } +} + +func NewMessageBodyWithEdit(v MessageEdit) MessageBody { + return MessageBody{ + MessageType__: MessageType_EDIT, + Edit__: &v, + } +} + +func NewMessageBodyWithDelete(v MessageDelete) MessageBody { + return MessageBody{ + MessageType__: MessageType_DELETE, + Delete__: &v, + } +} + +func NewMessageBodyWithMetadata(v MessageConversationMetadata) MessageBody { + return MessageBody{ + MessageType__: MessageType_METADATA, + Metadata__: &v, + } +} + +func NewMessageBodyWithHeadline(v MessageHeadline) MessageBody { + return MessageBody{ + MessageType__: MessageType_HEADLINE, + Headline__: &v, + } +} + +func NewMessageBodyWithAttachmentuploaded(v MessageAttachmentUploaded) MessageBody { + return MessageBody{ + MessageType__: MessageType_ATTACHMENTUPLOADED, + Attachmentuploaded__: &v, + } +} + +func NewMessageBodyWithJoin(v MessageJoin) MessageBody { + return MessageBody{ + MessageType__: MessageType_JOIN, + Join__: &v, + } +} + +func NewMessageBodyWithLeave(v MessageLeave) MessageBody { + return MessageBody{ + MessageType__: MessageType_LEAVE, + Leave__: &v, + } +} + +func NewMessageBodyWithSystem(v MessageSystem) MessageBody { + return MessageBody{ + MessageType__: MessageType_SYSTEM, + System__: &v, + } +} + +func NewMessageBodyWithDeletehistory(v MessageDeleteHistory) MessageBody { + return MessageBody{ + MessageType__: MessageType_DELETEHISTORY, + Deletehistory__: &v, + } +} + +func NewMessageBodyWithReaction(v MessageReaction) MessageBody { + return MessageBody{ + MessageType__: MessageType_REACTION, + Reaction__: &v, + } +} + +func NewMessageBodyWithSendpayment(v MessageSendPayment) MessageBody { + return MessageBody{ + MessageType__: MessageType_SENDPAYMENT, + Sendpayment__: &v, + } +} + +func NewMessageBodyWithRequestpayment(v MessageRequestPayment) MessageBody { + return MessageBody{ + MessageType__: MessageType_REQUESTPAYMENT, + Requestpayment__: &v, + } +} + +func NewMessageBodyWithUnfurl(v MessageUnfurl) MessageBody { + return MessageBody{ + MessageType__: MessageType_UNFURL, + Unfurl__: &v, + } +} + +func NewMessageBodyWithFlip(v MessageFlip) MessageBody { + return MessageBody{ + MessageType__: MessageType_FLIP, + Flip__: &v, + } +} + +func NewMessageBodyWithPin(v MessagePin) MessageBody { + return MessageBody{ + MessageType__: MessageType_PIN, + Pin__: &v, + } +} + +func (o MessageBody) DeepCopy() MessageBody { + return MessageBody{ + MessageType__: o.MessageType__.DeepCopy(), + Text__: (func(x *MessageText) *MessageText { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Text__), + Attachment__: (func(x *MessageAttachment) *MessageAttachment { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Attachment__), + Edit__: (func(x *MessageEdit) *MessageEdit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Edit__), + Delete__: (func(x *MessageDelete) *MessageDelete { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Delete__), + Metadata__: (func(x *MessageConversationMetadata) *MessageConversationMetadata { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Metadata__), + Headline__: (func(x *MessageHeadline) *MessageHeadline { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Headline__), + Attachmentuploaded__: (func(x *MessageAttachmentUploaded) *MessageAttachmentUploaded { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Attachmentuploaded__), + Join__: (func(x *MessageJoin) *MessageJoin { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Join__), + Leave__: (func(x *MessageLeave) *MessageLeave { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Leave__), + System__: (func(x *MessageSystem) *MessageSystem { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.System__), + Deletehistory__: (func(x *MessageDeleteHistory) *MessageDeleteHistory { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Deletehistory__), + Reaction__: (func(x *MessageReaction) *MessageReaction { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Reaction__), + Sendpayment__: (func(x *MessageSendPayment) *MessageSendPayment { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Sendpayment__), + Requestpayment__: (func(x *MessageRequestPayment) *MessageRequestPayment { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Requestpayment__), + Unfurl__: (func(x *MessageUnfurl) *MessageUnfurl { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Unfurl__), + Flip__: (func(x *MessageFlip) *MessageFlip { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Flip__), + Pin__: (func(x *MessagePin) *MessagePin { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Pin__), + } +} + +type SenderPrepareOptions struct { + SkipTopicNameState bool `codec:"skipTopicNameState" json:"skipTopicNameState"` + ReplyTo *MessageID `codec:"replyTo,omitempty" json:"replyTo,omitempty"` +} + +func (o SenderPrepareOptions) DeepCopy() SenderPrepareOptions { + return SenderPrepareOptions{ + SkipTopicNameState: o.SkipTopicNameState, + ReplyTo: (func(x *MessageID) *MessageID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ReplyTo), + } +} + +type SenderSendOptions struct { + JoinMentionsAs *ConversationMemberStatus `codec:"joinMentionsAs,omitempty" json:"joinMentionsAs,omitempty"` +} + +func (o SenderSendOptions) DeepCopy() SenderSendOptions { + return SenderSendOptions{ + JoinMentionsAs: (func(x *ConversationMemberStatus) *ConversationMemberStatus { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.JoinMentionsAs), + } +} + +type OutboxStateType int + +const ( + OutboxStateType_SENDING OutboxStateType = 0 + OutboxStateType_ERROR OutboxStateType = 1 +) + +func (o OutboxStateType) DeepCopy() OutboxStateType { return o } + +var OutboxStateTypeMap = map[string]OutboxStateType{ + "SENDING": 0, + "ERROR": 1, +} + +var OutboxStateTypeRevMap = map[OutboxStateType]string{ + 0: "SENDING", + 1: "ERROR", +} + +func (e OutboxStateType) String() string { + if v, ok := OutboxStateTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type OutboxErrorType int + +const ( + OutboxErrorType_MISC OutboxErrorType = 0 + OutboxErrorType_OFFLINE OutboxErrorType = 1 + OutboxErrorType_IDENTIFY OutboxErrorType = 2 + OutboxErrorType_TOOLONG OutboxErrorType = 3 + OutboxErrorType_DUPLICATE OutboxErrorType = 4 + OutboxErrorType_EXPIRED OutboxErrorType = 5 + OutboxErrorType_TOOMANYATTEMPTS OutboxErrorType = 6 + OutboxErrorType_ALREADY_DELETED OutboxErrorType = 7 + OutboxErrorType_UPLOADFAILED OutboxErrorType = 8 + OutboxErrorType_RESTRICTEDBOT OutboxErrorType = 9 + OutboxErrorType_MINWRITER OutboxErrorType = 10 +) + +func (o OutboxErrorType) DeepCopy() OutboxErrorType { return o } + +var OutboxErrorTypeMap = map[string]OutboxErrorType{ + "MISC": 0, + "OFFLINE": 1, + "IDENTIFY": 2, + "TOOLONG": 3, + "DUPLICATE": 4, + "EXPIRED": 5, + "TOOMANYATTEMPTS": 6, + "ALREADY_DELETED": 7, + "UPLOADFAILED": 8, + "RESTRICTEDBOT": 9, + "MINWRITER": 10, +} + +var OutboxErrorTypeRevMap = map[OutboxErrorType]string{ + 0: "MISC", + 1: "OFFLINE", + 2: "IDENTIFY", + 3: "TOOLONG", + 4: "DUPLICATE", + 5: "EXPIRED", + 6: "TOOMANYATTEMPTS", + 7: "ALREADY_DELETED", + 8: "UPLOADFAILED", + 9: "RESTRICTEDBOT", + 10: "MINWRITER", +} + +func (e OutboxErrorType) String() string { + if v, ok := OutboxErrorTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type OutboxStateError struct { + Message string `codec:"message" json:"message"` + Typ OutboxErrorType `codec:"typ" json:"typ"` +} + +func (o OutboxStateError) DeepCopy() OutboxStateError { + return OutboxStateError{ + Message: o.Message, + Typ: o.Typ.DeepCopy(), + } +} + +type OutboxState struct { + State__ OutboxStateType `codec:"state" json:"state"` + Sending__ *int `codec:"sending,omitempty" json:"sending,omitempty"` + Error__ *OutboxStateError `codec:"error,omitempty" json:"error,omitempty"` +} + +func (o *OutboxState) State() (ret OutboxStateType, err error) { + switch o.State__ { + case OutboxStateType_SENDING: + if o.Sending__ == nil { + err = errors.New("unexpected nil value for Sending__") + return ret, err + } + case OutboxStateType_ERROR: + if o.Error__ == nil { + err = errors.New("unexpected nil value for Error__") + return ret, err + } + } + return o.State__, nil +} + +func (o OutboxState) Sending() (res int) { + if o.State__ != OutboxStateType_SENDING { + panic("wrong case accessed") + } + if o.Sending__ == nil { + return + } + return *o.Sending__ +} + +func (o OutboxState) Error() (res OutboxStateError) { + if o.State__ != OutboxStateType_ERROR { + panic("wrong case accessed") + } + if o.Error__ == nil { + return + } + return *o.Error__ +} + +func NewOutboxStateWithSending(v int) OutboxState { + return OutboxState{ + State__: OutboxStateType_SENDING, + Sending__: &v, + } +} + +func NewOutboxStateWithError(v OutboxStateError) OutboxState { + return OutboxState{ + State__: OutboxStateType_ERROR, + Error__: &v, + } +} + +func (o OutboxState) DeepCopy() OutboxState { + return OutboxState{ + State__: o.State__.DeepCopy(), + Sending__: (func(x *int) *int { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Sending__), + Error__: (func(x *OutboxStateError) *OutboxStateError { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Error__), + } +} + +type OutboxRecord struct { + State OutboxState `codec:"state" json:"state"` + OutboxID OutboxID `codec:"outboxID" json:"outboxID"` + ConvID ConversationID `codec:"convID" json:"convID"` + Ctime gregor1.Time `codec:"ctime" json:"ctime"` + Msg MessagePlaintext `codec:"Msg" json:"Msg"` + IdentifyBehavior keybase1.TLFIdentifyBehavior `codec:"identifyBehavior" json:"identifyBehavior"` + PrepareOpts *SenderPrepareOptions `codec:"prepareOpts,omitempty" json:"prepareOpts,omitempty"` + SendOpts *SenderSendOptions `codec:"sendOpts,omitempty" json:"sendOpts,omitempty"` + Ordinal int `codec:"ordinal" json:"ordinal"` + Preview *MakePreviewRes `codec:"preview,omitempty" json:"preview,omitempty"` + ReplyTo *MessageUnboxed `codec:"replyTo,omitempty" json:"replyTo,omitempty"` +} + +func (o OutboxRecord) DeepCopy() OutboxRecord { + return OutboxRecord{ + State: o.State.DeepCopy(), + OutboxID: o.OutboxID.DeepCopy(), + ConvID: o.ConvID.DeepCopy(), + Ctime: o.Ctime.DeepCopy(), + Msg: o.Msg.DeepCopy(), + IdentifyBehavior: o.IdentifyBehavior.DeepCopy(), + PrepareOpts: (func(x *SenderPrepareOptions) *SenderPrepareOptions { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.PrepareOpts), + SendOpts: (func(x *SenderSendOptions) *SenderSendOptions { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.SendOpts), + Ordinal: o.Ordinal, + Preview: (func(x *MakePreviewRes) *MakePreviewRes { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Preview), + ReplyTo: (func(x *MessageUnboxed) *MessageUnboxed { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ReplyTo), + } +} + +type HeaderPlaintextVersion int + +const ( + HeaderPlaintextVersion_V1 HeaderPlaintextVersion = 1 + HeaderPlaintextVersion_V2 HeaderPlaintextVersion = 2 + HeaderPlaintextVersion_V3 HeaderPlaintextVersion = 3 + HeaderPlaintextVersion_V4 HeaderPlaintextVersion = 4 + HeaderPlaintextVersion_V5 HeaderPlaintextVersion = 5 + HeaderPlaintextVersion_V6 HeaderPlaintextVersion = 6 + HeaderPlaintextVersion_V7 HeaderPlaintextVersion = 7 + HeaderPlaintextVersion_V8 HeaderPlaintextVersion = 8 + HeaderPlaintextVersion_V9 HeaderPlaintextVersion = 9 + HeaderPlaintextVersion_V10 HeaderPlaintextVersion = 10 +) + +func (o HeaderPlaintextVersion) DeepCopy() HeaderPlaintextVersion { return o } + +var HeaderPlaintextVersionMap = map[string]HeaderPlaintextVersion{ + "V1": 1, + "V2": 2, + "V3": 3, + "V4": 4, + "V5": 5, + "V6": 6, + "V7": 7, + "V8": 8, + "V9": 9, + "V10": 10, +} + +var HeaderPlaintextVersionRevMap = map[HeaderPlaintextVersion]string{ + 1: "V1", + 2: "V2", + 3: "V3", + 4: "V4", + 5: "V5", + 6: "V6", + 7: "V7", + 8: "V8", + 9: "V9", + 10: "V10", +} + +func (e HeaderPlaintextVersion) String() string { + if v, ok := HeaderPlaintextVersionRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type HeaderPlaintextMetaInfo struct { + Crit bool `codec:"crit" json:"crit"` +} + +func (o HeaderPlaintextMetaInfo) DeepCopy() HeaderPlaintextMetaInfo { + return HeaderPlaintextMetaInfo{ + Crit: o.Crit, + } +} + +type HeaderPlaintextUnsupported struct { + Mi HeaderPlaintextMetaInfo `codec:"mi" json:"mi"` +} + +func (o HeaderPlaintextUnsupported) DeepCopy() HeaderPlaintextUnsupported { + return HeaderPlaintextUnsupported{ + Mi: o.Mi.DeepCopy(), + } +} + +type HeaderPlaintextV1 struct { + Conv ConversationIDTriple `codec:"conv" json:"conv"` + TlfName string `codec:"tlfName" json:"tlfName"` + TlfPublic bool `codec:"tlfPublic" json:"tlfPublic"` + MessageType MessageType `codec:"messageType" json:"messageType"` + Prev []MessagePreviousPointer `codec:"prev" json:"prev"` + Sender gregor1.UID `codec:"sender" json:"sender"` + SenderDevice gregor1.DeviceID `codec:"senderDevice" json:"senderDevice"` + KbfsCryptKeysUsed *bool `codec:"kbfsCryptKeysUsed,omitempty" json:"kbfsCryptKeysUsed,omitempty"` + BodyHash Hash `codec:"bodyHash" json:"bodyHash"` + OutboxInfo *OutboxInfo `codec:"outboxInfo,omitempty" json:"outboxInfo,omitempty"` + OutboxID *OutboxID `codec:"outboxID,omitempty" json:"outboxID,omitempty"` + HeaderSignature *SignatureInfo `codec:"headerSignature,omitempty" json:"headerSignature,omitempty"` + MerkleRoot *MerkleRoot `codec:"merkleRoot,omitempty" json:"merkleRoot,omitempty"` + EphemeralMetadata *MsgEphemeralMetadata `codec:"em,omitempty" json:"em,omitempty"` + BotUID *gregor1.UID `codec:"b,omitempty" json:"b,omitempty"` +} + +func (o HeaderPlaintextV1) DeepCopy() HeaderPlaintextV1 { + return HeaderPlaintextV1{ + Conv: o.Conv.DeepCopy(), + TlfName: o.TlfName, + TlfPublic: o.TlfPublic, + MessageType: o.MessageType.DeepCopy(), + Prev: (func(x []MessagePreviousPointer) []MessagePreviousPointer { + if x == nil { + return nil + } + ret := make([]MessagePreviousPointer, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Prev), + Sender: o.Sender.DeepCopy(), + SenderDevice: o.SenderDevice.DeepCopy(), + KbfsCryptKeysUsed: (func(x *bool) *bool { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.KbfsCryptKeysUsed), + BodyHash: o.BodyHash.DeepCopy(), + OutboxInfo: (func(x *OutboxInfo) *OutboxInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.OutboxInfo), + OutboxID: (func(x *OutboxID) *OutboxID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.OutboxID), + HeaderSignature: (func(x *SignatureInfo) *SignatureInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.HeaderSignature), + MerkleRoot: (func(x *MerkleRoot) *MerkleRoot { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.MerkleRoot), + EphemeralMetadata: (func(x *MsgEphemeralMetadata) *MsgEphemeralMetadata { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.EphemeralMetadata), + BotUID: (func(x *gregor1.UID) *gregor1.UID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.BotUID), + } +} + +type HeaderPlaintext struct { + Version__ HeaderPlaintextVersion `codec:"version" json:"version"` + V1__ *HeaderPlaintextV1 `codec:"v1,omitempty" json:"v1,omitempty"` + V2__ *HeaderPlaintextUnsupported `codec:"v2,omitempty" json:"v2,omitempty"` + V3__ *HeaderPlaintextUnsupported `codec:"v3,omitempty" json:"v3,omitempty"` + V4__ *HeaderPlaintextUnsupported `codec:"v4,omitempty" json:"v4,omitempty"` + V5__ *HeaderPlaintextUnsupported `codec:"v5,omitempty" json:"v5,omitempty"` + V6__ *HeaderPlaintextUnsupported `codec:"v6,omitempty" json:"v6,omitempty"` + V7__ *HeaderPlaintextUnsupported `codec:"v7,omitempty" json:"v7,omitempty"` + V8__ *HeaderPlaintextUnsupported `codec:"v8,omitempty" json:"v8,omitempty"` + V9__ *HeaderPlaintextUnsupported `codec:"v9,omitempty" json:"v9,omitempty"` + V10__ *HeaderPlaintextUnsupported `codec:"v10,omitempty" json:"v10,omitempty"` +} + +func (o *HeaderPlaintext) Version() (ret HeaderPlaintextVersion, err error) { + switch o.Version__ { + case HeaderPlaintextVersion_V1: + if o.V1__ == nil { + err = errors.New("unexpected nil value for V1__") + return ret, err + } + case HeaderPlaintextVersion_V2: + if o.V2__ == nil { + err = errors.New("unexpected nil value for V2__") + return ret, err + } + case HeaderPlaintextVersion_V3: + if o.V3__ == nil { + err = errors.New("unexpected nil value for V3__") + return ret, err + } + case HeaderPlaintextVersion_V4: + if o.V4__ == nil { + err = errors.New("unexpected nil value for V4__") + return ret, err + } + case HeaderPlaintextVersion_V5: + if o.V5__ == nil { + err = errors.New("unexpected nil value for V5__") + return ret, err + } + case HeaderPlaintextVersion_V6: + if o.V6__ == nil { + err = errors.New("unexpected nil value for V6__") + return ret, err + } + case HeaderPlaintextVersion_V7: + if o.V7__ == nil { + err = errors.New("unexpected nil value for V7__") + return ret, err + } + case HeaderPlaintextVersion_V8: + if o.V8__ == nil { + err = errors.New("unexpected nil value for V8__") + return ret, err + } + case HeaderPlaintextVersion_V9: + if o.V9__ == nil { + err = errors.New("unexpected nil value for V9__") + return ret, err + } + case HeaderPlaintextVersion_V10: + if o.V10__ == nil { + err = errors.New("unexpected nil value for V10__") + return ret, err + } + } + return o.Version__, nil +} + +func (o HeaderPlaintext) V1() (res HeaderPlaintextV1) { + if o.Version__ != HeaderPlaintextVersion_V1 { + panic("wrong case accessed") + } + if o.V1__ == nil { + return + } + return *o.V1__ +} + +func (o HeaderPlaintext) V2() (res HeaderPlaintextUnsupported) { + if o.Version__ != HeaderPlaintextVersion_V2 { + panic("wrong case accessed") + } + if o.V2__ == nil { + return + } + return *o.V2__ +} + +func (o HeaderPlaintext) V3() (res HeaderPlaintextUnsupported) { + if o.Version__ != HeaderPlaintextVersion_V3 { + panic("wrong case accessed") + } + if o.V3__ == nil { + return + } + return *o.V3__ +} + +func (o HeaderPlaintext) V4() (res HeaderPlaintextUnsupported) { + if o.Version__ != HeaderPlaintextVersion_V4 { + panic("wrong case accessed") + } + if o.V4__ == nil { + return + } + return *o.V4__ +} + +func (o HeaderPlaintext) V5() (res HeaderPlaintextUnsupported) { + if o.Version__ != HeaderPlaintextVersion_V5 { + panic("wrong case accessed") + } + if o.V5__ == nil { + return + } + return *o.V5__ +} + +func (o HeaderPlaintext) V6() (res HeaderPlaintextUnsupported) { + if o.Version__ != HeaderPlaintextVersion_V6 { + panic("wrong case accessed") + } + if o.V6__ == nil { + return + } + return *o.V6__ +} + +func (o HeaderPlaintext) V7() (res HeaderPlaintextUnsupported) { + if o.Version__ != HeaderPlaintextVersion_V7 { + panic("wrong case accessed") + } + if o.V7__ == nil { + return + } + return *o.V7__ +} + +func (o HeaderPlaintext) V8() (res HeaderPlaintextUnsupported) { + if o.Version__ != HeaderPlaintextVersion_V8 { + panic("wrong case accessed") + } + if o.V8__ == nil { + return + } + return *o.V8__ +} + +func (o HeaderPlaintext) V9() (res HeaderPlaintextUnsupported) { + if o.Version__ != HeaderPlaintextVersion_V9 { + panic("wrong case accessed") + } + if o.V9__ == nil { + return + } + return *o.V9__ +} + +func (o HeaderPlaintext) V10() (res HeaderPlaintextUnsupported) { + if o.Version__ != HeaderPlaintextVersion_V10 { + panic("wrong case accessed") + } + if o.V10__ == nil { + return + } + return *o.V10__ +} + +func NewHeaderPlaintextWithV1(v HeaderPlaintextV1) HeaderPlaintext { + return HeaderPlaintext{ + Version__: HeaderPlaintextVersion_V1, + V1__: &v, + } +} + +func NewHeaderPlaintextWithV2(v HeaderPlaintextUnsupported) HeaderPlaintext { + return HeaderPlaintext{ + Version__: HeaderPlaintextVersion_V2, + V2__: &v, + } +} + +func NewHeaderPlaintextWithV3(v HeaderPlaintextUnsupported) HeaderPlaintext { + return HeaderPlaintext{ + Version__: HeaderPlaintextVersion_V3, + V3__: &v, + } +} + +func NewHeaderPlaintextWithV4(v HeaderPlaintextUnsupported) HeaderPlaintext { + return HeaderPlaintext{ + Version__: HeaderPlaintextVersion_V4, + V4__: &v, + } +} + +func NewHeaderPlaintextWithV5(v HeaderPlaintextUnsupported) HeaderPlaintext { + return HeaderPlaintext{ + Version__: HeaderPlaintextVersion_V5, + V5__: &v, + } +} + +func NewHeaderPlaintextWithV6(v HeaderPlaintextUnsupported) HeaderPlaintext { + return HeaderPlaintext{ + Version__: HeaderPlaintextVersion_V6, + V6__: &v, + } +} + +func NewHeaderPlaintextWithV7(v HeaderPlaintextUnsupported) HeaderPlaintext { + return HeaderPlaintext{ + Version__: HeaderPlaintextVersion_V7, + V7__: &v, + } +} + +func NewHeaderPlaintextWithV8(v HeaderPlaintextUnsupported) HeaderPlaintext { + return HeaderPlaintext{ + Version__: HeaderPlaintextVersion_V8, + V8__: &v, + } +} + +func NewHeaderPlaintextWithV9(v HeaderPlaintextUnsupported) HeaderPlaintext { + return HeaderPlaintext{ + Version__: HeaderPlaintextVersion_V9, + V9__: &v, + } +} + +func NewHeaderPlaintextWithV10(v HeaderPlaintextUnsupported) HeaderPlaintext { + return HeaderPlaintext{ + Version__: HeaderPlaintextVersion_V10, + V10__: &v, + } +} + +func (o HeaderPlaintext) DeepCopy() HeaderPlaintext { + return HeaderPlaintext{ + Version__: o.Version__.DeepCopy(), + V1__: (func(x *HeaderPlaintextV1) *HeaderPlaintextV1 { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V1__), + V2__: (func(x *HeaderPlaintextUnsupported) *HeaderPlaintextUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V2__), + V3__: (func(x *HeaderPlaintextUnsupported) *HeaderPlaintextUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V3__), + V4__: (func(x *HeaderPlaintextUnsupported) *HeaderPlaintextUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V4__), + V5__: (func(x *HeaderPlaintextUnsupported) *HeaderPlaintextUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V5__), + V6__: (func(x *HeaderPlaintextUnsupported) *HeaderPlaintextUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V6__), + V7__: (func(x *HeaderPlaintextUnsupported) *HeaderPlaintextUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V7__), + V8__: (func(x *HeaderPlaintextUnsupported) *HeaderPlaintextUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V8__), + V9__: (func(x *HeaderPlaintextUnsupported) *HeaderPlaintextUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V9__), + V10__: (func(x *HeaderPlaintextUnsupported) *HeaderPlaintextUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V10__), + } +} + +type BodyPlaintextVersion int + +const ( + BodyPlaintextVersion_V1 BodyPlaintextVersion = 1 + BodyPlaintextVersion_V2 BodyPlaintextVersion = 2 + BodyPlaintextVersion_V3 BodyPlaintextVersion = 3 + BodyPlaintextVersion_V4 BodyPlaintextVersion = 4 + BodyPlaintextVersion_V5 BodyPlaintextVersion = 5 + BodyPlaintextVersion_V6 BodyPlaintextVersion = 6 + BodyPlaintextVersion_V7 BodyPlaintextVersion = 7 + BodyPlaintextVersion_V8 BodyPlaintextVersion = 8 + BodyPlaintextVersion_V9 BodyPlaintextVersion = 9 + BodyPlaintextVersion_V10 BodyPlaintextVersion = 10 +) + +func (o BodyPlaintextVersion) DeepCopy() BodyPlaintextVersion { return o } + +var BodyPlaintextVersionMap = map[string]BodyPlaintextVersion{ + "V1": 1, + "V2": 2, + "V3": 3, + "V4": 4, + "V5": 5, + "V6": 6, + "V7": 7, + "V8": 8, + "V9": 9, + "V10": 10, +} + +var BodyPlaintextVersionRevMap = map[BodyPlaintextVersion]string{ + 1: "V1", + 2: "V2", + 3: "V3", + 4: "V4", + 5: "V5", + 6: "V6", + 7: "V7", + 8: "V8", + 9: "V9", + 10: "V10", +} + +func (e BodyPlaintextVersion) String() string { + if v, ok := BodyPlaintextVersionRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type BodyPlaintextMetaInfo struct { + Crit bool `codec:"crit" json:"crit"` +} + +func (o BodyPlaintextMetaInfo) DeepCopy() BodyPlaintextMetaInfo { + return BodyPlaintextMetaInfo{ + Crit: o.Crit, + } +} + +type BodyPlaintextUnsupported struct { + Mi BodyPlaintextMetaInfo `codec:"mi" json:"mi"` +} + +func (o BodyPlaintextUnsupported) DeepCopy() BodyPlaintextUnsupported { + return BodyPlaintextUnsupported{ + Mi: o.Mi.DeepCopy(), + } +} + +type BodyPlaintextV1 struct { + MessageBody MessageBody `codec:"messageBody" json:"messageBody"` +} + +func (o BodyPlaintextV1) DeepCopy() BodyPlaintextV1 { + return BodyPlaintextV1{ + MessageBody: o.MessageBody.DeepCopy(), + } +} + +type BodyPlaintextV2 struct { + MessageBody MessageBody `codec:"messageBody" json:"messageBody"` + Mi BodyPlaintextMetaInfo `codec:"mi" json:"mi"` +} + +func (o BodyPlaintextV2) DeepCopy() BodyPlaintextV2 { + return BodyPlaintextV2{ + MessageBody: o.MessageBody.DeepCopy(), + Mi: o.Mi.DeepCopy(), + } +} + +type BodyPlaintext struct { + Version__ BodyPlaintextVersion `codec:"version" json:"version"` + V1__ *BodyPlaintextV1 `codec:"v1,omitempty" json:"v1,omitempty"` + V2__ *BodyPlaintextV2 `codec:"v2,omitempty" json:"v2,omitempty"` + V3__ *BodyPlaintextUnsupported `codec:"v3,omitempty" json:"v3,omitempty"` + V4__ *BodyPlaintextUnsupported `codec:"v4,omitempty" json:"v4,omitempty"` + V5__ *BodyPlaintextUnsupported `codec:"v5,omitempty" json:"v5,omitempty"` + V6__ *BodyPlaintextUnsupported `codec:"v6,omitempty" json:"v6,omitempty"` + V7__ *BodyPlaintextUnsupported `codec:"v7,omitempty" json:"v7,omitempty"` + V8__ *BodyPlaintextUnsupported `codec:"v8,omitempty" json:"v8,omitempty"` + V9__ *BodyPlaintextUnsupported `codec:"v9,omitempty" json:"v9,omitempty"` + V10__ *BodyPlaintextUnsupported `codec:"v10,omitempty" json:"v10,omitempty"` +} + +func (o *BodyPlaintext) Version() (ret BodyPlaintextVersion, err error) { + switch o.Version__ { + case BodyPlaintextVersion_V1: + if o.V1__ == nil { + err = errors.New("unexpected nil value for V1__") + return ret, err + } + case BodyPlaintextVersion_V2: + if o.V2__ == nil { + err = errors.New("unexpected nil value for V2__") + return ret, err + } + case BodyPlaintextVersion_V3: + if o.V3__ == nil { + err = errors.New("unexpected nil value for V3__") + return ret, err + } + case BodyPlaintextVersion_V4: + if o.V4__ == nil { + err = errors.New("unexpected nil value for V4__") + return ret, err + } + case BodyPlaintextVersion_V5: + if o.V5__ == nil { + err = errors.New("unexpected nil value for V5__") + return ret, err + } + case BodyPlaintextVersion_V6: + if o.V6__ == nil { + err = errors.New("unexpected nil value for V6__") + return ret, err + } + case BodyPlaintextVersion_V7: + if o.V7__ == nil { + err = errors.New("unexpected nil value for V7__") + return ret, err + } + case BodyPlaintextVersion_V8: + if o.V8__ == nil { + err = errors.New("unexpected nil value for V8__") + return ret, err + } + case BodyPlaintextVersion_V9: + if o.V9__ == nil { + err = errors.New("unexpected nil value for V9__") + return ret, err + } + case BodyPlaintextVersion_V10: + if o.V10__ == nil { + err = errors.New("unexpected nil value for V10__") + return ret, err + } + } + return o.Version__, nil +} + +func (o BodyPlaintext) V1() (res BodyPlaintextV1) { + if o.Version__ != BodyPlaintextVersion_V1 { + panic("wrong case accessed") + } + if o.V1__ == nil { + return + } + return *o.V1__ +} + +func (o BodyPlaintext) V2() (res BodyPlaintextV2) { + if o.Version__ != BodyPlaintextVersion_V2 { + panic("wrong case accessed") + } + if o.V2__ == nil { + return + } + return *o.V2__ +} + +func (o BodyPlaintext) V3() (res BodyPlaintextUnsupported) { + if o.Version__ != BodyPlaintextVersion_V3 { + panic("wrong case accessed") + } + if o.V3__ == nil { + return + } + return *o.V3__ +} + +func (o BodyPlaintext) V4() (res BodyPlaintextUnsupported) { + if o.Version__ != BodyPlaintextVersion_V4 { + panic("wrong case accessed") + } + if o.V4__ == nil { + return + } + return *o.V4__ +} + +func (o BodyPlaintext) V5() (res BodyPlaintextUnsupported) { + if o.Version__ != BodyPlaintextVersion_V5 { + panic("wrong case accessed") + } + if o.V5__ == nil { + return + } + return *o.V5__ +} + +func (o BodyPlaintext) V6() (res BodyPlaintextUnsupported) { + if o.Version__ != BodyPlaintextVersion_V6 { + panic("wrong case accessed") + } + if o.V6__ == nil { + return + } + return *o.V6__ +} + +func (o BodyPlaintext) V7() (res BodyPlaintextUnsupported) { + if o.Version__ != BodyPlaintextVersion_V7 { + panic("wrong case accessed") + } + if o.V7__ == nil { + return + } + return *o.V7__ +} + +func (o BodyPlaintext) V8() (res BodyPlaintextUnsupported) { + if o.Version__ != BodyPlaintextVersion_V8 { + panic("wrong case accessed") + } + if o.V8__ == nil { + return + } + return *o.V8__ +} + +func (o BodyPlaintext) V9() (res BodyPlaintextUnsupported) { + if o.Version__ != BodyPlaintextVersion_V9 { + panic("wrong case accessed") + } + if o.V9__ == nil { + return + } + return *o.V9__ +} + +func (o BodyPlaintext) V10() (res BodyPlaintextUnsupported) { + if o.Version__ != BodyPlaintextVersion_V10 { + panic("wrong case accessed") + } + if o.V10__ == nil { + return + } + return *o.V10__ +} + +func NewBodyPlaintextWithV1(v BodyPlaintextV1) BodyPlaintext { + return BodyPlaintext{ + Version__: BodyPlaintextVersion_V1, + V1__: &v, + } +} + +func NewBodyPlaintextWithV2(v BodyPlaintextV2) BodyPlaintext { + return BodyPlaintext{ + Version__: BodyPlaintextVersion_V2, + V2__: &v, + } +} + +func NewBodyPlaintextWithV3(v BodyPlaintextUnsupported) BodyPlaintext { + return BodyPlaintext{ + Version__: BodyPlaintextVersion_V3, + V3__: &v, + } +} + +func NewBodyPlaintextWithV4(v BodyPlaintextUnsupported) BodyPlaintext { + return BodyPlaintext{ + Version__: BodyPlaintextVersion_V4, + V4__: &v, + } +} + +func NewBodyPlaintextWithV5(v BodyPlaintextUnsupported) BodyPlaintext { + return BodyPlaintext{ + Version__: BodyPlaintextVersion_V5, + V5__: &v, + } +} + +func NewBodyPlaintextWithV6(v BodyPlaintextUnsupported) BodyPlaintext { + return BodyPlaintext{ + Version__: BodyPlaintextVersion_V6, + V6__: &v, + } +} + +func NewBodyPlaintextWithV7(v BodyPlaintextUnsupported) BodyPlaintext { + return BodyPlaintext{ + Version__: BodyPlaintextVersion_V7, + V7__: &v, + } +} + +func NewBodyPlaintextWithV8(v BodyPlaintextUnsupported) BodyPlaintext { + return BodyPlaintext{ + Version__: BodyPlaintextVersion_V8, + V8__: &v, + } +} + +func NewBodyPlaintextWithV9(v BodyPlaintextUnsupported) BodyPlaintext { + return BodyPlaintext{ + Version__: BodyPlaintextVersion_V9, + V9__: &v, + } +} + +func NewBodyPlaintextWithV10(v BodyPlaintextUnsupported) BodyPlaintext { + return BodyPlaintext{ + Version__: BodyPlaintextVersion_V10, + V10__: &v, + } +} + +func (o BodyPlaintext) DeepCopy() BodyPlaintext { + return BodyPlaintext{ + Version__: o.Version__.DeepCopy(), + V1__: (func(x *BodyPlaintextV1) *BodyPlaintextV1 { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V1__), + V2__: (func(x *BodyPlaintextV2) *BodyPlaintextV2 { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V2__), + V3__: (func(x *BodyPlaintextUnsupported) *BodyPlaintextUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V3__), + V4__: (func(x *BodyPlaintextUnsupported) *BodyPlaintextUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V4__), + V5__: (func(x *BodyPlaintextUnsupported) *BodyPlaintextUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V5__), + V6__: (func(x *BodyPlaintextUnsupported) *BodyPlaintextUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V6__), + V7__: (func(x *BodyPlaintextUnsupported) *BodyPlaintextUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V7__), + V8__: (func(x *BodyPlaintextUnsupported) *BodyPlaintextUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V8__), + V9__: (func(x *BodyPlaintextUnsupported) *BodyPlaintextUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V9__), + V10__: (func(x *BodyPlaintextUnsupported) *BodyPlaintextUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V10__), + } +} + +type MessagePlaintext struct { + ClientHeader MessageClientHeader `codec:"clientHeader" json:"clientHeader"` + MessageBody MessageBody `codec:"messageBody" json:"messageBody"` + SupersedesOutboxID *OutboxID `codec:"supersedesOutboxID,omitempty" json:"supersedesOutboxID,omitempty"` +} + +func (o MessagePlaintext) DeepCopy() MessagePlaintext { + return MessagePlaintext{ + ClientHeader: o.ClientHeader.DeepCopy(), + MessageBody: o.MessageBody.DeepCopy(), + SupersedesOutboxID: (func(x *OutboxID) *OutboxID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.SupersedesOutboxID), + } +} + +type MessageUnboxedValid struct { + ClientHeader MessageClientHeaderVerified `codec:"clientHeader" json:"clientHeader"` + ServerHeader MessageServerHeader `codec:"serverHeader" json:"serverHeader"` + MessageBody MessageBody `codec:"messageBody" json:"messageBody"` + SenderUsername string `codec:"senderUsername" json:"senderUsername"` + SenderDeviceName string `codec:"senderDeviceName" json:"senderDeviceName"` + SenderDeviceType string `codec:"senderDeviceType" json:"senderDeviceType"` + BodyHash Hash `codec:"bodyHash" json:"bodyHash"` + HeaderHash Hash `codec:"headerHash" json:"headerHash"` + HeaderSignature *SignatureInfo `codec:"headerSignature,omitempty" json:"headerSignature,omitempty"` + VerificationKey *[]byte `codec:"verificationKey,omitempty" json:"verificationKey,omitempty"` + SenderDeviceRevokedAt *gregor1.Time `codec:"senderDeviceRevokedAt,omitempty" json:"senderDeviceRevokedAt,omitempty"` + AtMentionUsernames []string `codec:"atMentionUsernames" json:"atMentionUsernames"` + AtMentions []gregor1.UID `codec:"atMentions" json:"atMentions"` + ChannelMention ChannelMention `codec:"channelMention" json:"channelMention"` + MaybeMentions []MaybeMention `codec:"maybeMentions" json:"maybeMentions"` + ChannelNameMentions []ChannelNameMention `codec:"channelNameMentions" json:"channelNameMentions"` + Reactions ReactionMap `codec:"reactions" json:"reactions"` + Unfurls map[MessageID]UnfurlResult `codec:"unfurls" json:"unfurls"` + ReplyTo *MessageUnboxed `codec:"replyTo,omitempty" json:"replyTo,omitempty"` + BotUsername string `codec:"botUsername" json:"botUsername"` +} + +func (o MessageUnboxedValid) DeepCopy() MessageUnboxedValid { + return MessageUnboxedValid{ + ClientHeader: o.ClientHeader.DeepCopy(), + ServerHeader: o.ServerHeader.DeepCopy(), + MessageBody: o.MessageBody.DeepCopy(), + SenderUsername: o.SenderUsername, + SenderDeviceName: o.SenderDeviceName, + SenderDeviceType: o.SenderDeviceType, + BodyHash: o.BodyHash.DeepCopy(), + HeaderHash: o.HeaderHash.DeepCopy(), + HeaderSignature: (func(x *SignatureInfo) *SignatureInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.HeaderSignature), + VerificationKey: (func(x *[]byte) *[]byte { + if x == nil { + return nil + } + tmp := (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })((*x)) + return &tmp + })(o.VerificationKey), + SenderDeviceRevokedAt: (func(x *gregor1.Time) *gregor1.Time { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.SenderDeviceRevokedAt), + AtMentionUsernames: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.AtMentionUsernames), + AtMentions: (func(x []gregor1.UID) []gregor1.UID { + if x == nil { + return nil + } + ret := make([]gregor1.UID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.AtMentions), + ChannelMention: o.ChannelMention.DeepCopy(), + MaybeMentions: (func(x []MaybeMention) []MaybeMention { + if x == nil { + return nil + } + ret := make([]MaybeMention, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.MaybeMentions), + ChannelNameMentions: (func(x []ChannelNameMention) []ChannelNameMention { + if x == nil { + return nil + } + ret := make([]ChannelNameMention, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ChannelNameMentions), + Reactions: o.Reactions.DeepCopy(), + Unfurls: (func(x map[MessageID]UnfurlResult) map[MessageID]UnfurlResult { + if x == nil { + return nil + } + ret := make(map[MessageID]UnfurlResult, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.Unfurls), + ReplyTo: (func(x *MessageUnboxed) *MessageUnboxed { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ReplyTo), + BotUsername: o.BotUsername, + } +} + +type MessageUnboxedErrorType int + +const ( + MessageUnboxedErrorType_MISC MessageUnboxedErrorType = 0 + MessageUnboxedErrorType_BADVERSION_CRITICAL MessageUnboxedErrorType = 1 + MessageUnboxedErrorType_BADVERSION MessageUnboxedErrorType = 2 + MessageUnboxedErrorType_IDENTIFY MessageUnboxedErrorType = 3 + MessageUnboxedErrorType_EPHEMERAL MessageUnboxedErrorType = 4 + MessageUnboxedErrorType_PAIRWISE_MISSING MessageUnboxedErrorType = 5 +) + +func (o MessageUnboxedErrorType) DeepCopy() MessageUnboxedErrorType { return o } + +var MessageUnboxedErrorTypeMap = map[string]MessageUnboxedErrorType{ + "MISC": 0, + "BADVERSION_CRITICAL": 1, + "BADVERSION": 2, + "IDENTIFY": 3, + "EPHEMERAL": 4, + "PAIRWISE_MISSING": 5, +} + +var MessageUnboxedErrorTypeRevMap = map[MessageUnboxedErrorType]string{ + 0: "MISC", + 1: "BADVERSION_CRITICAL", + 2: "BADVERSION", + 3: "IDENTIFY", + 4: "EPHEMERAL", + 5: "PAIRWISE_MISSING", +} + +func (e MessageUnboxedErrorType) String() string { + if v, ok := MessageUnboxedErrorTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type MessageUnboxedError struct { + ErrType MessageUnboxedErrorType `codec:"errType" json:"errType"` + ErrMsg string `codec:"errMsg" json:"errMsg"` + InternalErrMsg string `codec:"internalErrMsg" json:"internalErrMsg"` + VersionKind VersionKind `codec:"versionKind" json:"versionKind"` + VersionNumber int `codec:"versionNumber" json:"versionNumber"` + IsCritical bool `codec:"isCritical" json:"isCritical"` + SenderUsername string `codec:"senderUsername" json:"senderUsername"` + SenderDeviceName string `codec:"senderDeviceName" json:"senderDeviceName"` + SenderDeviceType string `codec:"senderDeviceType" json:"senderDeviceType"` + MessageID MessageID `codec:"messageID" json:"messageID"` + MessageType MessageType `codec:"messageType" json:"messageType"` + Ctime gregor1.Time `codec:"ctime" json:"ctime"` + IsEphemeral bool `codec:"isEphemeral" json:"isEphemeral"` + ExplodedBy *string `codec:"explodedBy,omitempty" json:"explodedBy,omitempty"` + Etime gregor1.Time `codec:"etime" json:"etime"` + BotUsername string `codec:"botUsername" json:"botUsername"` +} + +func (o MessageUnboxedError) DeepCopy() MessageUnboxedError { + return MessageUnboxedError{ + ErrType: o.ErrType.DeepCopy(), + ErrMsg: o.ErrMsg, + InternalErrMsg: o.InternalErrMsg, + VersionKind: o.VersionKind.DeepCopy(), + VersionNumber: o.VersionNumber, + IsCritical: o.IsCritical, + SenderUsername: o.SenderUsername, + SenderDeviceName: o.SenderDeviceName, + SenderDeviceType: o.SenderDeviceType, + MessageID: o.MessageID.DeepCopy(), + MessageType: o.MessageType.DeepCopy(), + Ctime: o.Ctime.DeepCopy(), + IsEphemeral: o.IsEphemeral, + ExplodedBy: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.ExplodedBy), + Etime: o.Etime.DeepCopy(), + BotUsername: o.BotUsername, + } +} + +type MessageUnboxedPlaceholder struct { + MessageID MessageID `codec:"messageID" json:"messageID"` + Hidden bool `codec:"hidden" json:"hidden"` +} + +func (o MessageUnboxedPlaceholder) DeepCopy() MessageUnboxedPlaceholder { + return MessageUnboxedPlaceholder{ + MessageID: o.MessageID.DeepCopy(), + Hidden: o.Hidden, + } +} + +type JourneycardType int + +const ( + JourneycardType_WELCOME JourneycardType = 0 + JourneycardType_POPULAR_CHANNELS JourneycardType = 1 + JourneycardType_ADD_PEOPLE JourneycardType = 2 + JourneycardType_CREATE_CHANNELS JourneycardType = 3 + JourneycardType_MSG_ATTENTION JourneycardType = 4 + JourneycardType_UNUSED JourneycardType = 5 + JourneycardType_CHANNEL_INACTIVE JourneycardType = 6 + JourneycardType_MSG_NO_ANSWER JourneycardType = 7 +) + +func (o JourneycardType) DeepCopy() JourneycardType { return o } + +var JourneycardTypeMap = map[string]JourneycardType{ + "WELCOME": 0, + "POPULAR_CHANNELS": 1, + "ADD_PEOPLE": 2, + "CREATE_CHANNELS": 3, + "MSG_ATTENTION": 4, + "UNUSED": 5, + "CHANNEL_INACTIVE": 6, + "MSG_NO_ANSWER": 7, +} + +var JourneycardTypeRevMap = map[JourneycardType]string{ + 0: "WELCOME", + 1: "POPULAR_CHANNELS", + 2: "ADD_PEOPLE", + 3: "CREATE_CHANNELS", + 4: "MSG_ATTENTION", + 5: "UNUSED", + 6: "CHANNEL_INACTIVE", + 7: "MSG_NO_ANSWER", +} + +func (e JourneycardType) String() string { + if v, ok := JourneycardTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type MessageUnboxedJourneycard struct { + PrevID MessageID `codec:"prevID" json:"prevID"` + Ordinal int `codec:"ordinal" json:"ordinal"` + CardType JourneycardType `codec:"cardType" json:"cardType"` + HighlightMsgID MessageID `codec:"highlightMsgID" json:"highlightMsgID"` + OpenTeam bool `codec:"openTeam" json:"openTeam"` +} + +func (o MessageUnboxedJourneycard) DeepCopy() MessageUnboxedJourneycard { + return MessageUnboxedJourneycard{ + PrevID: o.PrevID.DeepCopy(), + Ordinal: o.Ordinal, + CardType: o.CardType.DeepCopy(), + HighlightMsgID: o.HighlightMsgID.DeepCopy(), + OpenTeam: o.OpenTeam, + } +} + +type MessageUnboxed struct { + State__ MessageUnboxedState `codec:"state" json:"state"` + Valid__ *MessageUnboxedValid `codec:"valid,omitempty" json:"valid,omitempty"` + Error__ *MessageUnboxedError `codec:"error,omitempty" json:"error,omitempty"` + Outbox__ *OutboxRecord `codec:"outbox,omitempty" json:"outbox,omitempty"` + Placeholder__ *MessageUnboxedPlaceholder `codec:"placeholder,omitempty" json:"placeholder,omitempty"` + Journeycard__ *MessageUnboxedJourneycard `codec:"journeycard,omitempty" json:"journeycard,omitempty"` +} + +func (o *MessageUnboxed) State() (ret MessageUnboxedState, err error) { + switch o.State__ { + case MessageUnboxedState_VALID: + if o.Valid__ == nil { + err = errors.New("unexpected nil value for Valid__") + return ret, err + } + case MessageUnboxedState_ERROR: + if o.Error__ == nil { + err = errors.New("unexpected nil value for Error__") + return ret, err + } + case MessageUnboxedState_OUTBOX: + if o.Outbox__ == nil { + err = errors.New("unexpected nil value for Outbox__") + return ret, err + } + case MessageUnboxedState_PLACEHOLDER: + if o.Placeholder__ == nil { + err = errors.New("unexpected nil value for Placeholder__") + return ret, err + } + case MessageUnboxedState_JOURNEYCARD: + if o.Journeycard__ == nil { + err = errors.New("unexpected nil value for Journeycard__") + return ret, err + } + } + return o.State__, nil +} + +func (o MessageUnboxed) Valid() (res MessageUnboxedValid) { + if o.State__ != MessageUnboxedState_VALID { + panic("wrong case accessed") + } + if o.Valid__ == nil { + return + } + return *o.Valid__ +} + +func (o MessageUnboxed) Error() (res MessageUnboxedError) { + if o.State__ != MessageUnboxedState_ERROR { + panic("wrong case accessed") + } + if o.Error__ == nil { + return + } + return *o.Error__ +} + +func (o MessageUnboxed) Outbox() (res OutboxRecord) { + if o.State__ != MessageUnboxedState_OUTBOX { + panic("wrong case accessed") + } + if o.Outbox__ == nil { + return + } + return *o.Outbox__ +} + +func (o MessageUnboxed) Placeholder() (res MessageUnboxedPlaceholder) { + if o.State__ != MessageUnboxedState_PLACEHOLDER { + panic("wrong case accessed") + } + if o.Placeholder__ == nil { + return + } + return *o.Placeholder__ +} + +func (o MessageUnboxed) Journeycard() (res MessageUnboxedJourneycard) { + if o.State__ != MessageUnboxedState_JOURNEYCARD { + panic("wrong case accessed") + } + if o.Journeycard__ == nil { + return + } + return *o.Journeycard__ +} + +func NewMessageUnboxedWithValid(v MessageUnboxedValid) MessageUnboxed { + return MessageUnboxed{ + State__: MessageUnboxedState_VALID, + Valid__: &v, + } +} + +func NewMessageUnboxedWithError(v MessageUnboxedError) MessageUnboxed { + return MessageUnboxed{ + State__: MessageUnboxedState_ERROR, + Error__: &v, + } +} + +func NewMessageUnboxedWithOutbox(v OutboxRecord) MessageUnboxed { + return MessageUnboxed{ + State__: MessageUnboxedState_OUTBOX, + Outbox__: &v, + } +} + +func NewMessageUnboxedWithPlaceholder(v MessageUnboxedPlaceholder) MessageUnboxed { + return MessageUnboxed{ + State__: MessageUnboxedState_PLACEHOLDER, + Placeholder__: &v, + } +} + +func NewMessageUnboxedWithJourneycard(v MessageUnboxedJourneycard) MessageUnboxed { + return MessageUnboxed{ + State__: MessageUnboxedState_JOURNEYCARD, + Journeycard__: &v, + } +} + +func (o MessageUnboxed) DeepCopy() MessageUnboxed { + return MessageUnboxed{ + State__: o.State__.DeepCopy(), + Valid__: (func(x *MessageUnboxedValid) *MessageUnboxedValid { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Valid__), + Error__: (func(x *MessageUnboxedError) *MessageUnboxedError { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Error__), + Outbox__: (func(x *OutboxRecord) *OutboxRecord { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Outbox__), + Placeholder__: (func(x *MessageUnboxedPlaceholder) *MessageUnboxedPlaceholder { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Placeholder__), + Journeycard__: (func(x *MessageUnboxedJourneycard) *MessageUnboxedJourneycard { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Journeycard__), + } +} + +type UnreadFirstNumLimit struct { + NumRead int `codec:"NumRead" json:"NumRead"` + AtLeast int `codec:"AtLeast" json:"AtLeast"` + AtMost int `codec:"AtMost" json:"AtMost"` +} + +func (o UnreadFirstNumLimit) DeepCopy() UnreadFirstNumLimit { + return UnreadFirstNumLimit{ + NumRead: o.NumRead, + AtLeast: o.AtLeast, + AtMost: o.AtMost, + } +} + +type ConversationLocalParticipant struct { + Username string `codec:"username" json:"username"` + InConvName bool `codec:"inConvName" json:"inConvName"` + Fullname *string `codec:"fullname,omitempty" json:"fullname,omitempty"` + ContactName *string `codec:"contactName,omitempty" json:"contactName,omitempty"` +} + +func (o ConversationLocalParticipant) DeepCopy() ConversationLocalParticipant { + return ConversationLocalParticipant{ + Username: o.Username, + InConvName: o.InConvName, + Fullname: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Fullname), + ContactName: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.ContactName), + } +} + +type ConversationPinnedMessage struct { + Message MessageUnboxed `codec:"message" json:"message"` + PinnerUsername string `codec:"pinnerUsername" json:"pinnerUsername"` +} + +func (o ConversationPinnedMessage) DeepCopy() ConversationPinnedMessage { + return ConversationPinnedMessage{ + Message: o.Message.DeepCopy(), + PinnerUsername: o.PinnerUsername, + } +} + +type ConversationInfoLocal struct { + Id ConversationID `codec:"id" json:"id"` + Triple ConversationIDTriple `codec:"triple" json:"triple"` + TlfName string `codec:"tlfName" json:"tlfName"` + TopicName string `codec:"topicName" json:"topicName"` + Headline string `codec:"headline" json:"headline"` + SnippetMsg *MessageUnboxed `codec:"snippetMsg,omitempty" json:"snippetMsg,omitempty"` + PinnedMsg *ConversationPinnedMessage `codec:"pinnedMsg,omitempty" json:"pinnedMsg,omitempty"` + Draft *string `codec:"draft,omitempty" json:"draft,omitempty"` + Visibility keybase1.TLFVisibility `codec:"visibility" json:"visibility"` + IsDefaultConv bool `codec:"isDefaultConv" json:"isDefaultConv"` + Status ConversationStatus `codec:"status" json:"status"` + MembersType ConversationMembersType `codec:"membersType" json:"membersType"` + MemberStatus ConversationMemberStatus `codec:"memberStatus" json:"memberStatus"` + TeamType TeamType `codec:"teamType" json:"teamType"` + Existence ConversationExistence `codec:"existence" json:"existence"` + Version ConversationVers `codec:"version" json:"version"` + LocalVersion LocalConversationVers `codec:"localVersion" json:"localVersion"` + Participants []ConversationLocalParticipant `codec:"participants" json:"participants"` + FinalizeInfo *ConversationFinalizeInfo `codec:"finalizeInfo,omitempty" json:"finalizeInfo,omitempty"` + ResetNames []string `codec:"resetNames" json:"resetNames"` +} + +func (o ConversationInfoLocal) DeepCopy() ConversationInfoLocal { + return ConversationInfoLocal{ + Id: o.Id.DeepCopy(), + Triple: o.Triple.DeepCopy(), + TlfName: o.TlfName, + TopicName: o.TopicName, + Headline: o.Headline, + SnippetMsg: (func(x *MessageUnboxed) *MessageUnboxed { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.SnippetMsg), + PinnedMsg: (func(x *ConversationPinnedMessage) *ConversationPinnedMessage { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.PinnedMsg), + Draft: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Draft), + Visibility: o.Visibility.DeepCopy(), + IsDefaultConv: o.IsDefaultConv, + Status: o.Status.DeepCopy(), + MembersType: o.MembersType.DeepCopy(), + MemberStatus: o.MemberStatus.DeepCopy(), + TeamType: o.TeamType.DeepCopy(), + Existence: o.Existence.DeepCopy(), + Version: o.Version.DeepCopy(), + LocalVersion: o.LocalVersion.DeepCopy(), + Participants: (func(x []ConversationLocalParticipant) []ConversationLocalParticipant { + if x == nil { + return nil + } + ret := make([]ConversationLocalParticipant, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Participants), + FinalizeInfo: (func(x *ConversationFinalizeInfo) *ConversationFinalizeInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.FinalizeInfo), + ResetNames: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.ResetNames), + } +} + +type ConversationErrorType int + +const ( + ConversationErrorType_PERMANENT ConversationErrorType = 0 + ConversationErrorType_MISSINGINFO ConversationErrorType = 1 + ConversationErrorType_SELFREKEYNEEDED ConversationErrorType = 2 + ConversationErrorType_OTHERREKEYNEEDED ConversationErrorType = 3 + ConversationErrorType_IDENTIFY ConversationErrorType = 4 + ConversationErrorType_TRANSIENT ConversationErrorType = 5 + ConversationErrorType_NONE ConversationErrorType = 6 +) + +func (o ConversationErrorType) DeepCopy() ConversationErrorType { return o } + +var ConversationErrorTypeMap = map[string]ConversationErrorType{ + "PERMANENT": 0, + "MISSINGINFO": 1, + "SELFREKEYNEEDED": 2, + "OTHERREKEYNEEDED": 3, + "IDENTIFY": 4, + "TRANSIENT": 5, + "NONE": 6, +} + +var ConversationErrorTypeRevMap = map[ConversationErrorType]string{ + 0: "PERMANENT", + 1: "MISSINGINFO", + 2: "SELFREKEYNEEDED", + 3: "OTHERREKEYNEEDED", + 4: "IDENTIFY", + 5: "TRANSIENT", + 6: "NONE", +} + +func (e ConversationErrorType) String() string { + if v, ok := ConversationErrorTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ConversationErrorLocal struct { + Typ ConversationErrorType `codec:"typ" json:"typ"` + Message string `codec:"message" json:"message"` + RemoteConv Conversation `codec:"remoteConv" json:"remoteConv"` + UnverifiedTLFName string `codec:"unverifiedTLFName" json:"unverifiedTLFName"` + RekeyInfo *ConversationErrorRekey `codec:"rekeyInfo,omitempty" json:"rekeyInfo,omitempty"` +} + +func (o ConversationErrorLocal) DeepCopy() ConversationErrorLocal { + return ConversationErrorLocal{ + Typ: o.Typ.DeepCopy(), + Message: o.Message, + RemoteConv: o.RemoteConv.DeepCopy(), + UnverifiedTLFName: o.UnverifiedTLFName, + RekeyInfo: (func(x *ConversationErrorRekey) *ConversationErrorRekey { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RekeyInfo), + } +} + +type ConversationErrorRekey struct { + TlfName string `codec:"tlfName" json:"tlfName"` + TlfPublic bool `codec:"tlfPublic" json:"tlfPublic"` + Rekeyers []string `codec:"rekeyers" json:"rekeyers"` + WriterNames []string `codec:"writerNames" json:"writerNames"` + ReaderNames []string `codec:"readerNames" json:"readerNames"` +} + +func (o ConversationErrorRekey) DeepCopy() ConversationErrorRekey { + return ConversationErrorRekey{ + TlfName: o.TlfName, + TlfPublic: o.TlfPublic, + Rekeyers: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Rekeyers), + WriterNames: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.WriterNames), + ReaderNames: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.ReaderNames), + } +} + +type ConversationMinWriterRoleInfoLocal struct { + ChangedBy string `codec:"changedBy" json:"changedBy"` + CannotWrite bool `codec:"cannotWrite" json:"cannotWrite"` + Role keybase1.TeamRole `codec:"role" json:"role"` +} + +func (o ConversationMinWriterRoleInfoLocal) DeepCopy() ConversationMinWriterRoleInfoLocal { + return ConversationMinWriterRoleInfoLocal{ + ChangedBy: o.ChangedBy, + CannotWrite: o.CannotWrite, + Role: o.Role.DeepCopy(), + } +} + +type ConversationSettingsLocal struct { + MinWriterRoleInfo *ConversationMinWriterRoleInfoLocal `codec:"minWriterRoleInfo,omitempty" json:"minWriterRoleInfo,omitempty"` +} + +func (o ConversationSettingsLocal) DeepCopy() ConversationSettingsLocal { + return ConversationSettingsLocal{ + MinWriterRoleInfo: (func(x *ConversationMinWriterRoleInfoLocal) *ConversationMinWriterRoleInfoLocal { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.MinWriterRoleInfo), + } +} + +type ConversationLocal struct { + Error *ConversationErrorLocal `codec:"error,omitempty" json:"error,omitempty"` + Info ConversationInfoLocal `codec:"info" json:"info"` + ReaderInfo ConversationReaderInfo `codec:"readerInfo" json:"readerInfo"` + CreatorInfo *ConversationCreatorInfoLocal `codec:"creatorInfo,omitempty" json:"creatorInfo,omitempty"` + Notifications *ConversationNotificationInfo `codec:"notifications,omitempty" json:"notifications,omitempty"` + Supersedes []ConversationMetadata `codec:"supersedes" json:"supersedes"` + SupersededBy []ConversationMetadata `codec:"supersededBy" json:"supersededBy"` + MaxMessages []MessageSummary `codec:"maxMessages" json:"maxMessages"` + IsEmpty bool `codec:"isEmpty" json:"isEmpty"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures" json:"identifyFailures"` + Expunge Expunge `codec:"expunge" json:"expunge"` + ConvRetention *RetentionPolicy `codec:"convRetention,omitempty" json:"convRetention,omitempty"` + TeamRetention *RetentionPolicy `codec:"teamRetention,omitempty" json:"teamRetention,omitempty"` + ConvSettings *ConversationSettingsLocal `codec:"convSettings,omitempty" json:"convSettings,omitempty"` + Commands ConversationCommandGroups `codec:"commands" json:"commands"` + BotCommands ConversationCommandGroups `codec:"botCommands" json:"botCommands"` + BotAliases map[string]string `codec:"botAliases" json:"botAliases"` +} + +func (o ConversationLocal) DeepCopy() ConversationLocal { + return ConversationLocal{ + Error: (func(x *ConversationErrorLocal) *ConversationErrorLocal { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Error), + Info: o.Info.DeepCopy(), + ReaderInfo: o.ReaderInfo.DeepCopy(), + CreatorInfo: (func(x *ConversationCreatorInfoLocal) *ConversationCreatorInfoLocal { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.CreatorInfo), + Notifications: (func(x *ConversationNotificationInfo) *ConversationNotificationInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Notifications), + Supersedes: (func(x []ConversationMetadata) []ConversationMetadata { + if x == nil { + return nil + } + ret := make([]ConversationMetadata, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Supersedes), + SupersededBy: (func(x []ConversationMetadata) []ConversationMetadata { + if x == nil { + return nil + } + ret := make([]ConversationMetadata, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.SupersededBy), + MaxMessages: (func(x []MessageSummary) []MessageSummary { + if x == nil { + return nil + } + ret := make([]MessageSummary, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.MaxMessages), + IsEmpty: o.IsEmpty, + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + Expunge: o.Expunge.DeepCopy(), + ConvRetention: (func(x *RetentionPolicy) *RetentionPolicy { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ConvRetention), + TeamRetention: (func(x *RetentionPolicy) *RetentionPolicy { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.TeamRetention), + ConvSettings: (func(x *ConversationSettingsLocal) *ConversationSettingsLocal { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ConvSettings), + Commands: o.Commands.DeepCopy(), + BotCommands: o.BotCommands.DeepCopy(), + BotAliases: (func(x map[string]string) map[string]string { + if x == nil { + return nil + } + ret := make(map[string]string, len(x)) + for k, v := range x { + kCopy := k + vCopy := v + ret[kCopy] = vCopy + } + return ret + })(o.BotAliases), + } +} + +type NonblockFetchRes struct { + Offline bool `codec:"offline" json:"offline"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures" json:"identifyFailures"` +} + +func (o NonblockFetchRes) DeepCopy() NonblockFetchRes { + return NonblockFetchRes{ + Offline: o.Offline, + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + } +} + +type ThreadView struct { + Messages []MessageUnboxed `codec:"messages" json:"messages"` + Pagination *Pagination `codec:"pagination,omitempty" json:"pagination,omitempty"` +} + +func (o ThreadView) DeepCopy() ThreadView { + return ThreadView{ + Messages: (func(x []MessageUnboxed) []MessageUnboxed { + if x == nil { + return nil + } + ret := make([]MessageUnboxed, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Messages), + Pagination: (func(x *Pagination) *Pagination { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Pagination), + } +} + +type MessageIDControlMode int + +const ( + MessageIDControlMode_OLDERMESSAGES MessageIDControlMode = 0 + MessageIDControlMode_NEWERMESSAGES MessageIDControlMode = 1 + MessageIDControlMode_CENTERED MessageIDControlMode = 2 + MessageIDControlMode_UNREADLINE MessageIDControlMode = 3 +) + +func (o MessageIDControlMode) DeepCopy() MessageIDControlMode { return o } + +var MessageIDControlModeMap = map[string]MessageIDControlMode{ + "OLDERMESSAGES": 0, + "NEWERMESSAGES": 1, + "CENTERED": 2, + "UNREADLINE": 3, +} + +var MessageIDControlModeRevMap = map[MessageIDControlMode]string{ + 0: "OLDERMESSAGES", + 1: "NEWERMESSAGES", + 2: "CENTERED", + 3: "UNREADLINE", +} + +func (e MessageIDControlMode) String() string { + if v, ok := MessageIDControlModeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type MessageIDControl struct { + Pivot *MessageID `codec:"pivot,omitempty" json:"pivot,omitempty"` + Mode MessageIDControlMode `codec:"mode" json:"mode"` + Num int `codec:"num" json:"num"` +} + +func (o MessageIDControl) DeepCopy() MessageIDControl { + return MessageIDControl{ + Pivot: (func(x *MessageID) *MessageID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Pivot), + Mode: o.Mode.DeepCopy(), + Num: o.Num, + } +} + +type GetThreadQuery struct { + MarkAsRead bool `codec:"markAsRead" json:"markAsRead"` + MessageTypes []MessageType `codec:"messageTypes" json:"messageTypes"` + DisableResolveSupersedes bool `codec:"disableResolveSupersedes" json:"disableResolveSupersedes"` + EnableDeletePlaceholders bool `codec:"enableDeletePlaceholders" json:"enableDeletePlaceholders"` + DisablePostProcessThread bool `codec:"disablePostProcessThread" json:"disablePostProcessThread"` + Before *gregor1.Time `codec:"before,omitempty" json:"before,omitempty"` + After *gregor1.Time `codec:"after,omitempty" json:"after,omitempty"` + MessageIDControl *MessageIDControl `codec:"messageIDControl,omitempty" json:"messageIDControl,omitempty"` +} + +func (o GetThreadQuery) DeepCopy() GetThreadQuery { + return GetThreadQuery{ + MarkAsRead: o.MarkAsRead, + MessageTypes: (func(x []MessageType) []MessageType { + if x == nil { + return nil + } + ret := make([]MessageType, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.MessageTypes), + DisableResolveSupersedes: o.DisableResolveSupersedes, + EnableDeletePlaceholders: o.EnableDeletePlaceholders, + DisablePostProcessThread: o.DisablePostProcessThread, + Before: (func(x *gregor1.Time) *gregor1.Time { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Before), + After: (func(x *gregor1.Time) *gregor1.Time { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.After), + MessageIDControl: (func(x *MessageIDControl) *MessageIDControl { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.MessageIDControl), + } +} + +type GetThreadLocalRes struct { + Thread ThreadView `codec:"thread" json:"thread"` + Offline bool `codec:"offline" json:"offline"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures" json:"identifyFailures"` +} + +func (o GetThreadLocalRes) DeepCopy() GetThreadLocalRes { + return GetThreadLocalRes{ + Thread: o.Thread.DeepCopy(), + Offline: o.Offline, + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + } +} + +type GetThreadNonblockCbMode int + +const ( + GetThreadNonblockCbMode_FULL GetThreadNonblockCbMode = 0 + GetThreadNonblockCbMode_INCREMENTAL GetThreadNonblockCbMode = 1 +) + +func (o GetThreadNonblockCbMode) DeepCopy() GetThreadNonblockCbMode { return o } + +var GetThreadNonblockCbModeMap = map[string]GetThreadNonblockCbMode{ + "FULL": 0, + "INCREMENTAL": 1, +} + +var GetThreadNonblockCbModeRevMap = map[GetThreadNonblockCbMode]string{ + 0: "FULL", + 1: "INCREMENTAL", +} + +func (e GetThreadNonblockCbMode) String() string { + if v, ok := GetThreadNonblockCbModeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type GetThreadNonblockPgMode int + +const ( + GetThreadNonblockPgMode_DEFAULT GetThreadNonblockPgMode = 0 + GetThreadNonblockPgMode_SERVER GetThreadNonblockPgMode = 1 +) + +func (o GetThreadNonblockPgMode) DeepCopy() GetThreadNonblockPgMode { return o } + +var GetThreadNonblockPgModeMap = map[string]GetThreadNonblockPgMode{ + "DEFAULT": 0, + "SERVER": 1, +} + +var GetThreadNonblockPgModeRevMap = map[GetThreadNonblockPgMode]string{ + 0: "DEFAULT", + 1: "SERVER", +} + +func (e GetThreadNonblockPgMode) String() string { + if v, ok := GetThreadNonblockPgModeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UnreadlineRes struct { + Offline bool `codec:"offline" json:"offline"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures" json:"identifyFailures"` + UnreadlineID *MessageID `codec:"unreadlineID,omitempty" json:"unreadlineID,omitempty"` +} + +func (o UnreadlineRes) DeepCopy() UnreadlineRes { + return UnreadlineRes{ + Offline: o.Offline, + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + UnreadlineID: (func(x *MessageID) *MessageID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.UnreadlineID), + } +} + +type NameQuery struct { + Name string `codec:"name" json:"name"` + TlfID *TLFID `codec:"tlfID,omitempty" json:"tlfID,omitempty"` + MembersType ConversationMembersType `codec:"membersType" json:"membersType"` +} + +func (o NameQuery) DeepCopy() NameQuery { + return NameQuery{ + Name: o.Name, + TlfID: (func(x *TLFID) *TLFID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.TlfID), + MembersType: o.MembersType.DeepCopy(), + } +} + +type GetInboxLocalQuery struct { + Name *NameQuery `codec:"name,omitempty" json:"name,omitempty"` + TopicName *string `codec:"topicName,omitempty" json:"topicName,omitempty"` + ConvIDs []ConversationID `codec:"convIDs" json:"convIDs"` + TopicType *TopicType `codec:"topicType,omitempty" json:"topicType,omitempty"` + TlfVisibility *keybase1.TLFVisibility `codec:"tlfVisibility,omitempty" json:"tlfVisibility,omitempty"` + Before *gregor1.Time `codec:"before,omitempty" json:"before,omitempty"` + After *gregor1.Time `codec:"after,omitempty" json:"after,omitempty"` + OneChatTypePerTLF *bool `codec:"oneChatTypePerTLF,omitempty" json:"oneChatTypePerTLF,omitempty"` + Status []ConversationStatus `codec:"status" json:"status"` + MemberStatus []ConversationMemberStatus `codec:"memberStatus" json:"memberStatus"` + UnreadOnly bool `codec:"unreadOnly" json:"unreadOnly"` + ReadOnly bool `codec:"readOnly" json:"readOnly"` + ComputeActiveList bool `codec:"computeActiveList" json:"computeActiveList"` +} + +func (o GetInboxLocalQuery) DeepCopy() GetInboxLocalQuery { + return GetInboxLocalQuery{ + Name: (func(x *NameQuery) *NameQuery { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Name), + TopicName: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.TopicName), + ConvIDs: (func(x []ConversationID) []ConversationID { + if x == nil { + return nil + } + ret := make([]ConversationID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ConvIDs), + TopicType: (func(x *TopicType) *TopicType { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.TopicType), + TlfVisibility: (func(x *keybase1.TLFVisibility) *keybase1.TLFVisibility { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.TlfVisibility), + Before: (func(x *gregor1.Time) *gregor1.Time { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Before), + After: (func(x *gregor1.Time) *gregor1.Time { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.After), + OneChatTypePerTLF: (func(x *bool) *bool { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.OneChatTypePerTLF), + Status: (func(x []ConversationStatus) []ConversationStatus { + if x == nil { + return nil + } + ret := make([]ConversationStatus, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Status), + MemberStatus: (func(x []ConversationMemberStatus) []ConversationMemberStatus { + if x == nil { + return nil + } + ret := make([]ConversationMemberStatus, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.MemberStatus), + UnreadOnly: o.UnreadOnly, + ReadOnly: o.ReadOnly, + ComputeActiveList: o.ComputeActiveList, + } +} + +type GetInboxAndUnboxLocalRes struct { + Conversations []ConversationLocal `codec:"conversations" json:"conversations"` + Offline bool `codec:"offline" json:"offline"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures" json:"identifyFailures"` +} + +func (o GetInboxAndUnboxLocalRes) DeepCopy() GetInboxAndUnboxLocalRes { + return GetInboxAndUnboxLocalRes{ + Conversations: (func(x []ConversationLocal) []ConversationLocal { + if x == nil { + return nil + } + ret := make([]ConversationLocal, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Conversations), + Offline: o.Offline, + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + } +} + +type GetInboxAndUnboxUILocalRes struct { + Conversations []InboxUIItem `codec:"conversations" json:"conversations"` + Offline bool `codec:"offline" json:"offline"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures" json:"identifyFailures"` +} + +func (o GetInboxAndUnboxUILocalRes) DeepCopy() GetInboxAndUnboxUILocalRes { + return GetInboxAndUnboxUILocalRes{ + Conversations: (func(x []InboxUIItem) []InboxUIItem { + if x == nil { + return nil + } + ret := make([]InboxUIItem, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Conversations), + Offline: o.Offline, + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + } +} + +type InboxLayoutReselectMode int + +const ( + InboxLayoutReselectMode_DEFAULT InboxLayoutReselectMode = 0 + InboxLayoutReselectMode_FORCE InboxLayoutReselectMode = 1 +) + +func (o InboxLayoutReselectMode) DeepCopy() InboxLayoutReselectMode { return o } + +var InboxLayoutReselectModeMap = map[string]InboxLayoutReselectMode{ + "DEFAULT": 0, + "FORCE": 1, +} + +var InboxLayoutReselectModeRevMap = map[InboxLayoutReselectMode]string{ + 0: "DEFAULT", + 1: "FORCE", +} + +func (e InboxLayoutReselectMode) String() string { + if v, ok := InboxLayoutReselectModeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type PostLocalRes struct { + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` + MessageID MessageID `codec:"messageID" json:"messageID"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures" json:"identifyFailures"` +} + +func (o PostLocalRes) DeepCopy() PostLocalRes { + return PostLocalRes{ + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + MessageID: o.MessageID.DeepCopy(), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + } +} + +type PostLocalNonblockRes struct { + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` + OutboxID OutboxID `codec:"outboxID" json:"outboxID"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures" json:"identifyFailures"` +} + +func (o PostLocalNonblockRes) DeepCopy() PostLocalNonblockRes { + return PostLocalNonblockRes{ + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + OutboxID: o.OutboxID.DeepCopy(), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + } +} + +type EditTarget struct { + MessageID *MessageID `codec:"messageID,omitempty" json:"messageID,omitempty"` + OutboxID *OutboxID `codec:"outboxID,omitempty" json:"outboxID,omitempty"` +} + +func (o EditTarget) DeepCopy() EditTarget { + return EditTarget{ + MessageID: (func(x *MessageID) *MessageID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.MessageID), + OutboxID: (func(x *OutboxID) *OutboxID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.OutboxID), + } +} + +type SetConversationStatusLocalRes struct { + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures" json:"identifyFailures"` +} + +func (o SetConversationStatusLocalRes) DeepCopy() SetConversationStatusLocalRes { + return SetConversationStatusLocalRes{ + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + } +} + +type NewConversationLocalRes struct { + Conv ConversationLocal `codec:"conv" json:"conv"` + UiConv InboxUIItem `codec:"uiConv" json:"uiConv"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures" json:"identifyFailures"` +} + +func (o NewConversationLocalRes) DeepCopy() NewConversationLocalRes { + return NewConversationLocalRes{ + Conv: o.Conv.DeepCopy(), + UiConv: o.UiConv.DeepCopy(), + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + } +} + +type GetInboxSummaryForCLILocalQuery struct { + TopicType TopicType `codec:"topicType" json:"topicType"` + After string `codec:"after" json:"after"` + Before string `codec:"before" json:"before"` + Visibility keybase1.TLFVisibility `codec:"visibility" json:"visibility"` + Status []ConversationStatus `codec:"status" json:"status"` + ConvIDs []ConversationID `codec:"convIDs" json:"convIDs"` + UnreadFirst bool `codec:"unreadFirst" json:"unreadFirst"` + UnreadFirstLimit UnreadFirstNumLimit `codec:"unreadFirstLimit" json:"unreadFirstLimit"` + ActivitySortedLimit int `codec:"activitySortedLimit" json:"activitySortedLimit"` +} + +func (o GetInboxSummaryForCLILocalQuery) DeepCopy() GetInboxSummaryForCLILocalQuery { + return GetInboxSummaryForCLILocalQuery{ + TopicType: o.TopicType.DeepCopy(), + After: o.After, + Before: o.Before, + Visibility: o.Visibility.DeepCopy(), + Status: (func(x []ConversationStatus) []ConversationStatus { + if x == nil { + return nil + } + ret := make([]ConversationStatus, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Status), + ConvIDs: (func(x []ConversationID) []ConversationID { + if x == nil { + return nil + } + ret := make([]ConversationID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ConvIDs), + UnreadFirst: o.UnreadFirst, + UnreadFirstLimit: o.UnreadFirstLimit.DeepCopy(), + ActivitySortedLimit: o.ActivitySortedLimit, + } +} + +type GetInboxSummaryForCLILocalRes struct { + Conversations []ConversationLocal `codec:"conversations" json:"conversations"` + Offline bool `codec:"offline" json:"offline"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` +} + +func (o GetInboxSummaryForCLILocalRes) DeepCopy() GetInboxSummaryForCLILocalRes { + return GetInboxSummaryForCLILocalRes{ + Conversations: (func(x []ConversationLocal) []ConversationLocal { + if x == nil { + return nil + } + ret := make([]ConversationLocal, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Conversations), + Offline: o.Offline, + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +type GetConversationForCLILocalQuery struct { + MarkAsRead bool `codec:"markAsRead" json:"markAsRead"` + MessageTypes []MessageType `codec:"MessageTypes" json:"MessageTypes"` + Since *string `codec:"Since,omitempty" json:"Since,omitempty"` + Limit UnreadFirstNumLimit `codec:"limit" json:"limit"` + Conv ConversationLocal `codec:"conv" json:"conv"` +} + +func (o GetConversationForCLILocalQuery) DeepCopy() GetConversationForCLILocalQuery { + return GetConversationForCLILocalQuery{ + MarkAsRead: o.MarkAsRead, + MessageTypes: (func(x []MessageType) []MessageType { + if x == nil { + return nil + } + ret := make([]MessageType, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.MessageTypes), + Since: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Since), + Limit: o.Limit.DeepCopy(), + Conv: o.Conv.DeepCopy(), + } +} + +type GetConversationForCLILocalRes struct { + Conversation ConversationLocal `codec:"conversation" json:"conversation"` + Messages []MessageUnboxed `codec:"messages" json:"messages"` + Offline bool `codec:"offline" json:"offline"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` +} + +func (o GetConversationForCLILocalRes) DeepCopy() GetConversationForCLILocalRes { + return GetConversationForCLILocalRes{ + Conversation: o.Conversation.DeepCopy(), + Messages: (func(x []MessageUnboxed) []MessageUnboxed { + if x == nil { + return nil + } + ret := make([]MessageUnboxed, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Messages), + Offline: o.Offline, + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +type GetMessagesLocalRes struct { + Messages []MessageUnboxed `codec:"messages" json:"messages"` + Offline bool `codec:"offline" json:"offline"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures" json:"identifyFailures"` +} + +func (o GetMessagesLocalRes) DeepCopy() GetMessagesLocalRes { + return GetMessagesLocalRes{ + Messages: (func(x []MessageUnboxed) []MessageUnboxed { + if x == nil { + return nil + } + ret := make([]MessageUnboxed, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Messages), + Offline: o.Offline, + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + } +} + +type PostFileAttachmentArg struct { + ConversationID ConversationID `codec:"conversationID" json:"conversationID"` + TlfName string `codec:"tlfName" json:"tlfName"` + Visibility keybase1.TLFVisibility `codec:"visibility" json:"visibility"` + Filename string `codec:"filename" json:"filename"` + Title string `codec:"title" json:"title"` + Metadata []byte `codec:"metadata" json:"metadata"` + IdentifyBehavior keybase1.TLFIdentifyBehavior `codec:"identifyBehavior" json:"identifyBehavior"` + CallerPreview *MakePreviewRes `codec:"callerPreview,omitempty" json:"callerPreview,omitempty"` + OutboxID *OutboxID `codec:"outboxID,omitempty" json:"outboxID,omitempty"` + EphemeralLifetime *gregor1.DurationSec `codec:"ephemeralLifetime,omitempty" json:"ephemeralLifetime,omitempty"` +} + +func (o PostFileAttachmentArg) DeepCopy() PostFileAttachmentArg { + return PostFileAttachmentArg{ + ConversationID: o.ConversationID.DeepCopy(), + TlfName: o.TlfName, + Visibility: o.Visibility.DeepCopy(), + Filename: o.Filename, + Title: o.Title, + Metadata: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.Metadata), + IdentifyBehavior: o.IdentifyBehavior.DeepCopy(), + CallerPreview: (func(x *MakePreviewRes) *MakePreviewRes { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.CallerPreview), + OutboxID: (func(x *OutboxID) *OutboxID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.OutboxID), + EphemeralLifetime: (func(x *gregor1.DurationSec) *gregor1.DurationSec { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.EphemeralLifetime), + } +} + +type GetNextAttachmentMessageLocalRes struct { + Message *UIMessage `codec:"message,omitempty" json:"message,omitempty"` + Offline bool `codec:"offline" json:"offline"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures" json:"identifyFailures"` +} + +func (o GetNextAttachmentMessageLocalRes) DeepCopy() GetNextAttachmentMessageLocalRes { + return GetNextAttachmentMessageLocalRes{ + Message: (func(x *UIMessage) *UIMessage { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Message), + Offline: o.Offline, + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + } +} + +type DownloadAttachmentLocalRes struct { + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures" json:"identifyFailures"` +} + +func (o DownloadAttachmentLocalRes) DeepCopy() DownloadAttachmentLocalRes { + return DownloadAttachmentLocalRes{ + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + } +} + +type DownloadFileAttachmentLocalRes struct { + FilePath string `codec:"filePath" json:"filePath"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures" json:"identifyFailures"` +} + +func (o DownloadFileAttachmentLocalRes) DeepCopy() DownloadFileAttachmentLocalRes { + return DownloadFileAttachmentLocalRes{ + FilePath: o.FilePath, + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + } +} + +type PreviewLocationTyp int + +const ( + PreviewLocationTyp_URL PreviewLocationTyp = 0 + PreviewLocationTyp_FILE PreviewLocationTyp = 1 + PreviewLocationTyp_BYTES PreviewLocationTyp = 2 +) + +func (o PreviewLocationTyp) DeepCopy() PreviewLocationTyp { return o } + +var PreviewLocationTypMap = map[string]PreviewLocationTyp{ + "URL": 0, + "FILE": 1, + "BYTES": 2, +} + +var PreviewLocationTypRevMap = map[PreviewLocationTyp]string{ + 0: "URL", + 1: "FILE", + 2: "BYTES", +} + +func (e PreviewLocationTyp) String() string { + if v, ok := PreviewLocationTypRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type PreviewLocation struct { + Ltyp__ PreviewLocationTyp `codec:"ltyp" json:"ltyp"` + Url__ *string `codec:"url,omitempty" json:"url,omitempty"` + File__ *string `codec:"file,omitempty" json:"file,omitempty"` + Bytes__ *[]byte `codec:"bytes,omitempty" json:"bytes,omitempty"` +} + +func (o *PreviewLocation) Ltyp() (ret PreviewLocationTyp, err error) { + switch o.Ltyp__ { + case PreviewLocationTyp_URL: + if o.Url__ == nil { + err = errors.New("unexpected nil value for Url__") + return ret, err + } + case PreviewLocationTyp_FILE: + if o.File__ == nil { + err = errors.New("unexpected nil value for File__") + return ret, err + } + case PreviewLocationTyp_BYTES: + if o.Bytes__ == nil { + err = errors.New("unexpected nil value for Bytes__") + return ret, err + } + } + return o.Ltyp__, nil +} + +func (o PreviewLocation) Url() (res string) { + if o.Ltyp__ != PreviewLocationTyp_URL { + panic("wrong case accessed") + } + if o.Url__ == nil { + return + } + return *o.Url__ +} + +func (o PreviewLocation) File() (res string) { + if o.Ltyp__ != PreviewLocationTyp_FILE { + panic("wrong case accessed") + } + if o.File__ == nil { + return + } + return *o.File__ +} + +func (o PreviewLocation) Bytes() (res []byte) { + if o.Ltyp__ != PreviewLocationTyp_BYTES { + panic("wrong case accessed") + } + if o.Bytes__ == nil { + return + } + return *o.Bytes__ +} + +func NewPreviewLocationWithUrl(v string) PreviewLocation { + return PreviewLocation{ + Ltyp__: PreviewLocationTyp_URL, + Url__: &v, + } +} + +func NewPreviewLocationWithFile(v string) PreviewLocation { + return PreviewLocation{ + Ltyp__: PreviewLocationTyp_FILE, + File__: &v, + } +} + +func NewPreviewLocationWithBytes(v []byte) PreviewLocation { + return PreviewLocation{ + Ltyp__: PreviewLocationTyp_BYTES, + Bytes__: &v, + } +} + +func (o PreviewLocation) DeepCopy() PreviewLocation { + return PreviewLocation{ + Ltyp__: o.Ltyp__.DeepCopy(), + Url__: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Url__), + File__: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.File__), + Bytes__: (func(x *[]byte) *[]byte { + if x == nil { + return nil + } + tmp := (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })((*x)) + return &tmp + })(o.Bytes__), + } +} + +type MakePreviewRes struct { + MimeType string `codec:"mimeType" json:"mimeType"` + PreviewMimeType *string `codec:"previewMimeType,omitempty" json:"previewMimeType,omitempty"` + Location *PreviewLocation `codec:"location,omitempty" json:"location,omitempty"` + Metadata *AssetMetadata `codec:"metadata,omitempty" json:"metadata,omitempty"` + BaseMetadata *AssetMetadata `codec:"baseMetadata,omitempty" json:"baseMetadata,omitempty"` +} + +func (o MakePreviewRes) DeepCopy() MakePreviewRes { + return MakePreviewRes{ + MimeType: o.MimeType, + PreviewMimeType: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.PreviewMimeType), + Location: (func(x *PreviewLocation) *PreviewLocation { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Location), + Metadata: (func(x *AssetMetadata) *AssetMetadata { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Metadata), + BaseMetadata: (func(x *AssetMetadata) *AssetMetadata { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.BaseMetadata), + } +} + +type MarkAsReadLocalRes struct { + Offline bool `codec:"offline" json:"offline"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` +} + +func (o MarkAsReadLocalRes) DeepCopy() MarkAsReadLocalRes { + return MarkAsReadLocalRes{ + Offline: o.Offline, + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +type FindConversationsLocalRes struct { + Conversations []ConversationLocal `codec:"conversations" json:"conversations"` + UiConversations []InboxUIItem `codec:"uiConversations" json:"uiConversations"` + Offline bool `codec:"offline" json:"offline"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures" json:"identifyFailures"` +} + +func (o FindConversationsLocalRes) DeepCopy() FindConversationsLocalRes { + return FindConversationsLocalRes{ + Conversations: (func(x []ConversationLocal) []ConversationLocal { + if x == nil { + return nil + } + ret := make([]ConversationLocal, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Conversations), + UiConversations: (func(x []InboxUIItem) []InboxUIItem { + if x == nil { + return nil + } + ret := make([]InboxUIItem, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.UiConversations), + Offline: o.Offline, + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + } +} + +type JoinLeaveConversationLocalRes struct { + Offline bool `codec:"offline" json:"offline"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` +} + +func (o JoinLeaveConversationLocalRes) DeepCopy() JoinLeaveConversationLocalRes { + return JoinLeaveConversationLocalRes{ + Offline: o.Offline, + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +type PreviewConversationLocalRes struct { + Conv InboxUIItem `codec:"conv" json:"conv"` + Offline bool `codec:"offline" json:"offline"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` +} + +func (o PreviewConversationLocalRes) DeepCopy() PreviewConversationLocalRes { + return PreviewConversationLocalRes{ + Conv: o.Conv.DeepCopy(), + Offline: o.Offline, + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +type DeleteConversationLocalRes struct { + Offline bool `codec:"offline" json:"offline"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` +} + +func (o DeleteConversationLocalRes) DeepCopy() DeleteConversationLocalRes { + return DeleteConversationLocalRes{ + Offline: o.Offline, + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +type GetTLFConversationsLocalRes struct { + Convs []InboxUIItem `codec:"convs" json:"convs"` + Offline bool `codec:"offline" json:"offline"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` +} + +func (o GetTLFConversationsLocalRes) DeepCopy() GetTLFConversationsLocalRes { + return GetTLFConversationsLocalRes{ + Convs: (func(x []InboxUIItem) []InboxUIItem { + if x == nil { + return nil + } + ret := make([]InboxUIItem, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Convs), + Offline: o.Offline, + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +type SetAppNotificationSettingsLocalRes struct { + Offline bool `codec:"offline" json:"offline"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` +} + +func (o SetAppNotificationSettingsLocalRes) DeepCopy() SetAppNotificationSettingsLocalRes { + return SetAppNotificationSettingsLocalRes{ + Offline: o.Offline, + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +type AppNotificationSettingLocal struct { + DeviceType keybase1.DeviceType `codec:"deviceType" json:"deviceType"` + Kind NotificationKind `codec:"kind" json:"kind"` + Enabled bool `codec:"enabled" json:"enabled"` +} + +func (o AppNotificationSettingLocal) DeepCopy() AppNotificationSettingLocal { + return AppNotificationSettingLocal{ + DeviceType: o.DeviceType.DeepCopy(), + Kind: o.Kind.DeepCopy(), + Enabled: o.Enabled, + } +} + +type ResetConvMember struct { + Username string `codec:"username" json:"username"` + Uid gregor1.UID `codec:"uid" json:"uid"` + Conv ConversationID `codec:"conv" json:"conv"` +} + +func (o ResetConvMember) DeepCopy() ResetConvMember { + return ResetConvMember{ + Username: o.Username, + Uid: o.Uid.DeepCopy(), + Conv: o.Conv.DeepCopy(), + } +} + +type GetAllResetConvMembersRes struct { + Members []ResetConvMember `codec:"members" json:"members"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` +} + +func (o GetAllResetConvMembersRes) DeepCopy() GetAllResetConvMembersRes { + return GetAllResetConvMembersRes{ + Members: (func(x []ResetConvMember) []ResetConvMember { + if x == nil { + return nil + } + ret := make([]ResetConvMember, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Members), + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +type SearchRegexpRes struct { + Offline bool `codec:"offline" json:"offline"` + Hits []ChatSearchHit `codec:"hits" json:"hits"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures" json:"identifyFailures"` +} + +func (o SearchRegexpRes) DeepCopy() SearchRegexpRes { + return SearchRegexpRes{ + Offline: o.Offline, + Hits: (func(x []ChatSearchHit) []ChatSearchHit { + if x == nil { + return nil + } + ret := make([]ChatSearchHit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Hits), + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + } +} + +type SearchInboxRes struct { + Offline bool `codec:"offline" json:"offline"` + Res *ChatSearchInboxResults `codec:"res,omitempty" json:"res,omitempty"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures" json:"identifyFailures"` +} + +func (o SearchInboxRes) DeepCopy() SearchInboxRes { + return SearchInboxRes{ + Offline: o.Offline, + Res: (func(x *ChatSearchInboxResults) *ChatSearchInboxResults { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Res), + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + } +} + +type ProfileSearchConvStats struct { + Err string `codec:"err" json:"err"` + ConvName string `codec:"convName" json:"convName"` + MinConvID MessageID `codec:"minConvID" json:"minConvID"` + MaxConvID MessageID `codec:"maxConvID" json:"maxConvID"` + NumMissing int `codec:"numMissing" json:"numMissing"` + NumMessages int `codec:"numMessages" json:"numMessages"` + IndexSizeDisk int `codec:"indexSizeDisk" json:"indexSizeDisk"` + IndexSizeMem int64 `codec:"indexSizeMem" json:"indexSizeMem"` + DurationMsec gregor1.DurationMsec `codec:"durationMsec" json:"durationMsec"` + PercentIndexed int `codec:"percentIndexed" json:"percentIndexed"` +} + +func (o ProfileSearchConvStats) DeepCopy() ProfileSearchConvStats { + return ProfileSearchConvStats{ + Err: o.Err, + ConvName: o.ConvName, + MinConvID: o.MinConvID.DeepCopy(), + MaxConvID: o.MaxConvID.DeepCopy(), + NumMissing: o.NumMissing, + NumMessages: o.NumMessages, + IndexSizeDisk: o.IndexSizeDisk, + IndexSizeMem: o.IndexSizeMem, + DurationMsec: o.DurationMsec.DeepCopy(), + PercentIndexed: o.PercentIndexed, + } +} + +type BuiltinCommandGroup struct { + Typ ConversationBuiltinCommandTyp `codec:"typ" json:"typ"` + Commands []ConversationCommand `codec:"commands" json:"commands"` +} + +func (o BuiltinCommandGroup) DeepCopy() BuiltinCommandGroup { + return BuiltinCommandGroup{ + Typ: o.Typ.DeepCopy(), + Commands: (func(x []ConversationCommand) []ConversationCommand { + if x == nil { + return nil + } + ret := make([]ConversationCommand, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Commands), + } +} + +type StaticConfig struct { + DeletableByDeleteHistory []MessageType `codec:"deletableByDeleteHistory" json:"deletableByDeleteHistory"` + BuiltinCommands []BuiltinCommandGroup `codec:"builtinCommands" json:"builtinCommands"` +} + +func (o StaticConfig) DeepCopy() StaticConfig { + return StaticConfig{ + DeletableByDeleteHistory: (func(x []MessageType) []MessageType { + if x == nil { + return nil + } + ret := make([]MessageType, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.DeletableByDeleteHistory), + BuiltinCommands: (func(x []BuiltinCommandGroup) []BuiltinCommandGroup { + if x == nil { + return nil + } + ret := make([]BuiltinCommandGroup, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.BuiltinCommands), + } +} + +type UnfurlPromptAction int + +const ( + UnfurlPromptAction_ALWAYS UnfurlPromptAction = 0 + UnfurlPromptAction_NEVER UnfurlPromptAction = 1 + UnfurlPromptAction_ACCEPT UnfurlPromptAction = 2 + UnfurlPromptAction_NOTNOW UnfurlPromptAction = 3 + UnfurlPromptAction_ONETIME UnfurlPromptAction = 4 +) + +func (o UnfurlPromptAction) DeepCopy() UnfurlPromptAction { return o } + +var UnfurlPromptActionMap = map[string]UnfurlPromptAction{ + "ALWAYS": 0, + "NEVER": 1, + "ACCEPT": 2, + "NOTNOW": 3, + "ONETIME": 4, +} + +var UnfurlPromptActionRevMap = map[UnfurlPromptAction]string{ + 0: "ALWAYS", + 1: "NEVER", + 2: "ACCEPT", + 3: "NOTNOW", + 4: "ONETIME", +} + +func (e UnfurlPromptAction) String() string { + if v, ok := UnfurlPromptActionRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UnfurlPromptResult struct { + ActionType__ UnfurlPromptAction `codec:"actionType" json:"actionType"` + Accept__ *string `codec:"accept,omitempty" json:"accept,omitempty"` + Onetime__ *string `codec:"onetime,omitempty" json:"onetime,omitempty"` +} + +func (o *UnfurlPromptResult) ActionType() (ret UnfurlPromptAction, err error) { + switch o.ActionType__ { + case UnfurlPromptAction_ACCEPT: + if o.Accept__ == nil { + err = errors.New("unexpected nil value for Accept__") + return ret, err + } + case UnfurlPromptAction_ONETIME: + if o.Onetime__ == nil { + err = errors.New("unexpected nil value for Onetime__") + return ret, err + } + } + return o.ActionType__, nil +} + +func (o UnfurlPromptResult) Accept() (res string) { + if o.ActionType__ != UnfurlPromptAction_ACCEPT { + panic("wrong case accessed") + } + if o.Accept__ == nil { + return + } + return *o.Accept__ +} + +func (o UnfurlPromptResult) Onetime() (res string) { + if o.ActionType__ != UnfurlPromptAction_ONETIME { + panic("wrong case accessed") + } + if o.Onetime__ == nil { + return + } + return *o.Onetime__ +} + +func NewUnfurlPromptResultWithAlways() UnfurlPromptResult { + return UnfurlPromptResult{ + ActionType__: UnfurlPromptAction_ALWAYS, + } +} + +func NewUnfurlPromptResultWithNever() UnfurlPromptResult { + return UnfurlPromptResult{ + ActionType__: UnfurlPromptAction_NEVER, + } +} + +func NewUnfurlPromptResultWithNotnow() UnfurlPromptResult { + return UnfurlPromptResult{ + ActionType__: UnfurlPromptAction_NOTNOW, + } +} + +func NewUnfurlPromptResultWithAccept(v string) UnfurlPromptResult { + return UnfurlPromptResult{ + ActionType__: UnfurlPromptAction_ACCEPT, + Accept__: &v, + } +} + +func NewUnfurlPromptResultWithOnetime(v string) UnfurlPromptResult { + return UnfurlPromptResult{ + ActionType__: UnfurlPromptAction_ONETIME, + Onetime__: &v, + } +} + +func (o UnfurlPromptResult) DeepCopy() UnfurlPromptResult { + return UnfurlPromptResult{ + ActionType__: o.ActionType__.DeepCopy(), + Accept__: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Accept__), + Onetime__: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Onetime__), + } +} + +type GalleryItemTyp int + +const ( + GalleryItemTyp_MEDIA GalleryItemTyp = 0 + GalleryItemTyp_LINK GalleryItemTyp = 1 + GalleryItemTyp_DOC GalleryItemTyp = 2 +) + +func (o GalleryItemTyp) DeepCopy() GalleryItemTyp { return o } + +var GalleryItemTypMap = map[string]GalleryItemTyp{ + "MEDIA": 0, + "LINK": 1, + "DOC": 2, +} + +var GalleryItemTypRevMap = map[GalleryItemTyp]string{ + 0: "MEDIA", + 1: "LINK", + 2: "DOC", +} + +func (e GalleryItemTyp) String() string { + if v, ok := GalleryItemTypRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type LoadGalleryRes struct { + Messages []UIMessage `codec:"messages" json:"messages"` + Last bool `codec:"last" json:"last"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures" json:"identifyFailures"` +} + +func (o LoadGalleryRes) DeepCopy() LoadGalleryRes { + return LoadGalleryRes{ + Messages: (func(x []UIMessage) []UIMessage { + if x == nil { + return nil + } + ret := make([]UIMessage, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Messages), + Last: o.Last, + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + } +} + +type LoadFlipRes struct { + Status UICoinFlipStatus `codec:"status" json:"status"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` + IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures" json:"identifyFailures"` +} + +func (o LoadFlipRes) DeepCopy() LoadFlipRes { + return LoadFlipRes{ + Status: o.Status.DeepCopy(), + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]keybase1.TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IdentifyFailures), + } +} + +type UserBotExtendedDescription struct { + Title string `codec:"title" json:"title"` + DesktopBody string `codec:"desktopBody" json:"desktop_body"` + MobileBody string `codec:"mobileBody" json:"mobile_body"` +} + +func (o UserBotExtendedDescription) DeepCopy() UserBotExtendedDescription { + return UserBotExtendedDescription{ + Title: o.Title, + DesktopBody: o.DesktopBody, + MobileBody: o.MobileBody, + } +} + +type UserBotCommandOutput struct { + Name string `codec:"name" json:"name"` + Description string `codec:"description" json:"description"` + Usage string `codec:"usage" json:"usage"` + ExtendedDescription *UserBotExtendedDescription `codec:"extendedDescription,omitempty" json:"extended_description,omitempty"` + Username string `codec:"username" json:"username"` +} + +func (o UserBotCommandOutput) DeepCopy() UserBotCommandOutput { + return UserBotCommandOutput{ + Name: o.Name, + Description: o.Description, + Usage: o.Usage, + ExtendedDescription: (func(x *UserBotExtendedDescription) *UserBotExtendedDescription { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ExtendedDescription), + Username: o.Username, + } +} + +type UserBotCommandInput struct { + Name string `codec:"name" json:"name"` + Description string `codec:"description" json:"description"` + Usage string `codec:"usage" json:"usage"` + ExtendedDescription *UserBotExtendedDescription `codec:"extendedDescription,omitempty" json:"extended_description,omitempty"` +} + +func (o UserBotCommandInput) DeepCopy() UserBotCommandInput { + return UserBotCommandInput{ + Name: o.Name, + Description: o.Description, + Usage: o.Usage, + ExtendedDescription: (func(x *UserBotExtendedDescription) *UserBotExtendedDescription { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ExtendedDescription), + } +} + +type AdvertiseCommandsParam struct { + Typ BotCommandsAdvertisementTyp `codec:"typ" json:"typ"` + Commands []UserBotCommandInput `codec:"commands" json:"commands"` + TeamName *string `codec:"teamName,omitempty" json:"teamName,omitempty"` +} + +func (o AdvertiseCommandsParam) DeepCopy() AdvertiseCommandsParam { + return AdvertiseCommandsParam{ + Typ: o.Typ.DeepCopy(), + Commands: (func(x []UserBotCommandInput) []UserBotCommandInput { + if x == nil { + return nil + } + ret := make([]UserBotCommandInput, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Commands), + TeamName: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.TeamName), + } +} + +type AdvertiseBotCommandsLocalRes struct { + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` +} + +func (o AdvertiseBotCommandsLocalRes) DeepCopy() AdvertiseBotCommandsLocalRes { + return AdvertiseBotCommandsLocalRes{ + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +type ListBotCommandsLocalRes struct { + Commands []UserBotCommandOutput `codec:"commands" json:"commands"` + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` +} + +func (o ListBotCommandsLocalRes) DeepCopy() ListBotCommandsLocalRes { + return ListBotCommandsLocalRes{ + Commands: (func(x []UserBotCommandOutput) []UserBotCommandOutput { + if x == nil { + return nil + } + ret := make([]UserBotCommandOutput, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Commands), + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +type ClearBotCommandsLocalRes struct { + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` +} + +func (o ClearBotCommandsLocalRes) DeepCopy() ClearBotCommandsLocalRes { + return ClearBotCommandsLocalRes{ + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +type PinMessageRes struct { + RateLimits []RateLimit `codec:"rateLimits" json:"rateLimits"` +} + +func (o PinMessageRes) DeepCopy() PinMessageRes { + return PinMessageRes{ + RateLimits: (func(x []RateLimit) []RateLimit { + if x == nil { + return nil + } + ret := make([]RateLimit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RateLimits), + } +} + +type AddBotConvSearchHit struct { + Name string `codec:"name" json:"name"` + ConvID ConversationID `codec:"convID" json:"convID"` + IsTeam bool `codec:"isTeam" json:"isTeam"` + Parts []string `codec:"parts" json:"parts"` +} + +func (o AddBotConvSearchHit) DeepCopy() AddBotConvSearchHit { + return AddBotConvSearchHit{ + Name: o.Name, + ConvID: o.ConvID.DeepCopy(), + IsTeam: o.IsTeam, + Parts: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Parts), + } +} + +type LocalMtimeUpdate struct { + ConvID ConversationID `codec:"convID" json:"convID"` + Mtime gregor1.Time `codec:"mtime" json:"mtime"` +} + +func (o LocalMtimeUpdate) DeepCopy() LocalMtimeUpdate { + return LocalMtimeUpdate{ + ConvID: o.ConvID.DeepCopy(), + Mtime: o.Mtime.DeepCopy(), + } +} + +type SnippetDecoration int + +const ( + SnippetDecoration_NONE SnippetDecoration = 0 + SnippetDecoration_PENDING_MESSAGE SnippetDecoration = 1 + SnippetDecoration_FAILED_PENDING_MESSAGE SnippetDecoration = 2 + SnippetDecoration_EXPLODING_MESSAGE SnippetDecoration = 3 + SnippetDecoration_EXPLODED_MESSAGE SnippetDecoration = 4 + SnippetDecoration_AUDIO_ATTACHMENT SnippetDecoration = 5 + SnippetDecoration_VIDEO_ATTACHMENT SnippetDecoration = 6 + SnippetDecoration_PHOTO_ATTACHMENT SnippetDecoration = 7 + SnippetDecoration_FILE_ATTACHMENT SnippetDecoration = 8 + SnippetDecoration_STELLAR_RECEIVED SnippetDecoration = 9 + SnippetDecoration_STELLAR_SENT SnippetDecoration = 10 + SnippetDecoration_PINNED_MESSAGE SnippetDecoration = 11 +) + +func (o SnippetDecoration) DeepCopy() SnippetDecoration { return o } + +var SnippetDecorationMap = map[string]SnippetDecoration{ + "NONE": 0, + "PENDING_MESSAGE": 1, + "FAILED_PENDING_MESSAGE": 2, + "EXPLODING_MESSAGE": 3, + "EXPLODED_MESSAGE": 4, + "AUDIO_ATTACHMENT": 5, + "VIDEO_ATTACHMENT": 6, + "PHOTO_ATTACHMENT": 7, + "FILE_ATTACHMENT": 8, + "STELLAR_RECEIVED": 9, + "STELLAR_SENT": 10, + "PINNED_MESSAGE": 11, +} + +var SnippetDecorationRevMap = map[SnippetDecoration]string{ + 0: "NONE", + 1: "PENDING_MESSAGE", + 2: "FAILED_PENDING_MESSAGE", + 3: "EXPLODING_MESSAGE", + 4: "EXPLODED_MESSAGE", + 5: "AUDIO_ATTACHMENT", + 6: "VIDEO_ATTACHMENT", + 7: "PHOTO_ATTACHMENT", + 8: "FILE_ATTACHMENT", + 9: "STELLAR_RECEIVED", + 10: "STELLAR_SENT", + 11: "PINNED_MESSAGE", +} + +func (e SnippetDecoration) String() string { + if v, ok := SnippetDecorationRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/notify.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/notify.go new file mode 100644 index 00000000..ebc5c2a2 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/notify.go @@ -0,0 +1,938 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/chat1/notify.avdl + +package chat1 + +import ( + "errors" + "fmt" + + keybase1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1" +) + +type ChatActivitySource int + +const ( + ChatActivitySource_LOCAL ChatActivitySource = 0 + ChatActivitySource_REMOTE ChatActivitySource = 1 +) + +func (o ChatActivitySource) DeepCopy() ChatActivitySource { return o } + +var ChatActivitySourceMap = map[string]ChatActivitySource{ + "LOCAL": 0, + "REMOTE": 1, +} + +var ChatActivitySourceRevMap = map[ChatActivitySource]string{ + 0: "LOCAL", + 1: "REMOTE", +} + +func (e ChatActivitySource) String() string { + if v, ok := ChatActivitySourceRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ChatActivityType int + +const ( + ChatActivityType_RESERVED ChatActivityType = 0 + ChatActivityType_INCOMING_MESSAGE ChatActivityType = 1 + ChatActivityType_READ_MESSAGE ChatActivityType = 2 + ChatActivityType_NEW_CONVERSATION ChatActivityType = 3 + ChatActivityType_SET_STATUS ChatActivityType = 4 + ChatActivityType_FAILED_MESSAGE ChatActivityType = 5 + ChatActivityType_MEMBERS_UPDATE ChatActivityType = 6 + ChatActivityType_SET_APP_NOTIFICATION_SETTINGS ChatActivityType = 7 + ChatActivityType_TEAMTYPE ChatActivityType = 8 + ChatActivityType_EXPUNGE ChatActivityType = 9 + ChatActivityType_EPHEMERAL_PURGE ChatActivityType = 10 + ChatActivityType_REACTION_UPDATE ChatActivityType = 11 + ChatActivityType_MESSAGES_UPDATED ChatActivityType = 12 +) + +func (o ChatActivityType) DeepCopy() ChatActivityType { return o } + +var ChatActivityTypeMap = map[string]ChatActivityType{ + "RESERVED": 0, + "INCOMING_MESSAGE": 1, + "READ_MESSAGE": 2, + "NEW_CONVERSATION": 3, + "SET_STATUS": 4, + "FAILED_MESSAGE": 5, + "MEMBERS_UPDATE": 6, + "SET_APP_NOTIFICATION_SETTINGS": 7, + "TEAMTYPE": 8, + "EXPUNGE": 9, + "EPHEMERAL_PURGE": 10, + "REACTION_UPDATE": 11, + "MESSAGES_UPDATED": 12, +} + +var ChatActivityTypeRevMap = map[ChatActivityType]string{ + 0: "RESERVED", + 1: "INCOMING_MESSAGE", + 2: "READ_MESSAGE", + 3: "NEW_CONVERSATION", + 4: "SET_STATUS", + 5: "FAILED_MESSAGE", + 6: "MEMBERS_UPDATE", + 7: "SET_APP_NOTIFICATION_SETTINGS", + 8: "TEAMTYPE", + 9: "EXPUNGE", + 10: "EPHEMERAL_PURGE", + 11: "REACTION_UPDATE", + 12: "MESSAGES_UPDATED", +} + +func (e ChatActivityType) String() string { + if v, ok := ChatActivityTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type IncomingMessage struct { + Message UIMessage `codec:"message" json:"message"` + ModifiedMessage *UIMessage `codec:"modifiedMessage,omitempty" json:"modifiedMessage,omitempty"` + ConvID ConversationID `codec:"convID" json:"convID"` + DisplayDesktopNotification bool `codec:"displayDesktopNotification" json:"displayDesktopNotification"` + DesktopNotificationSnippet string `codec:"desktopNotificationSnippet" json:"desktopNotificationSnippet"` + Conv *InboxUIItem `codec:"conv,omitempty" json:"conv,omitempty"` + Pagination *UIPagination `codec:"pagination,omitempty" json:"pagination,omitempty"` +} + +func (o IncomingMessage) DeepCopy() IncomingMessage { + return IncomingMessage{ + Message: o.Message.DeepCopy(), + ModifiedMessage: (func(x *UIMessage) *UIMessage { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ModifiedMessage), + ConvID: o.ConvID.DeepCopy(), + DisplayDesktopNotification: o.DisplayDesktopNotification, + DesktopNotificationSnippet: o.DesktopNotificationSnippet, + Conv: (func(x *InboxUIItem) *InboxUIItem { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Conv), + Pagination: (func(x *UIPagination) *UIPagination { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Pagination), + } +} + +type ReadMessageInfo struct { + ConvID ConversationID `codec:"convID" json:"convID"` + MsgID MessageID `codec:"msgID" json:"msgID"` + Conv *InboxUIItem `codec:"conv,omitempty" json:"conv,omitempty"` +} + +func (o ReadMessageInfo) DeepCopy() ReadMessageInfo { + return ReadMessageInfo{ + ConvID: o.ConvID.DeepCopy(), + MsgID: o.MsgID.DeepCopy(), + Conv: (func(x *InboxUIItem) *InboxUIItem { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Conv), + } +} + +type NewConversationInfo struct { + ConvID ConversationID `codec:"convID" json:"convID"` + Conv *InboxUIItem `codec:"conv,omitempty" json:"conv,omitempty"` +} + +func (o NewConversationInfo) DeepCopy() NewConversationInfo { + return NewConversationInfo{ + ConvID: o.ConvID.DeepCopy(), + Conv: (func(x *InboxUIItem) *InboxUIItem { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Conv), + } +} + +type SetStatusInfo struct { + ConvID ConversationID `codec:"convID" json:"convID"` + Status ConversationStatus `codec:"status" json:"status"` + Conv *InboxUIItem `codec:"conv,omitempty" json:"conv,omitempty"` +} + +func (o SetStatusInfo) DeepCopy() SetStatusInfo { + return SetStatusInfo{ + ConvID: o.ConvID.DeepCopy(), + Status: o.Status.DeepCopy(), + Conv: (func(x *InboxUIItem) *InboxUIItem { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Conv), + } +} + +type SetAppNotificationSettingsInfo struct { + ConvID ConversationID `codec:"convID" json:"convID"` + Settings ConversationNotificationInfo `codec:"settings" json:"settings"` +} + +func (o SetAppNotificationSettingsInfo) DeepCopy() SetAppNotificationSettingsInfo { + return SetAppNotificationSettingsInfo{ + ConvID: o.ConvID.DeepCopy(), + Settings: o.Settings.DeepCopy(), + } +} + +type FailedMessageInfo struct { + OutboxRecords []OutboxRecord `codec:"outboxRecords" json:"outboxRecords"` + IsEphemeralPurge bool `codec:"isEphemeralPurge" json:"isEphemeralPurge"` + Conv *InboxUIItem `codec:"conv,omitempty" json:"conv,omitempty"` +} + +func (o FailedMessageInfo) DeepCopy() FailedMessageInfo { + return FailedMessageInfo{ + OutboxRecords: (func(x []OutboxRecord) []OutboxRecord { + if x == nil { + return nil + } + ret := make([]OutboxRecord, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.OutboxRecords), + IsEphemeralPurge: o.IsEphemeralPurge, + Conv: (func(x *InboxUIItem) *InboxUIItem { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Conv), + } +} + +type MemberInfo struct { + Member string `codec:"member" json:"member"` + Status ConversationMemberStatus `codec:"status" json:"status"` +} + +func (o MemberInfo) DeepCopy() MemberInfo { + return MemberInfo{ + Member: o.Member, + Status: o.Status.DeepCopy(), + } +} + +type MembersUpdateInfo struct { + ConvID ConversationID `codec:"convID" json:"convID"` + Members []MemberInfo `codec:"members" json:"members"` +} + +func (o MembersUpdateInfo) DeepCopy() MembersUpdateInfo { + return MembersUpdateInfo{ + ConvID: o.ConvID.DeepCopy(), + Members: (func(x []MemberInfo) []MemberInfo { + if x == nil { + return nil + } + ret := make([]MemberInfo, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Members), + } +} + +type TeamTypeInfo struct { + ConvID ConversationID `codec:"convID" json:"convID"` + TeamType TeamType `codec:"teamType" json:"teamType"` + Conv *InboxUIItem `codec:"conv,omitempty" json:"conv,omitempty"` +} + +func (o TeamTypeInfo) DeepCopy() TeamTypeInfo { + return TeamTypeInfo{ + ConvID: o.ConvID.DeepCopy(), + TeamType: o.TeamType.DeepCopy(), + Conv: (func(x *InboxUIItem) *InboxUIItem { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Conv), + } +} + +type ExpungeInfo struct { + ConvID ConversationID `codec:"convID" json:"convID"` + Expunge Expunge `codec:"expunge" json:"expunge"` +} + +func (o ExpungeInfo) DeepCopy() ExpungeInfo { + return ExpungeInfo{ + ConvID: o.ConvID.DeepCopy(), + Expunge: o.Expunge.DeepCopy(), + } +} + +type EphemeralPurgeNotifInfo struct { + ConvID ConversationID `codec:"convID" json:"convID"` + Msgs []UIMessage `codec:"msgs" json:"msgs"` +} + +func (o EphemeralPurgeNotifInfo) DeepCopy() EphemeralPurgeNotifInfo { + return EphemeralPurgeNotifInfo{ + ConvID: o.ConvID.DeepCopy(), + Msgs: (func(x []UIMessage) []UIMessage { + if x == nil { + return nil + } + ret := make([]UIMessage, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Msgs), + } +} + +type ReactionUpdate struct { + Reactions ReactionMap `codec:"reactions" json:"reactions"` + TargetMsgID MessageID `codec:"targetMsgID" json:"targetMsgID"` +} + +func (o ReactionUpdate) DeepCopy() ReactionUpdate { + return ReactionUpdate{ + Reactions: o.Reactions.DeepCopy(), + TargetMsgID: o.TargetMsgID.DeepCopy(), + } +} + +type ReactionUpdateNotif struct { + ConvID ConversationID `codec:"convID" json:"convID"` + UserReacjis keybase1.UserReacjis `codec:"userReacjis" json:"userReacjis"` + ReactionUpdates []ReactionUpdate `codec:"reactionUpdates" json:"reactionUpdates"` +} + +func (o ReactionUpdateNotif) DeepCopy() ReactionUpdateNotif { + return ReactionUpdateNotif{ + ConvID: o.ConvID.DeepCopy(), + UserReacjis: o.UserReacjis.DeepCopy(), + ReactionUpdates: (func(x []ReactionUpdate) []ReactionUpdate { + if x == nil { + return nil + } + ret := make([]ReactionUpdate, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ReactionUpdates), + } +} + +type MessagesUpdated struct { + ConvID ConversationID `codec:"convID" json:"convID"` + Updates []UIMessage `codec:"updates" json:"updates"` +} + +func (o MessagesUpdated) DeepCopy() MessagesUpdated { + return MessagesUpdated{ + ConvID: o.ConvID.DeepCopy(), + Updates: (func(x []UIMessage) []UIMessage { + if x == nil { + return nil + } + ret := make([]UIMessage, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Updates), + } +} + +type ChatActivity struct { + ActivityType__ ChatActivityType `codec:"activityType" json:"activityType"` + IncomingMessage__ *IncomingMessage `codec:"incomingMessage,omitempty" json:"incomingMessage,omitempty"` + ReadMessage__ *ReadMessageInfo `codec:"readMessage,omitempty" json:"readMessage,omitempty"` + NewConversation__ *NewConversationInfo `codec:"newConversation,omitempty" json:"newConversation,omitempty"` + SetStatus__ *SetStatusInfo `codec:"setStatus,omitempty" json:"setStatus,omitempty"` + FailedMessage__ *FailedMessageInfo `codec:"failedMessage,omitempty" json:"failedMessage,omitempty"` + MembersUpdate__ *MembersUpdateInfo `codec:"membersUpdate,omitempty" json:"membersUpdate,omitempty"` + SetAppNotificationSettings__ *SetAppNotificationSettingsInfo `codec:"setAppNotificationSettings,omitempty" json:"setAppNotificationSettings,omitempty"` + Teamtype__ *TeamTypeInfo `codec:"teamtype,omitempty" json:"teamtype,omitempty"` + Expunge__ *ExpungeInfo `codec:"expunge,omitempty" json:"expunge,omitempty"` + EphemeralPurge__ *EphemeralPurgeNotifInfo `codec:"ephemeralPurge,omitempty" json:"ephemeralPurge,omitempty"` + ReactionUpdate__ *ReactionUpdateNotif `codec:"reactionUpdate,omitempty" json:"reactionUpdate,omitempty"` + MessagesUpdated__ *MessagesUpdated `codec:"messagesUpdated,omitempty" json:"messagesUpdated,omitempty"` +} + +func (o *ChatActivity) ActivityType() (ret ChatActivityType, err error) { + switch o.ActivityType__ { + case ChatActivityType_INCOMING_MESSAGE: + if o.IncomingMessage__ == nil { + err = errors.New("unexpected nil value for IncomingMessage__") + return ret, err + } + case ChatActivityType_READ_MESSAGE: + if o.ReadMessage__ == nil { + err = errors.New("unexpected nil value for ReadMessage__") + return ret, err + } + case ChatActivityType_NEW_CONVERSATION: + if o.NewConversation__ == nil { + err = errors.New("unexpected nil value for NewConversation__") + return ret, err + } + case ChatActivityType_SET_STATUS: + if o.SetStatus__ == nil { + err = errors.New("unexpected nil value for SetStatus__") + return ret, err + } + case ChatActivityType_FAILED_MESSAGE: + if o.FailedMessage__ == nil { + err = errors.New("unexpected nil value for FailedMessage__") + return ret, err + } + case ChatActivityType_MEMBERS_UPDATE: + if o.MembersUpdate__ == nil { + err = errors.New("unexpected nil value for MembersUpdate__") + return ret, err + } + case ChatActivityType_SET_APP_NOTIFICATION_SETTINGS: + if o.SetAppNotificationSettings__ == nil { + err = errors.New("unexpected nil value for SetAppNotificationSettings__") + return ret, err + } + case ChatActivityType_TEAMTYPE: + if o.Teamtype__ == nil { + err = errors.New("unexpected nil value for Teamtype__") + return ret, err + } + case ChatActivityType_EXPUNGE: + if o.Expunge__ == nil { + err = errors.New("unexpected nil value for Expunge__") + return ret, err + } + case ChatActivityType_EPHEMERAL_PURGE: + if o.EphemeralPurge__ == nil { + err = errors.New("unexpected nil value for EphemeralPurge__") + return ret, err + } + case ChatActivityType_REACTION_UPDATE: + if o.ReactionUpdate__ == nil { + err = errors.New("unexpected nil value for ReactionUpdate__") + return ret, err + } + case ChatActivityType_MESSAGES_UPDATED: + if o.MessagesUpdated__ == nil { + err = errors.New("unexpected nil value for MessagesUpdated__") + return ret, err + } + } + return o.ActivityType__, nil +} + +func (o ChatActivity) IncomingMessage() (res IncomingMessage) { + if o.ActivityType__ != ChatActivityType_INCOMING_MESSAGE { + panic("wrong case accessed") + } + if o.IncomingMessage__ == nil { + return + } + return *o.IncomingMessage__ +} + +func (o ChatActivity) ReadMessage() (res ReadMessageInfo) { + if o.ActivityType__ != ChatActivityType_READ_MESSAGE { + panic("wrong case accessed") + } + if o.ReadMessage__ == nil { + return + } + return *o.ReadMessage__ +} + +func (o ChatActivity) NewConversation() (res NewConversationInfo) { + if o.ActivityType__ != ChatActivityType_NEW_CONVERSATION { + panic("wrong case accessed") + } + if o.NewConversation__ == nil { + return + } + return *o.NewConversation__ +} + +func (o ChatActivity) SetStatus() (res SetStatusInfo) { + if o.ActivityType__ != ChatActivityType_SET_STATUS { + panic("wrong case accessed") + } + if o.SetStatus__ == nil { + return + } + return *o.SetStatus__ +} + +func (o ChatActivity) FailedMessage() (res FailedMessageInfo) { + if o.ActivityType__ != ChatActivityType_FAILED_MESSAGE { + panic("wrong case accessed") + } + if o.FailedMessage__ == nil { + return + } + return *o.FailedMessage__ +} + +func (o ChatActivity) MembersUpdate() (res MembersUpdateInfo) { + if o.ActivityType__ != ChatActivityType_MEMBERS_UPDATE { + panic("wrong case accessed") + } + if o.MembersUpdate__ == nil { + return + } + return *o.MembersUpdate__ +} + +func (o ChatActivity) SetAppNotificationSettings() (res SetAppNotificationSettingsInfo) { + if o.ActivityType__ != ChatActivityType_SET_APP_NOTIFICATION_SETTINGS { + panic("wrong case accessed") + } + if o.SetAppNotificationSettings__ == nil { + return + } + return *o.SetAppNotificationSettings__ +} + +func (o ChatActivity) Teamtype() (res TeamTypeInfo) { + if o.ActivityType__ != ChatActivityType_TEAMTYPE { + panic("wrong case accessed") + } + if o.Teamtype__ == nil { + return + } + return *o.Teamtype__ +} + +func (o ChatActivity) Expunge() (res ExpungeInfo) { + if o.ActivityType__ != ChatActivityType_EXPUNGE { + panic("wrong case accessed") + } + if o.Expunge__ == nil { + return + } + return *o.Expunge__ +} + +func (o ChatActivity) EphemeralPurge() (res EphemeralPurgeNotifInfo) { + if o.ActivityType__ != ChatActivityType_EPHEMERAL_PURGE { + panic("wrong case accessed") + } + if o.EphemeralPurge__ == nil { + return + } + return *o.EphemeralPurge__ +} + +func (o ChatActivity) ReactionUpdate() (res ReactionUpdateNotif) { + if o.ActivityType__ != ChatActivityType_REACTION_UPDATE { + panic("wrong case accessed") + } + if o.ReactionUpdate__ == nil { + return + } + return *o.ReactionUpdate__ +} + +func (o ChatActivity) MessagesUpdated() (res MessagesUpdated) { + if o.ActivityType__ != ChatActivityType_MESSAGES_UPDATED { + panic("wrong case accessed") + } + if o.MessagesUpdated__ == nil { + return + } + return *o.MessagesUpdated__ +} + +func NewChatActivityWithIncomingMessage(v IncomingMessage) ChatActivity { + return ChatActivity{ + ActivityType__: ChatActivityType_INCOMING_MESSAGE, + IncomingMessage__: &v, + } +} + +func NewChatActivityWithReadMessage(v ReadMessageInfo) ChatActivity { + return ChatActivity{ + ActivityType__: ChatActivityType_READ_MESSAGE, + ReadMessage__: &v, + } +} + +func NewChatActivityWithNewConversation(v NewConversationInfo) ChatActivity { + return ChatActivity{ + ActivityType__: ChatActivityType_NEW_CONVERSATION, + NewConversation__: &v, + } +} + +func NewChatActivityWithSetStatus(v SetStatusInfo) ChatActivity { + return ChatActivity{ + ActivityType__: ChatActivityType_SET_STATUS, + SetStatus__: &v, + } +} + +func NewChatActivityWithFailedMessage(v FailedMessageInfo) ChatActivity { + return ChatActivity{ + ActivityType__: ChatActivityType_FAILED_MESSAGE, + FailedMessage__: &v, + } +} + +func NewChatActivityWithMembersUpdate(v MembersUpdateInfo) ChatActivity { + return ChatActivity{ + ActivityType__: ChatActivityType_MEMBERS_UPDATE, + MembersUpdate__: &v, + } +} + +func NewChatActivityWithSetAppNotificationSettings(v SetAppNotificationSettingsInfo) ChatActivity { + return ChatActivity{ + ActivityType__: ChatActivityType_SET_APP_NOTIFICATION_SETTINGS, + SetAppNotificationSettings__: &v, + } +} + +func NewChatActivityWithTeamtype(v TeamTypeInfo) ChatActivity { + return ChatActivity{ + ActivityType__: ChatActivityType_TEAMTYPE, + Teamtype__: &v, + } +} + +func NewChatActivityWithExpunge(v ExpungeInfo) ChatActivity { + return ChatActivity{ + ActivityType__: ChatActivityType_EXPUNGE, + Expunge__: &v, + } +} + +func NewChatActivityWithEphemeralPurge(v EphemeralPurgeNotifInfo) ChatActivity { + return ChatActivity{ + ActivityType__: ChatActivityType_EPHEMERAL_PURGE, + EphemeralPurge__: &v, + } +} + +func NewChatActivityWithReactionUpdate(v ReactionUpdateNotif) ChatActivity { + return ChatActivity{ + ActivityType__: ChatActivityType_REACTION_UPDATE, + ReactionUpdate__: &v, + } +} + +func NewChatActivityWithMessagesUpdated(v MessagesUpdated) ChatActivity { + return ChatActivity{ + ActivityType__: ChatActivityType_MESSAGES_UPDATED, + MessagesUpdated__: &v, + } +} + +func (o ChatActivity) DeepCopy() ChatActivity { + return ChatActivity{ + ActivityType__: o.ActivityType__.DeepCopy(), + IncomingMessage__: (func(x *IncomingMessage) *IncomingMessage { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.IncomingMessage__), + ReadMessage__: (func(x *ReadMessageInfo) *ReadMessageInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ReadMessage__), + NewConversation__: (func(x *NewConversationInfo) *NewConversationInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.NewConversation__), + SetStatus__: (func(x *SetStatusInfo) *SetStatusInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.SetStatus__), + FailedMessage__: (func(x *FailedMessageInfo) *FailedMessageInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.FailedMessage__), + MembersUpdate__: (func(x *MembersUpdateInfo) *MembersUpdateInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.MembersUpdate__), + SetAppNotificationSettings__: (func(x *SetAppNotificationSettingsInfo) *SetAppNotificationSettingsInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.SetAppNotificationSettings__), + Teamtype__: (func(x *TeamTypeInfo) *TeamTypeInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Teamtype__), + Expunge__: (func(x *ExpungeInfo) *ExpungeInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Expunge__), + EphemeralPurge__: (func(x *EphemeralPurgeNotifInfo) *EphemeralPurgeNotifInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.EphemeralPurge__), + ReactionUpdate__: (func(x *ReactionUpdateNotif) *ReactionUpdateNotif { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ReactionUpdate__), + MessagesUpdated__: (func(x *MessagesUpdated) *MessagesUpdated { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.MessagesUpdated__), + } +} + +type TyperInfo struct { + Uid keybase1.UID `codec:"uid" json:"uid"` + Username string `codec:"username" json:"username"` + DeviceID keybase1.DeviceID `codec:"deviceID" json:"deviceID"` + DeviceName string `codec:"deviceName" json:"deviceName"` + DeviceType string `codec:"deviceType" json:"deviceType"` +} + +func (o TyperInfo) DeepCopy() TyperInfo { + return TyperInfo{ + Uid: o.Uid.DeepCopy(), + Username: o.Username, + DeviceID: o.DeviceID.DeepCopy(), + DeviceName: o.DeviceName, + DeviceType: o.DeviceType, + } +} + +type ConvTypingUpdate struct { + ConvID ConversationID `codec:"convID" json:"convID"` + Typers []TyperInfo `codec:"typers" json:"typers"` +} + +func (o ConvTypingUpdate) DeepCopy() ConvTypingUpdate { + return ConvTypingUpdate{ + ConvID: o.ConvID.DeepCopy(), + Typers: (func(x []TyperInfo) []TyperInfo { + if x == nil { + return nil + } + ret := make([]TyperInfo, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Typers), + } +} + +type StaleUpdateType int + +const ( + StaleUpdateType_CLEAR StaleUpdateType = 0 + StaleUpdateType_NEWACTIVITY StaleUpdateType = 1 +) + +func (o StaleUpdateType) DeepCopy() StaleUpdateType { return o } + +var StaleUpdateTypeMap = map[string]StaleUpdateType{ + "CLEAR": 0, + "NEWACTIVITY": 1, +} + +var StaleUpdateTypeRevMap = map[StaleUpdateType]string{ + 0: "CLEAR", + 1: "NEWACTIVITY", +} + +func (e StaleUpdateType) String() string { + if v, ok := StaleUpdateTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ConversationStaleUpdate struct { + ConvID ConversationID `codec:"convID" json:"convID"` + UpdateType StaleUpdateType `codec:"updateType" json:"updateType"` +} + +func (o ConversationStaleUpdate) DeepCopy() ConversationStaleUpdate { + return ConversationStaleUpdate{ + ConvID: o.ConvID.DeepCopy(), + UpdateType: o.UpdateType.DeepCopy(), + } +} + +type ChatSyncIncrementalConv struct { + Conv UnverifiedInboxUIItem `codec:"conv" json:"conv"` + ShouldUnbox bool `codec:"shouldUnbox" json:"shouldUnbox"` +} + +func (o ChatSyncIncrementalConv) DeepCopy() ChatSyncIncrementalConv { + return ChatSyncIncrementalConv{ + Conv: o.Conv.DeepCopy(), + ShouldUnbox: o.ShouldUnbox, + } +} + +type ChatSyncIncrementalInfo struct { + Items []ChatSyncIncrementalConv `codec:"items" json:"items"` + Removals []string `codec:"removals" json:"removals"` +} + +func (o ChatSyncIncrementalInfo) DeepCopy() ChatSyncIncrementalInfo { + return ChatSyncIncrementalInfo{ + Items: (func(x []ChatSyncIncrementalConv) []ChatSyncIncrementalConv { + if x == nil { + return nil + } + ret := make([]ChatSyncIncrementalConv, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Items), + Removals: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Removals), + } +} + +type ChatSyncResult struct { + SyncType__ SyncInboxResType `codec:"syncType" json:"syncType"` + Incremental__ *ChatSyncIncrementalInfo `codec:"incremental,omitempty" json:"incremental,omitempty"` +} + +func (o *ChatSyncResult) SyncType() (ret SyncInboxResType, err error) { + switch o.SyncType__ { + case SyncInboxResType_INCREMENTAL: + if o.Incremental__ == nil { + err = errors.New("unexpected nil value for Incremental__") + return ret, err + } + } + return o.SyncType__, nil +} + +func (o ChatSyncResult) Incremental() (res ChatSyncIncrementalInfo) { + if o.SyncType__ != SyncInboxResType_INCREMENTAL { + panic("wrong case accessed") + } + if o.Incremental__ == nil { + return + } + return *o.Incremental__ +} + +func NewChatSyncResultWithCurrent() ChatSyncResult { + return ChatSyncResult{ + SyncType__: SyncInboxResType_CURRENT, + } +} + +func NewChatSyncResultWithClear() ChatSyncResult { + return ChatSyncResult{ + SyncType__: SyncInboxResType_CLEAR, + } +} + +func NewChatSyncResultWithIncremental(v ChatSyncIncrementalInfo) ChatSyncResult { + return ChatSyncResult{ + SyncType__: SyncInboxResType_INCREMENTAL, + Incremental__: &v, + } +} + +func (o ChatSyncResult) DeepCopy() ChatSyncResult { + return ChatSyncResult{ + SyncType__: o.SyncType__.DeepCopy(), + Incremental__: (func(x *ChatSyncIncrementalInfo) *ChatSyncIncrementalInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Incremental__), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/remote.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/remote.go new file mode 100644 index 00000000..bc4c3020 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/remote.go @@ -0,0 +1,1250 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/chat1/remote.avdl + +package chat1 + +import ( + "errors" + "fmt" + + gregor1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1" + keybase1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1" +) + +type MessageBoxed struct { + Version MessageBoxedVersion `codec:"version" json:"version"` + ServerHeader *MessageServerHeader `codec:"serverHeader,omitempty" json:"serverHeader,omitempty"` + ClientHeader MessageClientHeader `codec:"clientHeader" json:"clientHeader"` + HeaderCiphertext SealedData `codec:"headerCiphertext" json:"headerCiphertext"` + BodyCiphertext EncryptedData `codec:"bodyCiphertext" json:"bodyCiphertext"` + VerifyKey []byte `codec:"verifyKey" json:"verifyKey"` + KeyGeneration int `codec:"keyGeneration" json:"keyGeneration"` +} + +func (o MessageBoxed) DeepCopy() MessageBoxed { + return MessageBoxed{ + Version: o.Version.DeepCopy(), + ServerHeader: (func(x *MessageServerHeader) *MessageServerHeader { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ServerHeader), + ClientHeader: o.ClientHeader.DeepCopy(), + HeaderCiphertext: o.HeaderCiphertext.DeepCopy(), + BodyCiphertext: o.BodyCiphertext.DeepCopy(), + VerifyKey: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.VerifyKey), + KeyGeneration: o.KeyGeneration, + } +} + +type MessageBoxedVersion int + +const ( + MessageBoxedVersion_VNONE MessageBoxedVersion = 0 + MessageBoxedVersion_V1 MessageBoxedVersion = 1 + MessageBoxedVersion_V2 MessageBoxedVersion = 2 + MessageBoxedVersion_V3 MessageBoxedVersion = 3 + MessageBoxedVersion_V4 MessageBoxedVersion = 4 +) + +func (o MessageBoxedVersion) DeepCopy() MessageBoxedVersion { return o } + +var MessageBoxedVersionMap = map[string]MessageBoxedVersion{ + "VNONE": 0, + "V1": 1, + "V2": 2, + "V3": 3, + "V4": 4, +} + +var MessageBoxedVersionRevMap = map[MessageBoxedVersion]string{ + 0: "VNONE", + 1: "V1", + 2: "V2", + 3: "V3", + 4: "V4", +} + +func (e MessageBoxedVersion) String() string { + if v, ok := MessageBoxedVersionRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ThreadViewBoxed struct { + Messages []MessageBoxed `codec:"messages" json:"messages"` + Pagination *Pagination `codec:"pagination,omitempty" json:"pagination,omitempty"` +} + +func (o ThreadViewBoxed) DeepCopy() ThreadViewBoxed { + return ThreadViewBoxed{ + Messages: (func(x []MessageBoxed) []MessageBoxed { + if x == nil { + return nil + } + ret := make([]MessageBoxed, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Messages), + Pagination: (func(x *Pagination) *Pagination { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Pagination), + } +} + +type GetInboxRemoteRes struct { + Inbox InboxView `codec:"inbox" json:"inbox"` + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` +} + +func (o GetInboxRemoteRes) DeepCopy() GetInboxRemoteRes { + return GetInboxRemoteRes{ + Inbox: o.Inbox.DeepCopy(), + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + } +} + +type GetInboxByTLFIDRemoteRes struct { + Convs []Conversation `codec:"convs" json:"convs"` + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` +} + +func (o GetInboxByTLFIDRemoteRes) DeepCopy() GetInboxByTLFIDRemoteRes { + return GetInboxByTLFIDRemoteRes{ + Convs: (func(x []Conversation) []Conversation { + if x == nil { + return nil + } + ret := make([]Conversation, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Convs), + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + } +} + +type GetThreadRemoteRes struct { + Thread ThreadViewBoxed `codec:"thread" json:"thread"` + MembersType ConversationMembersType `codec:"membersType" json:"membersType"` + Visibility keybase1.TLFVisibility `codec:"visibility" json:"visibility"` + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` +} + +func (o GetThreadRemoteRes) DeepCopy() GetThreadRemoteRes { + return GetThreadRemoteRes{ + Thread: o.Thread.DeepCopy(), + MembersType: o.MembersType.DeepCopy(), + Visibility: o.Visibility.DeepCopy(), + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + } +} + +type GetConversationMetadataRemoteRes struct { + Conv Conversation `codec:"conv" json:"conv"` + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` +} + +func (o GetConversationMetadataRemoteRes) DeepCopy() GetConversationMetadataRemoteRes { + return GetConversationMetadataRemoteRes{ + Conv: o.Conv.DeepCopy(), + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + } +} + +type PostRemoteRes struct { + MsgHeader MessageServerHeader `codec:"msgHeader" json:"msgHeader"` + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` +} + +func (o PostRemoteRes) DeepCopy() PostRemoteRes { + return PostRemoteRes{ + MsgHeader: o.MsgHeader.DeepCopy(), + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + } +} + +type NewConversationRemoteRes struct { + ConvID ConversationID `codec:"convID" json:"convID"` + CreatedComplexTeam bool `codec:"createdComplexTeam" json:"createdComplexTeam"` + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` +} + +func (o NewConversationRemoteRes) DeepCopy() NewConversationRemoteRes { + return NewConversationRemoteRes{ + ConvID: o.ConvID.DeepCopy(), + CreatedComplexTeam: o.CreatedComplexTeam, + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + } +} + +type GetMessagesRemoteRes struct { + Msgs []MessageBoxed `codec:"msgs" json:"msgs"` + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` +} + +func (o GetMessagesRemoteRes) DeepCopy() GetMessagesRemoteRes { + return GetMessagesRemoteRes{ + Msgs: (func(x []MessageBoxed) []MessageBoxed { + if x == nil { + return nil + } + ret := make([]MessageBoxed, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Msgs), + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + } +} + +type MarkAsReadRes struct { + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` +} + +func (o MarkAsReadRes) DeepCopy() MarkAsReadRes { + return MarkAsReadRes{ + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + } +} + +type SetConversationStatusRes struct { + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` +} + +func (o SetConversationStatusRes) DeepCopy() SetConversationStatusRes { + return SetConversationStatusRes{ + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + } +} + +type GetPublicConversationsRes struct { + Conversations []Conversation `codec:"conversations" json:"conversations"` + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` +} + +func (o GetPublicConversationsRes) DeepCopy() GetPublicConversationsRes { + return GetPublicConversationsRes{ + Conversations: (func(x []Conversation) []Conversation { + if x == nil { + return nil + } + ret := make([]Conversation, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Conversations), + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + } +} + +type GetUnreadlineRemoteRes struct { + UnreadlineID *MessageID `codec:"unreadlineID,omitempty" json:"unreadlineID,omitempty"` + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` +} + +func (o GetUnreadlineRemoteRes) DeepCopy() GetUnreadlineRemoteRes { + return GetUnreadlineRemoteRes{ + UnreadlineID: (func(x *MessageID) *MessageID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.UnreadlineID), + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + } +} + +type ChannelMention int + +const ( + ChannelMention_NONE ChannelMention = 0 + ChannelMention_ALL ChannelMention = 1 + ChannelMention_HERE ChannelMention = 2 +) + +func (o ChannelMention) DeepCopy() ChannelMention { return o } + +var ChannelMentionMap = map[string]ChannelMention{ + "NONE": 0, + "ALL": 1, + "HERE": 2, +} + +var ChannelMentionRevMap = map[ChannelMention]string{ + 0: "NONE", + 1: "ALL", + 2: "HERE", +} + +func (e ChannelMention) String() string { + if v, ok := ChannelMentionRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UnreadUpdateFull struct { + Ignore bool `codec:"ignore" json:"ignore"` + InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"` + InboxSyncStatus SyncInboxResType `codec:"inboxSyncStatus" json:"inboxSyncStatus"` + Updates []UnreadUpdate `codec:"updates" json:"updates"` +} + +func (o UnreadUpdateFull) DeepCopy() UnreadUpdateFull { + return UnreadUpdateFull{ + Ignore: o.Ignore, + InboxVers: o.InboxVers.DeepCopy(), + InboxSyncStatus: o.InboxSyncStatus.DeepCopy(), + Updates: (func(x []UnreadUpdate) []UnreadUpdate { + if x == nil { + return nil + } + ret := make([]UnreadUpdate, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Updates), + } +} + +type S3Params struct { + Bucket string `codec:"bucket" json:"bucket"` + ObjectKey string `codec:"objectKey" json:"objectKey"` + AccessKey string `codec:"accessKey" json:"accessKey"` + Acl string `codec:"acl" json:"acl"` + RegionName string `codec:"regionName" json:"regionName"` + RegionEndpoint string `codec:"regionEndpoint" json:"regionEndpoint"` + RegionBucketEndpoint string `codec:"regionBucketEndpoint" json:"regionBucketEndpoint"` +} + +func (o S3Params) DeepCopy() S3Params { + return S3Params{ + Bucket: o.Bucket, + ObjectKey: o.ObjectKey, + AccessKey: o.AccessKey, + Acl: o.Acl, + RegionName: o.RegionName, + RegionEndpoint: o.RegionEndpoint, + RegionBucketEndpoint: o.RegionBucketEndpoint, + } +} + +type SyncIncrementalRes struct { + Vers InboxVers `codec:"vers" json:"vers"` + Convs []Conversation `codec:"convs" json:"convs"` +} + +func (o SyncIncrementalRes) DeepCopy() SyncIncrementalRes { + return SyncIncrementalRes{ + Vers: o.Vers.DeepCopy(), + Convs: (func(x []Conversation) []Conversation { + if x == nil { + return nil + } + ret := make([]Conversation, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Convs), + } +} + +type ServerCacheVers struct { + InboxVers int `codec:"inboxVers" json:"inboxVers"` + BodiesVers int `codec:"bodiesVers" json:"bodiesVers"` +} + +func (o ServerCacheVers) DeepCopy() ServerCacheVers { + return ServerCacheVers{ + InboxVers: o.InboxVers, + BodiesVers: o.BodiesVers, + } +} + +type SyncInboxRes struct { + Typ__ SyncInboxResType `codec:"typ" json:"typ"` + Incremental__ *SyncIncrementalRes `codec:"incremental,omitempty" json:"incremental,omitempty"` +} + +func (o *SyncInboxRes) Typ() (ret SyncInboxResType, err error) { + switch o.Typ__ { + case SyncInboxResType_INCREMENTAL: + if o.Incremental__ == nil { + err = errors.New("unexpected nil value for Incremental__") + return ret, err + } + } + return o.Typ__, nil +} + +func (o SyncInboxRes) Incremental() (res SyncIncrementalRes) { + if o.Typ__ != SyncInboxResType_INCREMENTAL { + panic("wrong case accessed") + } + if o.Incremental__ == nil { + return + } + return *o.Incremental__ +} + +func NewSyncInboxResWithCurrent() SyncInboxRes { + return SyncInboxRes{ + Typ__: SyncInboxResType_CURRENT, + } +} + +func NewSyncInboxResWithIncremental(v SyncIncrementalRes) SyncInboxRes { + return SyncInboxRes{ + Typ__: SyncInboxResType_INCREMENTAL, + Incremental__: &v, + } +} + +func NewSyncInboxResWithClear() SyncInboxRes { + return SyncInboxRes{ + Typ__: SyncInboxResType_CLEAR, + } +} + +func (o SyncInboxRes) DeepCopy() SyncInboxRes { + return SyncInboxRes{ + Typ__: o.Typ__.DeepCopy(), + Incremental__: (func(x *SyncIncrementalRes) *SyncIncrementalRes { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Incremental__), + } +} + +type SyncChatRes struct { + CacheVers ServerCacheVers `codec:"cacheVers" json:"cacheVers"` + InboxRes SyncInboxRes `codec:"inboxRes" json:"inboxRes"` +} + +func (o SyncChatRes) DeepCopy() SyncChatRes { + return SyncChatRes{ + CacheVers: o.CacheVers.DeepCopy(), + InboxRes: o.InboxRes.DeepCopy(), + } +} + +type SyncAllProtVers int + +const ( + SyncAllProtVers_V0 SyncAllProtVers = 0 + SyncAllProtVers_V1 SyncAllProtVers = 1 +) + +func (o SyncAllProtVers) DeepCopy() SyncAllProtVers { return o } + +var SyncAllProtVersMap = map[string]SyncAllProtVers{ + "V0": 0, + "V1": 1, +} + +var SyncAllProtVersRevMap = map[SyncAllProtVers]string{ + 0: "V0", + 1: "V1", +} + +func (e SyncAllProtVers) String() string { + if v, ok := SyncAllProtVersRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type SyncAllNotificationType int + +const ( + SyncAllNotificationType_STATE SyncAllNotificationType = 0 + SyncAllNotificationType_INCREMENTAL SyncAllNotificationType = 1 +) + +func (o SyncAllNotificationType) DeepCopy() SyncAllNotificationType { return o } + +var SyncAllNotificationTypeMap = map[string]SyncAllNotificationType{ + "STATE": 0, + "INCREMENTAL": 1, +} + +var SyncAllNotificationTypeRevMap = map[SyncAllNotificationType]string{ + 0: "STATE", + 1: "INCREMENTAL", +} + +func (e SyncAllNotificationType) String() string { + if v, ok := SyncAllNotificationTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type SyncAllNotificationRes struct { + Typ__ SyncAllNotificationType `codec:"typ" json:"typ"` + State__ *gregor1.State `codec:"state,omitempty" json:"state,omitempty"` + Incremental__ *gregor1.SyncResult `codec:"incremental,omitempty" json:"incremental,omitempty"` +} + +func (o *SyncAllNotificationRes) Typ() (ret SyncAllNotificationType, err error) { + switch o.Typ__ { + case SyncAllNotificationType_STATE: + if o.State__ == nil { + err = errors.New("unexpected nil value for State__") + return ret, err + } + case SyncAllNotificationType_INCREMENTAL: + if o.Incremental__ == nil { + err = errors.New("unexpected nil value for Incremental__") + return ret, err + } + } + return o.Typ__, nil +} + +func (o SyncAllNotificationRes) State() (res gregor1.State) { + if o.Typ__ != SyncAllNotificationType_STATE { + panic("wrong case accessed") + } + if o.State__ == nil { + return + } + return *o.State__ +} + +func (o SyncAllNotificationRes) Incremental() (res gregor1.SyncResult) { + if o.Typ__ != SyncAllNotificationType_INCREMENTAL { + panic("wrong case accessed") + } + if o.Incremental__ == nil { + return + } + return *o.Incremental__ +} + +func NewSyncAllNotificationResWithState(v gregor1.State) SyncAllNotificationRes { + return SyncAllNotificationRes{ + Typ__: SyncAllNotificationType_STATE, + State__: &v, + } +} + +func NewSyncAllNotificationResWithIncremental(v gregor1.SyncResult) SyncAllNotificationRes { + return SyncAllNotificationRes{ + Typ__: SyncAllNotificationType_INCREMENTAL, + Incremental__: &v, + } +} + +func (o SyncAllNotificationRes) DeepCopy() SyncAllNotificationRes { + return SyncAllNotificationRes{ + Typ__: o.Typ__.DeepCopy(), + State__: (func(x *gregor1.State) *gregor1.State { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.State__), + Incremental__: (func(x *gregor1.SyncResult) *gregor1.SyncResult { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Incremental__), + } +} + +type SyncAllResult struct { + Auth gregor1.AuthResult `codec:"auth" json:"auth"` + Chat SyncChatRes `codec:"chat" json:"chat"` + Notification SyncAllNotificationRes `codec:"notification" json:"notification"` + Badge UnreadUpdateFull `codec:"badge" json:"badge"` +} + +func (o SyncAllResult) DeepCopy() SyncAllResult { + return SyncAllResult{ + Auth: o.Auth.DeepCopy(), + Chat: o.Chat.DeepCopy(), + Notification: o.Notification.DeepCopy(), + Badge: o.Badge.DeepCopy(), + } +} + +type JoinLeaveConversationRemoteRes struct { + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` +} + +func (o JoinLeaveConversationRemoteRes) DeepCopy() JoinLeaveConversationRemoteRes { + return JoinLeaveConversationRemoteRes{ + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + } +} + +type DeleteConversationRemoteRes struct { + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` +} + +func (o DeleteConversationRemoteRes) DeepCopy() DeleteConversationRemoteRes { + return DeleteConversationRemoteRes{ + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + } +} + +type GetMessageBeforeRes struct { + MsgID MessageID `codec:"msgID" json:"msgID"` + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` +} + +func (o GetMessageBeforeRes) DeepCopy() GetMessageBeforeRes { + return GetMessageBeforeRes{ + MsgID: o.MsgID.DeepCopy(), + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + } +} + +type GetTLFConversationsRes struct { + Conversations []Conversation `codec:"conversations" json:"conversations"` + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` +} + +func (o GetTLFConversationsRes) DeepCopy() GetTLFConversationsRes { + return GetTLFConversationsRes{ + Conversations: (func(x []Conversation) []Conversation { + if x == nil { + return nil + } + ret := make([]Conversation, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Conversations), + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + } +} + +type SetAppNotificationSettingsRes struct { + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` +} + +func (o SetAppNotificationSettingsRes) DeepCopy() SetAppNotificationSettingsRes { + return SetAppNotificationSettingsRes{ + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + } +} + +type SetRetentionRes struct { + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` +} + +func (o SetRetentionRes) DeepCopy() SetRetentionRes { + return SetRetentionRes{ + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + } +} + +type SetConvMinWriterRoleRes struct { + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` +} + +func (o SetConvMinWriterRoleRes) DeepCopy() SetConvMinWriterRoleRes { + return SetConvMinWriterRoleRes{ + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + } +} + +type SweepRes struct { + FoundTask bool `codec:"foundTask" json:"foundTask"` + DeletedMessages bool `codec:"deletedMessages" json:"deletedMessages"` + Expunge Expunge `codec:"expunge" json:"expunge"` +} + +func (o SweepRes) DeepCopy() SweepRes { + return SweepRes{ + FoundTask: o.FoundTask, + DeletedMessages: o.DeletedMessages, + Expunge: o.Expunge.DeepCopy(), + } +} + +type ServerNowRes struct { + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` + Now gregor1.Time `codec:"now" json:"now"` +} + +func (o ServerNowRes) DeepCopy() ServerNowRes { + return ServerNowRes{ + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + Now: o.Now.DeepCopy(), + } +} + +type ExternalAPIKeyTyp int + +const ( + ExternalAPIKeyTyp_GOOGLEMAPS ExternalAPIKeyTyp = 0 + ExternalAPIKeyTyp_GIPHY ExternalAPIKeyTyp = 1 +) + +func (o ExternalAPIKeyTyp) DeepCopy() ExternalAPIKeyTyp { return o } + +var ExternalAPIKeyTypMap = map[string]ExternalAPIKeyTyp{ + "GOOGLEMAPS": 0, + "GIPHY": 1, +} + +var ExternalAPIKeyTypRevMap = map[ExternalAPIKeyTyp]string{ + 0: "GOOGLEMAPS", + 1: "GIPHY", +} + +func (e ExternalAPIKeyTyp) String() string { + if v, ok := ExternalAPIKeyTypRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ExternalAPIKey struct { + Typ__ ExternalAPIKeyTyp `codec:"typ" json:"typ"` + Googlemaps__ *string `codec:"googlemaps,omitempty" json:"googlemaps,omitempty"` + Giphy__ *string `codec:"giphy,omitempty" json:"giphy,omitempty"` +} + +func (o *ExternalAPIKey) Typ() (ret ExternalAPIKeyTyp, err error) { + switch o.Typ__ { + case ExternalAPIKeyTyp_GOOGLEMAPS: + if o.Googlemaps__ == nil { + err = errors.New("unexpected nil value for Googlemaps__") + return ret, err + } + case ExternalAPIKeyTyp_GIPHY: + if o.Giphy__ == nil { + err = errors.New("unexpected nil value for Giphy__") + return ret, err + } + } + return o.Typ__, nil +} + +func (o ExternalAPIKey) Googlemaps() (res string) { + if o.Typ__ != ExternalAPIKeyTyp_GOOGLEMAPS { + panic("wrong case accessed") + } + if o.Googlemaps__ == nil { + return + } + return *o.Googlemaps__ +} + +func (o ExternalAPIKey) Giphy() (res string) { + if o.Typ__ != ExternalAPIKeyTyp_GIPHY { + panic("wrong case accessed") + } + if o.Giphy__ == nil { + return + } + return *o.Giphy__ +} + +func NewExternalAPIKeyWithGooglemaps(v string) ExternalAPIKey { + return ExternalAPIKey{ + Typ__: ExternalAPIKeyTyp_GOOGLEMAPS, + Googlemaps__: &v, + } +} + +func NewExternalAPIKeyWithGiphy(v string) ExternalAPIKey { + return ExternalAPIKey{ + Typ__: ExternalAPIKeyTyp_GIPHY, + Giphy__: &v, + } +} + +func (o ExternalAPIKey) DeepCopy() ExternalAPIKey { + return ExternalAPIKey{ + Typ__: o.Typ__.DeepCopy(), + Googlemaps__: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Googlemaps__), + Giphy__: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Giphy__), + } +} + +type BotInfoHashVers uint64 + +func (o BotInfoHashVers) DeepCopy() BotInfoHashVers { + return o +} + +type CommandConvVers uint64 + +func (o CommandConvVers) DeepCopy() CommandConvVers { + return o +} + +type RemoteBotCommandsAdvertisementPublic struct { + ConvID ConversationID `codec:"convID" json:"convID"` +} + +func (o RemoteBotCommandsAdvertisementPublic) DeepCopy() RemoteBotCommandsAdvertisementPublic { + return RemoteBotCommandsAdvertisementPublic{ + ConvID: o.ConvID.DeepCopy(), + } +} + +type RemoteBotCommandsAdvertisementTLFID struct { + ConvID ConversationID `codec:"convID" json:"convID"` + TlfID TLFID `codec:"tlfID" json:"tlfID"` +} + +func (o RemoteBotCommandsAdvertisementTLFID) DeepCopy() RemoteBotCommandsAdvertisementTLFID { + return RemoteBotCommandsAdvertisementTLFID{ + ConvID: o.ConvID.DeepCopy(), + TlfID: o.TlfID.DeepCopy(), + } +} + +type RemoteBotCommandsAdvertisement struct { + Typ__ BotCommandsAdvertisementTyp `codec:"typ" json:"typ"` + Public__ *RemoteBotCommandsAdvertisementPublic `codec:"public,omitempty" json:"public,omitempty"` + TlfidMembers__ *RemoteBotCommandsAdvertisementTLFID `codec:"tlfidMembers,omitempty" json:"tlfidMembers,omitempty"` + TlfidConvs__ *RemoteBotCommandsAdvertisementTLFID `codec:"tlfidConvs,omitempty" json:"tlfidConvs,omitempty"` +} + +func (o *RemoteBotCommandsAdvertisement) Typ() (ret BotCommandsAdvertisementTyp, err error) { + switch o.Typ__ { + case BotCommandsAdvertisementTyp_PUBLIC: + if o.Public__ == nil { + err = errors.New("unexpected nil value for Public__") + return ret, err + } + case BotCommandsAdvertisementTyp_TLFID_MEMBERS: + if o.TlfidMembers__ == nil { + err = errors.New("unexpected nil value for TlfidMembers__") + return ret, err + } + case BotCommandsAdvertisementTyp_TLFID_CONVS: + if o.TlfidConvs__ == nil { + err = errors.New("unexpected nil value for TlfidConvs__") + return ret, err + } + } + return o.Typ__, nil +} + +func (o RemoteBotCommandsAdvertisement) Public() (res RemoteBotCommandsAdvertisementPublic) { + if o.Typ__ != BotCommandsAdvertisementTyp_PUBLIC { + panic("wrong case accessed") + } + if o.Public__ == nil { + return + } + return *o.Public__ +} + +func (o RemoteBotCommandsAdvertisement) TlfidMembers() (res RemoteBotCommandsAdvertisementTLFID) { + if o.Typ__ != BotCommandsAdvertisementTyp_TLFID_MEMBERS { + panic("wrong case accessed") + } + if o.TlfidMembers__ == nil { + return + } + return *o.TlfidMembers__ +} + +func (o RemoteBotCommandsAdvertisement) TlfidConvs() (res RemoteBotCommandsAdvertisementTLFID) { + if o.Typ__ != BotCommandsAdvertisementTyp_TLFID_CONVS { + panic("wrong case accessed") + } + if o.TlfidConvs__ == nil { + return + } + return *o.TlfidConvs__ +} + +func NewRemoteBotCommandsAdvertisementWithPublic(v RemoteBotCommandsAdvertisementPublic) RemoteBotCommandsAdvertisement { + return RemoteBotCommandsAdvertisement{ + Typ__: BotCommandsAdvertisementTyp_PUBLIC, + Public__: &v, + } +} + +func NewRemoteBotCommandsAdvertisementWithTlfidMembers(v RemoteBotCommandsAdvertisementTLFID) RemoteBotCommandsAdvertisement { + return RemoteBotCommandsAdvertisement{ + Typ__: BotCommandsAdvertisementTyp_TLFID_MEMBERS, + TlfidMembers__: &v, + } +} + +func NewRemoteBotCommandsAdvertisementWithTlfidConvs(v RemoteBotCommandsAdvertisementTLFID) RemoteBotCommandsAdvertisement { + return RemoteBotCommandsAdvertisement{ + Typ__: BotCommandsAdvertisementTyp_TLFID_CONVS, + TlfidConvs__: &v, + } +} + +func (o RemoteBotCommandsAdvertisement) DeepCopy() RemoteBotCommandsAdvertisement { + return RemoteBotCommandsAdvertisement{ + Typ__: o.Typ__.DeepCopy(), + Public__: (func(x *RemoteBotCommandsAdvertisementPublic) *RemoteBotCommandsAdvertisementPublic { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Public__), + TlfidMembers__: (func(x *RemoteBotCommandsAdvertisementTLFID) *RemoteBotCommandsAdvertisementTLFID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.TlfidMembers__), + TlfidConvs__: (func(x *RemoteBotCommandsAdvertisementTLFID) *RemoteBotCommandsAdvertisementTLFID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.TlfidConvs__), + } +} + +type BotCommandConv struct { + Uid gregor1.UID `codec:"uid" json:"uid"` + UntrustedTeamRole keybase1.TeamRole `codec:"untrustedTeamRole" json:"untrustedTeamRole"` + ConvID ConversationID `codec:"convID" json:"convID"` + Vers CommandConvVers `codec:"vers" json:"vers"` + Mtime gregor1.Time `codec:"mtime" json:"mtime"` +} + +func (o BotCommandConv) DeepCopy() BotCommandConv { + return BotCommandConv{ + Uid: o.Uid.DeepCopy(), + UntrustedTeamRole: o.UntrustedTeamRole.DeepCopy(), + ConvID: o.ConvID.DeepCopy(), + Vers: o.Vers.DeepCopy(), + Mtime: o.Mtime.DeepCopy(), + } +} + +type BotInfo struct { + ServerHashVers BotInfoHashVers `codec:"serverHashVers" json:"serverHashVers"` + ClientHashVers BotInfoHashVers `codec:"clientHashVers" json:"clientHashVers"` + CommandConvs []BotCommandConv `codec:"commandConvs" json:"commandConvs"` +} + +func (o BotInfo) DeepCopy() BotInfo { + return BotInfo{ + ServerHashVers: o.ServerHashVers.DeepCopy(), + ClientHashVers: o.ClientHashVers.DeepCopy(), + CommandConvs: (func(x []BotCommandConv) []BotCommandConv { + if x == nil { + return nil + } + ret := make([]BotCommandConv, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.CommandConvs), + } +} + +type AdvertiseBotCommandsRes struct { + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` +} + +func (o AdvertiseBotCommandsRes) DeepCopy() AdvertiseBotCommandsRes { + return AdvertiseBotCommandsRes{ + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + } +} + +type ClearBotCommandsRes struct { + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` +} + +func (o ClearBotCommandsRes) DeepCopy() ClearBotCommandsRes { + return ClearBotCommandsRes{ + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + } +} + +type BotInfoResponseTyp int + +const ( + BotInfoResponseTyp_UPTODATE BotInfoResponseTyp = 0 + BotInfoResponseTyp_INFO BotInfoResponseTyp = 1 +) + +func (o BotInfoResponseTyp) DeepCopy() BotInfoResponseTyp { return o } + +var BotInfoResponseTypMap = map[string]BotInfoResponseTyp{ + "UPTODATE": 0, + "INFO": 1, +} + +var BotInfoResponseTypRevMap = map[BotInfoResponseTyp]string{ + 0: "UPTODATE", + 1: "INFO", +} + +func (e BotInfoResponseTyp) String() string { + if v, ok := BotInfoResponseTypRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type BotInfoResponse struct { + Typ__ BotInfoResponseTyp `codec:"typ" json:"typ"` + Info__ *BotInfo `codec:"info,omitempty" json:"info,omitempty"` +} + +func (o *BotInfoResponse) Typ() (ret BotInfoResponseTyp, err error) { + switch o.Typ__ { + case BotInfoResponseTyp_INFO: + if o.Info__ == nil { + err = errors.New("unexpected nil value for Info__") + return ret, err + } + } + return o.Typ__, nil +} + +func (o BotInfoResponse) Info() (res BotInfo) { + if o.Typ__ != BotInfoResponseTyp_INFO { + panic("wrong case accessed") + } + if o.Info__ == nil { + return + } + return *o.Info__ +} + +func NewBotInfoResponseWithUptodate() BotInfoResponse { + return BotInfoResponse{ + Typ__: BotInfoResponseTyp_UPTODATE, + } +} + +func NewBotInfoResponseWithInfo(v BotInfo) BotInfoResponse { + return BotInfoResponse{ + Typ__: BotInfoResponseTyp_INFO, + Info__: &v, + } +} + +func (o BotInfoResponse) DeepCopy() BotInfoResponse { + return BotInfoResponse{ + Typ__: o.Typ__.DeepCopy(), + Info__: (func(x *BotInfo) *BotInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Info__), + } +} + +type GetBotInfoRes struct { + Response BotInfoResponse `codec:"response" json:"response"` + RateLimit *RateLimit `codec:"rateLimit,omitempty" json:"rateLimit,omitempty"` +} + +func (o GetBotInfoRes) DeepCopy() GetBotInfoRes { + return GetBotInfoRes{ + Response: o.Response.DeepCopy(), + RateLimit: (func(x *RateLimit) *RateLimit { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RateLimit), + } +} + +type BotInfoHash []byte + +func (o BotInfoHash) DeepCopy() BotInfoHash { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/unfurl.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/unfurl.go new file mode 100644 index 00000000..7b99d35d --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1/unfurl.go @@ -0,0 +1,850 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/chat1/unfurl.avdl + +package chat1 + +import ( + "errors" + "fmt" + + gregor1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1" +) + +type UnfurlType int + +const ( + UnfurlType_GENERIC UnfurlType = 0 + UnfurlType_YOUTUBE UnfurlType = 1 + UnfurlType_GIPHY UnfurlType = 2 + UnfurlType_MAPS UnfurlType = 3 +) + +func (o UnfurlType) DeepCopy() UnfurlType { return o } + +var UnfurlTypeMap = map[string]UnfurlType{ + "GENERIC": 0, + "YOUTUBE": 1, + "GIPHY": 2, + "MAPS": 3, +} + +var UnfurlTypeRevMap = map[UnfurlType]string{ + 0: "GENERIC", + 1: "YOUTUBE", + 2: "GIPHY", + 3: "MAPS", +} + +func (e UnfurlType) String() string { + if v, ok := UnfurlTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UnfurlVideo struct { + Url string `codec:"url" json:"url"` + MimeType string `codec:"mimeType" json:"mimeType"` + Height int `codec:"height" json:"height"` + Width int `codec:"width" json:"width"` +} + +func (o UnfurlVideo) DeepCopy() UnfurlVideo { + return UnfurlVideo{ + Url: o.Url, + MimeType: o.MimeType, + Height: o.Height, + Width: o.Width, + } +} + +type UnfurlGenericRaw struct { + Title string `codec:"title" json:"title"` + Url string `codec:"url" json:"url"` + SiteName string `codec:"siteName" json:"siteName"` + FaviconUrl *string `codec:"faviconUrl,omitempty" json:"faviconUrl,omitempty"` + ImageUrl *string `codec:"imageUrl,omitempty" json:"imageUrl,omitempty"` + Video *UnfurlVideo `codec:"video,omitempty" json:"video,omitempty"` + PublishTime *int `codec:"publishTime,omitempty" json:"publishTime,omitempty"` + Description *string `codec:"description,omitempty" json:"description,omitempty"` +} + +func (o UnfurlGenericRaw) DeepCopy() UnfurlGenericRaw { + return UnfurlGenericRaw{ + Title: o.Title, + Url: o.Url, + SiteName: o.SiteName, + FaviconUrl: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.FaviconUrl), + ImageUrl: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.ImageUrl), + Video: (func(x *UnfurlVideo) *UnfurlVideo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Video), + PublishTime: (func(x *int) *int { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.PublishTime), + Description: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Description), + } +} + +type UnfurlYoutubeRaw struct { +} + +func (o UnfurlYoutubeRaw) DeepCopy() UnfurlYoutubeRaw { + return UnfurlYoutubeRaw{} +} + +type UnfurlGiphyRaw struct { + ImageUrl *string `codec:"imageUrl,omitempty" json:"imageUrl,omitempty"` + Video *UnfurlVideo `codec:"video,omitempty" json:"video,omitempty"` + FaviconUrl *string `codec:"faviconUrl,omitempty" json:"faviconUrl,omitempty"` +} + +func (o UnfurlGiphyRaw) DeepCopy() UnfurlGiphyRaw { + return UnfurlGiphyRaw{ + ImageUrl: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.ImageUrl), + Video: (func(x *UnfurlVideo) *UnfurlVideo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Video), + FaviconUrl: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.FaviconUrl), + } +} + +type UnfurlMapsRaw struct { + Title string `codec:"title" json:"title"` + Url string `codec:"url" json:"url"` + SiteName string `codec:"siteName" json:"siteName"` + ImageUrl string `codec:"imageUrl" json:"imageUrl"` + HistoryImageUrl *string `codec:"historyImageUrl,omitempty" json:"historyImageUrl,omitempty"` + Description string `codec:"description" json:"description"` + Coord Coordinate `codec:"coord" json:"coord"` + Time gregor1.Time `codec:"time" json:"time"` + LiveLocationEndTime *gregor1.Time `codec:"liveLocationEndTime,omitempty" json:"liveLocationEndTime,omitempty"` + LiveLocationDone bool `codec:"liveLocationDone" json:"liveLocationDone"` +} + +func (o UnfurlMapsRaw) DeepCopy() UnfurlMapsRaw { + return UnfurlMapsRaw{ + Title: o.Title, + Url: o.Url, + SiteName: o.SiteName, + ImageUrl: o.ImageUrl, + HistoryImageUrl: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.HistoryImageUrl), + Description: o.Description, + Coord: o.Coord.DeepCopy(), + Time: o.Time.DeepCopy(), + LiveLocationEndTime: (func(x *gregor1.Time) *gregor1.Time { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.LiveLocationEndTime), + LiveLocationDone: o.LiveLocationDone, + } +} + +type UnfurlRaw struct { + UnfurlType__ UnfurlType `codec:"unfurlType" json:"unfurlType"` + Generic__ *UnfurlGenericRaw `codec:"generic,omitempty" json:"generic,omitempty"` + Youtube__ *UnfurlYoutubeRaw `codec:"youtube,omitempty" json:"youtube,omitempty"` + Giphy__ *UnfurlGiphyRaw `codec:"giphy,omitempty" json:"giphy,omitempty"` + Maps__ *UnfurlMapsRaw `codec:"maps,omitempty" json:"maps,omitempty"` +} + +func (o *UnfurlRaw) UnfurlType() (ret UnfurlType, err error) { + switch o.UnfurlType__ { + case UnfurlType_GENERIC: + if o.Generic__ == nil { + err = errors.New("unexpected nil value for Generic__") + return ret, err + } + case UnfurlType_YOUTUBE: + if o.Youtube__ == nil { + err = errors.New("unexpected nil value for Youtube__") + return ret, err + } + case UnfurlType_GIPHY: + if o.Giphy__ == nil { + err = errors.New("unexpected nil value for Giphy__") + return ret, err + } + case UnfurlType_MAPS: + if o.Maps__ == nil { + err = errors.New("unexpected nil value for Maps__") + return ret, err + } + } + return o.UnfurlType__, nil +} + +func (o UnfurlRaw) Generic() (res UnfurlGenericRaw) { + if o.UnfurlType__ != UnfurlType_GENERIC { + panic("wrong case accessed") + } + if o.Generic__ == nil { + return + } + return *o.Generic__ +} + +func (o UnfurlRaw) Youtube() (res UnfurlYoutubeRaw) { + if o.UnfurlType__ != UnfurlType_YOUTUBE { + panic("wrong case accessed") + } + if o.Youtube__ == nil { + return + } + return *o.Youtube__ +} + +func (o UnfurlRaw) Giphy() (res UnfurlGiphyRaw) { + if o.UnfurlType__ != UnfurlType_GIPHY { + panic("wrong case accessed") + } + if o.Giphy__ == nil { + return + } + return *o.Giphy__ +} + +func (o UnfurlRaw) Maps() (res UnfurlMapsRaw) { + if o.UnfurlType__ != UnfurlType_MAPS { + panic("wrong case accessed") + } + if o.Maps__ == nil { + return + } + return *o.Maps__ +} + +func NewUnfurlRawWithGeneric(v UnfurlGenericRaw) UnfurlRaw { + return UnfurlRaw{ + UnfurlType__: UnfurlType_GENERIC, + Generic__: &v, + } +} + +func NewUnfurlRawWithYoutube(v UnfurlYoutubeRaw) UnfurlRaw { + return UnfurlRaw{ + UnfurlType__: UnfurlType_YOUTUBE, + Youtube__: &v, + } +} + +func NewUnfurlRawWithGiphy(v UnfurlGiphyRaw) UnfurlRaw { + return UnfurlRaw{ + UnfurlType__: UnfurlType_GIPHY, + Giphy__: &v, + } +} + +func NewUnfurlRawWithMaps(v UnfurlMapsRaw) UnfurlRaw { + return UnfurlRaw{ + UnfurlType__: UnfurlType_MAPS, + Maps__: &v, + } +} + +func (o UnfurlRaw) DeepCopy() UnfurlRaw { + return UnfurlRaw{ + UnfurlType__: o.UnfurlType__.DeepCopy(), + Generic__: (func(x *UnfurlGenericRaw) *UnfurlGenericRaw { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Generic__), + Youtube__: (func(x *UnfurlYoutubeRaw) *UnfurlYoutubeRaw { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Youtube__), + Giphy__: (func(x *UnfurlGiphyRaw) *UnfurlGiphyRaw { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Giphy__), + Maps__: (func(x *UnfurlMapsRaw) *UnfurlMapsRaw { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Maps__), + } +} + +type UnfurlGenericMapInfo struct { + Coord Coordinate `codec:"coord" json:"coord"` + Time gregor1.Time `codec:"time" json:"time"` + LiveLocationEndTime *gregor1.Time `codec:"liveLocationEndTime,omitempty" json:"liveLocationEndTime,omitempty"` + IsLiveLocationDone bool `codec:"isLiveLocationDone" json:"isLiveLocationDone"` +} + +func (o UnfurlGenericMapInfo) DeepCopy() UnfurlGenericMapInfo { + return UnfurlGenericMapInfo{ + Coord: o.Coord.DeepCopy(), + Time: o.Time.DeepCopy(), + LiveLocationEndTime: (func(x *gregor1.Time) *gregor1.Time { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.LiveLocationEndTime), + IsLiveLocationDone: o.IsLiveLocationDone, + } +} + +type UnfurlGeneric struct { + Title string `codec:"title" json:"title"` + Url string `codec:"url" json:"url"` + SiteName string `codec:"siteName" json:"siteName"` + Favicon *Asset `codec:"favicon,omitempty" json:"favicon,omitempty"` + Image *Asset `codec:"image,omitempty" json:"image,omitempty"` + PublishTime *int `codec:"publishTime,omitempty" json:"publishTime,omitempty"` + Description *string `codec:"description,omitempty" json:"description,omitempty"` + MapInfo *UnfurlGenericMapInfo `codec:"mapInfo,omitempty" json:"mapInfo,omitempty"` +} + +func (o UnfurlGeneric) DeepCopy() UnfurlGeneric { + return UnfurlGeneric{ + Title: o.Title, + Url: o.Url, + SiteName: o.SiteName, + Favicon: (func(x *Asset) *Asset { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Favicon), + Image: (func(x *Asset) *Asset { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Image), + PublishTime: (func(x *int) *int { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.PublishTime), + Description: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Description), + MapInfo: (func(x *UnfurlGenericMapInfo) *UnfurlGenericMapInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.MapInfo), + } +} + +type UnfurlYoutube struct { +} + +func (o UnfurlYoutube) DeepCopy() UnfurlYoutube { + return UnfurlYoutube{} +} + +type UnfurlGiphy struct { + Favicon *Asset `codec:"favicon,omitempty" json:"favicon,omitempty"` + Image *Asset `codec:"image,omitempty" json:"image,omitempty"` + Video *Asset `codec:"video,omitempty" json:"video,omitempty"` +} + +func (o UnfurlGiphy) DeepCopy() UnfurlGiphy { + return UnfurlGiphy{ + Favicon: (func(x *Asset) *Asset { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Favicon), + Image: (func(x *Asset) *Asset { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Image), + Video: (func(x *Asset) *Asset { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Video), + } +} + +type Unfurl struct { + UnfurlType__ UnfurlType `codec:"unfurlType" json:"unfurlType"` + Generic__ *UnfurlGeneric `codec:"generic,omitempty" json:"generic,omitempty"` + Youtube__ *UnfurlYoutube `codec:"youtube,omitempty" json:"youtube,omitempty"` + Giphy__ *UnfurlGiphy `codec:"giphy,omitempty" json:"giphy,omitempty"` +} + +func (o *Unfurl) UnfurlType() (ret UnfurlType, err error) { + switch o.UnfurlType__ { + case UnfurlType_GENERIC: + if o.Generic__ == nil { + err = errors.New("unexpected nil value for Generic__") + return ret, err + } + case UnfurlType_YOUTUBE: + if o.Youtube__ == nil { + err = errors.New("unexpected nil value for Youtube__") + return ret, err + } + case UnfurlType_GIPHY: + if o.Giphy__ == nil { + err = errors.New("unexpected nil value for Giphy__") + return ret, err + } + } + return o.UnfurlType__, nil +} + +func (o Unfurl) Generic() (res UnfurlGeneric) { + if o.UnfurlType__ != UnfurlType_GENERIC { + panic("wrong case accessed") + } + if o.Generic__ == nil { + return + } + return *o.Generic__ +} + +func (o Unfurl) Youtube() (res UnfurlYoutube) { + if o.UnfurlType__ != UnfurlType_YOUTUBE { + panic("wrong case accessed") + } + if o.Youtube__ == nil { + return + } + return *o.Youtube__ +} + +func (o Unfurl) Giphy() (res UnfurlGiphy) { + if o.UnfurlType__ != UnfurlType_GIPHY { + panic("wrong case accessed") + } + if o.Giphy__ == nil { + return + } + return *o.Giphy__ +} + +func NewUnfurlWithGeneric(v UnfurlGeneric) Unfurl { + return Unfurl{ + UnfurlType__: UnfurlType_GENERIC, + Generic__: &v, + } +} + +func NewUnfurlWithYoutube(v UnfurlYoutube) Unfurl { + return Unfurl{ + UnfurlType__: UnfurlType_YOUTUBE, + Youtube__: &v, + } +} + +func NewUnfurlWithGiphy(v UnfurlGiphy) Unfurl { + return Unfurl{ + UnfurlType__: UnfurlType_GIPHY, + Giphy__: &v, + } +} + +func (o Unfurl) DeepCopy() Unfurl { + return Unfurl{ + UnfurlType__: o.UnfurlType__.DeepCopy(), + Generic__: (func(x *UnfurlGeneric) *UnfurlGeneric { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Generic__), + Youtube__: (func(x *UnfurlYoutube) *UnfurlYoutube { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Youtube__), + Giphy__: (func(x *UnfurlGiphy) *UnfurlGiphy { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Giphy__), + } +} + +type UnfurlResult struct { + Unfurl Unfurl `codec:"unfurl" json:"unfurl"` + Url string `codec:"url" json:"url"` +} + +func (o UnfurlResult) DeepCopy() UnfurlResult { + return UnfurlResult{ + Unfurl: o.Unfurl.DeepCopy(), + Url: o.Url, + } +} + +type UnfurlImageDisplay struct { + Url string `codec:"url" json:"url"` + Height int `codec:"height" json:"height"` + Width int `codec:"width" json:"width"` + IsVideo bool `codec:"isVideo" json:"isVideo"` +} + +func (o UnfurlImageDisplay) DeepCopy() UnfurlImageDisplay { + return UnfurlImageDisplay{ + Url: o.Url, + Height: o.Height, + Width: o.Width, + IsVideo: o.IsVideo, + } +} + +type UnfurlGenericDisplay struct { + Title string `codec:"title" json:"title"` + Url string `codec:"url" json:"url"` + SiteName string `codec:"siteName" json:"siteName"` + Favicon *UnfurlImageDisplay `codec:"favicon,omitempty" json:"favicon,omitempty"` + Media *UnfurlImageDisplay `codec:"media,omitempty" json:"media,omitempty"` + PublishTime *int `codec:"publishTime,omitempty" json:"publishTime,omitempty"` + Description *string `codec:"description,omitempty" json:"description,omitempty"` + MapInfo *UnfurlGenericMapInfo `codec:"mapInfo,omitempty" json:"mapInfo,omitempty"` +} + +func (o UnfurlGenericDisplay) DeepCopy() UnfurlGenericDisplay { + return UnfurlGenericDisplay{ + Title: o.Title, + Url: o.Url, + SiteName: o.SiteName, + Favicon: (func(x *UnfurlImageDisplay) *UnfurlImageDisplay { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Favicon), + Media: (func(x *UnfurlImageDisplay) *UnfurlImageDisplay { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Media), + PublishTime: (func(x *int) *int { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.PublishTime), + Description: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Description), + MapInfo: (func(x *UnfurlGenericMapInfo) *UnfurlGenericMapInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.MapInfo), + } +} + +type UnfurlYoutubeDisplay struct { +} + +func (o UnfurlYoutubeDisplay) DeepCopy() UnfurlYoutubeDisplay { + return UnfurlYoutubeDisplay{} +} + +type UnfurlGiphyDisplay struct { + Favicon *UnfurlImageDisplay `codec:"favicon,omitempty" json:"favicon,omitempty"` + Image *UnfurlImageDisplay `codec:"image,omitempty" json:"image,omitempty"` + Video *UnfurlImageDisplay `codec:"video,omitempty" json:"video,omitempty"` +} + +func (o UnfurlGiphyDisplay) DeepCopy() UnfurlGiphyDisplay { + return UnfurlGiphyDisplay{ + Favicon: (func(x *UnfurlImageDisplay) *UnfurlImageDisplay { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Favicon), + Image: (func(x *UnfurlImageDisplay) *UnfurlImageDisplay { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Image), + Video: (func(x *UnfurlImageDisplay) *UnfurlImageDisplay { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Video), + } +} + +type UnfurlDisplay struct { + UnfurlType__ UnfurlType `codec:"unfurlType" json:"unfurlType"` + Generic__ *UnfurlGenericDisplay `codec:"generic,omitempty" json:"generic,omitempty"` + Youtube__ *UnfurlYoutubeDisplay `codec:"youtube,omitempty" json:"youtube,omitempty"` + Giphy__ *UnfurlGiphyDisplay `codec:"giphy,omitempty" json:"giphy,omitempty"` +} + +func (o *UnfurlDisplay) UnfurlType() (ret UnfurlType, err error) { + switch o.UnfurlType__ { + case UnfurlType_GENERIC: + if o.Generic__ == nil { + err = errors.New("unexpected nil value for Generic__") + return ret, err + } + case UnfurlType_YOUTUBE: + if o.Youtube__ == nil { + err = errors.New("unexpected nil value for Youtube__") + return ret, err + } + case UnfurlType_GIPHY: + if o.Giphy__ == nil { + err = errors.New("unexpected nil value for Giphy__") + return ret, err + } + } + return o.UnfurlType__, nil +} + +func (o UnfurlDisplay) Generic() (res UnfurlGenericDisplay) { + if o.UnfurlType__ != UnfurlType_GENERIC { + panic("wrong case accessed") + } + if o.Generic__ == nil { + return + } + return *o.Generic__ +} + +func (o UnfurlDisplay) Youtube() (res UnfurlYoutubeDisplay) { + if o.UnfurlType__ != UnfurlType_YOUTUBE { + panic("wrong case accessed") + } + if o.Youtube__ == nil { + return + } + return *o.Youtube__ +} + +func (o UnfurlDisplay) Giphy() (res UnfurlGiphyDisplay) { + if o.UnfurlType__ != UnfurlType_GIPHY { + panic("wrong case accessed") + } + if o.Giphy__ == nil { + return + } + return *o.Giphy__ +} + +func NewUnfurlDisplayWithGeneric(v UnfurlGenericDisplay) UnfurlDisplay { + return UnfurlDisplay{ + UnfurlType__: UnfurlType_GENERIC, + Generic__: &v, + } +} + +func NewUnfurlDisplayWithYoutube(v UnfurlYoutubeDisplay) UnfurlDisplay { + return UnfurlDisplay{ + UnfurlType__: UnfurlType_YOUTUBE, + Youtube__: &v, + } +} + +func NewUnfurlDisplayWithGiphy(v UnfurlGiphyDisplay) UnfurlDisplay { + return UnfurlDisplay{ + UnfurlType__: UnfurlType_GIPHY, + Giphy__: &v, + } +} + +func (o UnfurlDisplay) DeepCopy() UnfurlDisplay { + return UnfurlDisplay{ + UnfurlType__: o.UnfurlType__.DeepCopy(), + Generic__: (func(x *UnfurlGenericDisplay) *UnfurlGenericDisplay { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Generic__), + Youtube__: (func(x *UnfurlYoutubeDisplay) *UnfurlYoutubeDisplay { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Youtube__), + Giphy__: (func(x *UnfurlGiphyDisplay) *UnfurlGiphyDisplay { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Giphy__), + } +} + +type UnfurlMode int + +const ( + UnfurlMode_ALWAYS UnfurlMode = 0 + UnfurlMode_NEVER UnfurlMode = 1 + UnfurlMode_WHITELISTED UnfurlMode = 2 +) + +func (o UnfurlMode) DeepCopy() UnfurlMode { return o } + +var UnfurlModeMap = map[string]UnfurlMode{ + "ALWAYS": 0, + "NEVER": 1, + "WHITELISTED": 2, +} + +var UnfurlModeRevMap = map[UnfurlMode]string{ + 0: "ALWAYS", + 1: "NEVER", + 2: "WHITELISTED", +} + +func (e UnfurlMode) String() string { + if v, ok := UnfurlModeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UnfurlSettings struct { + Mode UnfurlMode `codec:"mode" json:"mode"` + Whitelist map[string]bool `codec:"whitelist" json:"whitelist"` +} + +func (o UnfurlSettings) DeepCopy() UnfurlSettings { + return UnfurlSettings{ + Mode: o.Mode.DeepCopy(), + Whitelist: (func(x map[string]bool) map[string]bool { + if x == nil { + return nil + } + ret := make(map[string]bool, len(x)) + for k, v := range x { + kCopy := k + vCopy := v + ret[kCopy] = vCopy + } + return ret + })(o.Whitelist), + } +} + +type UnfurlSettingsDisplay struct { + Mode UnfurlMode `codec:"mode" json:"mode"` + Whitelist []string `codec:"whitelist" json:"whitelist"` +} + +func (o UnfurlSettingsDisplay) DeepCopy() UnfurlSettingsDisplay { + return UnfurlSettingsDisplay{ + Mode: o.Mode.DeepCopy(), + Whitelist: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Whitelist), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/auth.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/auth.go new file mode 100644 index 00000000..3da25001 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/auth.go @@ -0,0 +1,20 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/gregor1/auth.avdl + +package gregor1 + +type AuthResult struct { + Uid UID `codec:"uid" json:"uid"` + Username string `codec:"username" json:"username"` + Sid SessionID `codec:"sid" json:"sid"` + IsAdmin bool `codec:"isAdmin" json:"isAdmin"` +} + +func (o AuthResult) DeepCopy() AuthResult { + return AuthResult{ + Uid: o.Uid.DeepCopy(), + Username: o.Username, + Sid: o.Sid.DeepCopy(), + IsAdmin: o.IsAdmin, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/auth_internal.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/auth_internal.go new file mode 100644 index 00000000..3a0376cb --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/auth_internal.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/gregor1/auth_internal.avdl + +package gregor1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/auth_update.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/auth_update.go new file mode 100644 index 00000000..74fce37f --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/auth_update.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/gregor1/auth_update.avdl + +package gregor1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/common.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/common.go new file mode 100644 index 00000000..27ba51d1 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/common.go @@ -0,0 +1,394 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/gregor1/common.avdl + +package gregor1 + +type TimeOrOffset struct { + Time_ Time `codec:"time" json:"time"` + Offset_ DurationMsec `codec:"offset" json:"offset"` +} + +func (o TimeOrOffset) DeepCopy() TimeOrOffset { + return TimeOrOffset{ + Time_: o.Time_.DeepCopy(), + Offset_: o.Offset_.DeepCopy(), + } +} + +type Metadata struct { + Uid_ UID `codec:"uid" json:"uid"` + MsgID_ MsgID `codec:"msgID" json:"msgID"` + Ctime_ Time `codec:"ctime" json:"ctime"` + DeviceID_ DeviceID `codec:"deviceID" json:"deviceID"` + InBandMsgType_ int `codec:"inBandMsgType" json:"inBandMsgType"` +} + +func (o Metadata) DeepCopy() Metadata { + return Metadata{ + Uid_: o.Uid_.DeepCopy(), + MsgID_: o.MsgID_.DeepCopy(), + Ctime_: o.Ctime_.DeepCopy(), + DeviceID_: o.DeviceID_.DeepCopy(), + InBandMsgType_: o.InBandMsgType_, + } +} + +type InBandMessage struct { + StateUpdate_ *StateUpdateMessage `codec:"stateUpdate,omitempty" json:"stateUpdate,omitempty"` + StateSync_ *StateSyncMessage `codec:"stateSync,omitempty" json:"stateSync,omitempty"` +} + +func (o InBandMessage) DeepCopy() InBandMessage { + return InBandMessage{ + StateUpdate_: (func(x *StateUpdateMessage) *StateUpdateMessage { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.StateUpdate_), + StateSync_: (func(x *StateSyncMessage) *StateSyncMessage { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.StateSync_), + } +} + +type State struct { + Items_ []ItemAndMetadata `codec:"items" json:"items"` +} + +func (o State) DeepCopy() State { + return State{ + Items_: (func(x []ItemAndMetadata) []ItemAndMetadata { + if x == nil { + return nil + } + ret := make([]ItemAndMetadata, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Items_), + } +} + +type StateUpdateMessage struct { + Md_ Metadata `codec:"md" json:"md"` + Creation_ *Item `codec:"creation,omitempty" json:"creation,omitempty"` + Dismissal_ *Dismissal `codec:"dismissal,omitempty" json:"dismissal,omitempty"` +} + +func (o StateUpdateMessage) DeepCopy() StateUpdateMessage { + return StateUpdateMessage{ + Md_: o.Md_.DeepCopy(), + Creation_: (func(x *Item) *Item { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Creation_), + Dismissal_: (func(x *Dismissal) *Dismissal { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Dismissal_), + } +} + +type StateSyncMessage struct { + Md_ Metadata `codec:"md" json:"md"` +} + +func (o StateSyncMessage) DeepCopy() StateSyncMessage { + return StateSyncMessage{ + Md_: o.Md_.DeepCopy(), + } +} + +type MsgRange struct { + EndTime_ TimeOrOffset `codec:"endTime" json:"endTime"` + Category_ Category `codec:"category" json:"category"` + SkipMsgIDs_ []MsgID `codec:"skipMsgIDs" json:"skipMsgIDs"` +} + +func (o MsgRange) DeepCopy() MsgRange { + return MsgRange{ + EndTime_: o.EndTime_.DeepCopy(), + Category_: o.Category_.DeepCopy(), + SkipMsgIDs_: (func(x []MsgID) []MsgID { + if x == nil { + return nil + } + ret := make([]MsgID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.SkipMsgIDs_), + } +} + +type Dismissal struct { + MsgIDs_ []MsgID `codec:"msgIDs" json:"msgIDs"` + Ranges_ []MsgRange `codec:"ranges" json:"ranges"` +} + +func (o Dismissal) DeepCopy() Dismissal { + return Dismissal{ + MsgIDs_: (func(x []MsgID) []MsgID { + if x == nil { + return nil + } + ret := make([]MsgID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.MsgIDs_), + Ranges_: (func(x []MsgRange) []MsgRange { + if x == nil { + return nil + } + ret := make([]MsgRange, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Ranges_), + } +} + +type Item struct { + Category_ Category `codec:"category" json:"category"` + Dtime_ TimeOrOffset `codec:"dtime" json:"dtime"` + RemindTimes_ []TimeOrOffset `codec:"remindTimes" json:"remindTimes"` + Body_ Body `codec:"body" json:"body"` +} + +func (o Item) DeepCopy() Item { + return Item{ + Category_: o.Category_.DeepCopy(), + Dtime_: o.Dtime_.DeepCopy(), + RemindTimes_: (func(x []TimeOrOffset) []TimeOrOffset { + if x == nil { + return nil + } + ret := make([]TimeOrOffset, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RemindTimes_), + Body_: o.Body_.DeepCopy(), + } +} + +type ItemAndMetadata struct { + Md_ *Metadata `codec:"md,omitempty" json:"md,omitempty"` + Item_ *Item `codec:"item,omitempty" json:"item,omitempty"` +} + +func (o ItemAndMetadata) DeepCopy() ItemAndMetadata { + return ItemAndMetadata{ + Md_: (func(x *Metadata) *Metadata { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Md_), + Item_: (func(x *Item) *Item { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Item_), + } +} + +type Reminder struct { + Item_ ItemAndMetadata `codec:"item" json:"item"` + Seqno_ int `codec:"seqno" json:"seqno"` + RemindTime_ Time `codec:"remindTime" json:"remindTime"` +} + +func (o Reminder) DeepCopy() Reminder { + return Reminder{ + Item_: o.Item_.DeepCopy(), + Seqno_: o.Seqno_, + RemindTime_: o.RemindTime_.DeepCopy(), + } +} + +type ReminderID struct { + Uid_ UID `codec:"uid" json:"uid"` + MsgID_ MsgID `codec:"msgID" json:"msgID"` + Seqno_ int `codec:"seqno" json:"seqno"` +} + +func (o ReminderID) DeepCopy() ReminderID { + return ReminderID{ + Uid_: o.Uid_.DeepCopy(), + MsgID_: o.MsgID_.DeepCopy(), + Seqno_: o.Seqno_, + } +} + +type OutOfBandMessage struct { + Uid_ UID `codec:"uid" json:"uid"` + System_ System `codec:"system" json:"system"` + Body_ Body `codec:"body" json:"body"` +} + +func (o OutOfBandMessage) DeepCopy() OutOfBandMessage { + return OutOfBandMessage{ + Uid_: o.Uid_.DeepCopy(), + System_: o.System_.DeepCopy(), + Body_: o.Body_.DeepCopy(), + } +} + +type ReminderSet struct { + Reminders_ []Reminder `codec:"reminders" json:"reminders"` + MoreRemindersReady_ bool `codec:"moreRemindersReady" json:"moreRemindersReady"` +} + +func (o ReminderSet) DeepCopy() ReminderSet { + return ReminderSet{ + Reminders_: (func(x []Reminder) []Reminder { + if x == nil { + return nil + } + ret := make([]Reminder, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Reminders_), + MoreRemindersReady_: o.MoreRemindersReady_, + } +} + +type Message struct { + Oobm_ *OutOfBandMessage `codec:"oobm,omitempty" json:"oobm,omitempty"` + Ibm_ *InBandMessage `codec:"ibm,omitempty" json:"ibm,omitempty"` +} + +func (o Message) DeepCopy() Message { + return Message{ + Oobm_: (func(x *OutOfBandMessage) *OutOfBandMessage { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Oobm_), + Ibm_: (func(x *InBandMessage) *InBandMessage { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Ibm_), + } +} + +type DurationMsec int64 + +func (o DurationMsec) DeepCopy() DurationMsec { + return o +} + +type DurationSec int64 + +func (o DurationSec) DeepCopy() DurationSec { + return o +} + +type Category string + +func (o Category) DeepCopy() Category { + return o +} + +type System string + +func (o System) DeepCopy() System { + return o +} + +type UID []byte + +func (o UID) DeepCopy() UID { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type MsgID []byte + +func (o MsgID) DeepCopy() MsgID { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type DeviceID []byte + +func (o DeviceID) DeepCopy() DeviceID { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type Body []byte + +func (o Body) DeepCopy() Body { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type Time int64 + +func (o Time) DeepCopy() Time { + return o +} + +type SessionID string + +func (o SessionID) DeepCopy() SessionID { + return o +} + +type SessionToken string + +func (o SessionToken) DeepCopy() SessionToken { + return o +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/incoming.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/incoming.go new file mode 100644 index 00000000..153cc160 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/incoming.go @@ -0,0 +1,72 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/gregor1/incoming.avdl + +package gregor1 + +type SyncResult struct { + Msgs []InBandMessage `codec:"msgs" json:"msgs"` + Hash []byte `codec:"hash" json:"hash"` +} + +func (o SyncResult) DeepCopy() SyncResult { + return SyncResult{ + Msgs: (func(x []InBandMessage) []InBandMessage { + if x == nil { + return nil + } + ret := make([]InBandMessage, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Msgs), + Hash: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.Hash), + } +} + +// DescribeConnectedUsers will take a list of users, and return the list of users +// which are connected to any Gregor in the cluster, and what devices (and device type) +// those users are connected with. +type ConnectedDevice struct { + DeviceID DeviceID `codec:"deviceID" json:"deviceID"` + DeviceType string `codec:"deviceType" json:"deviceType"` + DevicePlatform string `codec:"devicePlatform" json:"devicePlatform"` + UserAgent string `codec:"userAgent" json:"userAgent"` +} + +func (o ConnectedDevice) DeepCopy() ConnectedDevice { + return ConnectedDevice{ + DeviceID: o.DeviceID.DeepCopy(), + DeviceType: o.DeviceType, + DevicePlatform: o.DevicePlatform, + UserAgent: o.UserAgent, + } +} + +type ConnectedUser struct { + Uid UID `codec:"uid" json:"uid"` + Devices []ConnectedDevice `codec:"devices" json:"devices"` +} + +func (o ConnectedUser) DeepCopy() ConnectedUser { + return ConnectedUser{ + Uid: o.Uid.DeepCopy(), + Devices: (func(x []ConnectedDevice) []ConnectedDevice { + if x == nil { + return nil + } + ret := make([]ConnectedDevice, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Devices), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/outgoing.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/outgoing.go new file mode 100644 index 00000000..685ece41 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/outgoing.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/gregor1/outgoing.avdl + +package gregor1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/remind.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/remind.go new file mode 100644 index 00000000..b949c545 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1/remind.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/gregor1/remind.avdl + +package gregor1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/account.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/account.go new file mode 100644 index 00000000..f26f967d --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/account.go @@ -0,0 +1,98 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/account.avdl + +package keybase1 + +type HasServerKeysRes struct { + HasServerKeys bool `codec:"hasServerKeys" json:"hasServerKeys"` +} + +func (o HasServerKeysRes) DeepCopy() HasServerKeysRes { + return HasServerKeysRes{ + HasServerKeys: o.HasServerKeys, + } +} + +type LockdownHistory struct { + Status bool `codec:"status" json:"status"` + CreationTime Time `codec:"creationTime" json:"ctime"` + DeviceID DeviceID `codec:"deviceID" json:"device_id"` + DeviceName string `codec:"deviceName" json:"deviceName"` +} + +func (o LockdownHistory) DeepCopy() LockdownHistory { + return LockdownHistory{ + Status: o.Status, + CreationTime: o.CreationTime.DeepCopy(), + DeviceID: o.DeviceID.DeepCopy(), + DeviceName: o.DeviceName, + } +} + +type GetLockdownResponse struct { + History []LockdownHistory `codec:"history" json:"history"` + Status bool `codec:"status" json:"status"` +} + +func (o GetLockdownResponse) DeepCopy() GetLockdownResponse { + return GetLockdownResponse{ + History: (func(x []LockdownHistory) []LockdownHistory { + if x == nil { + return nil + } + ret := make([]LockdownHistory, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.History), + Status: o.Status, + } +} + +type TeamContactSettings struct { + TeamID TeamID `codec:"teamID" json:"team_id"` + Enabled bool `codec:"enabled" json:"enabled"` +} + +func (o TeamContactSettings) DeepCopy() TeamContactSettings { + return TeamContactSettings{ + TeamID: o.TeamID.DeepCopy(), + Enabled: o.Enabled, + } +} + +type ContactSettings struct { + Version *int `codec:"version,omitempty" json:"version,omitempty"` + AllowFolloweeDegrees int `codec:"allowFolloweeDegrees" json:"allow_followee_degrees"` + AllowGoodTeams bool `codec:"allowGoodTeams" json:"allow_good_teams"` + Enabled bool `codec:"enabled" json:"enabled"` + Teams []TeamContactSettings `codec:"teams" json:"teams"` +} + +func (o ContactSettings) DeepCopy() ContactSettings { + return ContactSettings{ + Version: (func(x *int) *int { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Version), + AllowFolloweeDegrees: o.AllowFolloweeDegrees, + AllowGoodTeams: o.AllowGoodTeams, + Enabled: o.Enabled, + Teams: (func(x []TeamContactSettings) []TeamContactSettings { + if x == nil { + return nil + } + ret := make([]TeamContactSettings, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Teams), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/airdrop.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/airdrop.go new file mode 100644 index 00000000..ec00de3a --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/airdrop.go @@ -0,0 +1,22 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/airdrop.avdl + +package keybase1 + +type AirdropDetails struct { + Uid UID `codec:"uid" json:"uid"` + Kid BinaryKID `codec:"kid" json:"kid"` + Vid VID `codec:"vid" json:"vid"` + Vers string `codec:"vers" json:"vers"` + Time Time `codec:"time" json:"time"` +} + +func (o AirdropDetails) DeepCopy() AirdropDetails { + return AirdropDetails{ + Uid: o.Uid.DeepCopy(), + Kid: o.Kid.DeepCopy(), + Vid: o.Vid.DeepCopy(), + Vers: o.Vers, + Time: o.Time.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/apiserver.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/apiserver.go new file mode 100644 index 00000000..8e773533 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/apiserver.go @@ -0,0 +1,20 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/apiserver.avdl + +package keybase1 + +type APIRes struct { + Status string `codec:"status" json:"status"` + Body string `codec:"body" json:"body"` + HttpStatus int `codec:"httpStatus" json:"httpStatus"` + AppStatus string `codec:"appStatus" json:"appStatus"` +} + +func (o APIRes) DeepCopy() APIRes { + return APIRes{ + Status: o.Status, + Body: o.Body, + HttpStatus: o.HttpStatus, + AppStatus: o.AppStatus, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/appstate.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/appstate.go new file mode 100644 index 00000000..52478e31 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/appstate.go @@ -0,0 +1,75 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/appstate.avdl + +package keybase1 + +import ( + "fmt" +) + +type MobileAppState int + +const ( + MobileAppState_FOREGROUND MobileAppState = 0 + MobileAppState_BACKGROUND MobileAppState = 1 + MobileAppState_INACTIVE MobileAppState = 2 + MobileAppState_BACKGROUNDACTIVE MobileAppState = 3 +) + +func (o MobileAppState) DeepCopy() MobileAppState { return o } + +var MobileAppStateMap = map[string]MobileAppState{ + "FOREGROUND": 0, + "BACKGROUND": 1, + "INACTIVE": 2, + "BACKGROUNDACTIVE": 3, +} + +var MobileAppStateRevMap = map[MobileAppState]string{ + 0: "FOREGROUND", + 1: "BACKGROUND", + 2: "INACTIVE", + 3: "BACKGROUNDACTIVE", +} + +func (e MobileAppState) String() string { + if v, ok := MobileAppStateRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type MobileNetworkState int + +const ( + MobileNetworkState_NONE MobileNetworkState = 0 + MobileNetworkState_WIFI MobileNetworkState = 1 + MobileNetworkState_CELLULAR MobileNetworkState = 2 + MobileNetworkState_UNKNOWN MobileNetworkState = 3 + MobileNetworkState_NOTAVAILABLE MobileNetworkState = 4 +) + +func (o MobileNetworkState) DeepCopy() MobileNetworkState { return o } + +var MobileNetworkStateMap = map[string]MobileNetworkState{ + "NONE": 0, + "WIFI": 1, + "CELLULAR": 2, + "UNKNOWN": 3, + "NOTAVAILABLE": 4, +} + +var MobileNetworkStateRevMap = map[MobileNetworkState]string{ + 0: "NONE", + 1: "WIFI", + 2: "CELLULAR", + 3: "UNKNOWN", + 4: "NOTAVAILABLE", +} + +func (e MobileNetworkState) String() string { + if v, ok := MobileNetworkStateRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/audit.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/audit.go new file mode 100644 index 00000000..1a4c7223 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/audit.go @@ -0,0 +1,76 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/audit.avdl + +package keybase1 + +import ( + "fmt" +) + +type BoxAuditAttemptResult int + +const ( + BoxAuditAttemptResult_FAILURE_RETRYABLE BoxAuditAttemptResult = 0 + BoxAuditAttemptResult_FAILURE_MALICIOUS_SERVER BoxAuditAttemptResult = 1 + BoxAuditAttemptResult_OK_VERIFIED BoxAuditAttemptResult = 2 + BoxAuditAttemptResult_OK_NOT_ATTEMPTED_ROLE BoxAuditAttemptResult = 3 + BoxAuditAttemptResult_OK_NOT_ATTEMPTED_OPENTEAM BoxAuditAttemptResult = 4 + BoxAuditAttemptResult_OK_NOT_ATTEMPTED_SUBTEAM BoxAuditAttemptResult = 5 +) + +func (o BoxAuditAttemptResult) DeepCopy() BoxAuditAttemptResult { return o } + +var BoxAuditAttemptResultMap = map[string]BoxAuditAttemptResult{ + "FAILURE_RETRYABLE": 0, + "FAILURE_MALICIOUS_SERVER": 1, + "OK_VERIFIED": 2, + "OK_NOT_ATTEMPTED_ROLE": 3, + "OK_NOT_ATTEMPTED_OPENTEAM": 4, + "OK_NOT_ATTEMPTED_SUBTEAM": 5, +} + +var BoxAuditAttemptResultRevMap = map[BoxAuditAttemptResult]string{ + 0: "FAILURE_RETRYABLE", + 1: "FAILURE_MALICIOUS_SERVER", + 2: "OK_VERIFIED", + 3: "OK_NOT_ATTEMPTED_ROLE", + 4: "OK_NOT_ATTEMPTED_OPENTEAM", + 5: "OK_NOT_ATTEMPTED_SUBTEAM", +} + +func (e BoxAuditAttemptResult) String() string { + if v, ok := BoxAuditAttemptResultRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type BoxAuditAttempt struct { + Ctime UnixTime `codec:"ctime" json:"ctime"` + Error *string `codec:"error,omitempty" json:"error,omitempty"` + Result BoxAuditAttemptResult `codec:"result" json:"result"` + Generation *PerTeamKeyGeneration `codec:"generation,omitempty" json:"generation,omitempty"` + Rotated bool `codec:"rotated" json:"rotated"` +} + +func (o BoxAuditAttempt) DeepCopy() BoxAuditAttempt { + return BoxAuditAttempt{ + Ctime: o.Ctime.DeepCopy(), + Error: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Error), + Result: o.Result.DeepCopy(), + Generation: (func(x *PerTeamKeyGeneration) *PerTeamKeyGeneration { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Generation), + Rotated: o.Rotated, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/avatars.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/avatars.go new file mode 100644 index 00000000..9e78e2f8 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/avatars.go @@ -0,0 +1,72 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/avatars.avdl + +package keybase1 + +type AvatarUrl string + +func (o AvatarUrl) DeepCopy() AvatarUrl { + return o +} + +type AvatarFormat string + +func (o AvatarFormat) DeepCopy() AvatarFormat { + return o +} + +type LoadAvatarsRes struct { + Picmap map[string]map[AvatarFormat]AvatarUrl `codec:"picmap" json:"picmap"` +} + +func (o LoadAvatarsRes) DeepCopy() LoadAvatarsRes { + return LoadAvatarsRes{ + Picmap: (func(x map[string]map[AvatarFormat]AvatarUrl) map[string]map[AvatarFormat]AvatarUrl { + if x == nil { + return nil + } + ret := make(map[string]map[AvatarFormat]AvatarUrl, len(x)) + for k, v := range x { + kCopy := k + vCopy := (func(x map[AvatarFormat]AvatarUrl) map[AvatarFormat]AvatarUrl { + if x == nil { + return nil + } + ret := make(map[AvatarFormat]AvatarUrl, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(v) + ret[kCopy] = vCopy + } + return ret + })(o.Picmap), + } +} + +type AvatarClearCacheMsg struct { + Name string `codec:"name" json:"name"` + Formats []AvatarFormat `codec:"formats" json:"formats"` + Typ AvatarUpdateType `codec:"typ" json:"typ"` +} + +func (o AvatarClearCacheMsg) DeepCopy() AvatarClearCacheMsg { + return AvatarClearCacheMsg{ + Name: o.Name, + Formats: (func(x []AvatarFormat) []AvatarFormat { + if x == nil { + return nil + } + ret := make([]AvatarFormat, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Formats), + Typ: o.Typ.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/backend_common.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/backend_common.go new file mode 100644 index 00000000..ed83acf3 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/backend_common.go @@ -0,0 +1,63 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/backend_common.avdl + +package keybase1 + +import ( + "fmt" +) + +type BlockType int + +const ( + BlockType_DATA BlockType = 0 + BlockType_MD BlockType = 1 + BlockType_GIT BlockType = 2 +) + +func (o BlockType) DeepCopy() BlockType { return o } + +var BlockTypeMap = map[string]BlockType{ + "DATA": 0, + "MD": 1, + "GIT": 2, +} + +var BlockTypeRevMap = map[BlockType]string{ + 0: "DATA", + 1: "MD", + 2: "GIT", +} + +func (e BlockType) String() string { + if v, ok := BlockTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type BlockIdCombo struct { + BlockHash string `codec:"blockHash" json:"blockHash"` + ChargedTo UserOrTeamID `codec:"chargedTo" json:"chargedTo"` + BlockType BlockType `codec:"blockType" json:"blockType"` +} + +func (o BlockIdCombo) DeepCopy() BlockIdCombo { + return BlockIdCombo{ + BlockHash: o.BlockHash, + ChargedTo: o.ChargedTo.DeepCopy(), + BlockType: o.BlockType.DeepCopy(), + } +} + +type ChallengeInfo struct { + Now int64 `codec:"now" json:"now"` + Challenge string `codec:"challenge" json:"challenge"` +} + +func (o ChallengeInfo) DeepCopy() ChallengeInfo { + return ChallengeInfo{ + Now: o.Now, + Challenge: o.Challenge, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/badger.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/badger.go new file mode 100644 index 00000000..b2604354 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/badger.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/badger.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/block.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/block.go new file mode 100644 index 00000000..cb1b2c37 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/block.go @@ -0,0 +1,153 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/block.avdl + +package keybase1 + +import ( + "fmt" +) + +type BlockStatus int + +const ( + BlockStatus_UNKNOWN BlockStatus = 0 + BlockStatus_LIVE BlockStatus = 1 + BlockStatus_ARCHIVED BlockStatus = 2 +) + +func (o BlockStatus) DeepCopy() BlockStatus { return o } + +var BlockStatusMap = map[string]BlockStatus{ + "UNKNOWN": 0, + "LIVE": 1, + "ARCHIVED": 2, +} + +var BlockStatusRevMap = map[BlockStatus]string{ + 0: "UNKNOWN", + 1: "LIVE", + 2: "ARCHIVED", +} + +func (e BlockStatus) String() string { + if v, ok := BlockStatusRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type GetBlockRes struct { + BlockKey string `codec:"blockKey" json:"blockKey"` + Buf []byte `codec:"buf" json:"buf"` + Size int `codec:"size" json:"size"` + Status BlockStatus `codec:"status" json:"status"` +} + +func (o GetBlockRes) DeepCopy() GetBlockRes { + return GetBlockRes{ + BlockKey: o.BlockKey, + Buf: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.Buf), + Size: o.Size, + Status: o.Status.DeepCopy(), + } +} + +type BlockRefNonce [8]byte + +func (o BlockRefNonce) DeepCopy() BlockRefNonce { + var ret BlockRefNonce + copy(ret[:], o[:]) + return ret +} + +type BlockReference struct { + Bid BlockIdCombo `codec:"bid" json:"bid"` + Nonce BlockRefNonce `codec:"nonce" json:"nonce"` + ChargedTo UserOrTeamID `codec:"chargedTo" json:"chargedTo"` +} + +func (o BlockReference) DeepCopy() BlockReference { + return BlockReference{ + Bid: o.Bid.DeepCopy(), + Nonce: o.Nonce.DeepCopy(), + ChargedTo: o.ChargedTo.DeepCopy(), + } +} + +type BlockReferenceCount struct { + Ref BlockReference `codec:"ref" json:"ref"` + LiveCount int `codec:"liveCount" json:"liveCount"` +} + +func (o BlockReferenceCount) DeepCopy() BlockReferenceCount { + return BlockReferenceCount{ + Ref: o.Ref.DeepCopy(), + LiveCount: o.LiveCount, + } +} + +type DowngradeReferenceRes struct { + Completed []BlockReferenceCount `codec:"completed" json:"completed"` + Failed BlockReference `codec:"failed" json:"failed"` +} + +func (o DowngradeReferenceRes) DeepCopy() DowngradeReferenceRes { + return DowngradeReferenceRes{ + Completed: (func(x []BlockReferenceCount) []BlockReferenceCount { + if x == nil { + return nil + } + ret := make([]BlockReferenceCount, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Completed), + Failed: o.Failed.DeepCopy(), + } +} + +type BlockIdCount struct { + Id BlockIdCombo `codec:"id" json:"id"` + LiveCount int `codec:"liveCount" json:"liveCount"` +} + +func (o BlockIdCount) DeepCopy() BlockIdCount { + return BlockIdCount{ + Id: o.Id.DeepCopy(), + LiveCount: o.LiveCount, + } +} + +type ReferenceCountRes struct { + Counts []BlockIdCount `codec:"counts" json:"counts"` +} + +func (o ReferenceCountRes) DeepCopy() ReferenceCountRes { + return ReferenceCountRes{ + Counts: (func(x []BlockIdCount) []BlockIdCount { + if x == nil { + return nil + } + ret := make([]BlockIdCount, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Counts), + } +} + +type BlockPingResponse struct { +} + +func (o BlockPingResponse) DeepCopy() BlockPingResponse { + return BlockPingResponse{} +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/bot.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/bot.go new file mode 100644 index 00000000..8b9306f4 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/bot.go @@ -0,0 +1,22 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/bot.avdl + +package keybase1 + +type BotToken string + +func (o BotToken) DeepCopy() BotToken { + return o +} + +type BotTokenInfo struct { + Token BotToken `codec:"token" json:"bot_token"` + Ctime Time `codec:"ctime" json:"ctime"` +} + +func (o BotTokenInfo) DeepCopy() BotTokenInfo { + return BotTokenInfo{ + Token: o.Token.DeepCopy(), + Ctime: o.Ctime.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/btc.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/btc.go new file mode 100644 index 00000000..f54533b8 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/btc.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/btc.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/common.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/common.go new file mode 100644 index 00000000..128329f7 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/common.go @@ -0,0 +1,1090 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/common.avdl + +package keybase1 + +import ( + "errors" + "fmt" +) + +type Time int64 + +func (o Time) DeepCopy() Time { + return o +} + +type UnixTime int64 + +func (o UnixTime) DeepCopy() UnixTime { + return o +} + +type DurationSec float64 + +func (o DurationSec) DeepCopy() DurationSec { + return o +} + +type StringKVPair struct { + Key string `codec:"key" json:"key"` + Value string `codec:"value" json:"value"` +} + +func (o StringKVPair) DeepCopy() StringKVPair { + return StringKVPair{ + Key: o.Key, + Value: o.Value, + } +} + +type Status struct { + Code int `codec:"code" json:"code"` + Name string `codec:"name" json:"name"` + Desc string `codec:"desc" json:"desc"` + Fields []StringKVPair `codec:"fields" json:"fields"` +} + +func (o Status) DeepCopy() Status { + return Status{ + Code: o.Code, + Name: o.Name, + Desc: o.Desc, + Fields: (func(x []StringKVPair) []StringKVPair { + if x == nil { + return nil + } + ret := make([]StringKVPair, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Fields), + } +} + +type UID string + +func (o UID) DeepCopy() UID { + return o +} + +type VID string + +func (o VID) DeepCopy() VID { + return o +} + +type DeviceID string + +func (o DeviceID) DeepCopy() DeviceID { + return o +} + +type SigID string + +func (o SigID) DeepCopy() SigID { + return o +} + +type LeaseID string + +func (o LeaseID) DeepCopy() LeaseID { + return o +} + +type KID string + +func (o KID) DeepCopy() KID { + return o +} + +type PhoneNumber string + +func (o PhoneNumber) DeepCopy() PhoneNumber { + return o +} + +type RawPhoneNumber string + +func (o RawPhoneNumber) DeepCopy() RawPhoneNumber { + return o +} + +type LinkID string + +func (o LinkID) DeepCopy() LinkID { + return o +} + +type BinaryLinkID []byte + +func (o BinaryLinkID) DeepCopy() BinaryLinkID { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type BinaryKID []byte + +func (o BinaryKID) DeepCopy() BinaryKID { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type TLFID string + +func (o TLFID) DeepCopy() TLFID { + return o +} + +type TeamID string + +func (o TeamID) DeepCopy() TeamID { + return o +} + +type UserOrTeamID string + +func (o UserOrTeamID) DeepCopy() UserOrTeamID { + return o +} + +type GitRepoName string + +func (o GitRepoName) DeepCopy() GitRepoName { + return o +} + +type HashMeta []byte + +func (o HashMeta) DeepCopy() HashMeta { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type UserVersion struct { + Uid UID `codec:"uid" json:"uid"` + EldestSeqno Seqno `codec:"eldestSeqno" json:"eldestSeqno"` +} + +func (o UserVersion) DeepCopy() UserVersion { + return UserVersion{ + Uid: o.Uid.DeepCopy(), + EldestSeqno: o.EldestSeqno.DeepCopy(), + } +} + +type TeamType int + +const ( + TeamType_NONE TeamType = 0 + TeamType_LEGACY TeamType = 1 + TeamType_MODERN TeamType = 2 +) + +func (o TeamType) DeepCopy() TeamType { return o } + +var TeamTypeMap = map[string]TeamType{ + "NONE": 0, + "LEGACY": 1, + "MODERN": 2, +} + +var TeamTypeRevMap = map[TeamType]string{ + 0: "NONE", + 1: "LEGACY", + 2: "MODERN", +} + +func (e TeamType) String() string { + if v, ok := TeamTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type CompatibilityTeamID struct { + Typ__ TeamType `codec:"typ" json:"typ"` + Legacy__ *TLFID `codec:"legacy,omitempty" json:"legacy,omitempty"` + Modern__ *TeamID `codec:"modern,omitempty" json:"modern,omitempty"` +} + +func (o *CompatibilityTeamID) Typ() (ret TeamType, err error) { + switch o.Typ__ { + case TeamType_LEGACY: + if o.Legacy__ == nil { + err = errors.New("unexpected nil value for Legacy__") + return ret, err + } + case TeamType_MODERN: + if o.Modern__ == nil { + err = errors.New("unexpected nil value for Modern__") + return ret, err + } + } + return o.Typ__, nil +} + +func (o CompatibilityTeamID) Legacy() (res TLFID) { + if o.Typ__ != TeamType_LEGACY { + panic("wrong case accessed") + } + if o.Legacy__ == nil { + return + } + return *o.Legacy__ +} + +func (o CompatibilityTeamID) Modern() (res TeamID) { + if o.Typ__ != TeamType_MODERN { + panic("wrong case accessed") + } + if o.Modern__ == nil { + return + } + return *o.Modern__ +} + +func NewCompatibilityTeamIDWithLegacy(v TLFID) CompatibilityTeamID { + return CompatibilityTeamID{ + Typ__: TeamType_LEGACY, + Legacy__: &v, + } +} + +func NewCompatibilityTeamIDWithModern(v TeamID) CompatibilityTeamID { + return CompatibilityTeamID{ + Typ__: TeamType_MODERN, + Modern__: &v, + } +} + +func (o CompatibilityTeamID) DeepCopy() CompatibilityTeamID { + return CompatibilityTeamID{ + Typ__: o.Typ__.DeepCopy(), + Legacy__: (func(x *TLFID) *TLFID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Legacy__), + Modern__: (func(x *TeamID) *TeamID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Modern__), + } +} + +type TLFVisibility int + +const ( + TLFVisibility_ANY TLFVisibility = 0 + TLFVisibility_PUBLIC TLFVisibility = 1 + TLFVisibility_PRIVATE TLFVisibility = 2 +) + +func (o TLFVisibility) DeepCopy() TLFVisibility { return o } + +var TLFVisibilityMap = map[string]TLFVisibility{ + "ANY": 0, + "PUBLIC": 1, + "PRIVATE": 2, +} + +var TLFVisibilityRevMap = map[TLFVisibility]string{ + 0: "ANY", + 1: "PUBLIC", + 2: "PRIVATE", +} + +func (e TLFVisibility) String() string { + if v, ok := TLFVisibilityRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type TeamIDWithVisibility struct { + TeamID TeamID `codec:"teamID" json:"teamID"` + Visibility TLFVisibility `codec:"visibility" json:"visibility"` +} + +func (o TeamIDWithVisibility) DeepCopy() TeamIDWithVisibility { + return TeamIDWithVisibility{ + TeamID: o.TeamID.DeepCopy(), + Visibility: o.Visibility.DeepCopy(), + } +} + +type TeamIDAndName struct { + Id TeamID `codec:"id" json:"id"` + Name TeamName `codec:"name" json:"name"` +} + +func (o TeamIDAndName) DeepCopy() TeamIDAndName { + return TeamIDAndName{ + Id: o.Id.DeepCopy(), + Name: o.Name.DeepCopy(), + } +} + +type Seqno int64 + +func (o Seqno) DeepCopy() Seqno { + return o +} + +type SeqType int + +const ( + SeqType_NONE SeqType = 0 + SeqType_PUBLIC SeqType = 1 + SeqType_PRIVATE SeqType = 2 + SeqType_SEMIPRIVATE SeqType = 3 + SeqType_USER_PRIVATE_HIDDEN SeqType = 16 + SeqType_TEAM_PRIVATE_HIDDEN SeqType = 17 +) + +func (o SeqType) DeepCopy() SeqType { return o } + +var SeqTypeMap = map[string]SeqType{ + "NONE": 0, + "PUBLIC": 1, + "PRIVATE": 2, + "SEMIPRIVATE": 3, + "USER_PRIVATE_HIDDEN": 16, + "TEAM_PRIVATE_HIDDEN": 17, +} + +var SeqTypeRevMap = map[SeqType]string{ + 0: "NONE", + 1: "PUBLIC", + 2: "PRIVATE", + 3: "SEMIPRIVATE", + 16: "USER_PRIVATE_HIDDEN", + 17: "TEAM_PRIVATE_HIDDEN", +} + +func (e SeqType) String() string { + if v, ok := SeqTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type Bytes32 [32]byte + +func (o Bytes32) DeepCopy() Bytes32 { + var ret Bytes32 + copy(ret[:], o[:]) + return ret +} + +type Text struct { + Data string `codec:"data" json:"data"` + Markup bool `codec:"markup" json:"markup"` +} + +func (o Text) DeepCopy() Text { + return Text{ + Data: o.Data, + Markup: o.Markup, + } +} + +type PGPIdentity struct { + Username string `codec:"username" json:"username"` + Comment string `codec:"comment" json:"comment"` + Email string `codec:"email" json:"email"` +} + +func (o PGPIdentity) DeepCopy() PGPIdentity { + return PGPIdentity{ + Username: o.Username, + Comment: o.Comment, + Email: o.Email, + } +} + +type PublicKey struct { + KID KID `codec:"KID" json:"KID"` + PGPFingerprint string `codec:"PGPFingerprint" json:"PGPFingerprint"` + PGPIdentities []PGPIdentity `codec:"PGPIdentities" json:"PGPIdentities"` + IsSibkey bool `codec:"isSibkey" json:"isSibkey"` + IsEldest bool `codec:"isEldest" json:"isEldest"` + ParentID string `codec:"parentID" json:"parentID"` + DeviceID DeviceID `codec:"deviceID" json:"deviceID"` + DeviceDescription string `codec:"deviceDescription" json:"deviceDescription"` + DeviceType string `codec:"deviceType" json:"deviceType"` + CTime Time `codec:"cTime" json:"cTime"` + ETime Time `codec:"eTime" json:"eTime"` + IsRevoked bool `codec:"isRevoked" json:"isRevoked"` +} + +func (o PublicKey) DeepCopy() PublicKey { + return PublicKey{ + KID: o.KID.DeepCopy(), + PGPFingerprint: o.PGPFingerprint, + PGPIdentities: (func(x []PGPIdentity) []PGPIdentity { + if x == nil { + return nil + } + ret := make([]PGPIdentity, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.PGPIdentities), + IsSibkey: o.IsSibkey, + IsEldest: o.IsEldest, + ParentID: o.ParentID, + DeviceID: o.DeviceID.DeepCopy(), + DeviceDescription: o.DeviceDescription, + DeviceType: o.DeviceType, + CTime: o.CTime.DeepCopy(), + ETime: o.ETime.DeepCopy(), + IsRevoked: o.IsRevoked, + } +} + +type KeybaseTime struct { + Unix Time `codec:"unix" json:"unix"` + Chain Seqno `codec:"chain" json:"chain"` +} + +func (o KeybaseTime) DeepCopy() KeybaseTime { + return KeybaseTime{ + Unix: o.Unix.DeepCopy(), + Chain: o.Chain.DeepCopy(), + } +} + +type RevokedKey struct { + Key PublicKey `codec:"key" json:"key"` + Time KeybaseTime `codec:"time" json:"time"` + By KID `codec:"by" json:"by"` +} + +func (o RevokedKey) DeepCopy() RevokedKey { + return RevokedKey{ + Key: o.Key.DeepCopy(), + Time: o.Time.DeepCopy(), + By: o.By.DeepCopy(), + } +} + +type User struct { + Uid UID `codec:"uid" json:"uid"` + Username string `codec:"username" json:"username"` +} + +func (o User) DeepCopy() User { + return User{ + Uid: o.Uid.DeepCopy(), + Username: o.Username, + } +} + +type Device struct { + Type string `codec:"type" json:"type"` + Name string `codec:"name" json:"name"` + DeviceID DeviceID `codec:"deviceID" json:"deviceID"` + DeviceNumberOfType int `codec:"deviceNumberOfType" json:"deviceNumberOfType"` + CTime Time `codec:"cTime" json:"cTime"` + MTime Time `codec:"mTime" json:"mTime"` + LastUsedTime Time `codec:"lastUsedTime" json:"lastUsedTime"` + EncryptKey KID `codec:"encryptKey" json:"encryptKey"` + VerifyKey KID `codec:"verifyKey" json:"verifyKey"` + Status int `codec:"status" json:"status"` +} + +func (o Device) DeepCopy() Device { + return Device{ + Type: o.Type, + Name: o.Name, + DeviceID: o.DeviceID.DeepCopy(), + DeviceNumberOfType: o.DeviceNumberOfType, + CTime: o.CTime.DeepCopy(), + MTime: o.MTime.DeepCopy(), + LastUsedTime: o.LastUsedTime.DeepCopy(), + EncryptKey: o.EncryptKey.DeepCopy(), + VerifyKey: o.VerifyKey.DeepCopy(), + Status: o.Status, + } +} + +type DeviceType int + +const ( + DeviceType_DESKTOP DeviceType = 0 + DeviceType_MOBILE DeviceType = 1 +) + +func (o DeviceType) DeepCopy() DeviceType { return o } + +var DeviceTypeMap = map[string]DeviceType{ + "DESKTOP": 0, + "MOBILE": 1, +} + +var DeviceTypeRevMap = map[DeviceType]string{ + 0: "DESKTOP", + 1: "MOBILE", +} + +func (e DeviceType) String() string { + if v, ok := DeviceTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type Stream struct { + Fd int `codec:"fd" json:"fd"` +} + +func (o Stream) DeepCopy() Stream { + return Stream{ + Fd: o.Fd, + } +} + +type LogLevel int + +const ( + LogLevel_NONE LogLevel = 0 + LogLevel_DEBUG LogLevel = 1 + LogLevel_INFO LogLevel = 2 + LogLevel_NOTICE LogLevel = 3 + LogLevel_WARN LogLevel = 4 + LogLevel_ERROR LogLevel = 5 + LogLevel_CRITICAL LogLevel = 6 + LogLevel_FATAL LogLevel = 7 +) + +func (o LogLevel) DeepCopy() LogLevel { return o } + +var LogLevelMap = map[string]LogLevel{ + "NONE": 0, + "DEBUG": 1, + "INFO": 2, + "NOTICE": 3, + "WARN": 4, + "ERROR": 5, + "CRITICAL": 6, + "FATAL": 7, +} + +var LogLevelRevMap = map[LogLevel]string{ + 0: "NONE", + 1: "DEBUG", + 2: "INFO", + 3: "NOTICE", + 4: "WARN", + 5: "ERROR", + 6: "CRITICAL", + 7: "FATAL", +} + +func (e LogLevel) String() string { + if v, ok := LogLevelRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ClientType int + +const ( + ClientType_NONE ClientType = 0 + ClientType_CLI ClientType = 1 + ClientType_GUI_MAIN ClientType = 2 + ClientType_KBFS ClientType = 3 + ClientType_GUI_HELPER ClientType = 4 +) + +func (o ClientType) DeepCopy() ClientType { return o } + +var ClientTypeMap = map[string]ClientType{ + "NONE": 0, + "CLI": 1, + "GUI_MAIN": 2, + "KBFS": 3, + "GUI_HELPER": 4, +} + +var ClientTypeRevMap = map[ClientType]string{ + 0: "NONE", + 1: "CLI", + 2: "GUI_MAIN", + 3: "KBFS", + 4: "GUI_HELPER", +} + +type KBFSPathInfo struct { + StandardPath string `codec:"standardPath" json:"standardPath"` + DeeplinkPath string `codec:"deeplinkPath" json:"deeplinkPath"` + PlatformAfterMountPath string `codec:"platformAfterMountPath" json:"platformAfterMountPath"` +} + +func (o KBFSPathInfo) DeepCopy() KBFSPathInfo { + return KBFSPathInfo{ + StandardPath: o.StandardPath, + DeeplinkPath: o.DeeplinkPath, + PlatformAfterMountPath: o.PlatformAfterMountPath, + } +} + +type UserVersionVector struct { + Id int64 `codec:"id" json:"id"` + SigHints int `codec:"sigHints" json:"sigHints"` + SigChain int64 `codec:"sigChain" json:"sigChain"` + CachedAt Time `codec:"cachedAt" json:"cachedAt"` +} + +func (o UserVersionVector) DeepCopy() UserVersionVector { + return UserVersionVector{ + Id: o.Id, + SigHints: o.SigHints, + SigChain: o.SigChain, + CachedAt: o.CachedAt.DeepCopy(), + } +} + +type PerUserKeyGeneration int + +func (o PerUserKeyGeneration) DeepCopy() PerUserKeyGeneration { + return o +} + +type PerUserKey struct { + Gen int `codec:"gen" json:"gen"` + Seqno Seqno `codec:"seqno" json:"seqno"` + SigKID KID `codec:"sigKID" json:"sigKID"` + EncKID KID `codec:"encKID" json:"encKID"` + SignedByKID KID `codec:"signedByKID" json:"signedByKID"` +} + +func (o PerUserKey) DeepCopy() PerUserKey { + return PerUserKey{ + Gen: o.Gen, + Seqno: o.Seqno.DeepCopy(), + SigKID: o.SigKID.DeepCopy(), + EncKID: o.EncKID.DeepCopy(), + SignedByKID: o.SignedByKID.DeepCopy(), + } +} + +type UserPlusKeys struct { + Uid UID `codec:"uid" json:"uid"` + Username string `codec:"username" json:"username"` + EldestSeqno Seqno `codec:"eldestSeqno" json:"eldestSeqno"` + Status StatusCode `codec:"status" json:"status"` + DeviceKeys []PublicKey `codec:"deviceKeys" json:"deviceKeys"` + RevokedDeviceKeys []RevokedKey `codec:"revokedDeviceKeys" json:"revokedDeviceKeys"` + PGPKeyCount int `codec:"pgpKeyCount" json:"pgpKeyCount"` + Uvv UserVersionVector `codec:"uvv" json:"uvv"` + DeletedDeviceKeys []PublicKey `codec:"deletedDeviceKeys" json:"deletedDeviceKeys"` + PerUserKeys []PerUserKey `codec:"perUserKeys" json:"perUserKeys"` + Resets []ResetSummary `codec:"resets" json:"resets"` +} + +func (o UserPlusKeys) DeepCopy() UserPlusKeys { + return UserPlusKeys{ + Uid: o.Uid.DeepCopy(), + Username: o.Username, + EldestSeqno: o.EldestSeqno.DeepCopy(), + Status: o.Status.DeepCopy(), + DeviceKeys: (func(x []PublicKey) []PublicKey { + if x == nil { + return nil + } + ret := make([]PublicKey, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.DeviceKeys), + RevokedDeviceKeys: (func(x []RevokedKey) []RevokedKey { + if x == nil { + return nil + } + ret := make([]RevokedKey, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RevokedDeviceKeys), + PGPKeyCount: o.PGPKeyCount, + Uvv: o.Uvv.DeepCopy(), + DeletedDeviceKeys: (func(x []PublicKey) []PublicKey { + if x == nil { + return nil + } + ret := make([]PublicKey, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.DeletedDeviceKeys), + PerUserKeys: (func(x []PerUserKey) []PerUserKey { + if x == nil { + return nil + } + ret := make([]PerUserKey, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.PerUserKeys), + Resets: (func(x []ResetSummary) []ResetSummary { + if x == nil { + return nil + } + ret := make([]ResetSummary, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Resets), + } +} + +type UserOrTeamLite struct { + Id UserOrTeamID `codec:"id" json:"id"` + Name string `codec:"name" json:"name"` +} + +func (o UserOrTeamLite) DeepCopy() UserOrTeamLite { + return UserOrTeamLite{ + Id: o.Id.DeepCopy(), + Name: o.Name, + } +} + +type UserOrTeamResult int + +const ( + UserOrTeamResult_USER UserOrTeamResult = 1 + UserOrTeamResult_TEAM UserOrTeamResult = 2 +) + +func (o UserOrTeamResult) DeepCopy() UserOrTeamResult { return o } + +var UserOrTeamResultMap = map[string]UserOrTeamResult{ + "USER": 1, + "TEAM": 2, +} + +var UserOrTeamResultRevMap = map[UserOrTeamResult]string{ + 1: "USER", + 2: "TEAM", +} + +func (e UserOrTeamResult) String() string { + if v, ok := UserOrTeamResultRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type RemoteTrack struct { + Username string `codec:"username" json:"username"` + Uid UID `codec:"uid" json:"uid"` + LinkID LinkID `codec:"linkID" json:"linkID"` +} + +func (o RemoteTrack) DeepCopy() RemoteTrack { + return RemoteTrack{ + Username: o.Username, + Uid: o.Uid.DeepCopy(), + LinkID: o.LinkID.DeepCopy(), + } +} + +type UserPlusAllKeys struct { + Base UserPlusKeys `codec:"base" json:"base"` + PGPKeys []PublicKey `codec:"pgpKeys" json:"pgpKeys"` + RemoteTracks []RemoteTrack `codec:"remoteTracks" json:"remoteTracks"` +} + +func (o UserPlusAllKeys) DeepCopy() UserPlusAllKeys { + return UserPlusAllKeys{ + Base: o.Base.DeepCopy(), + PGPKeys: (func(x []PublicKey) []PublicKey { + if x == nil { + return nil + } + ret := make([]PublicKey, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.PGPKeys), + RemoteTracks: (func(x []RemoteTrack) []RemoteTrack { + if x == nil { + return nil + } + ret := make([]RemoteTrack, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RemoteTracks), + } +} + +type MerkleTreeID int + +const ( + MerkleTreeID_MASTER MerkleTreeID = 0 + MerkleTreeID_KBFS_PUBLIC MerkleTreeID = 1 + MerkleTreeID_KBFS_PRIVATE MerkleTreeID = 2 + MerkleTreeID_KBFS_PRIVATETEAM MerkleTreeID = 3 +) + +func (o MerkleTreeID) DeepCopy() MerkleTreeID { return o } + +var MerkleTreeIDMap = map[string]MerkleTreeID{ + "MASTER": 0, + "KBFS_PUBLIC": 1, + "KBFS_PRIVATE": 2, + "KBFS_PRIVATETEAM": 3, +} + +var MerkleTreeIDRevMap = map[MerkleTreeID]string{ + 0: "MASTER", + 1: "KBFS_PUBLIC", + 2: "KBFS_PRIVATE", + 3: "KBFS_PRIVATETEAM", +} + +// SocialAssertionService is a service that can be used to assert proofs for a +// user. +type SocialAssertionService string + +func (o SocialAssertionService) DeepCopy() SocialAssertionService { + return o +} + +// SocialAssertion contains a service and username for that service, that +// together form an assertion about a user. It can either be a social +// assertion (like "facebook" or "twitter") or a server trust assertion (like +// "phone" or "email"). +// +// If the assertion is for social network, resolving an assertion requires +// that the user posts a Keybase proof on the asserted service as the asserted +// user. +// +// For server trust assertion, we have to trust the server. +type SocialAssertion struct { + User string `codec:"user" json:"user"` + Service SocialAssertionService `codec:"service" json:"service"` +} + +func (o SocialAssertion) DeepCopy() SocialAssertion { + return SocialAssertion{ + User: o.User, + Service: o.Service.DeepCopy(), + } +} + +type FullName string + +func (o FullName) DeepCopy() FullName { + return o +} + +type FullNamePackageVersion int + +const ( + FullNamePackageVersion_V0 FullNamePackageVersion = 0 + FullNamePackageVersion_V1 FullNamePackageVersion = 1 + FullNamePackageVersion_V2 FullNamePackageVersion = 2 +) + +func (o FullNamePackageVersion) DeepCopy() FullNamePackageVersion { return o } + +var FullNamePackageVersionMap = map[string]FullNamePackageVersion{ + "V0": 0, + "V1": 1, + "V2": 2, +} + +var FullNamePackageVersionRevMap = map[FullNamePackageVersion]string{ + 0: "V0", + 1: "V1", + 2: "V2", +} + +func (e FullNamePackageVersion) String() string { + if v, ok := FullNamePackageVersionRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type FullNamePackage struct { + Version FullNamePackageVersion `codec:"version" json:"version"` + FullName FullName `codec:"fullName" json:"fullName"` + EldestSeqno Seqno `codec:"eldestSeqno" json:"eldestSeqno"` + Status StatusCode `codec:"status" json:"status"` + CachedAt Time `codec:"cachedAt" json:"cachedAt"` +} + +func (o FullNamePackage) DeepCopy() FullNamePackage { + return FullNamePackage{ + Version: o.Version.DeepCopy(), + FullName: o.FullName.DeepCopy(), + EldestSeqno: o.EldestSeqno.DeepCopy(), + Status: o.Status.DeepCopy(), + CachedAt: o.CachedAt.DeepCopy(), + } +} + +type ImageCropRect struct { + X0 int `codec:"x0" json:"x0"` + Y0 int `codec:"y0" json:"y0"` + X1 int `codec:"x1" json:"x1"` + Y1 int `codec:"y1" json:"y1"` +} + +func (o ImageCropRect) DeepCopy() ImageCropRect { + return ImageCropRect{ + X0: o.X0, + Y0: o.Y0, + X1: o.X1, + Y1: o.Y1, + } +} + +type PhoneLookupResult struct { + Uid UID `codec:"uid" json:"uid"` + Username string `codec:"username" json:"username"` + Ctime UnixTime `codec:"ctime" json:"ctime"` +} + +func (o PhoneLookupResult) DeepCopy() PhoneLookupResult { + return PhoneLookupResult{ + Uid: o.Uid.DeepCopy(), + Username: o.Username, + Ctime: o.Ctime.DeepCopy(), + } +} + +type IdentityVisibility int + +const ( + IdentityVisibility_PRIVATE IdentityVisibility = 0 + IdentityVisibility_PUBLIC IdentityVisibility = 1 +) + +func (o IdentityVisibility) DeepCopy() IdentityVisibility { return o } + +var IdentityVisibilityMap = map[string]IdentityVisibility{ + "PRIVATE": 0, + "PUBLIC": 1, +} + +var IdentityVisibilityRevMap = map[IdentityVisibility]string{ + 0: "PRIVATE", + 1: "PUBLIC", +} + +func (e IdentityVisibility) String() string { + if v, ok := IdentityVisibilityRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type SizedImage struct { + Path string `codec:"path" json:"path"` + Width int `codec:"width" json:"width"` +} + +func (o SizedImage) DeepCopy() SizedImage { + return SizedImage{ + Path: o.Path, + Width: o.Width, + } +} + +type OfflineAvailability int + +const ( + OfflineAvailability_NONE OfflineAvailability = 0 + OfflineAvailability_BEST_EFFORT OfflineAvailability = 1 +) + +func (o OfflineAvailability) DeepCopy() OfflineAvailability { return o } + +var OfflineAvailabilityMap = map[string]OfflineAvailability{ + "NONE": 0, + "BEST_EFFORT": 1, +} + +var OfflineAvailabilityRevMap = map[OfflineAvailability]string{ + 0: "NONE", + 1: "BEST_EFFORT", +} + +func (e OfflineAvailability) String() string { + if v, ok := OfflineAvailabilityRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ReacjiSkinTone int + +func (o ReacjiSkinTone) DeepCopy() ReacjiSkinTone { + return o +} + +type UserReacjis struct { + TopReacjis []string `codec:"topReacjis" json:"topReacjis"` + SkinTone ReacjiSkinTone `codec:"skinTone" json:"skinTone"` +} + +func (o UserReacjis) DeepCopy() UserReacjis { + return UserReacjis{ + TopReacjis: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.TopReacjis), + SkinTone: o.SkinTone.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/config.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/config.go new file mode 100644 index 00000000..3700dcad --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/config.go @@ -0,0 +1,842 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/config.avdl + +package keybase1 + +import ( + "errors" + "fmt" +) + +type CurrentStatus struct { + Configured bool `codec:"configured" json:"configured"` + Registered bool `codec:"registered" json:"registered"` + LoggedIn bool `codec:"loggedIn" json:"loggedIn"` + SessionIsValid bool `codec:"sessionIsValid" json:"sessionIsValid"` + User *User `codec:"user,omitempty" json:"user,omitempty"` +} + +func (o CurrentStatus) DeepCopy() CurrentStatus { + return CurrentStatus{ + Configured: o.Configured, + Registered: o.Registered, + LoggedIn: o.LoggedIn, + SessionIsValid: o.SessionIsValid, + User: (func(x *User) *User { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.User), + } +} + +type SessionStatus struct { + SessionFor string `codec:"SessionFor" json:"SessionFor"` + Loaded bool `codec:"Loaded" json:"Loaded"` + Cleared bool `codec:"Cleared" json:"Cleared"` + SaltOnly bool `codec:"SaltOnly" json:"SaltOnly"` + Expired bool `codec:"Expired" json:"Expired"` +} + +func (o SessionStatus) DeepCopy() SessionStatus { + return SessionStatus{ + SessionFor: o.SessionFor, + Loaded: o.Loaded, + Cleared: o.Cleared, + SaltOnly: o.SaltOnly, + Expired: o.Expired, + } +} + +type ClientDetails struct { + Pid int `codec:"pid" json:"pid"` + ClientType ClientType `codec:"clientType" json:"clientType"` + Argv []string `codec:"argv" json:"argv"` + Desc string `codec:"desc" json:"desc"` + Version string `codec:"version" json:"version"` +} + +func (o ClientDetails) DeepCopy() ClientDetails { + return ClientDetails{ + Pid: o.Pid, + ClientType: o.ClientType.DeepCopy(), + Argv: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Argv), + Desc: o.Desc, + Version: o.Version, + } +} + +type ClientStatus struct { + Details ClientDetails `codec:"details" json:"details"` + ConnectionID int `codec:"connectionID" json:"connectionID"` + NotificationChannels NotificationChannels `codec:"notificationChannels" json:"notificationChannels"` +} + +func (o ClientStatus) DeepCopy() ClientStatus { + return ClientStatus{ + Details: o.Details.DeepCopy(), + ConnectionID: o.ConnectionID, + NotificationChannels: o.NotificationChannels.DeepCopy(), + } +} + +type PlatformInfo struct { + Os string `codec:"os" json:"os"` + OsVersion string `codec:"osVersion" json:"osVersion"` + Arch string `codec:"arch" json:"arch"` + GoVersion string `codec:"goVersion" json:"goVersion"` +} + +func (o PlatformInfo) DeepCopy() PlatformInfo { + return PlatformInfo{ + Os: o.Os, + OsVersion: o.OsVersion, + Arch: o.Arch, + GoVersion: o.GoVersion, + } +} + +type LoadDeviceErr struct { + Where string `codec:"where" json:"where"` + Desc string `codec:"desc" json:"desc"` +} + +func (o LoadDeviceErr) DeepCopy() LoadDeviceErr { + return LoadDeviceErr{ + Where: o.Where, + Desc: o.Desc, + } +} + +type DirSizeInfo struct { + NumFiles int `codec:"numFiles" json:"numFiles"` + Name string `codec:"name" json:"name"` + HumanSize string `codec:"humanSize" json:"humanSize"` +} + +func (o DirSizeInfo) DeepCopy() DirSizeInfo { + return DirSizeInfo{ + NumFiles: o.NumFiles, + Name: o.Name, + HumanSize: o.HumanSize, + } +} + +type ExtendedStatus struct { + Standalone bool `codec:"standalone" json:"standalone"` + PassphraseStreamCached bool `codec:"passphraseStreamCached" json:"passphraseStreamCached"` + TsecCached bool `codec:"tsecCached" json:"tsecCached"` + DeviceSigKeyCached bool `codec:"deviceSigKeyCached" json:"deviceSigKeyCached"` + DeviceEncKeyCached bool `codec:"deviceEncKeyCached" json:"deviceEncKeyCached"` + PaperSigKeyCached bool `codec:"paperSigKeyCached" json:"paperSigKeyCached"` + PaperEncKeyCached bool `codec:"paperEncKeyCached" json:"paperEncKeyCached"` + StoredSecret bool `codec:"storedSecret" json:"storedSecret"` + SecretPromptSkip bool `codec:"secretPromptSkip" json:"secretPromptSkip"` + RememberPassphrase bool `codec:"rememberPassphrase" json:"rememberPassphrase"` + Device *Device `codec:"device,omitempty" json:"device,omitempty"` + DeviceErr *LoadDeviceErr `codec:"deviceErr,omitempty" json:"deviceErr,omitempty"` + LogDir string `codec:"logDir" json:"logDir"` + Session *SessionStatus `codec:"session,omitempty" json:"session,omitempty"` + DefaultUsername string `codec:"defaultUsername" json:"defaultUsername"` + ProvisionedUsernames []string `codec:"provisionedUsernames" json:"provisionedUsernames"` + ConfiguredAccounts []ConfiguredAccount `codec:"configuredAccounts" json:"configuredAccounts"` + Clients []ClientStatus `codec:"Clients" json:"Clients"` + DeviceEkNames []string `codec:"deviceEkNames" json:"deviceEkNames"` + PlatformInfo PlatformInfo `codec:"platformInfo" json:"platformInfo"` + DefaultDeviceID DeviceID `codec:"defaultDeviceID" json:"defaultDeviceID"` + LocalDbStats []string `codec:"localDbStats" json:"localDbStats"` + LocalChatDbStats []string `codec:"localChatDbStats" json:"localChatDbStats"` + LocalBlockCacheDbStats []string `codec:"localBlockCacheDbStats" json:"localBlockCacheDbStats"` + LocalSyncCacheDbStats []string `codec:"localSyncCacheDbStats" json:"localSyncCacheDbStats"` + CacheDirSizeInfo []DirSizeInfo `codec:"cacheDirSizeInfo" json:"cacheDirSizeInfo"` + UiRouterMapping map[string]int `codec:"uiRouterMapping" json:"uiRouterMapping"` +} + +func (o ExtendedStatus) DeepCopy() ExtendedStatus { + return ExtendedStatus{ + Standalone: o.Standalone, + PassphraseStreamCached: o.PassphraseStreamCached, + TsecCached: o.TsecCached, + DeviceSigKeyCached: o.DeviceSigKeyCached, + DeviceEncKeyCached: o.DeviceEncKeyCached, + PaperSigKeyCached: o.PaperSigKeyCached, + PaperEncKeyCached: o.PaperEncKeyCached, + StoredSecret: o.StoredSecret, + SecretPromptSkip: o.SecretPromptSkip, + RememberPassphrase: o.RememberPassphrase, + Device: (func(x *Device) *Device { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Device), + DeviceErr: (func(x *LoadDeviceErr) *LoadDeviceErr { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.DeviceErr), + LogDir: o.LogDir, + Session: (func(x *SessionStatus) *SessionStatus { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Session), + DefaultUsername: o.DefaultUsername, + ProvisionedUsernames: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.ProvisionedUsernames), + ConfiguredAccounts: (func(x []ConfiguredAccount) []ConfiguredAccount { + if x == nil { + return nil + } + ret := make([]ConfiguredAccount, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ConfiguredAccounts), + Clients: (func(x []ClientStatus) []ClientStatus { + if x == nil { + return nil + } + ret := make([]ClientStatus, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Clients), + DeviceEkNames: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.DeviceEkNames), + PlatformInfo: o.PlatformInfo.DeepCopy(), + DefaultDeviceID: o.DefaultDeviceID.DeepCopy(), + LocalDbStats: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.LocalDbStats), + LocalChatDbStats: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.LocalChatDbStats), + LocalBlockCacheDbStats: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.LocalBlockCacheDbStats), + LocalSyncCacheDbStats: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.LocalSyncCacheDbStats), + CacheDirSizeInfo: (func(x []DirSizeInfo) []DirSizeInfo { + if x == nil { + return nil + } + ret := make([]DirSizeInfo, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.CacheDirSizeInfo), + UiRouterMapping: (func(x map[string]int) map[string]int { + if x == nil { + return nil + } + ret := make(map[string]int, len(x)) + for k, v := range x { + kCopy := k + vCopy := v + ret[kCopy] = vCopy + } + return ret + })(o.UiRouterMapping), + } +} + +type KbClientStatus struct { + Version string `codec:"version" json:"version"` +} + +func (o KbClientStatus) DeepCopy() KbClientStatus { + return KbClientStatus{ + Version: o.Version, + } +} + +type KbServiceStatus struct { + Version string `codec:"version" json:"version"` + Running bool `codec:"running" json:"running"` + Pid string `codec:"pid" json:"pid"` + Log string `codec:"log" json:"log"` + EkLog string `codec:"ekLog" json:"ekLog"` +} + +func (o KbServiceStatus) DeepCopy() KbServiceStatus { + return KbServiceStatus{ + Version: o.Version, + Running: o.Running, + Pid: o.Pid, + Log: o.Log, + EkLog: o.EkLog, + } +} + +type KBFSStatus struct { + Version string `codec:"version" json:"version"` + InstalledVersion string `codec:"installedVersion" json:"installedVersion"` + Running bool `codec:"running" json:"running"` + Pid string `codec:"pid" json:"pid"` + Log string `codec:"log" json:"log"` + Mount string `codec:"mount" json:"mount"` +} + +func (o KBFSStatus) DeepCopy() KBFSStatus { + return KBFSStatus{ + Version: o.Version, + InstalledVersion: o.InstalledVersion, + Running: o.Running, + Pid: o.Pid, + Log: o.Log, + Mount: o.Mount, + } +} + +type DesktopStatus struct { + Version string `codec:"version" json:"version"` + Running bool `codec:"running" json:"running"` + Log string `codec:"log" json:"log"` +} + +func (o DesktopStatus) DeepCopy() DesktopStatus { + return DesktopStatus{ + Version: o.Version, + Running: o.Running, + Log: o.Log, + } +} + +type UpdaterStatus struct { + Log string `codec:"log" json:"log"` +} + +func (o UpdaterStatus) DeepCopy() UpdaterStatus { + return UpdaterStatus{ + Log: o.Log, + } +} + +type StartStatus struct { + Log string `codec:"log" json:"log"` +} + +func (o StartStatus) DeepCopy() StartStatus { + return StartStatus{ + Log: o.Log, + } +} + +type GitStatus struct { + Log string `codec:"log" json:"log"` +} + +func (o GitStatus) DeepCopy() GitStatus { + return GitStatus{ + Log: o.Log, + } +} + +type FullStatus struct { + Username string `codec:"username" json:"username"` + ConfigPath string `codec:"configPath" json:"configPath"` + CurStatus CurrentStatus `codec:"curStatus" json:"curStatus"` + ExtStatus ExtendedStatus `codec:"extStatus" json:"extStatus"` + Client KbClientStatus `codec:"client" json:"client"` + Service KbServiceStatus `codec:"service" json:"service"` + Kbfs KBFSStatus `codec:"kbfs" json:"kbfs"` + Desktop DesktopStatus `codec:"desktop" json:"desktop"` + Updater UpdaterStatus `codec:"updater" json:"updater"` + Start StartStatus `codec:"start" json:"start"` + Git GitStatus `codec:"git" json:"git"` +} + +func (o FullStatus) DeepCopy() FullStatus { + return FullStatus{ + Username: o.Username, + ConfigPath: o.ConfigPath, + CurStatus: o.CurStatus.DeepCopy(), + ExtStatus: o.ExtStatus.DeepCopy(), + Client: o.Client.DeepCopy(), + Service: o.Service.DeepCopy(), + Kbfs: o.Kbfs.DeepCopy(), + Desktop: o.Desktop.DeepCopy(), + Updater: o.Updater.DeepCopy(), + Start: o.Start.DeepCopy(), + Git: o.Git.DeepCopy(), + } +} + +type LogSendID string + +func (o LogSendID) DeepCopy() LogSendID { + return o +} + +type AllProvisionedUsernames struct { + DefaultUsername string `codec:"defaultUsername" json:"defaultUsername"` + ProvisionedUsernames []string `codec:"provisionedUsernames" json:"provisionedUsernames"` + HasProvisionedUser bool `codec:"hasProvisionedUser" json:"hasProvisionedUser"` +} + +func (o AllProvisionedUsernames) DeepCopy() AllProvisionedUsernames { + return AllProvisionedUsernames{ + DefaultUsername: o.DefaultUsername, + ProvisionedUsernames: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.ProvisionedUsernames), + HasProvisionedUser: o.HasProvisionedUser, + } +} + +type ForkType int + +const ( + ForkType_NONE ForkType = 0 + ForkType_AUTO ForkType = 1 + ForkType_WATCHDOG ForkType = 2 + ForkType_LAUNCHD ForkType = 3 + ForkType_SYSTEMD ForkType = 4 +) + +func (o ForkType) DeepCopy() ForkType { return o } + +var ForkTypeMap = map[string]ForkType{ + "NONE": 0, + "AUTO": 1, + "WATCHDOG": 2, + "LAUNCHD": 3, + "SYSTEMD": 4, +} + +var ForkTypeRevMap = map[ForkType]string{ + 0: "NONE", + 1: "AUTO", + 2: "WATCHDOG", + 3: "LAUNCHD", + 4: "SYSTEMD", +} + +func (e ForkType) String() string { + if v, ok := ForkTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type Config struct { + ServerURI string `codec:"serverURI" json:"serverURI"` + SocketFile string `codec:"socketFile" json:"socketFile"` + Label string `codec:"label" json:"label"` + RunMode string `codec:"runMode" json:"runMode"` + GpgExists bool `codec:"gpgExists" json:"gpgExists"` + GpgPath string `codec:"gpgPath" json:"gpgPath"` + Version string `codec:"version" json:"version"` + Path string `codec:"path" json:"path"` + BinaryRealpath string `codec:"binaryRealpath" json:"binaryRealpath"` + ConfigPath string `codec:"configPath" json:"configPath"` + VersionShort string `codec:"versionShort" json:"versionShort"` + VersionFull string `codec:"versionFull" json:"versionFull"` + IsAutoForked bool `codec:"isAutoForked" json:"isAutoForked"` + ForkType ForkType `codec:"forkType" json:"forkType"` +} + +func (o Config) DeepCopy() Config { + return Config{ + ServerURI: o.ServerURI, + SocketFile: o.SocketFile, + Label: o.Label, + RunMode: o.RunMode, + GpgExists: o.GpgExists, + GpgPath: o.GpgPath, + Version: o.Version, + Path: o.Path, + BinaryRealpath: o.BinaryRealpath, + ConfigPath: o.ConfigPath, + VersionShort: o.VersionShort, + VersionFull: o.VersionFull, + IsAutoForked: o.IsAutoForked, + ForkType: o.ForkType.DeepCopy(), + } +} + +type ConfigValue struct { + IsNull bool `codec:"isNull" json:"isNull"` + B *bool `codec:"b,omitempty" json:"b,omitempty"` + I *int `codec:"i,omitempty" json:"i,omitempty"` + F *float64 `codec:"f,omitempty" json:"f,omitempty"` + S *string `codec:"s,omitempty" json:"s,omitempty"` + O *string `codec:"o,omitempty" json:"o,omitempty"` +} + +func (o ConfigValue) DeepCopy() ConfigValue { + return ConfigValue{ + IsNull: o.IsNull, + B: (func(x *bool) *bool { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.B), + I: (func(x *int) *int { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.I), + F: (func(x *float64) *float64 { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.F), + S: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.S), + O: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.O), + } +} + +type OutOfDateInfo struct { + UpgradeTo string `codec:"upgradeTo" json:"upgradeTo"` + UpgradeURI string `codec:"upgradeURI" json:"upgradeURI"` + CustomMessage string `codec:"customMessage" json:"customMessage"` + CriticalClockSkew int64 `codec:"criticalClockSkew" json:"criticalClockSkew"` +} + +func (o OutOfDateInfo) DeepCopy() OutOfDateInfo { + return OutOfDateInfo{ + UpgradeTo: o.UpgradeTo, + UpgradeURI: o.UpgradeURI, + CustomMessage: o.CustomMessage, + CriticalClockSkew: o.CriticalClockSkew, + } +} + +type UpdateInfoStatus int + +const ( + UpdateInfoStatus_UP_TO_DATE UpdateInfoStatus = 0 + UpdateInfoStatus_NEED_UPDATE UpdateInfoStatus = 1 + UpdateInfoStatus_CRITICALLY_OUT_OF_DATE UpdateInfoStatus = 2 +) + +func (o UpdateInfoStatus) DeepCopy() UpdateInfoStatus { return o } + +var UpdateInfoStatusMap = map[string]UpdateInfoStatus{ + "UP_TO_DATE": 0, + "NEED_UPDATE": 1, + "CRITICALLY_OUT_OF_DATE": 2, +} + +var UpdateInfoStatusRevMap = map[UpdateInfoStatus]string{ + 0: "UP_TO_DATE", + 1: "NEED_UPDATE", + 2: "CRITICALLY_OUT_OF_DATE", +} + +func (e UpdateInfoStatus) String() string { + if v, ok := UpdateInfoStatusRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UpdateInfo struct { + Status UpdateInfoStatus `codec:"status" json:"status"` + Message string `codec:"message" json:"message"` +} + +func (o UpdateInfo) DeepCopy() UpdateInfo { + return UpdateInfo{ + Status: o.Status.DeepCopy(), + Message: o.Message, + } +} + +type BootstrapStatus struct { + Registered bool `codec:"registered" json:"registered"` + LoggedIn bool `codec:"loggedIn" json:"loggedIn"` + Uid UID `codec:"uid" json:"uid"` + Username string `codec:"username" json:"username"` + DeviceID DeviceID `codec:"deviceID" json:"deviceID"` + DeviceName string `codec:"deviceName" json:"deviceName"` + Fullname FullName `codec:"fullname" json:"fullname"` + UserReacjis UserReacjis `codec:"userReacjis" json:"userReacjis"` + HttpSrvInfo *HttpSrvInfo `codec:"httpSrvInfo,omitempty" json:"httpSrvInfo,omitempty"` +} + +func (o BootstrapStatus) DeepCopy() BootstrapStatus { + return BootstrapStatus{ + Registered: o.Registered, + LoggedIn: o.LoggedIn, + Uid: o.Uid.DeepCopy(), + Username: o.Username, + DeviceID: o.DeviceID.DeepCopy(), + DeviceName: o.DeviceName, + Fullname: o.Fullname.DeepCopy(), + UserReacjis: o.UserReacjis.DeepCopy(), + HttpSrvInfo: (func(x *HttpSrvInfo) *HttpSrvInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.HttpSrvInfo), + } +} + +type UpdateInfoStatus2 int + +const ( + UpdateInfoStatus2_OK UpdateInfoStatus2 = 0 + UpdateInfoStatus2_SUGGESTED UpdateInfoStatus2 = 1 + UpdateInfoStatus2_CRITICAL UpdateInfoStatus2 = 2 +) + +func (o UpdateInfoStatus2) DeepCopy() UpdateInfoStatus2 { return o } + +var UpdateInfoStatus2Map = map[string]UpdateInfoStatus2{ + "OK": 0, + "SUGGESTED": 1, + "CRITICAL": 2, +} + +var UpdateInfoStatus2RevMap = map[UpdateInfoStatus2]string{ + 0: "OK", + 1: "SUGGESTED", + 2: "CRITICAL", +} + +func (e UpdateInfoStatus2) String() string { + if v, ok := UpdateInfoStatus2RevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UpdateDetails struct { + Message string `codec:"message" json:"message"` +} + +func (o UpdateDetails) DeepCopy() UpdateDetails { + return UpdateDetails{ + Message: o.Message, + } +} + +type UpdateInfo2 struct { + Status__ UpdateInfoStatus2 `codec:"status" json:"status"` + Suggested__ *UpdateDetails `codec:"suggested,omitempty" json:"suggested,omitempty"` + Critical__ *UpdateDetails `codec:"critical,omitempty" json:"critical,omitempty"` +} + +func (o *UpdateInfo2) Status() (ret UpdateInfoStatus2, err error) { + switch o.Status__ { + case UpdateInfoStatus2_SUGGESTED: + if o.Suggested__ == nil { + err = errors.New("unexpected nil value for Suggested__") + return ret, err + } + case UpdateInfoStatus2_CRITICAL: + if o.Critical__ == nil { + err = errors.New("unexpected nil value for Critical__") + return ret, err + } + } + return o.Status__, nil +} + +func (o UpdateInfo2) Suggested() (res UpdateDetails) { + if o.Status__ != UpdateInfoStatus2_SUGGESTED { + panic("wrong case accessed") + } + if o.Suggested__ == nil { + return + } + return *o.Suggested__ +} + +func (o UpdateInfo2) Critical() (res UpdateDetails) { + if o.Status__ != UpdateInfoStatus2_CRITICAL { + panic("wrong case accessed") + } + if o.Critical__ == nil { + return + } + return *o.Critical__ +} + +func NewUpdateInfo2WithOk() UpdateInfo2 { + return UpdateInfo2{ + Status__: UpdateInfoStatus2_OK, + } +} + +func NewUpdateInfo2WithSuggested(v UpdateDetails) UpdateInfo2 { + return UpdateInfo2{ + Status__: UpdateInfoStatus2_SUGGESTED, + Suggested__: &v, + } +} + +func NewUpdateInfo2WithCritical(v UpdateDetails) UpdateInfo2 { + return UpdateInfo2{ + Status__: UpdateInfoStatus2_CRITICAL, + Critical__: &v, + } +} + +func (o UpdateInfo2) DeepCopy() UpdateInfo2 { + return UpdateInfo2{ + Status__: o.Status__.DeepCopy(), + Suggested__: (func(x *UpdateDetails) *UpdateDetails { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Suggested__), + Critical__: (func(x *UpdateDetails) *UpdateDetails { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Critical__), + } +} + +type ProxyType int + +const ( + ProxyType_No_Proxy ProxyType = 0 + ProxyType_HTTP_Connect ProxyType = 1 + ProxyType_Socks ProxyType = 2 +) + +func (o ProxyType) DeepCopy() ProxyType { return o } + +var ProxyTypeMap = map[string]ProxyType{ + "No_Proxy": 0, + "HTTP_Connect": 1, + "Socks": 2, +} + +var ProxyTypeRevMap = map[ProxyType]string{ + 0: "No_Proxy", + 1: "HTTP_Connect", + 2: "Socks", +} + +func (e ProxyType) String() string { + if v, ok := ProxyTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ProxyData struct { + AddressWithPort string `codec:"addressWithPort" json:"addressWithPort"` + ProxyType ProxyType `codec:"proxyType" json:"proxyType"` + CertPinning bool `codec:"certPinning" json:"certPinning"` +} + +func (o ProxyData) DeepCopy() ProxyData { + return ProxyData{ + AddressWithPort: o.AddressWithPort, + ProxyType: o.ProxyType.DeepCopy(), + CertPinning: o.CertPinning, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/constants.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/constants.go new file mode 100644 index 00000000..c9d45956 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/constants.go @@ -0,0 +1,724 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/constants.avdl + +package keybase1 + +import ( + "fmt" +) + +type StatusCode int + +const ( + StatusCode_SCOk StatusCode = 0 + StatusCode_SCInputError StatusCode = 100 + StatusCode_SCLoginRequired StatusCode = 201 + StatusCode_SCBadSession StatusCode = 202 + StatusCode_SCBadLoginUserNotFound StatusCode = 203 + StatusCode_SCBadLoginPassword StatusCode = 204 + StatusCode_SCNotFound StatusCode = 205 + StatusCode_SCThrottleControl StatusCode = 210 + StatusCode_SCDeleted StatusCode = 216 + StatusCode_SCGeneric StatusCode = 218 + StatusCode_SCAlreadyLoggedIn StatusCode = 235 + StatusCode_SCExists StatusCode = 230 + StatusCode_SCCanceled StatusCode = 237 + StatusCode_SCInputCanceled StatusCode = 239 + StatusCode_SCBadUsername StatusCode = 243 + StatusCode_SCOffline StatusCode = 267 + StatusCode_SCReloginRequired StatusCode = 274 + StatusCode_SCResolutionFailed StatusCode = 275 + StatusCode_SCProfileNotPublic StatusCode = 276 + StatusCode_SCIdentifyFailed StatusCode = 277 + StatusCode_SCTrackingBroke StatusCode = 278 + StatusCode_SCWrongCryptoFormat StatusCode = 279 + StatusCode_SCDecryptionError StatusCode = 280 + StatusCode_SCInvalidAddress StatusCode = 281 + StatusCode_SCNoSession StatusCode = 283 + StatusCode_SCAccountReset StatusCode = 290 + StatusCode_SCIdentifiesFailed StatusCode = 295 + StatusCode_SCNoSpaceOnDevice StatusCode = 297 + StatusCode_SCMerkleClientError StatusCode = 299 + StatusCode_SCBadEmail StatusCode = 472 + StatusCode_SCRateLimit StatusCode = 602 + StatusCode_SCBadSignupUsernameTaken StatusCode = 701 + StatusCode_SCDuplicate StatusCode = 706 + StatusCode_SCBadInvitationCode StatusCode = 707 + StatusCode_SCBadSignupUsernameReserved StatusCode = 710 + StatusCode_SCBadSignupTeamName StatusCode = 711 + StatusCode_SCFeatureFlag StatusCode = 712 + StatusCode_SCEmailTaken StatusCode = 713 + StatusCode_SCEmailAlreadyAdded StatusCode = 714 + StatusCode_SCEmailLimitExceeded StatusCode = 715 + StatusCode_SCEmailCannotDeletePrimary StatusCode = 716 + StatusCode_SCEmailUnknown StatusCode = 717 + StatusCode_SCBotSignupTokenNotFound StatusCode = 719 + StatusCode_SCNoUpdate StatusCode = 723 + StatusCode_SCMissingResult StatusCode = 801 + StatusCode_SCKeyNotFound StatusCode = 901 + StatusCode_SCKeyCorrupted StatusCode = 905 + StatusCode_SCKeyInUse StatusCode = 907 + StatusCode_SCKeyBadGen StatusCode = 913 + StatusCode_SCKeyNoSecret StatusCode = 914 + StatusCode_SCKeyBadUIDs StatusCode = 915 + StatusCode_SCKeyNoActive StatusCode = 916 + StatusCode_SCKeyNoSig StatusCode = 917 + StatusCode_SCKeyBadSig StatusCode = 918 + StatusCode_SCKeyBadEldest StatusCode = 919 + StatusCode_SCKeyNoEldest StatusCode = 920 + StatusCode_SCKeyDuplicateUpdate StatusCode = 921 + StatusCode_SCSibkeyAlreadyExists StatusCode = 922 + StatusCode_SCDecryptionKeyNotFound StatusCode = 924 + StatusCode_SCKeyNoPGPEncryption StatusCode = 927 + StatusCode_SCKeyNoNaClEncryption StatusCode = 928 + StatusCode_SCKeySyncedPGPNotFound StatusCode = 929 + StatusCode_SCKeyNoMatchingGPG StatusCode = 930 + StatusCode_SCKeyRevoked StatusCode = 931 + StatusCode_SCSigCannotVerify StatusCode = 1002 + StatusCode_SCSigWrongKey StatusCode = 1008 + StatusCode_SCSigOldSeqno StatusCode = 1010 + StatusCode_SCSigCreationDisallowed StatusCode = 1016 + StatusCode_SCSigMissingRatchet StatusCode = 1021 + StatusCode_SCSigBadTotalOrder StatusCode = 1022 + StatusCode_SCBadTrackSession StatusCode = 1301 + StatusCode_SCDeviceBadName StatusCode = 1404 + StatusCode_SCDeviceBadStatus StatusCode = 1405 + StatusCode_SCDeviceNameInUse StatusCode = 1408 + StatusCode_SCDeviceNotFound StatusCode = 1409 + StatusCode_SCDeviceMismatch StatusCode = 1410 + StatusCode_SCDeviceRequired StatusCode = 1411 + StatusCode_SCDevicePrevProvisioned StatusCode = 1413 + StatusCode_SCDeviceNoProvision StatusCode = 1414 + StatusCode_SCDeviceProvisionViaDevice StatusCode = 1415 + StatusCode_SCRevokeCurrentDevice StatusCode = 1416 + StatusCode_SCRevokeLastDevice StatusCode = 1417 + StatusCode_SCDeviceProvisionOffline StatusCode = 1418 + StatusCode_SCRevokeLastDevicePGP StatusCode = 1419 + StatusCode_SCStreamExists StatusCode = 1501 + StatusCode_SCStreamNotFound StatusCode = 1502 + StatusCode_SCStreamWrongKind StatusCode = 1503 + StatusCode_SCStreamEOF StatusCode = 1504 + StatusCode_SCStreamUnknown StatusCode = 1505 + StatusCode_SCGenericAPIError StatusCode = 1600 + StatusCode_SCAPINetworkError StatusCode = 1601 + StatusCode_SCTimeout StatusCode = 1602 + StatusCode_SCProofError StatusCode = 1701 + StatusCode_SCIdentificationExpired StatusCode = 1702 + StatusCode_SCSelfNotFound StatusCode = 1703 + StatusCode_SCBadKexPhrase StatusCode = 1704 + StatusCode_SCNoUIDelegation StatusCode = 1705 + StatusCode_SCNoUI StatusCode = 1706 + StatusCode_SCGPGUnavailable StatusCode = 1707 + StatusCode_SCInvalidVersionError StatusCode = 1800 + StatusCode_SCOldVersionError StatusCode = 1801 + StatusCode_SCInvalidLocationError StatusCode = 1802 + StatusCode_SCServiceStatusError StatusCode = 1803 + StatusCode_SCInstallError StatusCode = 1804 + StatusCode_SCLoadKextError StatusCode = 1810 + StatusCode_SCLoadKextPermError StatusCode = 1811 + StatusCode_SCGitInternal StatusCode = 2300 + StatusCode_SCGitRepoAlreadyExists StatusCode = 2301 + StatusCode_SCGitInvalidRepoName StatusCode = 2302 + StatusCode_SCGitCannotDelete StatusCode = 2303 + StatusCode_SCGitRepoDoesntExist StatusCode = 2304 + StatusCode_SCLoginStateTimeout StatusCode = 2400 + StatusCode_SCChatInternal StatusCode = 2500 + StatusCode_SCChatRateLimit StatusCode = 2501 + StatusCode_SCChatConvExists StatusCode = 2502 + StatusCode_SCChatUnknownTLFID StatusCode = 2503 + StatusCode_SCChatNotInConv StatusCode = 2504 + StatusCode_SCChatBadMsg StatusCode = 2505 + StatusCode_SCChatBroadcast StatusCode = 2506 + StatusCode_SCChatAlreadySuperseded StatusCode = 2507 + StatusCode_SCChatAlreadyDeleted StatusCode = 2508 + StatusCode_SCChatTLFFinalized StatusCode = 2509 + StatusCode_SCChatCollision StatusCode = 2510 + StatusCode_SCIdentifySummaryError StatusCode = 2511 + StatusCode_SCNeedSelfRekey StatusCode = 2512 + StatusCode_SCNeedOtherRekey StatusCode = 2513 + StatusCode_SCChatMessageCollision StatusCode = 2514 + StatusCode_SCChatDuplicateMessage StatusCode = 2515 + StatusCode_SCChatClientError StatusCode = 2516 + StatusCode_SCChatNotInTeam StatusCode = 2517 + StatusCode_SCChatStalePreviousState StatusCode = 2518 + StatusCode_SCChatEphemeralRetentionPolicyViolatedError StatusCode = 2519 + StatusCode_SCTeamBadMembership StatusCode = 2604 + StatusCode_SCTeamSelfNotOwner StatusCode = 2607 + StatusCode_SCTeamNotFound StatusCode = 2614 + StatusCode_SCTeamExists StatusCode = 2619 + StatusCode_SCTeamReadError StatusCode = 2623 + StatusCode_SCTeamWritePermDenied StatusCode = 2625 + StatusCode_SCTeamBadGeneration StatusCode = 2634 + StatusCode_SCNoOp StatusCode = 2638 + StatusCode_SCTeamInviteBadCancel StatusCode = 2645 + StatusCode_SCTeamInviteBadToken StatusCode = 2646 + StatusCode_SCTeamTarDuplicate StatusCode = 2663 + StatusCode_SCTeamTarNotFound StatusCode = 2664 + StatusCode_SCTeamMemberExists StatusCode = 2665 + StatusCode_SCTeamNotReleased StatusCode = 2666 + StatusCode_SCTeamPermanentlyLeft StatusCode = 2667 + StatusCode_SCTeamNeedRootId StatusCode = 2668 + StatusCode_SCTeamHasLiveChildren StatusCode = 2669 + StatusCode_SCTeamDeleteError StatusCode = 2670 + StatusCode_SCTeamBadRootTeam StatusCode = 2671 + StatusCode_SCTeamNameConflictsWithUser StatusCode = 2672 + StatusCode_SCTeamDeleteNoUpPointer StatusCode = 2673 + StatusCode_SCTeamNeedOwner StatusCode = 2674 + StatusCode_SCTeamNoOwnerAllowed StatusCode = 2675 + StatusCode_SCTeamImplicitNoNonSbs StatusCode = 2676 + StatusCode_SCTeamImplicitBadHash StatusCode = 2677 + StatusCode_SCTeamImplicitBadName StatusCode = 2678 + StatusCode_SCTeamImplicitClash StatusCode = 2679 + StatusCode_SCTeamImplicitDuplicate StatusCode = 2680 + StatusCode_SCTeamImplicitBadOp StatusCode = 2681 + StatusCode_SCTeamImplicitBadRole StatusCode = 2682 + StatusCode_SCTeamImplicitNotFound StatusCode = 2683 + StatusCode_SCTeamBadAdminSeqnoType StatusCode = 2684 + StatusCode_SCTeamImplicitBadAdd StatusCode = 2685 + StatusCode_SCTeamImplicitBadRemove StatusCode = 2686 + StatusCode_SCTeamInviteTokenReused StatusCode = 2696 + StatusCode_SCTeamKeyMaskNotFound StatusCode = 2697 + StatusCode_SCTeamBanned StatusCode = 2702 + StatusCode_SCTeamInvalidBan StatusCode = 2703 + StatusCode_SCTeamShowcasePermDenied StatusCode = 2711 + StatusCode_SCTeamProvisionalCanKey StatusCode = 2721 + StatusCode_SCTeamProvisionalCannotKey StatusCode = 2722 + StatusCode_SCTeamFTLOutdated StatusCode = 2736 + StatusCode_SCTeamStorageWrongRevision StatusCode = 2760 + StatusCode_SCTeamStorageBadGeneration StatusCode = 2761 + StatusCode_SCTeamStorageNotFound StatusCode = 2762 + StatusCode_SCTeamContactSettingsBlock StatusCode = 2763 + StatusCode_SCEphemeralKeyBadGeneration StatusCode = 2900 + StatusCode_SCEphemeralKeyUnexpectedBox StatusCode = 2901 + StatusCode_SCEphemeralKeyMissingBox StatusCode = 2902 + StatusCode_SCEphemeralKeyWrongNumberOfKeys StatusCode = 2903 + StatusCode_SCEphemeralKeyMismatchedKey StatusCode = 2904 + StatusCode_SCEphemeralPairwiseMACsMissingUIDs StatusCode = 2905 + StatusCode_SCEphemeralDeviceAfterEK StatusCode = 2906 + StatusCode_SCEphemeralMemberAfterEK StatusCode = 2907 + StatusCode_SCEphemeralDeviceStale StatusCode = 2908 + StatusCode_SCEphemeralUserStale StatusCode = 2909 + StatusCode_SCStellarError StatusCode = 3100 + StatusCode_SCStellarBadInput StatusCode = 3101 + StatusCode_SCStellarWrongRevision StatusCode = 3102 + StatusCode_SCStellarMissingBundle StatusCode = 3103 + StatusCode_SCStellarBadPuk StatusCode = 3104 + StatusCode_SCStellarMissingAccount StatusCode = 3105 + StatusCode_SCStellarBadPrev StatusCode = 3106 + StatusCode_SCStellarWrongPrimary StatusCode = 3107 + StatusCode_SCStellarUnsupportedCurrency StatusCode = 3108 + StatusCode_SCStellarNeedDisclaimer StatusCode = 3109 + StatusCode_SCStellarDeviceNotMobile StatusCode = 3110 + StatusCode_SCStellarMobileOnlyPurgatory StatusCode = 3111 + StatusCode_SCStellarIncompatibleVersion StatusCode = 3112 + StatusCode_SCNISTWrongSize StatusCode = 3201 + StatusCode_SCNISTBadMode StatusCode = 3202 + StatusCode_SCNISTHashWrongSize StatusCode = 3203 + StatusCode_SCNISTSigWrongSize StatusCode = 3204 + StatusCode_SCNISTSigBadInput StatusCode = 3205 + StatusCode_SCNISTSigBadUID StatusCode = 3206 + StatusCode_SCNISTSigBadDeviceID StatusCode = 3207 + StatusCode_SCNISTSigBadNonce StatusCode = 3208 + StatusCode_SCNISTNoSigOrHash StatusCode = 3209 + StatusCode_SCNISTExpired StatusCode = 3210 + StatusCode_SCNISTSigRevoked StatusCode = 3211 + StatusCode_SCNISTKeyRevoked StatusCode = 3212 + StatusCode_SCNISTUserDeleted StatusCode = 3213 + StatusCode_SCNISTNoDevice StatusCode = 3214 + StatusCode_SCNISTSigCannot_verify StatusCode = 3215 + StatusCode_SCNISTReplay StatusCode = 3216 + StatusCode_SCNISTSigBadLifetime StatusCode = 3217 + StatusCode_SCNISTNotFound StatusCode = 3218 + StatusCode_SCNISTBadClock StatusCode = 3219 + StatusCode_SCNISTSigBadCtime StatusCode = 3220 + StatusCode_SCBadSignupUsernameDeleted StatusCode = 3221 + StatusCode_SCPhoneNumberUnknown StatusCode = 3400 + StatusCode_SCPhoneNumberAlreadyVerified StatusCode = 3401 + StatusCode_SCPhoneNumberVerificationCodeExpired StatusCode = 3402 + StatusCode_SCPhoneNumberWrongVerificationCode StatusCode = 3403 + StatusCode_SCPhoneNumberLimitExceeded StatusCode = 3404 + StatusCode_SCNoPaperKeys StatusCode = 3605 + StatusCode_SCTeambotKeyGenerationExists StatusCode = 3800 + StatusCode_SCTeambotKeyOldBoxedGeneration StatusCode = 3801 + StatusCode_SCTeambotKeyBadGeneration StatusCode = 3802 + StatusCode_SCAirdropRegisterFailedMisc StatusCode = 4207 +) + +func (o StatusCode) DeepCopy() StatusCode { return o } + +var StatusCodeMap = map[string]StatusCode{ + "SCOk": 0, + "SCInputError": 100, + "SCLoginRequired": 201, + "SCBadSession": 202, + "SCBadLoginUserNotFound": 203, + "SCBadLoginPassword": 204, + "SCNotFound": 205, + "SCThrottleControl": 210, + "SCDeleted": 216, + "SCGeneric": 218, + "SCAlreadyLoggedIn": 235, + "SCExists": 230, + "SCCanceled": 237, + "SCInputCanceled": 239, + "SCBadUsername": 243, + "SCOffline": 267, + "SCReloginRequired": 274, + "SCResolutionFailed": 275, + "SCProfileNotPublic": 276, + "SCIdentifyFailed": 277, + "SCTrackingBroke": 278, + "SCWrongCryptoFormat": 279, + "SCDecryptionError": 280, + "SCInvalidAddress": 281, + "SCNoSession": 283, + "SCAccountReset": 290, + "SCIdentifiesFailed": 295, + "SCNoSpaceOnDevice": 297, + "SCMerkleClientError": 299, + "SCBadEmail": 472, + "SCRateLimit": 602, + "SCBadSignupUsernameTaken": 701, + "SCDuplicate": 706, + "SCBadInvitationCode": 707, + "SCBadSignupUsernameReserved": 710, + "SCBadSignupTeamName": 711, + "SCFeatureFlag": 712, + "SCEmailTaken": 713, + "SCEmailAlreadyAdded": 714, + "SCEmailLimitExceeded": 715, + "SCEmailCannotDeletePrimary": 716, + "SCEmailUnknown": 717, + "SCBotSignupTokenNotFound": 719, + "SCNoUpdate": 723, + "SCMissingResult": 801, + "SCKeyNotFound": 901, + "SCKeyCorrupted": 905, + "SCKeyInUse": 907, + "SCKeyBadGen": 913, + "SCKeyNoSecret": 914, + "SCKeyBadUIDs": 915, + "SCKeyNoActive": 916, + "SCKeyNoSig": 917, + "SCKeyBadSig": 918, + "SCKeyBadEldest": 919, + "SCKeyNoEldest": 920, + "SCKeyDuplicateUpdate": 921, + "SCSibkeyAlreadyExists": 922, + "SCDecryptionKeyNotFound": 924, + "SCKeyNoPGPEncryption": 927, + "SCKeyNoNaClEncryption": 928, + "SCKeySyncedPGPNotFound": 929, + "SCKeyNoMatchingGPG": 930, + "SCKeyRevoked": 931, + "SCSigCannotVerify": 1002, + "SCSigWrongKey": 1008, + "SCSigOldSeqno": 1010, + "SCSigCreationDisallowed": 1016, + "SCSigMissingRatchet": 1021, + "SCSigBadTotalOrder": 1022, + "SCBadTrackSession": 1301, + "SCDeviceBadName": 1404, + "SCDeviceBadStatus": 1405, + "SCDeviceNameInUse": 1408, + "SCDeviceNotFound": 1409, + "SCDeviceMismatch": 1410, + "SCDeviceRequired": 1411, + "SCDevicePrevProvisioned": 1413, + "SCDeviceNoProvision": 1414, + "SCDeviceProvisionViaDevice": 1415, + "SCRevokeCurrentDevice": 1416, + "SCRevokeLastDevice": 1417, + "SCDeviceProvisionOffline": 1418, + "SCRevokeLastDevicePGP": 1419, + "SCStreamExists": 1501, + "SCStreamNotFound": 1502, + "SCStreamWrongKind": 1503, + "SCStreamEOF": 1504, + "SCStreamUnknown": 1505, + "SCGenericAPIError": 1600, + "SCAPINetworkError": 1601, + "SCTimeout": 1602, + "SCProofError": 1701, + "SCIdentificationExpired": 1702, + "SCSelfNotFound": 1703, + "SCBadKexPhrase": 1704, + "SCNoUIDelegation": 1705, + "SCNoUI": 1706, + "SCGPGUnavailable": 1707, + "SCInvalidVersionError": 1800, + "SCOldVersionError": 1801, + "SCInvalidLocationError": 1802, + "SCServiceStatusError": 1803, + "SCInstallError": 1804, + "SCLoadKextError": 1810, + "SCLoadKextPermError": 1811, + "SCGitInternal": 2300, + "SCGitRepoAlreadyExists": 2301, + "SCGitInvalidRepoName": 2302, + "SCGitCannotDelete": 2303, + "SCGitRepoDoesntExist": 2304, + "SCLoginStateTimeout": 2400, + "SCChatInternal": 2500, + "SCChatRateLimit": 2501, + "SCChatConvExists": 2502, + "SCChatUnknownTLFID": 2503, + "SCChatNotInConv": 2504, + "SCChatBadMsg": 2505, + "SCChatBroadcast": 2506, + "SCChatAlreadySuperseded": 2507, + "SCChatAlreadyDeleted": 2508, + "SCChatTLFFinalized": 2509, + "SCChatCollision": 2510, + "SCIdentifySummaryError": 2511, + "SCNeedSelfRekey": 2512, + "SCNeedOtherRekey": 2513, + "SCChatMessageCollision": 2514, + "SCChatDuplicateMessage": 2515, + "SCChatClientError": 2516, + "SCChatNotInTeam": 2517, + "SCChatStalePreviousState": 2518, + "SCChatEphemeralRetentionPolicyViolatedError": 2519, + "SCTeamBadMembership": 2604, + "SCTeamSelfNotOwner": 2607, + "SCTeamNotFound": 2614, + "SCTeamExists": 2619, + "SCTeamReadError": 2623, + "SCTeamWritePermDenied": 2625, + "SCTeamBadGeneration": 2634, + "SCNoOp": 2638, + "SCTeamInviteBadCancel": 2645, + "SCTeamInviteBadToken": 2646, + "SCTeamTarDuplicate": 2663, + "SCTeamTarNotFound": 2664, + "SCTeamMemberExists": 2665, + "SCTeamNotReleased": 2666, + "SCTeamPermanentlyLeft": 2667, + "SCTeamNeedRootId": 2668, + "SCTeamHasLiveChildren": 2669, + "SCTeamDeleteError": 2670, + "SCTeamBadRootTeam": 2671, + "SCTeamNameConflictsWithUser": 2672, + "SCTeamDeleteNoUpPointer": 2673, + "SCTeamNeedOwner": 2674, + "SCTeamNoOwnerAllowed": 2675, + "SCTeamImplicitNoNonSbs": 2676, + "SCTeamImplicitBadHash": 2677, + "SCTeamImplicitBadName": 2678, + "SCTeamImplicitClash": 2679, + "SCTeamImplicitDuplicate": 2680, + "SCTeamImplicitBadOp": 2681, + "SCTeamImplicitBadRole": 2682, + "SCTeamImplicitNotFound": 2683, + "SCTeamBadAdminSeqnoType": 2684, + "SCTeamImplicitBadAdd": 2685, + "SCTeamImplicitBadRemove": 2686, + "SCTeamInviteTokenReused": 2696, + "SCTeamKeyMaskNotFound": 2697, + "SCTeamBanned": 2702, + "SCTeamInvalidBan": 2703, + "SCTeamShowcasePermDenied": 2711, + "SCTeamProvisionalCanKey": 2721, + "SCTeamProvisionalCannotKey": 2722, + "SCTeamFTLOutdated": 2736, + "SCTeamStorageWrongRevision": 2760, + "SCTeamStorageBadGeneration": 2761, + "SCTeamStorageNotFound": 2762, + "SCTeamContactSettingsBlock": 2763, + "SCEphemeralKeyBadGeneration": 2900, + "SCEphemeralKeyUnexpectedBox": 2901, + "SCEphemeralKeyMissingBox": 2902, + "SCEphemeralKeyWrongNumberOfKeys": 2903, + "SCEphemeralKeyMismatchedKey": 2904, + "SCEphemeralPairwiseMACsMissingUIDs": 2905, + "SCEphemeralDeviceAfterEK": 2906, + "SCEphemeralMemberAfterEK": 2907, + "SCEphemeralDeviceStale": 2908, + "SCEphemeralUserStale": 2909, + "SCStellarError": 3100, + "SCStellarBadInput": 3101, + "SCStellarWrongRevision": 3102, + "SCStellarMissingBundle": 3103, + "SCStellarBadPuk": 3104, + "SCStellarMissingAccount": 3105, + "SCStellarBadPrev": 3106, + "SCStellarWrongPrimary": 3107, + "SCStellarUnsupportedCurrency": 3108, + "SCStellarNeedDisclaimer": 3109, + "SCStellarDeviceNotMobile": 3110, + "SCStellarMobileOnlyPurgatory": 3111, + "SCStellarIncompatibleVersion": 3112, + "SCNISTWrongSize": 3201, + "SCNISTBadMode": 3202, + "SCNISTHashWrongSize": 3203, + "SCNISTSigWrongSize": 3204, + "SCNISTSigBadInput": 3205, + "SCNISTSigBadUID": 3206, + "SCNISTSigBadDeviceID": 3207, + "SCNISTSigBadNonce": 3208, + "SCNISTNoSigOrHash": 3209, + "SCNISTExpired": 3210, + "SCNISTSigRevoked": 3211, + "SCNISTKeyRevoked": 3212, + "SCNISTUserDeleted": 3213, + "SCNISTNoDevice": 3214, + "SCNISTSigCannot_verify": 3215, + "SCNISTReplay": 3216, + "SCNISTSigBadLifetime": 3217, + "SCNISTNotFound": 3218, + "SCNISTBadClock": 3219, + "SCNISTSigBadCtime": 3220, + "SCBadSignupUsernameDeleted": 3221, + "SCPhoneNumberUnknown": 3400, + "SCPhoneNumberAlreadyVerified": 3401, + "SCPhoneNumberVerificationCodeExpired": 3402, + "SCPhoneNumberWrongVerificationCode": 3403, + "SCPhoneNumberLimitExceeded": 3404, + "SCNoPaperKeys": 3605, + "SCTeambotKeyGenerationExists": 3800, + "SCTeambotKeyOldBoxedGeneration": 3801, + "SCTeambotKeyBadGeneration": 3802, + "SCAirdropRegisterFailedMisc": 4207, +} + +var StatusCodeRevMap = map[StatusCode]string{ + 0: "SCOk", + 100: "SCInputError", + 201: "SCLoginRequired", + 202: "SCBadSession", + 203: "SCBadLoginUserNotFound", + 204: "SCBadLoginPassword", + 205: "SCNotFound", + 210: "SCThrottleControl", + 216: "SCDeleted", + 218: "SCGeneric", + 235: "SCAlreadyLoggedIn", + 230: "SCExists", + 237: "SCCanceled", + 239: "SCInputCanceled", + 243: "SCBadUsername", + 267: "SCOffline", + 274: "SCReloginRequired", + 275: "SCResolutionFailed", + 276: "SCProfileNotPublic", + 277: "SCIdentifyFailed", + 278: "SCTrackingBroke", + 279: "SCWrongCryptoFormat", + 280: "SCDecryptionError", + 281: "SCInvalidAddress", + 283: "SCNoSession", + 290: "SCAccountReset", + 295: "SCIdentifiesFailed", + 297: "SCNoSpaceOnDevice", + 299: "SCMerkleClientError", + 472: "SCBadEmail", + 602: "SCRateLimit", + 701: "SCBadSignupUsernameTaken", + 706: "SCDuplicate", + 707: "SCBadInvitationCode", + 710: "SCBadSignupUsernameReserved", + 711: "SCBadSignupTeamName", + 712: "SCFeatureFlag", + 713: "SCEmailTaken", + 714: "SCEmailAlreadyAdded", + 715: "SCEmailLimitExceeded", + 716: "SCEmailCannotDeletePrimary", + 717: "SCEmailUnknown", + 719: "SCBotSignupTokenNotFound", + 723: "SCNoUpdate", + 801: "SCMissingResult", + 901: "SCKeyNotFound", + 905: "SCKeyCorrupted", + 907: "SCKeyInUse", + 913: "SCKeyBadGen", + 914: "SCKeyNoSecret", + 915: "SCKeyBadUIDs", + 916: "SCKeyNoActive", + 917: "SCKeyNoSig", + 918: "SCKeyBadSig", + 919: "SCKeyBadEldest", + 920: "SCKeyNoEldest", + 921: "SCKeyDuplicateUpdate", + 922: "SCSibkeyAlreadyExists", + 924: "SCDecryptionKeyNotFound", + 927: "SCKeyNoPGPEncryption", + 928: "SCKeyNoNaClEncryption", + 929: "SCKeySyncedPGPNotFound", + 930: "SCKeyNoMatchingGPG", + 931: "SCKeyRevoked", + 1002: "SCSigCannotVerify", + 1008: "SCSigWrongKey", + 1010: "SCSigOldSeqno", + 1016: "SCSigCreationDisallowed", + 1021: "SCSigMissingRatchet", + 1022: "SCSigBadTotalOrder", + 1301: "SCBadTrackSession", + 1404: "SCDeviceBadName", + 1405: "SCDeviceBadStatus", + 1408: "SCDeviceNameInUse", + 1409: "SCDeviceNotFound", + 1410: "SCDeviceMismatch", + 1411: "SCDeviceRequired", + 1413: "SCDevicePrevProvisioned", + 1414: "SCDeviceNoProvision", + 1415: "SCDeviceProvisionViaDevice", + 1416: "SCRevokeCurrentDevice", + 1417: "SCRevokeLastDevice", + 1418: "SCDeviceProvisionOffline", + 1419: "SCRevokeLastDevicePGP", + 1501: "SCStreamExists", + 1502: "SCStreamNotFound", + 1503: "SCStreamWrongKind", + 1504: "SCStreamEOF", + 1505: "SCStreamUnknown", + 1600: "SCGenericAPIError", + 1601: "SCAPINetworkError", + 1602: "SCTimeout", + 1701: "SCProofError", + 1702: "SCIdentificationExpired", + 1703: "SCSelfNotFound", + 1704: "SCBadKexPhrase", + 1705: "SCNoUIDelegation", + 1706: "SCNoUI", + 1707: "SCGPGUnavailable", + 1800: "SCInvalidVersionError", + 1801: "SCOldVersionError", + 1802: "SCInvalidLocationError", + 1803: "SCServiceStatusError", + 1804: "SCInstallError", + 1810: "SCLoadKextError", + 1811: "SCLoadKextPermError", + 2300: "SCGitInternal", + 2301: "SCGitRepoAlreadyExists", + 2302: "SCGitInvalidRepoName", + 2303: "SCGitCannotDelete", + 2304: "SCGitRepoDoesntExist", + 2400: "SCLoginStateTimeout", + 2500: "SCChatInternal", + 2501: "SCChatRateLimit", + 2502: "SCChatConvExists", + 2503: "SCChatUnknownTLFID", + 2504: "SCChatNotInConv", + 2505: "SCChatBadMsg", + 2506: "SCChatBroadcast", + 2507: "SCChatAlreadySuperseded", + 2508: "SCChatAlreadyDeleted", + 2509: "SCChatTLFFinalized", + 2510: "SCChatCollision", + 2511: "SCIdentifySummaryError", + 2512: "SCNeedSelfRekey", + 2513: "SCNeedOtherRekey", + 2514: "SCChatMessageCollision", + 2515: "SCChatDuplicateMessage", + 2516: "SCChatClientError", + 2517: "SCChatNotInTeam", + 2518: "SCChatStalePreviousState", + 2519: "SCChatEphemeralRetentionPolicyViolatedError", + 2604: "SCTeamBadMembership", + 2607: "SCTeamSelfNotOwner", + 2614: "SCTeamNotFound", + 2619: "SCTeamExists", + 2623: "SCTeamReadError", + 2625: "SCTeamWritePermDenied", + 2634: "SCTeamBadGeneration", + 2638: "SCNoOp", + 2645: "SCTeamInviteBadCancel", + 2646: "SCTeamInviteBadToken", + 2663: "SCTeamTarDuplicate", + 2664: "SCTeamTarNotFound", + 2665: "SCTeamMemberExists", + 2666: "SCTeamNotReleased", + 2667: "SCTeamPermanentlyLeft", + 2668: "SCTeamNeedRootId", + 2669: "SCTeamHasLiveChildren", + 2670: "SCTeamDeleteError", + 2671: "SCTeamBadRootTeam", + 2672: "SCTeamNameConflictsWithUser", + 2673: "SCTeamDeleteNoUpPointer", + 2674: "SCTeamNeedOwner", + 2675: "SCTeamNoOwnerAllowed", + 2676: "SCTeamImplicitNoNonSbs", + 2677: "SCTeamImplicitBadHash", + 2678: "SCTeamImplicitBadName", + 2679: "SCTeamImplicitClash", + 2680: "SCTeamImplicitDuplicate", + 2681: "SCTeamImplicitBadOp", + 2682: "SCTeamImplicitBadRole", + 2683: "SCTeamImplicitNotFound", + 2684: "SCTeamBadAdminSeqnoType", + 2685: "SCTeamImplicitBadAdd", + 2686: "SCTeamImplicitBadRemove", + 2696: "SCTeamInviteTokenReused", + 2697: "SCTeamKeyMaskNotFound", + 2702: "SCTeamBanned", + 2703: "SCTeamInvalidBan", + 2711: "SCTeamShowcasePermDenied", + 2721: "SCTeamProvisionalCanKey", + 2722: "SCTeamProvisionalCannotKey", + 2736: "SCTeamFTLOutdated", + 2760: "SCTeamStorageWrongRevision", + 2761: "SCTeamStorageBadGeneration", + 2762: "SCTeamStorageNotFound", + 2763: "SCTeamContactSettingsBlock", + 2900: "SCEphemeralKeyBadGeneration", + 2901: "SCEphemeralKeyUnexpectedBox", + 2902: "SCEphemeralKeyMissingBox", + 2903: "SCEphemeralKeyWrongNumberOfKeys", + 2904: "SCEphemeralKeyMismatchedKey", + 2905: "SCEphemeralPairwiseMACsMissingUIDs", + 2906: "SCEphemeralDeviceAfterEK", + 2907: "SCEphemeralMemberAfterEK", + 2908: "SCEphemeralDeviceStale", + 2909: "SCEphemeralUserStale", + 3100: "SCStellarError", + 3101: "SCStellarBadInput", + 3102: "SCStellarWrongRevision", + 3103: "SCStellarMissingBundle", + 3104: "SCStellarBadPuk", + 3105: "SCStellarMissingAccount", + 3106: "SCStellarBadPrev", + 3107: "SCStellarWrongPrimary", + 3108: "SCStellarUnsupportedCurrency", + 3109: "SCStellarNeedDisclaimer", + 3110: "SCStellarDeviceNotMobile", + 3111: "SCStellarMobileOnlyPurgatory", + 3112: "SCStellarIncompatibleVersion", + 3201: "SCNISTWrongSize", + 3202: "SCNISTBadMode", + 3203: "SCNISTHashWrongSize", + 3204: "SCNISTSigWrongSize", + 3205: "SCNISTSigBadInput", + 3206: "SCNISTSigBadUID", + 3207: "SCNISTSigBadDeviceID", + 3208: "SCNISTSigBadNonce", + 3209: "SCNISTNoSigOrHash", + 3210: "SCNISTExpired", + 3211: "SCNISTSigRevoked", + 3212: "SCNISTKeyRevoked", + 3213: "SCNISTUserDeleted", + 3214: "SCNISTNoDevice", + 3215: "SCNISTSigCannot_verify", + 3216: "SCNISTReplay", + 3217: "SCNISTSigBadLifetime", + 3218: "SCNISTNotFound", + 3219: "SCNISTBadClock", + 3220: "SCNISTSigBadCtime", + 3221: "SCBadSignupUsernameDeleted", + 3400: "SCPhoneNumberUnknown", + 3401: "SCPhoneNumberAlreadyVerified", + 3402: "SCPhoneNumberVerificationCodeExpired", + 3403: "SCPhoneNumberWrongVerificationCode", + 3404: "SCPhoneNumberLimitExceeded", + 3605: "SCNoPaperKeys", + 3800: "SCTeambotKeyGenerationExists", + 3801: "SCTeambotKeyOldBoxedGeneration", + 3802: "SCTeambotKeyBadGeneration", + 4207: "SCAirdropRegisterFailedMisc", +} + +func (e StatusCode) String() string { + if v, ok := StatusCodeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/contacts.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/contacts.go new file mode 100644 index 00000000..6853945c --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/contacts.go @@ -0,0 +1,127 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/contacts.avdl + +package keybase1 + +type ContactComponent struct { + Label string `codec:"label" json:"label"` + PhoneNumber *RawPhoneNumber `codec:"phoneNumber,omitempty" json:"phoneNumber,omitempty"` + Email *EmailAddress `codec:"email,omitempty" json:"email,omitempty"` +} + +func (o ContactComponent) DeepCopy() ContactComponent { + return ContactComponent{ + Label: o.Label, + PhoneNumber: (func(x *RawPhoneNumber) *RawPhoneNumber { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.PhoneNumber), + Email: (func(x *EmailAddress) *EmailAddress { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Email), + } +} + +type Contact struct { + Name string `codec:"name" json:"name"` + Components []ContactComponent `codec:"components" json:"components"` +} + +func (o Contact) DeepCopy() Contact { + return Contact{ + Name: o.Name, + Components: (func(x []ContactComponent) []ContactComponent { + if x == nil { + return nil + } + ret := make([]ContactComponent, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Components), + } +} + +type ProcessedContact struct { + ContactIndex int `codec:"contactIndex" json:"contactIndex"` + ContactName string `codec:"contactName" json:"contactName"` + Component ContactComponent `codec:"component" json:"component"` + Resolved bool `codec:"resolved" json:"resolved"` + Uid UID `codec:"uid" json:"uid"` + Username string `codec:"username" json:"username"` + FullName string `codec:"fullName" json:"fullName"` + Following bool `codec:"following" json:"following"` + ServiceMap map[string]string `codec:"serviceMap" json:"serviceMap"` + Assertion string `codec:"assertion" json:"assertion"` + DisplayName string `codec:"displayName" json:"displayName"` + DisplayLabel string `codec:"displayLabel" json:"displayLabel"` +} + +func (o ProcessedContact) DeepCopy() ProcessedContact { + return ProcessedContact{ + ContactIndex: o.ContactIndex, + ContactName: o.ContactName, + Component: o.Component.DeepCopy(), + Resolved: o.Resolved, + Uid: o.Uid.DeepCopy(), + Username: o.Username, + FullName: o.FullName, + Following: o.Following, + ServiceMap: (func(x map[string]string) map[string]string { + if x == nil { + return nil + } + ret := make(map[string]string, len(x)) + for k, v := range x { + kCopy := k + vCopy := v + ret[kCopy] = vCopy + } + return ret + })(o.ServiceMap), + Assertion: o.Assertion, + DisplayName: o.DisplayName, + DisplayLabel: o.DisplayLabel, + } +} + +type ContactListResolutionResult struct { + NewlyResolved []ProcessedContact `codec:"newlyResolved" json:"newlyResolved"` + Resolved []ProcessedContact `codec:"resolved" json:"resolved"` +} + +func (o ContactListResolutionResult) DeepCopy() ContactListResolutionResult { + return ContactListResolutionResult{ + NewlyResolved: (func(x []ProcessedContact) []ProcessedContact { + if x == nil { + return nil + } + ret := make([]ProcessedContact, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.NewlyResolved), + Resolved: (func(x []ProcessedContact) []ProcessedContact { + if x == nil { + return nil + } + ret := make([]ProcessedContact, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Resolved), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/crypto.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/crypto.go new file mode 100644 index 00000000..3a492fa0 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/crypto.go @@ -0,0 +1,86 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/crypto.avdl + +package keybase1 + +type ED25519PublicKey [32]byte + +func (o ED25519PublicKey) DeepCopy() ED25519PublicKey { + var ret ED25519PublicKey + copy(ret[:], o[:]) + return ret +} + +type ED25519Signature [64]byte + +func (o ED25519Signature) DeepCopy() ED25519Signature { + var ret ED25519Signature + copy(ret[:], o[:]) + return ret +} + +type ED25519SignatureInfo struct { + Sig ED25519Signature `codec:"sig" json:"sig"` + PublicKey ED25519PublicKey `codec:"publicKey" json:"publicKey"` +} + +func (o ED25519SignatureInfo) DeepCopy() ED25519SignatureInfo { + return ED25519SignatureInfo{ + Sig: o.Sig.DeepCopy(), + PublicKey: o.PublicKey.DeepCopy(), + } +} + +type EncryptedBytes32 [48]byte + +func (o EncryptedBytes32) DeepCopy() EncryptedBytes32 { + var ret EncryptedBytes32 + copy(ret[:], o[:]) + return ret +} + +type BoxNonce [24]byte + +func (o BoxNonce) DeepCopy() BoxNonce { + var ret BoxNonce + copy(ret[:], o[:]) + return ret +} + +type BoxPublicKey [32]byte + +func (o BoxPublicKey) DeepCopy() BoxPublicKey { + var ret BoxPublicKey + copy(ret[:], o[:]) + return ret +} + +type CiphertextBundle struct { + Kid KID `codec:"kid" json:"kid"` + Ciphertext EncryptedBytes32 `codec:"ciphertext" json:"ciphertext"` + Nonce BoxNonce `codec:"nonce" json:"nonce"` + PublicKey BoxPublicKey `codec:"publicKey" json:"publicKey"` +} + +func (o CiphertextBundle) DeepCopy() CiphertextBundle { + return CiphertextBundle{ + Kid: o.Kid.DeepCopy(), + Ciphertext: o.Ciphertext.DeepCopy(), + Nonce: o.Nonce.DeepCopy(), + PublicKey: o.PublicKey.DeepCopy(), + } +} + +type UnboxAnyRes struct { + Kid KID `codec:"kid" json:"kid"` + Plaintext Bytes32 `codec:"plaintext" json:"plaintext"` + Index int `codec:"index" json:"index"` +} + +func (o UnboxAnyRes) DeepCopy() UnboxAnyRes { + return UnboxAnyRes{ + Kid: o.Kid.DeepCopy(), + Plaintext: o.Plaintext.DeepCopy(), + Index: o.Index, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/cryptocurrency.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/cryptocurrency.go new file mode 100644 index 00000000..477357e7 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/cryptocurrency.go @@ -0,0 +1,16 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/cryptocurrency.avdl + +package keybase1 + +type RegisterAddressRes struct { + Type string `codec:"type" json:"type"` + Family string `codec:"family" json:"family"` +} + +func (o RegisterAddressRes) DeepCopy() RegisterAddressRes { + return RegisterAddressRes{ + Type: o.Type, + Family: o.Family, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/ctl.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/ctl.go new file mode 100644 index 00000000..1621930d --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/ctl.go @@ -0,0 +1,129 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/ctl.avdl + +package keybase1 + +import ( + "fmt" +) + +type ExitCode int + +const ( + ExitCode_OK ExitCode = 0 + ExitCode_NOTOK ExitCode = 2 + ExitCode_RESTART ExitCode = 4 +) + +func (o ExitCode) DeepCopy() ExitCode { return o } + +var ExitCodeMap = map[string]ExitCode{ + "OK": 0, + "NOTOK": 2, + "RESTART": 4, +} + +var ExitCodeRevMap = map[ExitCode]string{ + 0: "OK", + 2: "NOTOK", + 4: "RESTART", +} + +func (e ExitCode) String() string { + if v, ok := ExitCodeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type DbType int + +const ( + DbType_MAIN DbType = 0 + DbType_CHAT DbType = 1 + DbType_FS_BLOCK_CACHE DbType = 2 + DbType_FS_BLOCK_CACHE_META DbType = 3 + DbType_FS_SYNC_BLOCK_CACHE DbType = 4 + DbType_FS_SYNC_BLOCK_CACHE_META DbType = 5 +) + +func (o DbType) DeepCopy() DbType { return o } + +var DbTypeMap = map[string]DbType{ + "MAIN": 0, + "CHAT": 1, + "FS_BLOCK_CACHE": 2, + "FS_BLOCK_CACHE_META": 3, + "FS_SYNC_BLOCK_CACHE": 4, + "FS_SYNC_BLOCK_CACHE_META": 5, +} + +var DbTypeRevMap = map[DbType]string{ + 0: "MAIN", + 1: "CHAT", + 2: "FS_BLOCK_CACHE", + 3: "FS_BLOCK_CACHE_META", + 4: "FS_SYNC_BLOCK_CACHE", + 5: "FS_SYNC_BLOCK_CACHE_META", +} + +func (e DbType) String() string { + if v, ok := DbTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type DbKey struct { + DbType DbType `codec:"dbType" json:"dbType"` + ObjType int `codec:"objType" json:"objType"` + Key string `codec:"key" json:"key"` +} + +func (o DbKey) DeepCopy() DbKey { + return DbKey{ + DbType: o.DbType.DeepCopy(), + ObjType: o.ObjType, + Key: o.Key, + } +} + +type DbValue []byte + +func (o DbValue) DeepCopy() DbValue { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type OnLoginStartupStatus int + +const ( + OnLoginStartupStatus_UNKNOWN OnLoginStartupStatus = 0 + OnLoginStartupStatus_DISABLED OnLoginStartupStatus = 1 + OnLoginStartupStatus_ENABLED OnLoginStartupStatus = 2 +) + +func (o OnLoginStartupStatus) DeepCopy() OnLoginStartupStatus { return o } + +var OnLoginStartupStatusMap = map[string]OnLoginStartupStatus{ + "UNKNOWN": 0, + "DISABLED": 1, + "ENABLED": 2, +} + +var OnLoginStartupStatusRevMap = map[OnLoginStartupStatus]string{ + 0: "UNKNOWN", + 1: "DISABLED", + 2: "ENABLED", +} + +func (e OnLoginStartupStatus) String() string { + if v, ok := OnLoginStartupStatusRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/debugging.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/debugging.go new file mode 100644 index 00000000..220cd124 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/debugging.go @@ -0,0 +1,14 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/debugging.avdl + +package keybase1 + +type FirstStepResult struct { + ValPlusTwo int `codec:"valPlusTwo" json:"valPlusTwo"` +} + +func (o FirstStepResult) DeepCopy() FirstStepResult { + return FirstStepResult{ + ValPlusTwo: o.ValPlusTwo, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/delegate_ui_ctl.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/delegate_ui_ctl.go new file mode 100644 index 00000000..527d6fbf --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/delegate_ui_ctl.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/delegate_ui_ctl.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/device.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/device.go new file mode 100644 index 00000000..ada7469f --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/device.go @@ -0,0 +1,52 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/device.avdl + +package keybase1 + +type DeviceDetail struct { + Device Device `codec:"device" json:"device"` + Eldest bool `codec:"eldest" json:"eldest"` + Provisioner *Device `codec:"provisioner,omitempty" json:"provisioner,omitempty"` + ProvisionedAt *Time `codec:"provisionedAt,omitempty" json:"provisionedAt,omitempty"` + RevokedAt *Time `codec:"revokedAt,omitempty" json:"revokedAt,omitempty"` + RevokedBy KID `codec:"revokedBy" json:"revokedBy"` + RevokedByDevice *Device `codec:"revokedByDevice,omitempty" json:"revokedByDevice,omitempty"` + CurrentDevice bool `codec:"currentDevice" json:"currentDevice"` +} + +func (o DeviceDetail) DeepCopy() DeviceDetail { + return DeviceDetail{ + Device: o.Device.DeepCopy(), + Eldest: o.Eldest, + Provisioner: (func(x *Device) *Device { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Provisioner), + ProvisionedAt: (func(x *Time) *Time { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ProvisionedAt), + RevokedAt: (func(x *Time) *Time { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RevokedAt), + RevokedBy: o.RevokedBy.DeepCopy(), + RevokedByDevice: (func(x *Device) *Device { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RevokedByDevice), + CurrentDevice: o.CurrentDevice, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/emails.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/emails.go new file mode 100644 index 00000000..4fddd5de --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/emails.go @@ -0,0 +1,42 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/emails.avdl + +package keybase1 + +type EmailLookupResult struct { + Email EmailAddress `codec:"email" json:"email"` + Uid *UID `codec:"uid,omitempty" json:"uid,omitempty"` +} + +func (o EmailLookupResult) DeepCopy() EmailLookupResult { + return EmailLookupResult{ + Email: o.Email.DeepCopy(), + Uid: (func(x *UID) *UID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Uid), + } +} + +type EmailAddressVerifiedMsg struct { + Email EmailAddress `codec:"email" json:"email"` +} + +func (o EmailAddressVerifiedMsg) DeepCopy() EmailAddressVerifiedMsg { + return EmailAddressVerifiedMsg{ + Email: o.Email.DeepCopy(), + } +} + +type EmailAddressChangedMsg struct { + Email EmailAddress `codec:"email" json:"email"` +} + +func (o EmailAddressChangedMsg) DeepCopy() EmailAddressChangedMsg { + return EmailAddressChangedMsg{ + Email: o.Email.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/ephemeral.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/ephemeral.go new file mode 100644 index 00000000..def4172c --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/ephemeral.go @@ -0,0 +1,423 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/ephemeral.avdl + +package keybase1 + +import ( + "errors" + "fmt" +) + +type EkGeneration int64 + +func (o EkGeneration) DeepCopy() EkGeneration { + return o +} + +type DeviceEkMetadata struct { + Kid KID `codec:"kid" json:"device_ephemeral_dh_public"` + HashMeta HashMeta `codec:"hashMeta" json:"hash_meta"` + Generation EkGeneration `codec:"generation" json:"generation"` + Ctime Time `codec:"ctime" json:"ctime"` + DeviceCtime Time `codec:"deviceCtime" json:"deviceCtime"` +} + +func (o DeviceEkMetadata) DeepCopy() DeviceEkMetadata { + return DeviceEkMetadata{ + Kid: o.Kid.DeepCopy(), + HashMeta: o.HashMeta.DeepCopy(), + Generation: o.Generation.DeepCopy(), + Ctime: o.Ctime.DeepCopy(), + DeviceCtime: o.DeviceCtime.DeepCopy(), + } +} + +type DeviceEkStatement struct { + CurrentDeviceEkMetadata DeviceEkMetadata `codec:"currentDeviceEkMetadata" json:"current_device_ek_metadata"` +} + +func (o DeviceEkStatement) DeepCopy() DeviceEkStatement { + return DeviceEkStatement{ + CurrentDeviceEkMetadata: o.CurrentDeviceEkMetadata.DeepCopy(), + } +} + +type DeviceEk struct { + Seed Bytes32 `codec:"seed" json:"seed"` + Metadata DeviceEkMetadata `codec:"metadata" json:"metadata"` +} + +func (o DeviceEk) DeepCopy() DeviceEk { + return DeviceEk{ + Seed: o.Seed.DeepCopy(), + Metadata: o.Metadata.DeepCopy(), + } +} + +type UserEkStatement struct { + CurrentUserEkMetadata UserEkMetadata `codec:"currentUserEkMetadata" json:"current_user_ek_metadata"` +} + +func (o UserEkStatement) DeepCopy() UserEkStatement { + return UserEkStatement{ + CurrentUserEkMetadata: o.CurrentUserEkMetadata.DeepCopy(), + } +} + +type UserEkMetadata struct { + Kid KID `codec:"kid" json:"user_ephemeral_dh_public"` + HashMeta HashMeta `codec:"hashMeta" json:"hash_meta"` + Generation EkGeneration `codec:"generation" json:"generation"` + Ctime Time `codec:"ctime" json:"ctime"` +} + +func (o UserEkMetadata) DeepCopy() UserEkMetadata { + return UserEkMetadata{ + Kid: o.Kid.DeepCopy(), + HashMeta: o.HashMeta.DeepCopy(), + Generation: o.Generation.DeepCopy(), + Ctime: o.Ctime.DeepCopy(), + } +} + +type UserEkBoxed struct { + Box string `codec:"box" json:"box"` + DeviceEkGeneration EkGeneration `codec:"deviceEkGeneration" json:"device_ek_generation"` + Metadata UserEkMetadata `codec:"metadata" json:"metadata"` +} + +func (o UserEkBoxed) DeepCopy() UserEkBoxed { + return UserEkBoxed{ + Box: o.Box, + DeviceEkGeneration: o.DeviceEkGeneration.DeepCopy(), + Metadata: o.Metadata.DeepCopy(), + } +} + +type UserEkBoxMetadata struct { + Box string `codec:"box" json:"box"` + RecipientGeneration EkGeneration `codec:"recipientGeneration" json:"recipient_generation"` + RecipientDeviceID DeviceID `codec:"recipientDeviceID" json:"recipient_device_id"` +} + +func (o UserEkBoxMetadata) DeepCopy() UserEkBoxMetadata { + return UserEkBoxMetadata{ + Box: o.Box, + RecipientGeneration: o.RecipientGeneration.DeepCopy(), + RecipientDeviceID: o.RecipientDeviceID.DeepCopy(), + } +} + +type UserEk struct { + Seed Bytes32 `codec:"seed" json:"seed"` + Metadata UserEkMetadata `codec:"metadata" json:"metadata"` +} + +func (o UserEk) DeepCopy() UserEk { + return UserEk{ + Seed: o.Seed.DeepCopy(), + Metadata: o.Metadata.DeepCopy(), + } +} + +type UserEkReboxArg struct { + UserEkBoxMetadata UserEkBoxMetadata `codec:"userEkBoxMetadata" json:"userEkBoxMetadata"` + DeviceID DeviceID `codec:"deviceID" json:"deviceID"` + DeviceEkStatementSig string `codec:"deviceEkStatementSig" json:"deviceEkStatementSig"` +} + +func (o UserEkReboxArg) DeepCopy() UserEkReboxArg { + return UserEkReboxArg{ + UserEkBoxMetadata: o.UserEkBoxMetadata.DeepCopy(), + DeviceID: o.DeviceID.DeepCopy(), + DeviceEkStatementSig: o.DeviceEkStatementSig, + } +} + +type TeamEkMetadata struct { + Kid KID `codec:"kid" json:"team_ephemeral_dh_public"` + HashMeta HashMeta `codec:"hashMeta" json:"hash_meta"` + Generation EkGeneration `codec:"generation" json:"generation"` + Ctime Time `codec:"ctime" json:"ctime"` +} + +func (o TeamEkMetadata) DeepCopy() TeamEkMetadata { + return TeamEkMetadata{ + Kid: o.Kid.DeepCopy(), + HashMeta: o.HashMeta.DeepCopy(), + Generation: o.Generation.DeepCopy(), + Ctime: o.Ctime.DeepCopy(), + } +} + +type TeamEkStatement struct { + CurrentTeamEkMetadata TeamEkMetadata `codec:"currentTeamEkMetadata" json:"current_team_ek_metadata"` +} + +func (o TeamEkStatement) DeepCopy() TeamEkStatement { + return TeamEkStatement{ + CurrentTeamEkMetadata: o.CurrentTeamEkMetadata.DeepCopy(), + } +} + +type TeamEkBoxed struct { + Box string `codec:"box" json:"box"` + UserEkGeneration EkGeneration `codec:"userEkGeneration" json:"user_ek_generation"` + Metadata TeamEkMetadata `codec:"metadata" json:"metadata"` +} + +func (o TeamEkBoxed) DeepCopy() TeamEkBoxed { + return TeamEkBoxed{ + Box: o.Box, + UserEkGeneration: o.UserEkGeneration.DeepCopy(), + Metadata: o.Metadata.DeepCopy(), + } +} + +type TeamEkBoxMetadata struct { + Box string `codec:"box" json:"box"` + RecipientGeneration EkGeneration `codec:"recipientGeneration" json:"recipient_generation"` + RecipientUID UID `codec:"recipientUID" json:"recipient_uid"` +} + +func (o TeamEkBoxMetadata) DeepCopy() TeamEkBoxMetadata { + return TeamEkBoxMetadata{ + Box: o.Box, + RecipientGeneration: o.RecipientGeneration.DeepCopy(), + RecipientUID: o.RecipientUID.DeepCopy(), + } +} + +type TeamEk struct { + Seed Bytes32 `codec:"seed" json:"seed"` + Metadata TeamEkMetadata `codec:"metadata" json:"metadata"` +} + +func (o TeamEk) DeepCopy() TeamEk { + return TeamEk{ + Seed: o.Seed.DeepCopy(), + Metadata: o.Metadata.DeepCopy(), + } +} + +type TeambotEkMetadata struct { + Kid KID `codec:"kid" json:"teambot_dh_public"` + Generation EkGeneration `codec:"generation" json:"generation"` + Uid UID `codec:"uid" json:"uid"` + UserEkGeneration EkGeneration `codec:"userEkGeneration" json:"user_ek_generation"` + HashMeta HashMeta `codec:"hashMeta" json:"hash_meta"` + Ctime Time `codec:"ctime" json:"ctime"` +} + +func (o TeambotEkMetadata) DeepCopy() TeambotEkMetadata { + return TeambotEkMetadata{ + Kid: o.Kid.DeepCopy(), + Generation: o.Generation.DeepCopy(), + Uid: o.Uid.DeepCopy(), + UserEkGeneration: o.UserEkGeneration.DeepCopy(), + HashMeta: o.HashMeta.DeepCopy(), + Ctime: o.Ctime.DeepCopy(), + } +} + +type TeambotEkBoxed struct { + Box string `codec:"box" json:"box"` + Metadata TeambotEkMetadata `codec:"metadata" json:"metadata"` +} + +func (o TeambotEkBoxed) DeepCopy() TeambotEkBoxed { + return TeambotEkBoxed{ + Box: o.Box, + Metadata: o.Metadata.DeepCopy(), + } +} + +type TeambotEk struct { + Seed Bytes32 `codec:"seed" json:"seed"` + Metadata TeambotEkMetadata `codec:"metadata" json:"metadata"` +} + +func (o TeambotEk) DeepCopy() TeambotEk { + return TeambotEk{ + Seed: o.Seed.DeepCopy(), + Metadata: o.Metadata.DeepCopy(), + } +} + +type TeamEphemeralKeyType int + +const ( + TeamEphemeralKeyType_TEAM TeamEphemeralKeyType = 0 + TeamEphemeralKeyType_TEAMBOT TeamEphemeralKeyType = 1 +) + +func (o TeamEphemeralKeyType) DeepCopy() TeamEphemeralKeyType { return o } + +var TeamEphemeralKeyTypeMap = map[string]TeamEphemeralKeyType{ + "TEAM": 0, + "TEAMBOT": 1, +} + +var TeamEphemeralKeyTypeRevMap = map[TeamEphemeralKeyType]string{ + 0: "TEAM", + 1: "TEAMBOT", +} + +func (e TeamEphemeralKeyType) String() string { + if v, ok := TeamEphemeralKeyTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type TeamEphemeralKey struct { + KeyType__ TeamEphemeralKeyType `codec:"keyType" json:"keyType"` + Team__ *TeamEk `codec:"team,omitempty" json:"team,omitempty"` + Teambot__ *TeambotEk `codec:"teambot,omitempty" json:"teambot,omitempty"` +} + +func (o *TeamEphemeralKey) KeyType() (ret TeamEphemeralKeyType, err error) { + switch o.KeyType__ { + case TeamEphemeralKeyType_TEAM: + if o.Team__ == nil { + err = errors.New("unexpected nil value for Team__") + return ret, err + } + case TeamEphemeralKeyType_TEAMBOT: + if o.Teambot__ == nil { + err = errors.New("unexpected nil value for Teambot__") + return ret, err + } + } + return o.KeyType__, nil +} + +func (o TeamEphemeralKey) Team() (res TeamEk) { + if o.KeyType__ != TeamEphemeralKeyType_TEAM { + panic("wrong case accessed") + } + if o.Team__ == nil { + return + } + return *o.Team__ +} + +func (o TeamEphemeralKey) Teambot() (res TeambotEk) { + if o.KeyType__ != TeamEphemeralKeyType_TEAMBOT { + panic("wrong case accessed") + } + if o.Teambot__ == nil { + return + } + return *o.Teambot__ +} + +func NewTeamEphemeralKeyWithTeam(v TeamEk) TeamEphemeralKey { + return TeamEphemeralKey{ + KeyType__: TeamEphemeralKeyType_TEAM, + Team__: &v, + } +} + +func NewTeamEphemeralKeyWithTeambot(v TeambotEk) TeamEphemeralKey { + return TeamEphemeralKey{ + KeyType__: TeamEphemeralKeyType_TEAMBOT, + Teambot__: &v, + } +} + +func (o TeamEphemeralKey) DeepCopy() TeamEphemeralKey { + return TeamEphemeralKey{ + KeyType__: o.KeyType__.DeepCopy(), + Team__: (func(x *TeamEk) *TeamEk { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Team__), + Teambot__: (func(x *TeambotEk) *TeambotEk { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Teambot__), + } +} + +type TeamEphemeralKeyBoxed struct { + KeyType__ TeamEphemeralKeyType `codec:"keyType" json:"keyType"` + Team__ *TeamEkBoxed `codec:"team,omitempty" json:"team,omitempty"` + Teambot__ *TeambotEkBoxed `codec:"teambot,omitempty" json:"teambot,omitempty"` +} + +func (o *TeamEphemeralKeyBoxed) KeyType() (ret TeamEphemeralKeyType, err error) { + switch o.KeyType__ { + case TeamEphemeralKeyType_TEAM: + if o.Team__ == nil { + err = errors.New("unexpected nil value for Team__") + return ret, err + } + case TeamEphemeralKeyType_TEAMBOT: + if o.Teambot__ == nil { + err = errors.New("unexpected nil value for Teambot__") + return ret, err + } + } + return o.KeyType__, nil +} + +func (o TeamEphemeralKeyBoxed) Team() (res TeamEkBoxed) { + if o.KeyType__ != TeamEphemeralKeyType_TEAM { + panic("wrong case accessed") + } + if o.Team__ == nil { + return + } + return *o.Team__ +} + +func (o TeamEphemeralKeyBoxed) Teambot() (res TeambotEkBoxed) { + if o.KeyType__ != TeamEphemeralKeyType_TEAMBOT { + panic("wrong case accessed") + } + if o.Teambot__ == nil { + return + } + return *o.Teambot__ +} + +func NewTeamEphemeralKeyBoxedWithTeam(v TeamEkBoxed) TeamEphemeralKeyBoxed { + return TeamEphemeralKeyBoxed{ + KeyType__: TeamEphemeralKeyType_TEAM, + Team__: &v, + } +} + +func NewTeamEphemeralKeyBoxedWithTeambot(v TeambotEkBoxed) TeamEphemeralKeyBoxed { + return TeamEphemeralKeyBoxed{ + KeyType__: TeamEphemeralKeyType_TEAMBOT, + Teambot__: &v, + } +} + +func (o TeamEphemeralKeyBoxed) DeepCopy() TeamEphemeralKeyBoxed { + return TeamEphemeralKeyBoxed{ + KeyType__: o.KeyType__.DeepCopy(), + Team__: (func(x *TeamEkBoxed) *TeamEkBoxed { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Team__), + Teambot__: (func(x *TeambotEkBoxed) *TeambotEkBoxed { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Teambot__), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/favorite.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/favorite.go new file mode 100644 index 00000000..6f74e8d9 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/favorite.go @@ -0,0 +1,330 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/favorite.avdl + +package keybase1 + +import ( + "errors" + "fmt" +) + +type FolderType int + +const ( + FolderType_UNKNOWN FolderType = 0 + FolderType_PRIVATE FolderType = 1 + FolderType_PUBLIC FolderType = 2 + FolderType_TEAM FolderType = 3 +) + +func (o FolderType) DeepCopy() FolderType { return o } + +var FolderTypeMap = map[string]FolderType{ + "UNKNOWN": 0, + "PRIVATE": 1, + "PUBLIC": 2, + "TEAM": 3, +} + +var FolderTypeRevMap = map[FolderType]string{ + 0: "UNKNOWN", + 1: "PRIVATE", + 2: "PUBLIC", + 3: "TEAM", +} + +func (e FolderType) String() string { + if v, ok := FolderTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type FolderConflictType int + +const ( + FolderConflictType_NONE FolderConflictType = 0 + FolderConflictType_IN_CONFLICT FolderConflictType = 1 + FolderConflictType_IN_CONFLICT_AND_STUCK FolderConflictType = 2 + FolderConflictType_CLEARED_CONFLICT FolderConflictType = 3 +) + +func (o FolderConflictType) DeepCopy() FolderConflictType { return o } + +var FolderConflictTypeMap = map[string]FolderConflictType{ + "NONE": 0, + "IN_CONFLICT": 1, + "IN_CONFLICT_AND_STUCK": 2, + "CLEARED_CONFLICT": 3, +} + +var FolderConflictTypeRevMap = map[FolderConflictType]string{ + 0: "NONE", + 1: "IN_CONFLICT", + 2: "IN_CONFLICT_AND_STUCK", + 3: "CLEARED_CONFLICT", +} + +func (e FolderConflictType) String() string { + if v, ok := FolderConflictTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ConflictStateType int + +const ( + ConflictStateType_NormalView ConflictStateType = 1 + ConflictStateType_ManualResolvingLocalView ConflictStateType = 2 +) + +func (o ConflictStateType) DeepCopy() ConflictStateType { return o } + +var ConflictStateTypeMap = map[string]ConflictStateType{ + "NormalView": 1, + "ManualResolvingLocalView": 2, +} + +var ConflictStateTypeRevMap = map[ConflictStateType]string{ + 1: "NormalView", + 2: "ManualResolvingLocalView", +} + +func (e ConflictStateType) String() string { + if v, ok := ConflictStateTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type FolderNormalView struct { + ResolvingConflict bool `codec:"resolvingConflict" json:"resolvingConflict"` + StuckInConflict bool `codec:"stuckInConflict" json:"stuckInConflict"` + LocalViews []Path `codec:"localViews" json:"localViews"` +} + +func (o FolderNormalView) DeepCopy() FolderNormalView { + return FolderNormalView{ + ResolvingConflict: o.ResolvingConflict, + StuckInConflict: o.StuckInConflict, + LocalViews: (func(x []Path) []Path { + if x == nil { + return nil + } + ret := make([]Path, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.LocalViews), + } +} + +type FolderConflictManualResolvingLocalView struct { + NormalView Path `codec:"normalView" json:"normalView"` +} + +func (o FolderConflictManualResolvingLocalView) DeepCopy() FolderConflictManualResolvingLocalView { + return FolderConflictManualResolvingLocalView{ + NormalView: o.NormalView.DeepCopy(), + } +} + +type ConflictState struct { + ConflictStateType__ ConflictStateType `codec:"conflictStateType" json:"conflictStateType"` + Normalview__ *FolderNormalView `codec:"normalview,omitempty" json:"normalview,omitempty"` + Manualresolvinglocalview__ *FolderConflictManualResolvingLocalView `codec:"manualresolvinglocalview,omitempty" json:"manualresolvinglocalview,omitempty"` +} + +func (o *ConflictState) ConflictStateType() (ret ConflictStateType, err error) { + switch o.ConflictStateType__ { + case ConflictStateType_NormalView: + if o.Normalview__ == nil { + err = errors.New("unexpected nil value for Normalview__") + return ret, err + } + case ConflictStateType_ManualResolvingLocalView: + if o.Manualresolvinglocalview__ == nil { + err = errors.New("unexpected nil value for Manualresolvinglocalview__") + return ret, err + } + } + return o.ConflictStateType__, nil +} + +func (o ConflictState) Normalview() (res FolderNormalView) { + if o.ConflictStateType__ != ConflictStateType_NormalView { + panic("wrong case accessed") + } + if o.Normalview__ == nil { + return + } + return *o.Normalview__ +} + +func (o ConflictState) Manualresolvinglocalview() (res FolderConflictManualResolvingLocalView) { + if o.ConflictStateType__ != ConflictStateType_ManualResolvingLocalView { + panic("wrong case accessed") + } + if o.Manualresolvinglocalview__ == nil { + return + } + return *o.Manualresolvinglocalview__ +} + +func NewConflictStateWithNormalview(v FolderNormalView) ConflictState { + return ConflictState{ + ConflictStateType__: ConflictStateType_NormalView, + Normalview__: &v, + } +} + +func NewConflictStateWithManualresolvinglocalview(v FolderConflictManualResolvingLocalView) ConflictState { + return ConflictState{ + ConflictStateType__: ConflictStateType_ManualResolvingLocalView, + Manualresolvinglocalview__: &v, + } +} + +func (o ConflictState) DeepCopy() ConflictState { + return ConflictState{ + ConflictStateType__: o.ConflictStateType__.DeepCopy(), + Normalview__: (func(x *FolderNormalView) *FolderNormalView { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Normalview__), + Manualresolvinglocalview__: (func(x *FolderConflictManualResolvingLocalView) *FolderConflictManualResolvingLocalView { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Manualresolvinglocalview__), + } +} + +// Folder represents a favorite top-level folder in kbfs. +// This type is likely to change significantly as all the various parts are +// connected and tested. +type Folder struct { + Name string `codec:"name" json:"name"` + Private bool `codec:"private" json:"private"` + Created bool `codec:"created" json:"created"` + FolderType FolderType `codec:"folderType" json:"folderType"` + TeamID *TeamID `codec:"team_id,omitempty" json:"team_id,omitempty"` + ResetMembers []User `codec:"reset_members" json:"reset_members"` + Mtime *Time `codec:"mtime,omitempty" json:"mtime,omitempty"` + ConflictState *ConflictState `codec:"conflictState,omitempty" json:"conflictState,omitempty"` + SyncConfig *FolderSyncConfig `codec:"syncConfig,omitempty" json:"syncConfig,omitempty"` +} + +func (o Folder) DeepCopy() Folder { + return Folder{ + Name: o.Name, + Private: o.Private, + Created: o.Created, + FolderType: o.FolderType.DeepCopy(), + TeamID: (func(x *TeamID) *TeamID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.TeamID), + ResetMembers: (func(x []User) []User { + if x == nil { + return nil + } + ret := make([]User, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ResetMembers), + Mtime: (func(x *Time) *Time { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Mtime), + ConflictState: (func(x *ConflictState) *ConflictState { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ConflictState), + SyncConfig: (func(x *FolderSyncConfig) *FolderSyncConfig { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.SyncConfig), + } +} + +type FolderHandle struct { + Name string `codec:"name" json:"name"` + FolderType FolderType `codec:"folderType" json:"folderType"` + Created bool `codec:"created" json:"created"` +} + +func (o FolderHandle) DeepCopy() FolderHandle { + return FolderHandle{ + Name: o.Name, + FolderType: o.FolderType.DeepCopy(), + Created: o.Created, + } +} + +type FavoritesResult struct { + FavoriteFolders []Folder `codec:"favoriteFolders" json:"favoriteFolders"` + IgnoredFolders []Folder `codec:"ignoredFolders" json:"ignoredFolders"` + NewFolders []Folder `codec:"newFolders" json:"newFolders"` +} + +func (o FavoritesResult) DeepCopy() FavoritesResult { + return FavoritesResult{ + FavoriteFolders: (func(x []Folder) []Folder { + if x == nil { + return nil + } + ret := make([]Folder, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.FavoriteFolders), + IgnoredFolders: (func(x []Folder) []Folder { + if x == nil { + return nil + } + ret := make([]Folder, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.IgnoredFolders), + NewFolders: (func(x []Folder) []Folder { + if x == nil { + return nil + } + ret := make([]Folder, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.NewFolders), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/featured_bot.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/featured_bot.go new file mode 100644 index 00000000..d526f935 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/featured_bot.go @@ -0,0 +1,84 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/featured_bot.avdl + +package keybase1 + +type FeaturedBot struct { + BotAlias string `codec:"botAlias" json:"botAlias"` + Description string `codec:"description" json:"description"` + ExtendedDescription string `codec:"extendedDescription" json:"extendedDescription"` + BotUsername string `codec:"botUsername" json:"botUsername"` + OwnerTeam *string `codec:"ownerTeam,omitempty" json:"ownerTeam,omitempty"` + OwnerUser *string `codec:"ownerUser,omitempty" json:"ownerUser,omitempty"` + Rank int `codec:"rank" json:"rank"` + IsPromoted bool `codec:"isPromoted" json:"isPromoted"` +} + +func (o FeaturedBot) DeepCopy() FeaturedBot { + return FeaturedBot{ + BotAlias: o.BotAlias, + Description: o.Description, + ExtendedDescription: o.ExtendedDescription, + BotUsername: o.BotUsername, + OwnerTeam: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.OwnerTeam), + OwnerUser: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.OwnerUser), + Rank: o.Rank, + IsPromoted: o.IsPromoted, + } +} + +type FeaturedBotsRes struct { + Bots []FeaturedBot `codec:"bots" json:"bots"` + IsLastPage bool `codec:"isLastPage" json:"isLastPage"` +} + +func (o FeaturedBotsRes) DeepCopy() FeaturedBotsRes { + return FeaturedBotsRes{ + Bots: (func(x []FeaturedBot) []FeaturedBot { + if x == nil { + return nil + } + ret := make([]FeaturedBot, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Bots), + IsLastPage: o.IsLastPage, + } +} + +type SearchRes struct { + Bots []FeaturedBot `codec:"bots" json:"bots"` + IsLastPage bool `codec:"isLastPage" json:"isLastPage"` +} + +func (o SearchRes) DeepCopy() SearchRes { + return SearchRes{ + Bots: (func(x []FeaturedBot) []FeaturedBot { + if x == nil { + return nil + } + ret := make([]FeaturedBot, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Bots), + IsLastPage: o.IsLastPage, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/fs.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/fs.go new file mode 100644 index 00000000..ee2bdc11 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/fs.go @@ -0,0 +1,34 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/fs.avdl + +package keybase1 + +type File struct { + Path string `codec:"path" json:"path"` +} + +func (o File) DeepCopy() File { + return File{ + Path: o.Path, + } +} + +type ListResult struct { + Files []File `codec:"files" json:"files"` +} + +func (o ListResult) DeepCopy() ListResult { + return ListResult{ + Files: (func(x []File) []File { + if x == nil { + return nil + } + ret := make([]File, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Files), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/git.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/git.go new file mode 100644 index 00000000..f2283550 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/git.go @@ -0,0 +1,382 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/git.avdl + +package keybase1 + +import ( + "errors" + "fmt" +) + +type EncryptedGitMetadata struct { + V int `codec:"v" json:"v"` + E []byte `codec:"e" json:"e"` + N BoxNonce `codec:"n" json:"n"` + Gen PerTeamKeyGeneration `codec:"gen" json:"gen"` +} + +func (o EncryptedGitMetadata) DeepCopy() EncryptedGitMetadata { + return EncryptedGitMetadata{ + V: o.V, + E: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.E), + N: o.N.DeepCopy(), + Gen: o.Gen.DeepCopy(), + } +} + +type RepoID string + +func (o RepoID) DeepCopy() RepoID { + return o +} + +type GitLocalMetadataVersion int + +const ( + GitLocalMetadataVersion_V1 GitLocalMetadataVersion = 1 +) + +func (o GitLocalMetadataVersion) DeepCopy() GitLocalMetadataVersion { return o } + +var GitLocalMetadataVersionMap = map[string]GitLocalMetadataVersion{ + "V1": 1, +} + +var GitLocalMetadataVersionRevMap = map[GitLocalMetadataVersion]string{ + 1: "V1", +} + +func (e GitLocalMetadataVersion) String() string { + if v, ok := GitLocalMetadataVersionRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type GitLocalMetadataV1 struct { + RepoName GitRepoName `codec:"repoName" json:"repoName"` +} + +func (o GitLocalMetadataV1) DeepCopy() GitLocalMetadataV1 { + return GitLocalMetadataV1{ + RepoName: o.RepoName.DeepCopy(), + } +} + +type GitLocalMetadataVersioned struct { + Version__ GitLocalMetadataVersion `codec:"version" json:"version"` + V1__ *GitLocalMetadataV1 `codec:"v1,omitempty" json:"v1,omitempty"` +} + +func (o *GitLocalMetadataVersioned) Version() (ret GitLocalMetadataVersion, err error) { + switch o.Version__ { + case GitLocalMetadataVersion_V1: + if o.V1__ == nil { + err = errors.New("unexpected nil value for V1__") + return ret, err + } + } + return o.Version__, nil +} + +func (o GitLocalMetadataVersioned) V1() (res GitLocalMetadataV1) { + if o.Version__ != GitLocalMetadataVersion_V1 { + panic("wrong case accessed") + } + if o.V1__ == nil { + return + } + return *o.V1__ +} + +func NewGitLocalMetadataVersionedWithV1(v GitLocalMetadataV1) GitLocalMetadataVersioned { + return GitLocalMetadataVersioned{ + Version__: GitLocalMetadataVersion_V1, + V1__: &v, + } +} + +func (o GitLocalMetadataVersioned) DeepCopy() GitLocalMetadataVersioned { + return GitLocalMetadataVersioned{ + Version__: o.Version__.DeepCopy(), + V1__: (func(x *GitLocalMetadataV1) *GitLocalMetadataV1 { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V1__), + } +} + +type GitCommit struct { + CommitHash string `codec:"commitHash" json:"commitHash"` + Message string `codec:"message" json:"message"` + AuthorName string `codec:"authorName" json:"authorName"` + AuthorEmail string `codec:"authorEmail" json:"authorEmail"` + Ctime Time `codec:"ctime" json:"ctime"` +} + +func (o GitCommit) DeepCopy() GitCommit { + return GitCommit{ + CommitHash: o.CommitHash, + Message: o.Message, + AuthorName: o.AuthorName, + AuthorEmail: o.AuthorEmail, + Ctime: o.Ctime.DeepCopy(), + } +} + +type GitPushType int + +const ( + GitPushType_DEFAULT GitPushType = 0 + GitPushType_CREATEREPO GitPushType = 1 + GitPushType_RENAMEREPO GitPushType = 3 +) + +func (o GitPushType) DeepCopy() GitPushType { return o } + +var GitPushTypeMap = map[string]GitPushType{ + "DEFAULT": 0, + "CREATEREPO": 1, + "RENAMEREPO": 3, +} + +var GitPushTypeRevMap = map[GitPushType]string{ + 0: "DEFAULT", + 1: "CREATEREPO", + 3: "RENAMEREPO", +} + +func (e GitPushType) String() string { + if v, ok := GitPushTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type GitRefMetadata struct { + RefName string `codec:"refName" json:"refName"` + Commits []GitCommit `codec:"commits" json:"commits"` + MoreCommitsAvailable bool `codec:"moreCommitsAvailable" json:"moreCommitsAvailable"` + IsDelete bool `codec:"isDelete" json:"isDelete"` +} + +func (o GitRefMetadata) DeepCopy() GitRefMetadata { + return GitRefMetadata{ + RefName: o.RefName, + Commits: (func(x []GitCommit) []GitCommit { + if x == nil { + return nil + } + ret := make([]GitCommit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Commits), + MoreCommitsAvailable: o.MoreCommitsAvailable, + IsDelete: o.IsDelete, + } +} + +type GitLocalMetadata struct { + RepoName GitRepoName `codec:"repoName" json:"repoName"` + Refs []GitRefMetadata `codec:"refs" json:"refs"` + PushType GitPushType `codec:"pushType" json:"pushType"` + PreviousRepoName GitRepoName `codec:"previousRepoName" json:"previousRepoName"` +} + +func (o GitLocalMetadata) DeepCopy() GitLocalMetadata { + return GitLocalMetadata{ + RepoName: o.RepoName.DeepCopy(), + Refs: (func(x []GitRefMetadata) []GitRefMetadata { + if x == nil { + return nil + } + ret := make([]GitRefMetadata, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Refs), + PushType: o.PushType.DeepCopy(), + PreviousRepoName: o.PreviousRepoName.DeepCopy(), + } +} + +type GitServerMetadata struct { + Ctime Time `codec:"ctime" json:"ctime"` + Mtime Time `codec:"mtime" json:"mtime"` + LastModifyingUsername string `codec:"lastModifyingUsername" json:"lastModifyingUsername"` + LastModifyingDeviceID DeviceID `codec:"lastModifyingDeviceID" json:"lastModifyingDeviceID"` + LastModifyingDeviceName string `codec:"lastModifyingDeviceName" json:"lastModifyingDeviceName"` +} + +func (o GitServerMetadata) DeepCopy() GitServerMetadata { + return GitServerMetadata{ + Ctime: o.Ctime.DeepCopy(), + Mtime: o.Mtime.DeepCopy(), + LastModifyingUsername: o.LastModifyingUsername, + LastModifyingDeviceID: o.LastModifyingDeviceID.DeepCopy(), + LastModifyingDeviceName: o.LastModifyingDeviceName, + } +} + +type GitRepoResultState int + +const ( + GitRepoResultState_ERR GitRepoResultState = 0 + GitRepoResultState_OK GitRepoResultState = 1 +) + +func (o GitRepoResultState) DeepCopy() GitRepoResultState { return o } + +var GitRepoResultStateMap = map[string]GitRepoResultState{ + "ERR": 0, + "OK": 1, +} + +var GitRepoResultStateRevMap = map[GitRepoResultState]string{ + 0: "ERR", + 1: "OK", +} + +func (e GitRepoResultState) String() string { + if v, ok := GitRepoResultStateRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type GitRepoResult struct { + State__ GitRepoResultState `codec:"state" json:"state"` + Err__ *string `codec:"err,omitempty" json:"err,omitempty"` + Ok__ *GitRepoInfo `codec:"ok,omitempty" json:"ok,omitempty"` +} + +func (o *GitRepoResult) State() (ret GitRepoResultState, err error) { + switch o.State__ { + case GitRepoResultState_ERR: + if o.Err__ == nil { + err = errors.New("unexpected nil value for Err__") + return ret, err + } + case GitRepoResultState_OK: + if o.Ok__ == nil { + err = errors.New("unexpected nil value for Ok__") + return ret, err + } + } + return o.State__, nil +} + +func (o GitRepoResult) Err() (res string) { + if o.State__ != GitRepoResultState_ERR { + panic("wrong case accessed") + } + if o.Err__ == nil { + return + } + return *o.Err__ +} + +func (o GitRepoResult) Ok() (res GitRepoInfo) { + if o.State__ != GitRepoResultState_OK { + panic("wrong case accessed") + } + if o.Ok__ == nil { + return + } + return *o.Ok__ +} + +func NewGitRepoResultWithErr(v string) GitRepoResult { + return GitRepoResult{ + State__: GitRepoResultState_ERR, + Err__: &v, + } +} + +func NewGitRepoResultWithOk(v GitRepoInfo) GitRepoResult { + return GitRepoResult{ + State__: GitRepoResultState_OK, + Ok__: &v, + } +} + +func (o GitRepoResult) DeepCopy() GitRepoResult { + return GitRepoResult{ + State__: o.State__.DeepCopy(), + Err__: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Err__), + Ok__: (func(x *GitRepoInfo) *GitRepoInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Ok__), + } +} + +type GitRepoInfo struct { + Folder FolderHandle `codec:"folder" json:"folder"` + RepoID RepoID `codec:"repoID" json:"repoID"` + LocalMetadata GitLocalMetadata `codec:"localMetadata" json:"localMetadata"` + ServerMetadata GitServerMetadata `codec:"serverMetadata" json:"serverMetadata"` + RepoUrl string `codec:"repoUrl" json:"repoUrl"` + GlobalUniqueID string `codec:"globalUniqueID" json:"globalUniqueID"` + CanDelete bool `codec:"canDelete" json:"canDelete"` + TeamRepoSettings *GitTeamRepoSettings `codec:"teamRepoSettings,omitempty" json:"teamRepoSettings,omitempty"` +} + +func (o GitRepoInfo) DeepCopy() GitRepoInfo { + return GitRepoInfo{ + Folder: o.Folder.DeepCopy(), + RepoID: o.RepoID.DeepCopy(), + LocalMetadata: o.LocalMetadata.DeepCopy(), + ServerMetadata: o.ServerMetadata.DeepCopy(), + RepoUrl: o.RepoUrl, + GlobalUniqueID: o.GlobalUniqueID, + CanDelete: o.CanDelete, + TeamRepoSettings: (func(x *GitTeamRepoSettings) *GitTeamRepoSettings { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.TeamRepoSettings), + } +} + +type GitTeamRepoSettings struct { + ChannelName *string `codec:"channelName,omitempty" json:"channelName,omitempty"` + ChatDisabled bool `codec:"chatDisabled" json:"chatDisabled"` +} + +func (o GitTeamRepoSettings) DeepCopy() GitTeamRepoSettings { + return GitTeamRepoSettings{ + ChannelName: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.ChannelName), + ChatDisabled: o.ChatDisabled, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/gpg_common.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/gpg_common.go new file mode 100644 index 00000000..d351b2b3 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/gpg_common.go @@ -0,0 +1,32 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/gpg_common.avdl + +package keybase1 + +type GPGKey struct { + Algorithm string `codec:"algorithm" json:"algorithm"` + KeyID string `codec:"keyID" json:"keyID"` + Creation string `codec:"creation" json:"creation"` + Expiration string `codec:"expiration" json:"expiration"` + Identities []PGPIdentity `codec:"identities" json:"identities"` +} + +func (o GPGKey) DeepCopy() GPGKey { + return GPGKey{ + Algorithm: o.Algorithm, + KeyID: o.KeyID, + Creation: o.Creation, + Expiration: o.Expiration, + Identities: (func(x []PGPIdentity) []PGPIdentity { + if x == nil { + return nil + } + ret := make([]PGPIdentity, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Identities), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/gpg_ui.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/gpg_ui.go new file mode 100644 index 00000000..ca7b6b54 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/gpg_ui.go @@ -0,0 +1,16 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/gpg_ui.avdl + +package keybase1 + +type SelectKeyRes struct { + KeyID string `codec:"keyID" json:"keyID"` + DoSecretPush bool `codec:"doSecretPush" json:"doSecretPush"` +} + +func (o SelectKeyRes) DeepCopy() SelectKeyRes { + return SelectKeyRes{ + KeyID: o.KeyID, + DoSecretPush: o.DoSecretPush, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/gregor.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/gregor.go new file mode 100644 index 00000000..c1a15270 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/gregor.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/gregor.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/gregor_ui.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/gregor_ui.go new file mode 100644 index 00000000..5d9ce81e --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/gregor_ui.go @@ -0,0 +1,37 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/gregor_ui.avdl + +package keybase1 + +import ( + "fmt" +) + +type PushReason int + +const ( + PushReason_NONE PushReason = 0 + PushReason_RECONNECTED PushReason = 1 + PushReason_NEW_DATA PushReason = 2 +) + +func (o PushReason) DeepCopy() PushReason { return o } + +var PushReasonMap = map[string]PushReason{ + "NONE": 0, + "RECONNECTED": 1, + "NEW_DATA": 2, +} + +var PushReasonRevMap = map[PushReason]string{ + 0: "NONE", + 1: "RECONNECTED", + 2: "NEW_DATA", +} + +func (e PushReason) String() string { + if v, ok := PushReasonRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/home.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/home.go new file mode 100644 index 00000000..ad9ddf89 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/home.go @@ -0,0 +1,884 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/home.avdl + +package keybase1 + +import ( + "errors" + "fmt" +) + +type HomeScreenItemID string + +func (o HomeScreenItemID) DeepCopy() HomeScreenItemID { + return o +} + +type HomeScreenItemType int + +const ( + HomeScreenItemType_TODO HomeScreenItemType = 1 + HomeScreenItemType_PEOPLE HomeScreenItemType = 2 + HomeScreenItemType_ANNOUNCEMENT HomeScreenItemType = 3 +) + +func (o HomeScreenItemType) DeepCopy() HomeScreenItemType { return o } + +var HomeScreenItemTypeMap = map[string]HomeScreenItemType{ + "TODO": 1, + "PEOPLE": 2, + "ANNOUNCEMENT": 3, +} + +var HomeScreenItemTypeRevMap = map[HomeScreenItemType]string{ + 1: "TODO", + 2: "PEOPLE", + 3: "ANNOUNCEMENT", +} + +func (e HomeScreenItemType) String() string { + if v, ok := HomeScreenItemTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type HomeScreenItemData struct { + T__ HomeScreenItemType `codec:"t" json:"t"` + Todo__ *HomeScreenTodo `codec:"todo,omitempty" json:"todo,omitempty"` + People__ *HomeScreenPeopleNotification `codec:"people,omitempty" json:"people,omitempty"` + Announcement__ *HomeScreenAnnouncement `codec:"announcement,omitempty" json:"announcement,omitempty"` +} + +func (o *HomeScreenItemData) T() (ret HomeScreenItemType, err error) { + switch o.T__ { + case HomeScreenItemType_TODO: + if o.Todo__ == nil { + err = errors.New("unexpected nil value for Todo__") + return ret, err + } + case HomeScreenItemType_PEOPLE: + if o.People__ == nil { + err = errors.New("unexpected nil value for People__") + return ret, err + } + case HomeScreenItemType_ANNOUNCEMENT: + if o.Announcement__ == nil { + err = errors.New("unexpected nil value for Announcement__") + return ret, err + } + } + return o.T__, nil +} + +func (o HomeScreenItemData) Todo() (res HomeScreenTodo) { + if o.T__ != HomeScreenItemType_TODO { + panic("wrong case accessed") + } + if o.Todo__ == nil { + return + } + return *o.Todo__ +} + +func (o HomeScreenItemData) People() (res HomeScreenPeopleNotification) { + if o.T__ != HomeScreenItemType_PEOPLE { + panic("wrong case accessed") + } + if o.People__ == nil { + return + } + return *o.People__ +} + +func (o HomeScreenItemData) Announcement() (res HomeScreenAnnouncement) { + if o.T__ != HomeScreenItemType_ANNOUNCEMENT { + panic("wrong case accessed") + } + if o.Announcement__ == nil { + return + } + return *o.Announcement__ +} + +func NewHomeScreenItemDataWithTodo(v HomeScreenTodo) HomeScreenItemData { + return HomeScreenItemData{ + T__: HomeScreenItemType_TODO, + Todo__: &v, + } +} + +func NewHomeScreenItemDataWithPeople(v HomeScreenPeopleNotification) HomeScreenItemData { + return HomeScreenItemData{ + T__: HomeScreenItemType_PEOPLE, + People__: &v, + } +} + +func NewHomeScreenItemDataWithAnnouncement(v HomeScreenAnnouncement) HomeScreenItemData { + return HomeScreenItemData{ + T__: HomeScreenItemType_ANNOUNCEMENT, + Announcement__: &v, + } +} + +func NewHomeScreenItemDataDefault(t HomeScreenItemType) HomeScreenItemData { + return HomeScreenItemData{ + T__: t, + } +} + +func (o HomeScreenItemData) DeepCopy() HomeScreenItemData { + return HomeScreenItemData{ + T__: o.T__.DeepCopy(), + Todo__: (func(x *HomeScreenTodo) *HomeScreenTodo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Todo__), + People__: (func(x *HomeScreenPeopleNotification) *HomeScreenPeopleNotification { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.People__), + Announcement__: (func(x *HomeScreenAnnouncement) *HomeScreenAnnouncement { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Announcement__), + } +} + +type HomeScreenItemDataExt struct { + T__ HomeScreenItemType `codec:"t" json:"t"` + Todo__ *HomeScreenTodoExt `codec:"todo,omitempty" json:"todo,omitempty"` +} + +func (o *HomeScreenItemDataExt) T() (ret HomeScreenItemType, err error) { + switch o.T__ { + case HomeScreenItemType_TODO: + if o.Todo__ == nil { + err = errors.New("unexpected nil value for Todo__") + return ret, err + } + } + return o.T__, nil +} + +func (o HomeScreenItemDataExt) Todo() (res HomeScreenTodoExt) { + if o.T__ != HomeScreenItemType_TODO { + panic("wrong case accessed") + } + if o.Todo__ == nil { + return + } + return *o.Todo__ +} + +func NewHomeScreenItemDataExtWithTodo(v HomeScreenTodoExt) HomeScreenItemDataExt { + return HomeScreenItemDataExt{ + T__: HomeScreenItemType_TODO, + Todo__: &v, + } +} + +func NewHomeScreenItemDataExtDefault(t HomeScreenItemType) HomeScreenItemDataExt { + return HomeScreenItemDataExt{ + T__: t, + } +} + +func (o HomeScreenItemDataExt) DeepCopy() HomeScreenItemDataExt { + return HomeScreenItemDataExt{ + T__: o.T__.DeepCopy(), + Todo__: (func(x *HomeScreenTodoExt) *HomeScreenTodoExt { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Todo__), + } +} + +type AppLinkType int + +const ( + AppLinkType_NONE AppLinkType = 0 + AppLinkType_PEOPLE AppLinkType = 1 + AppLinkType_CHAT AppLinkType = 2 + AppLinkType_FILES AppLinkType = 3 + AppLinkType_WALLET AppLinkType = 4 + AppLinkType_GIT AppLinkType = 5 + AppLinkType_DEVICES AppLinkType = 6 + AppLinkType_SETTINGS AppLinkType = 7 + AppLinkType_TEAMS AppLinkType = 8 +) + +func (o AppLinkType) DeepCopy() AppLinkType { return o } + +var AppLinkTypeMap = map[string]AppLinkType{ + "NONE": 0, + "PEOPLE": 1, + "CHAT": 2, + "FILES": 3, + "WALLET": 4, + "GIT": 5, + "DEVICES": 6, + "SETTINGS": 7, + "TEAMS": 8, +} + +var AppLinkTypeRevMap = map[AppLinkType]string{ + 0: "NONE", + 1: "PEOPLE", + 2: "CHAT", + 3: "FILES", + 4: "WALLET", + 5: "GIT", + 6: "DEVICES", + 7: "SETTINGS", + 8: "TEAMS", +} + +func (e AppLinkType) String() string { + if v, ok := AppLinkTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type HomeScreenAnnouncementID int + +func (o HomeScreenAnnouncementID) DeepCopy() HomeScreenAnnouncementID { + return o +} + +type HomeScreenAnnouncementVersion int + +func (o HomeScreenAnnouncementVersion) DeepCopy() HomeScreenAnnouncementVersion { + return o +} + +type HomeScreenAnnouncement struct { + Id HomeScreenAnnouncementID `codec:"id" json:"id"` + Version HomeScreenAnnouncementVersion `codec:"version" json:"version"` + AppLink AppLinkType `codec:"appLink" json:"appLink"` + ConfirmLabel string `codec:"confirmLabel" json:"confirmLabel"` + Dismissable bool `codec:"dismissable" json:"dismissable"` + IconUrl string `codec:"iconUrl" json:"iconUrl"` + Text string `codec:"text" json:"text"` + Url string `codec:"url" json:"url"` +} + +func (o HomeScreenAnnouncement) DeepCopy() HomeScreenAnnouncement { + return HomeScreenAnnouncement{ + Id: o.Id.DeepCopy(), + Version: o.Version.DeepCopy(), + AppLink: o.AppLink.DeepCopy(), + ConfirmLabel: o.ConfirmLabel, + Dismissable: o.Dismissable, + IconUrl: o.IconUrl, + Text: o.Text, + Url: o.Url, + } +} + +type HomeScreenTodoType int + +const ( + HomeScreenTodoType_NONE HomeScreenTodoType = 0 + HomeScreenTodoType_BIO HomeScreenTodoType = 1 + HomeScreenTodoType_PROOF HomeScreenTodoType = 2 + HomeScreenTodoType_DEVICE HomeScreenTodoType = 3 + HomeScreenTodoType_FOLLOW HomeScreenTodoType = 4 + HomeScreenTodoType_CHAT HomeScreenTodoType = 5 + HomeScreenTodoType_PAPERKEY HomeScreenTodoType = 6 + HomeScreenTodoType_TEAM HomeScreenTodoType = 7 + HomeScreenTodoType_FOLDER HomeScreenTodoType = 8 + HomeScreenTodoType_GIT_REPO HomeScreenTodoType = 9 + HomeScreenTodoType_TEAM_SHOWCASE HomeScreenTodoType = 10 + HomeScreenTodoType_AVATAR_USER HomeScreenTodoType = 11 + HomeScreenTodoType_AVATAR_TEAM HomeScreenTodoType = 12 + HomeScreenTodoType_ADD_PHONE_NUMBER HomeScreenTodoType = 18 + HomeScreenTodoType_VERIFY_ALL_PHONE_NUMBER HomeScreenTodoType = 19 + HomeScreenTodoType_VERIFY_ALL_EMAIL HomeScreenTodoType = 20 + HomeScreenTodoType_LEGACY_EMAIL_VISIBILITY HomeScreenTodoType = 21 + HomeScreenTodoType_ADD_EMAIL HomeScreenTodoType = 22 + HomeScreenTodoType_ANNONCEMENT_PLACEHOLDER HomeScreenTodoType = 10000 +) + +func (o HomeScreenTodoType) DeepCopy() HomeScreenTodoType { return o } + +var HomeScreenTodoTypeMap = map[string]HomeScreenTodoType{ + "NONE": 0, + "BIO": 1, + "PROOF": 2, + "DEVICE": 3, + "FOLLOW": 4, + "CHAT": 5, + "PAPERKEY": 6, + "TEAM": 7, + "FOLDER": 8, + "GIT_REPO": 9, + "TEAM_SHOWCASE": 10, + "AVATAR_USER": 11, + "AVATAR_TEAM": 12, + "ADD_PHONE_NUMBER": 18, + "VERIFY_ALL_PHONE_NUMBER": 19, + "VERIFY_ALL_EMAIL": 20, + "LEGACY_EMAIL_VISIBILITY": 21, + "ADD_EMAIL": 22, + "ANNONCEMENT_PLACEHOLDER": 10000, +} + +var HomeScreenTodoTypeRevMap = map[HomeScreenTodoType]string{ + 0: "NONE", + 1: "BIO", + 2: "PROOF", + 3: "DEVICE", + 4: "FOLLOW", + 5: "CHAT", + 6: "PAPERKEY", + 7: "TEAM", + 8: "FOLDER", + 9: "GIT_REPO", + 10: "TEAM_SHOWCASE", + 11: "AVATAR_USER", + 12: "AVATAR_TEAM", + 18: "ADD_PHONE_NUMBER", + 19: "VERIFY_ALL_PHONE_NUMBER", + 20: "VERIFY_ALL_EMAIL", + 21: "LEGACY_EMAIL_VISIBILITY", + 22: "ADD_EMAIL", + 10000: "ANNONCEMENT_PLACEHOLDER", +} + +func (e HomeScreenTodoType) String() string { + if v, ok := HomeScreenTodoTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +// Most of TODO items do not carry additional data, but some do. e.g. TODO +// item to tell user to verify their email address will carry that email +// address. +// +// All new TODO data bundle types should be records rather than single fields +// to support adding new data to existing TODOs. If a legacy TODO (such as +// VERIFY_ALL_EMAIL) uses a single field, the "TodoExt" field should be used to +// introduce more data to the payload. +type HomeScreenTodo struct { + T__ HomeScreenTodoType `codec:"t" json:"t"` + VerifyAllPhoneNumber__ *PhoneNumber `codec:"verifyAllPhoneNumber,omitempty" json:"verifyAllPhoneNumber,omitempty"` + VerifyAllEmail__ *EmailAddress `codec:"verifyAllEmail,omitempty" json:"verifyAllEmail,omitempty"` + LegacyEmailVisibility__ *EmailAddress `codec:"legacyEmailVisibility,omitempty" json:"legacyEmailVisibility,omitempty"` +} + +func (o *HomeScreenTodo) T() (ret HomeScreenTodoType, err error) { + switch o.T__ { + case HomeScreenTodoType_VERIFY_ALL_PHONE_NUMBER: + if o.VerifyAllPhoneNumber__ == nil { + err = errors.New("unexpected nil value for VerifyAllPhoneNumber__") + return ret, err + } + case HomeScreenTodoType_VERIFY_ALL_EMAIL: + if o.VerifyAllEmail__ == nil { + err = errors.New("unexpected nil value for VerifyAllEmail__") + return ret, err + } + case HomeScreenTodoType_LEGACY_EMAIL_VISIBILITY: + if o.LegacyEmailVisibility__ == nil { + err = errors.New("unexpected nil value for LegacyEmailVisibility__") + return ret, err + } + } + return o.T__, nil +} + +func (o HomeScreenTodo) VerifyAllPhoneNumber() (res PhoneNumber) { + if o.T__ != HomeScreenTodoType_VERIFY_ALL_PHONE_NUMBER { + panic("wrong case accessed") + } + if o.VerifyAllPhoneNumber__ == nil { + return + } + return *o.VerifyAllPhoneNumber__ +} + +func (o HomeScreenTodo) VerifyAllEmail() (res EmailAddress) { + if o.T__ != HomeScreenTodoType_VERIFY_ALL_EMAIL { + panic("wrong case accessed") + } + if o.VerifyAllEmail__ == nil { + return + } + return *o.VerifyAllEmail__ +} + +func (o HomeScreenTodo) LegacyEmailVisibility() (res EmailAddress) { + if o.T__ != HomeScreenTodoType_LEGACY_EMAIL_VISIBILITY { + panic("wrong case accessed") + } + if o.LegacyEmailVisibility__ == nil { + return + } + return *o.LegacyEmailVisibility__ +} + +func NewHomeScreenTodoWithVerifyAllPhoneNumber(v PhoneNumber) HomeScreenTodo { + return HomeScreenTodo{ + T__: HomeScreenTodoType_VERIFY_ALL_PHONE_NUMBER, + VerifyAllPhoneNumber__: &v, + } +} + +func NewHomeScreenTodoWithVerifyAllEmail(v EmailAddress) HomeScreenTodo { + return HomeScreenTodo{ + T__: HomeScreenTodoType_VERIFY_ALL_EMAIL, + VerifyAllEmail__: &v, + } +} + +func NewHomeScreenTodoWithLegacyEmailVisibility(v EmailAddress) HomeScreenTodo { + return HomeScreenTodo{ + T__: HomeScreenTodoType_LEGACY_EMAIL_VISIBILITY, + LegacyEmailVisibility__: &v, + } +} + +func NewHomeScreenTodoDefault(t HomeScreenTodoType) HomeScreenTodo { + return HomeScreenTodo{ + T__: t, + } +} + +func (o HomeScreenTodo) DeepCopy() HomeScreenTodo { + return HomeScreenTodo{ + T__: o.T__.DeepCopy(), + VerifyAllPhoneNumber__: (func(x *PhoneNumber) *PhoneNumber { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.VerifyAllPhoneNumber__), + VerifyAllEmail__: (func(x *EmailAddress) *EmailAddress { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.VerifyAllEmail__), + LegacyEmailVisibility__: (func(x *EmailAddress) *EmailAddress { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.LegacyEmailVisibility__), + } +} + +type HomeScreenTodoExt struct { + T__ HomeScreenTodoType `codec:"t" json:"t"` + VerifyAllEmail__ *VerifyAllEmailTodoExt `codec:"verifyAllEmail,omitempty" json:"verifyAllEmail,omitempty"` +} + +func (o *HomeScreenTodoExt) T() (ret HomeScreenTodoType, err error) { + switch o.T__ { + case HomeScreenTodoType_VERIFY_ALL_EMAIL: + if o.VerifyAllEmail__ == nil { + err = errors.New("unexpected nil value for VerifyAllEmail__") + return ret, err + } + } + return o.T__, nil +} + +func (o HomeScreenTodoExt) VerifyAllEmail() (res VerifyAllEmailTodoExt) { + if o.T__ != HomeScreenTodoType_VERIFY_ALL_EMAIL { + panic("wrong case accessed") + } + if o.VerifyAllEmail__ == nil { + return + } + return *o.VerifyAllEmail__ +} + +func NewHomeScreenTodoExtWithVerifyAllEmail(v VerifyAllEmailTodoExt) HomeScreenTodoExt { + return HomeScreenTodoExt{ + T__: HomeScreenTodoType_VERIFY_ALL_EMAIL, + VerifyAllEmail__: &v, + } +} + +func NewHomeScreenTodoExtDefault(t HomeScreenTodoType) HomeScreenTodoExt { + return HomeScreenTodoExt{ + T__: t, + } +} + +func (o HomeScreenTodoExt) DeepCopy() HomeScreenTodoExt { + return HomeScreenTodoExt{ + T__: o.T__.DeepCopy(), + VerifyAllEmail__: (func(x *VerifyAllEmailTodoExt) *VerifyAllEmailTodoExt { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.VerifyAllEmail__), + } +} + +type VerifyAllEmailTodoExt struct { + LastVerifyEmailDate UnixTime `codec:"lastVerifyEmailDate" json:"lastVerifyEmailDate"` +} + +func (o VerifyAllEmailTodoExt) DeepCopy() VerifyAllEmailTodoExt { + return VerifyAllEmailTodoExt{ + LastVerifyEmailDate: o.LastVerifyEmailDate.DeepCopy(), + } +} + +type HomeScreenPeopleNotificationType int + +const ( + HomeScreenPeopleNotificationType_FOLLOWED HomeScreenPeopleNotificationType = 1 + HomeScreenPeopleNotificationType_FOLLOWED_MULTI HomeScreenPeopleNotificationType = 2 + HomeScreenPeopleNotificationType_CONTACT HomeScreenPeopleNotificationType = 3 + HomeScreenPeopleNotificationType_CONTACT_MULTI HomeScreenPeopleNotificationType = 4 +) + +func (o HomeScreenPeopleNotificationType) DeepCopy() HomeScreenPeopleNotificationType { return o } + +var HomeScreenPeopleNotificationTypeMap = map[string]HomeScreenPeopleNotificationType{ + "FOLLOWED": 1, + "FOLLOWED_MULTI": 2, + "CONTACT": 3, + "CONTACT_MULTI": 4, +} + +var HomeScreenPeopleNotificationTypeRevMap = map[HomeScreenPeopleNotificationType]string{ + 1: "FOLLOWED", + 2: "FOLLOWED_MULTI", + 3: "CONTACT", + 4: "CONTACT_MULTI", +} + +func (e HomeScreenPeopleNotificationType) String() string { + if v, ok := HomeScreenPeopleNotificationTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type HomeScreenPeopleNotificationFollowed struct { + FollowTime Time `codec:"followTime" json:"followTime"` + FollowedBack bool `codec:"followedBack" json:"followedBack"` + User UserSummary `codec:"user" json:"user"` +} + +func (o HomeScreenPeopleNotificationFollowed) DeepCopy() HomeScreenPeopleNotificationFollowed { + return HomeScreenPeopleNotificationFollowed{ + FollowTime: o.FollowTime.DeepCopy(), + FollowedBack: o.FollowedBack, + User: o.User.DeepCopy(), + } +} + +type HomeScreenPeopleNotificationFollowedMulti struct { + Followers []HomeScreenPeopleNotificationFollowed `codec:"followers" json:"followers"` + NumOthers int `codec:"numOthers" json:"numOthers"` +} + +func (o HomeScreenPeopleNotificationFollowedMulti) DeepCopy() HomeScreenPeopleNotificationFollowedMulti { + return HomeScreenPeopleNotificationFollowedMulti{ + Followers: (func(x []HomeScreenPeopleNotificationFollowed) []HomeScreenPeopleNotificationFollowed { + if x == nil { + return nil + } + ret := make([]HomeScreenPeopleNotificationFollowed, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Followers), + NumOthers: o.NumOthers, + } +} + +type HomeScreenPeopleNotificationContact struct { + ResolveTime Time `codec:"resolveTime" json:"resolveTime"` + Username string `codec:"username" json:"username"` + Description string `codec:"description" json:"description"` + ResolvedContactBlob string `codec:"resolvedContactBlob" json:"resolvedContactBlob"` +} + +func (o HomeScreenPeopleNotificationContact) DeepCopy() HomeScreenPeopleNotificationContact { + return HomeScreenPeopleNotificationContact{ + ResolveTime: o.ResolveTime.DeepCopy(), + Username: o.Username, + Description: o.Description, + ResolvedContactBlob: o.ResolvedContactBlob, + } +} + +type HomeScreenPeopleNotificationContactMulti struct { + Contacts []HomeScreenPeopleNotificationContact `codec:"contacts" json:"contacts"` + NumOthers int `codec:"numOthers" json:"numOthers"` +} + +func (o HomeScreenPeopleNotificationContactMulti) DeepCopy() HomeScreenPeopleNotificationContactMulti { + return HomeScreenPeopleNotificationContactMulti{ + Contacts: (func(x []HomeScreenPeopleNotificationContact) []HomeScreenPeopleNotificationContact { + if x == nil { + return nil + } + ret := make([]HomeScreenPeopleNotificationContact, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Contacts), + NumOthers: o.NumOthers, + } +} + +type HomeScreenPeopleNotification struct { + T__ HomeScreenPeopleNotificationType `codec:"t" json:"t"` + Followed__ *HomeScreenPeopleNotificationFollowed `codec:"followed,omitempty" json:"followed,omitempty"` + FollowedMulti__ *HomeScreenPeopleNotificationFollowedMulti `codec:"followedMulti,omitempty" json:"followedMulti,omitempty"` + Contact__ *HomeScreenPeopleNotificationContact `codec:"contact,omitempty" json:"contact,omitempty"` + ContactMulti__ *HomeScreenPeopleNotificationContactMulti `codec:"contactMulti,omitempty" json:"contactMulti,omitempty"` +} + +func (o *HomeScreenPeopleNotification) T() (ret HomeScreenPeopleNotificationType, err error) { + switch o.T__ { + case HomeScreenPeopleNotificationType_FOLLOWED: + if o.Followed__ == nil { + err = errors.New("unexpected nil value for Followed__") + return ret, err + } + case HomeScreenPeopleNotificationType_FOLLOWED_MULTI: + if o.FollowedMulti__ == nil { + err = errors.New("unexpected nil value for FollowedMulti__") + return ret, err + } + case HomeScreenPeopleNotificationType_CONTACT: + if o.Contact__ == nil { + err = errors.New("unexpected nil value for Contact__") + return ret, err + } + case HomeScreenPeopleNotificationType_CONTACT_MULTI: + if o.ContactMulti__ == nil { + err = errors.New("unexpected nil value for ContactMulti__") + return ret, err + } + } + return o.T__, nil +} + +func (o HomeScreenPeopleNotification) Followed() (res HomeScreenPeopleNotificationFollowed) { + if o.T__ != HomeScreenPeopleNotificationType_FOLLOWED { + panic("wrong case accessed") + } + if o.Followed__ == nil { + return + } + return *o.Followed__ +} + +func (o HomeScreenPeopleNotification) FollowedMulti() (res HomeScreenPeopleNotificationFollowedMulti) { + if o.T__ != HomeScreenPeopleNotificationType_FOLLOWED_MULTI { + panic("wrong case accessed") + } + if o.FollowedMulti__ == nil { + return + } + return *o.FollowedMulti__ +} + +func (o HomeScreenPeopleNotification) Contact() (res HomeScreenPeopleNotificationContact) { + if o.T__ != HomeScreenPeopleNotificationType_CONTACT { + panic("wrong case accessed") + } + if o.Contact__ == nil { + return + } + return *o.Contact__ +} + +func (o HomeScreenPeopleNotification) ContactMulti() (res HomeScreenPeopleNotificationContactMulti) { + if o.T__ != HomeScreenPeopleNotificationType_CONTACT_MULTI { + panic("wrong case accessed") + } + if o.ContactMulti__ == nil { + return + } + return *o.ContactMulti__ +} + +func NewHomeScreenPeopleNotificationWithFollowed(v HomeScreenPeopleNotificationFollowed) HomeScreenPeopleNotification { + return HomeScreenPeopleNotification{ + T__: HomeScreenPeopleNotificationType_FOLLOWED, + Followed__: &v, + } +} + +func NewHomeScreenPeopleNotificationWithFollowedMulti(v HomeScreenPeopleNotificationFollowedMulti) HomeScreenPeopleNotification { + return HomeScreenPeopleNotification{ + T__: HomeScreenPeopleNotificationType_FOLLOWED_MULTI, + FollowedMulti__: &v, + } +} + +func NewHomeScreenPeopleNotificationWithContact(v HomeScreenPeopleNotificationContact) HomeScreenPeopleNotification { + return HomeScreenPeopleNotification{ + T__: HomeScreenPeopleNotificationType_CONTACT, + Contact__: &v, + } +} + +func NewHomeScreenPeopleNotificationWithContactMulti(v HomeScreenPeopleNotificationContactMulti) HomeScreenPeopleNotification { + return HomeScreenPeopleNotification{ + T__: HomeScreenPeopleNotificationType_CONTACT_MULTI, + ContactMulti__: &v, + } +} + +func (o HomeScreenPeopleNotification) DeepCopy() HomeScreenPeopleNotification { + return HomeScreenPeopleNotification{ + T__: o.T__.DeepCopy(), + Followed__: (func(x *HomeScreenPeopleNotificationFollowed) *HomeScreenPeopleNotificationFollowed { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Followed__), + FollowedMulti__: (func(x *HomeScreenPeopleNotificationFollowedMulti) *HomeScreenPeopleNotificationFollowedMulti { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.FollowedMulti__), + Contact__: (func(x *HomeScreenPeopleNotificationContact) *HomeScreenPeopleNotificationContact { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Contact__), + ContactMulti__: (func(x *HomeScreenPeopleNotificationContactMulti) *HomeScreenPeopleNotificationContactMulti { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ContactMulti__), + } +} + +type HomeScreenItem struct { + Badged bool `codec:"badged" json:"badged"` + Data HomeScreenItemData `codec:"data" json:"data"` + DataExt HomeScreenItemDataExt `codec:"dataExt" json:"dataExt"` +} + +func (o HomeScreenItem) DeepCopy() HomeScreenItem { + return HomeScreenItem{ + Badged: o.Badged, + Data: o.Data.DeepCopy(), + DataExt: o.DataExt.DeepCopy(), + } +} + +type Pics struct { + Square40 string `codec:"square40" json:"square_40"` + Square200 string `codec:"square200" json:"square_200"` + Square360 string `codec:"square360" json:"square_360"` +} + +func (o Pics) DeepCopy() Pics { + return Pics{ + Square40: o.Square40, + Square200: o.Square200, + Square360: o.Square360, + } +} + +type HomeUserSummary struct { + Uid UID `codec:"uid" json:"uid"` + Username string `codec:"username" json:"username"` + Bio string `codec:"bio" json:"bio"` + FullName string `codec:"fullName" json:"full_name"` + Pics *Pics `codec:"pics,omitempty" json:"pics,omitempty"` +} + +func (o HomeUserSummary) DeepCopy() HomeUserSummary { + return HomeUserSummary{ + Uid: o.Uid.DeepCopy(), + Username: o.Username, + Bio: o.Bio, + FullName: o.FullName, + Pics: (func(x *Pics) *Pics { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Pics), + } +} + +type HomeScreen struct { + LastViewed Time `codec:"lastViewed" json:"lastViewed"` + Version int `codec:"version" json:"version"` + Visits int `codec:"visits" json:"visits"` + Items []HomeScreenItem `codec:"items" json:"items"` + FollowSuggestions []HomeUserSummary `codec:"followSuggestions" json:"followSuggestions"` + AnnouncementsVersion int `codec:"announcementsVersion" json:"announcementsVersion"` +} + +func (o HomeScreen) DeepCopy() HomeScreen { + return HomeScreen{ + LastViewed: o.LastViewed.DeepCopy(), + Version: o.Version, + Visits: o.Visits, + Items: (func(x []HomeScreenItem) []HomeScreenItem { + if x == nil { + return nil + } + ret := make([]HomeScreenItem, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Items), + FollowSuggestions: (func(x []HomeUserSummary) []HomeUserSummary { + if x == nil { + return nil + } + ret := make([]HomeUserSummary, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.FollowSuggestions), + AnnouncementsVersion: o.AnnouncementsVersion, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/home_ui.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/home_ui.go new file mode 100644 index 00000000..a7671a41 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/home_ui.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/home_ui.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify.go new file mode 100644 index 00000000..3a810197 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify.go @@ -0,0 +1,145 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/identify.avdl + +package keybase1 + +type IdentifyProofBreak struct { + RemoteProof RemoteProof `codec:"remoteProof" json:"remoteProof"` + Lcr LinkCheckResult `codec:"lcr" json:"lcr"` +} + +func (o IdentifyProofBreak) DeepCopy() IdentifyProofBreak { + return IdentifyProofBreak{ + RemoteProof: o.RemoteProof.DeepCopy(), + Lcr: o.Lcr.DeepCopy(), + } +} + +type IdentifyTrackBreaks struct { + Keys []IdentifyKey `codec:"keys" json:"keys"` + Proofs []IdentifyProofBreak `codec:"proofs" json:"proofs"` +} + +func (o IdentifyTrackBreaks) DeepCopy() IdentifyTrackBreaks { + return IdentifyTrackBreaks{ + Keys: (func(x []IdentifyKey) []IdentifyKey { + if x == nil { + return nil + } + ret := make([]IdentifyKey, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Keys), + Proofs: (func(x []IdentifyProofBreak) []IdentifyProofBreak { + if x == nil { + return nil + } + ret := make([]IdentifyProofBreak, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Proofs), + } +} + +type Identify2Res struct { + Upk UserPlusKeys `codec:"upk" json:"upk"` + IdentifiedAt Time `codec:"identifiedAt" json:"identifiedAt"` + TrackBreaks *IdentifyTrackBreaks `codec:"trackBreaks,omitempty" json:"trackBreaks,omitempty"` +} + +func (o Identify2Res) DeepCopy() Identify2Res { + return Identify2Res{ + Upk: o.Upk.DeepCopy(), + IdentifiedAt: o.IdentifiedAt.DeepCopy(), + TrackBreaks: (func(x *IdentifyTrackBreaks) *IdentifyTrackBreaks { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.TrackBreaks), + } +} + +type Identify2ResUPK2 struct { + Upk UserPlusKeysV2AllIncarnations `codec:"upk" json:"upk"` + IdentifiedAt Time `codec:"identifiedAt" json:"identifiedAt"` + TrackBreaks *IdentifyTrackBreaks `codec:"trackBreaks,omitempty" json:"trackBreaks,omitempty"` +} + +func (o Identify2ResUPK2) DeepCopy() Identify2ResUPK2 { + return Identify2ResUPK2{ + Upk: o.Upk.DeepCopy(), + IdentifiedAt: o.IdentifiedAt.DeepCopy(), + TrackBreaks: (func(x *IdentifyTrackBreaks) *IdentifyTrackBreaks { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.TrackBreaks), + } +} + +type IdentifyLiteRes struct { + Ul UserOrTeamLite `codec:"ul" json:"ul"` + TrackBreaks *IdentifyTrackBreaks `codec:"trackBreaks,omitempty" json:"trackBreaks,omitempty"` +} + +func (o IdentifyLiteRes) DeepCopy() IdentifyLiteRes { + return IdentifyLiteRes{ + Ul: o.Ul.DeepCopy(), + TrackBreaks: (func(x *IdentifyTrackBreaks) *IdentifyTrackBreaks { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.TrackBreaks), + } +} + +type ResolveIdentifyImplicitTeamRes struct { + DisplayName string `codec:"displayName" json:"displayName"` + TeamID TeamID `codec:"teamID" json:"teamID"` + Writers []UserVersion `codec:"writers" json:"writers"` + TrackBreaks map[UserVersion]IdentifyTrackBreaks `codec:"trackBreaks" json:"trackBreaks"` + FolderID TLFID `codec:"folderID" json:"folderID"` +} + +func (o ResolveIdentifyImplicitTeamRes) DeepCopy() ResolveIdentifyImplicitTeamRes { + return ResolveIdentifyImplicitTeamRes{ + DisplayName: o.DisplayName, + TeamID: o.TeamID.DeepCopy(), + Writers: (func(x []UserVersion) []UserVersion { + if x == nil { + return nil + } + ret := make([]UserVersion, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Writers), + TrackBreaks: (func(x map[UserVersion]IdentifyTrackBreaks) map[UserVersion]IdentifyTrackBreaks { + if x == nil { + return nil + } + ret := make(map[UserVersion]IdentifyTrackBreaks, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.TrackBreaks), + FolderID: o.FolderID.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify3.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify3.go new file mode 100644 index 00000000..af462f3c --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify3.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/identify3.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify3_common.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify3_common.go new file mode 100644 index 00000000..78b5377f --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify3_common.go @@ -0,0 +1,16 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/identify3_common.avdl + +package keybase1 + +type Identify3Assertion string + +func (o Identify3Assertion) DeepCopy() Identify3Assertion { + return o +} + +type Identify3GUIID string + +func (o Identify3GUIID) DeepCopy() Identify3GUIID { + return o +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify3_ui.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify3_ui.go new file mode 100644 index 00000000..1b3f34a2 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify3_ui.go @@ -0,0 +1,212 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/identify3_ui.avdl + +package keybase1 + +import ( + "fmt" +) + +type Identify3RowState int + +const ( + Identify3RowState_CHECKING Identify3RowState = 1 + Identify3RowState_VALID Identify3RowState = 2 + Identify3RowState_ERROR Identify3RowState = 3 + Identify3RowState_WARNING Identify3RowState = 4 + Identify3RowState_REVOKED Identify3RowState = 5 +) + +func (o Identify3RowState) DeepCopy() Identify3RowState { return o } + +var Identify3RowStateMap = map[string]Identify3RowState{ + "CHECKING": 1, + "VALID": 2, + "ERROR": 3, + "WARNING": 4, + "REVOKED": 5, +} + +var Identify3RowStateRevMap = map[Identify3RowState]string{ + 1: "CHECKING", + 2: "VALID", + 3: "ERROR", + 4: "WARNING", + 5: "REVOKED", +} + +func (e Identify3RowState) String() string { + if v, ok := Identify3RowStateRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type Identify3RowColor int + +const ( + Identify3RowColor_BLUE Identify3RowColor = 1 + Identify3RowColor_RED Identify3RowColor = 2 + Identify3RowColor_BLACK Identify3RowColor = 3 + Identify3RowColor_GREEN Identify3RowColor = 4 + Identify3RowColor_GRAY Identify3RowColor = 5 + Identify3RowColor_YELLOW Identify3RowColor = 6 + Identify3RowColor_ORANGE Identify3RowColor = 7 +) + +func (o Identify3RowColor) DeepCopy() Identify3RowColor { return o } + +var Identify3RowColorMap = map[string]Identify3RowColor{ + "BLUE": 1, + "RED": 2, + "BLACK": 3, + "GREEN": 4, + "GRAY": 5, + "YELLOW": 6, + "ORANGE": 7, +} + +var Identify3RowColorRevMap = map[Identify3RowColor]string{ + 1: "BLUE", + 2: "RED", + 3: "BLACK", + 4: "GREEN", + 5: "GRAY", + 6: "YELLOW", + 7: "ORANGE", +} + +func (e Identify3RowColor) String() string { + if v, ok := Identify3RowColorRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type Identify3ResultType int + +const ( + Identify3ResultType_OK Identify3ResultType = 0 + Identify3ResultType_BROKEN Identify3ResultType = 1 + Identify3ResultType_NEEDS_UPGRADE Identify3ResultType = 2 + Identify3ResultType_CANCELED Identify3ResultType = 3 +) + +func (o Identify3ResultType) DeepCopy() Identify3ResultType { return o } + +var Identify3ResultTypeMap = map[string]Identify3ResultType{ + "OK": 0, + "BROKEN": 1, + "NEEDS_UPGRADE": 2, + "CANCELED": 3, +} + +var Identify3ResultTypeRevMap = map[Identify3ResultType]string{ + 0: "OK", + 1: "BROKEN", + 2: "NEEDS_UPGRADE", + 3: "CANCELED", +} + +func (e Identify3ResultType) String() string { + if v, ok := Identify3ResultTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type Identify3RowMeta struct { + Color Identify3RowColor `codec:"color" json:"color"` + Label string `codec:"label" json:"label"` +} + +func (o Identify3RowMeta) DeepCopy() Identify3RowMeta { + return Identify3RowMeta{ + Color: o.Color.DeepCopy(), + Label: o.Label, + } +} + +type Identify3Row struct { + GuiID Identify3GUIID `codec:"guiID" json:"guiID"` + Key string `codec:"key" json:"key"` + Value string `codec:"value" json:"value"` + Priority int `codec:"priority" json:"priority"` + SiteURL string `codec:"siteURL" json:"siteURL"` + SiteIcon []SizedImage `codec:"siteIcon" json:"siteIcon"` + SiteIconFull []SizedImage `codec:"siteIconFull" json:"siteIconFull"` + SiteIconWhite []SizedImage `codec:"siteIconWhite" json:"siteIconWhite"` + ProofURL string `codec:"proofURL" json:"proofURL"` + SigID SigID `codec:"sigID" json:"sigID"` + Ctime Time `codec:"ctime" json:"ctime"` + State Identify3RowState `codec:"state" json:"state"` + Metas []Identify3RowMeta `codec:"metas" json:"metas"` + Color Identify3RowColor `codec:"color" json:"color"` + Kid *KID `codec:"kid,omitempty" json:"kid,omitempty"` +} + +func (o Identify3Row) DeepCopy() Identify3Row { + return Identify3Row{ + GuiID: o.GuiID.DeepCopy(), + Key: o.Key, + Value: o.Value, + Priority: o.Priority, + SiteURL: o.SiteURL, + SiteIcon: (func(x []SizedImage) []SizedImage { + if x == nil { + return nil + } + ret := make([]SizedImage, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.SiteIcon), + SiteIconFull: (func(x []SizedImage) []SizedImage { + if x == nil { + return nil + } + ret := make([]SizedImage, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.SiteIconFull), + SiteIconWhite: (func(x []SizedImage) []SizedImage { + if x == nil { + return nil + } + ret := make([]SizedImage, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.SiteIconWhite), + ProofURL: o.ProofURL, + SigID: o.SigID.DeepCopy(), + Ctime: o.Ctime.DeepCopy(), + State: o.State.DeepCopy(), + Metas: (func(x []Identify3RowMeta) []Identify3RowMeta { + if x == nil { + return nil + } + ret := make([]Identify3RowMeta, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Metas), + Color: o.Color.DeepCopy(), + Kid: (func(x *KID) *KID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Kid), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify_common.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify_common.go new file mode 100644 index 00000000..bd1ff200 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify_common.go @@ -0,0 +1,322 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/identify_common.avdl + +package keybase1 + +import ( + "fmt" +) + +type TrackToken string + +func (o TrackToken) DeepCopy() TrackToken { + return o +} + +type SigVersion int + +func (o SigVersion) DeepCopy() SigVersion { + return o +} + +type TrackDiffType int + +const ( + TrackDiffType_NONE TrackDiffType = 0 + TrackDiffType_ERROR TrackDiffType = 1 + TrackDiffType_CLASH TrackDiffType = 2 + TrackDiffType_REVOKED TrackDiffType = 3 + TrackDiffType_UPGRADED TrackDiffType = 4 + TrackDiffType_NEW TrackDiffType = 5 + TrackDiffType_REMOTE_FAIL TrackDiffType = 6 + TrackDiffType_REMOTE_WORKING TrackDiffType = 7 + TrackDiffType_REMOTE_CHANGED TrackDiffType = 8 + TrackDiffType_NEW_ELDEST TrackDiffType = 9 + TrackDiffType_NONE_VIA_TEMPORARY TrackDiffType = 10 +) + +func (o TrackDiffType) DeepCopy() TrackDiffType { return o } + +var TrackDiffTypeMap = map[string]TrackDiffType{ + "NONE": 0, + "ERROR": 1, + "CLASH": 2, + "REVOKED": 3, + "UPGRADED": 4, + "NEW": 5, + "REMOTE_FAIL": 6, + "REMOTE_WORKING": 7, + "REMOTE_CHANGED": 8, + "NEW_ELDEST": 9, + "NONE_VIA_TEMPORARY": 10, +} + +var TrackDiffTypeRevMap = map[TrackDiffType]string{ + 0: "NONE", + 1: "ERROR", + 2: "CLASH", + 3: "REVOKED", + 4: "UPGRADED", + 5: "NEW", + 6: "REMOTE_FAIL", + 7: "REMOTE_WORKING", + 8: "REMOTE_CHANGED", + 9: "NEW_ELDEST", + 10: "NONE_VIA_TEMPORARY", +} + +func (e TrackDiffType) String() string { + if v, ok := TrackDiffTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type TrackDiff struct { + Type TrackDiffType `codec:"type" json:"type"` + DisplayMarkup string `codec:"displayMarkup" json:"displayMarkup"` +} + +func (o TrackDiff) DeepCopy() TrackDiff { + return TrackDiff{ + Type: o.Type.DeepCopy(), + DisplayMarkup: o.DisplayMarkup, + } +} + +type TrackSummary struct { + Username string `codec:"username" json:"username"` + Time Time `codec:"time" json:"time"` + IsRemote bool `codec:"isRemote" json:"isRemote"` +} + +func (o TrackSummary) DeepCopy() TrackSummary { + return TrackSummary{ + Username: o.Username, + Time: o.Time.DeepCopy(), + IsRemote: o.IsRemote, + } +} + +// TrackStatus is a summary of this track before the track is approved by the +// user. +// NEW_*: New tracks +// UPDATE_*: Update to an existing track +// NEW_OK: Everything ok +// NEW_ZERO_PROOFS: User being tracked has no proofs +// NEW_FAIL_PROOFS: User being tracked has some failed proofs +// UPDATE_BROKEN: Previous tracking statement broken, this one will fix it. +// UPDATE_NEW_PROOFS: Previous tracking statement ok, but there are new proofs since previous tracking statement generated +// UPDATE_OK: No changes to previous tracking statement +type TrackStatus int + +const ( + TrackStatus_NEW_OK TrackStatus = 1 + TrackStatus_NEW_ZERO_PROOFS TrackStatus = 2 + TrackStatus_NEW_FAIL_PROOFS TrackStatus = 3 + TrackStatus_UPDATE_BROKEN_FAILED_PROOFS TrackStatus = 4 + TrackStatus_UPDATE_NEW_PROOFS TrackStatus = 5 + TrackStatus_UPDATE_OK TrackStatus = 6 + TrackStatus_UPDATE_BROKEN_REVOKED TrackStatus = 7 +) + +func (o TrackStatus) DeepCopy() TrackStatus { return o } + +var TrackStatusMap = map[string]TrackStatus{ + "NEW_OK": 1, + "NEW_ZERO_PROOFS": 2, + "NEW_FAIL_PROOFS": 3, + "UPDATE_BROKEN_FAILED_PROOFS": 4, + "UPDATE_NEW_PROOFS": 5, + "UPDATE_OK": 6, + "UPDATE_BROKEN_REVOKED": 7, +} + +var TrackStatusRevMap = map[TrackStatus]string{ + 1: "NEW_OK", + 2: "NEW_ZERO_PROOFS", + 3: "NEW_FAIL_PROOFS", + 4: "UPDATE_BROKEN_FAILED_PROOFS", + 5: "UPDATE_NEW_PROOFS", + 6: "UPDATE_OK", + 7: "UPDATE_BROKEN_REVOKED", +} + +func (e TrackStatus) String() string { + if v, ok := TrackStatusRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type TrackOptions struct { + LocalOnly bool `codec:"localOnly" json:"localOnly"` + BypassConfirm bool `codec:"bypassConfirm" json:"bypassConfirm"` + ForceRetrack bool `codec:"forceRetrack" json:"forceRetrack"` + ExpiringLocal bool `codec:"expiringLocal" json:"expiringLocal"` + ForPGPPull bool `codec:"forPGPPull" json:"forPGPPull"` + SigVersion *SigVersion `codec:"sigVersion,omitempty" json:"sigVersion,omitempty"` +} + +func (o TrackOptions) DeepCopy() TrackOptions { + return TrackOptions{ + LocalOnly: o.LocalOnly, + BypassConfirm: o.BypassConfirm, + ForceRetrack: o.ForceRetrack, + ExpiringLocal: o.ExpiringLocal, + ForPGPPull: o.ForPGPPull, + SigVersion: (func(x *SigVersion) *SigVersion { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.SigVersion), + } +} + +type IdentifyReasonType int + +const ( + IdentifyReasonType_NONE IdentifyReasonType = 0 + IdentifyReasonType_ID IdentifyReasonType = 1 + IdentifyReasonType_TRACK IdentifyReasonType = 2 + IdentifyReasonType_ENCRYPT IdentifyReasonType = 3 + IdentifyReasonType_DECRYPT IdentifyReasonType = 4 + IdentifyReasonType_VERIFY IdentifyReasonType = 5 + IdentifyReasonType_RESOURCE IdentifyReasonType = 6 + IdentifyReasonType_BACKGROUND IdentifyReasonType = 7 +) + +func (o IdentifyReasonType) DeepCopy() IdentifyReasonType { return o } + +var IdentifyReasonTypeMap = map[string]IdentifyReasonType{ + "NONE": 0, + "ID": 1, + "TRACK": 2, + "ENCRYPT": 3, + "DECRYPT": 4, + "VERIFY": 5, + "RESOURCE": 6, + "BACKGROUND": 7, +} + +var IdentifyReasonTypeRevMap = map[IdentifyReasonType]string{ + 0: "NONE", + 1: "ID", + 2: "TRACK", + 3: "ENCRYPT", + 4: "DECRYPT", + 5: "VERIFY", + 6: "RESOURCE", + 7: "BACKGROUND", +} + +func (e IdentifyReasonType) String() string { + if v, ok := IdentifyReasonTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type IdentifyReason struct { + Type IdentifyReasonType `codec:"type" json:"type"` + Reason string `codec:"reason" json:"reason"` + Resource string `codec:"resource" json:"resource"` +} + +func (o IdentifyReason) DeepCopy() IdentifyReason { + return IdentifyReason{ + Type: o.Type.DeepCopy(), + Reason: o.Reason, + Resource: o.Resource, + } +} + +type IdentifyOutcome struct { + Username string `codec:"username" json:"username"` + Status *Status `codec:"status,omitempty" json:"status,omitempty"` + Warnings []string `codec:"warnings" json:"warnings"` + TrackUsed *TrackSummary `codec:"trackUsed,omitempty" json:"trackUsed,omitempty"` + TrackStatus TrackStatus `codec:"trackStatus" json:"trackStatus"` + NumTrackFailures int `codec:"numTrackFailures" json:"numTrackFailures"` + NumTrackChanges int `codec:"numTrackChanges" json:"numTrackChanges"` + NumProofFailures int `codec:"numProofFailures" json:"numProofFailures"` + NumRevoked int `codec:"numRevoked" json:"numRevoked"` + NumProofSuccesses int `codec:"numProofSuccesses" json:"numProofSuccesses"` + Revoked []TrackDiff `codec:"revoked" json:"revoked"` + TrackOptions TrackOptions `codec:"trackOptions" json:"trackOptions"` + ForPGPPull bool `codec:"forPGPPull" json:"forPGPPull"` + Reason IdentifyReason `codec:"reason" json:"reason"` +} + +func (o IdentifyOutcome) DeepCopy() IdentifyOutcome { + return IdentifyOutcome{ + Username: o.Username, + Status: (func(x *Status) *Status { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Status), + Warnings: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Warnings), + TrackUsed: (func(x *TrackSummary) *TrackSummary { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.TrackUsed), + TrackStatus: o.TrackStatus.DeepCopy(), + NumTrackFailures: o.NumTrackFailures, + NumTrackChanges: o.NumTrackChanges, + NumProofFailures: o.NumProofFailures, + NumRevoked: o.NumRevoked, + NumProofSuccesses: o.NumProofSuccesses, + Revoked: (func(x []TrackDiff) []TrackDiff { + if x == nil { + return nil + } + ret := make([]TrackDiff, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Revoked), + TrackOptions: o.TrackOptions.DeepCopy(), + ForPGPPull: o.ForPGPPull, + Reason: o.Reason.DeepCopy(), + } +} + +type RemoteProof struct { + ProofType ProofType `codec:"proofType" json:"proofType"` + Key string `codec:"key" json:"key"` + Value string `codec:"value" json:"value"` + DisplayMarkup string `codec:"displayMarkup" json:"displayMarkup"` + SigID SigID `codec:"sigID" json:"sigID"` + MTime Time `codec:"mTime" json:"mTime"` +} + +func (o RemoteProof) DeepCopy() RemoteProof { + return RemoteProof{ + ProofType: o.ProofType.DeepCopy(), + Key: o.Key, + Value: o.Value, + DisplayMarkup: o.DisplayMarkup, + SigID: o.SigID.DeepCopy(), + MTime: o.MTime.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify_ui.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify_ui.go new file mode 100644 index 00000000..e8118f9f --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/identify_ui.go @@ -0,0 +1,443 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/identify_ui.avdl + +package keybase1 + +import ( + "fmt" +) + +type ProofResult struct { + State ProofState `codec:"state" json:"state"` + Status ProofStatus `codec:"status" json:"status"` + Desc string `codec:"desc" json:"desc"` +} + +func (o ProofResult) DeepCopy() ProofResult { + return ProofResult{ + State: o.State.DeepCopy(), + Status: o.Status.DeepCopy(), + Desc: o.Desc, + } +} + +type IdentifyRow struct { + RowId int `codec:"rowId" json:"rowId"` + Proof RemoteProof `codec:"proof" json:"proof"` + TrackDiff *TrackDiff `codec:"trackDiff,omitempty" json:"trackDiff,omitempty"` +} + +func (o IdentifyRow) DeepCopy() IdentifyRow { + return IdentifyRow{ + RowId: o.RowId, + Proof: o.Proof.DeepCopy(), + TrackDiff: (func(x *TrackDiff) *TrackDiff { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.TrackDiff), + } +} + +type IdentifyKey struct { + PGPFingerprint []byte `codec:"pgpFingerprint" json:"pgpFingerprint"` + KID KID `codec:"KID" json:"KID"` + TrackDiff *TrackDiff `codec:"trackDiff,omitempty" json:"trackDiff,omitempty"` + BreaksTracking bool `codec:"breaksTracking" json:"breaksTracking"` + SigID SigID `codec:"sigID" json:"sigID"` +} + +func (o IdentifyKey) DeepCopy() IdentifyKey { + return IdentifyKey{ + PGPFingerprint: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.PGPFingerprint), + KID: o.KID.DeepCopy(), + TrackDiff: (func(x *TrackDiff) *TrackDiff { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.TrackDiff), + BreaksTracking: o.BreaksTracking, + SigID: o.SigID.DeepCopy(), + } +} + +type Cryptocurrency struct { + RowId int `codec:"rowId" json:"rowId"` + Pkhash []byte `codec:"pkhash" json:"pkhash"` + Address string `codec:"address" json:"address"` + SigID SigID `codec:"sigID" json:"sigID"` + Type string `codec:"type" json:"type"` + Family string `codec:"family" json:"family"` +} + +func (o Cryptocurrency) DeepCopy() Cryptocurrency { + return Cryptocurrency{ + RowId: o.RowId, + Pkhash: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.Pkhash), + Address: o.Address, + SigID: o.SigID.DeepCopy(), + Type: o.Type, + Family: o.Family, + } +} + +type StellarAccount struct { + AccountID string `codec:"accountID" json:"accountID"` + FederationAddress string `codec:"federationAddress" json:"federationAddress"` + SigID SigID `codec:"sigID" json:"sigID"` + Hidden bool `codec:"hidden" json:"hidden"` +} + +func (o StellarAccount) DeepCopy() StellarAccount { + return StellarAccount{ + AccountID: o.AccountID, + FederationAddress: o.FederationAddress, + SigID: o.SigID.DeepCopy(), + Hidden: o.Hidden, + } +} + +type RevokedProof struct { + Proof RemoteProof `codec:"proof" json:"proof"` + Diff TrackDiff `codec:"diff" json:"diff"` + Snoozed bool `codec:"snoozed" json:"snoozed"` +} + +func (o RevokedProof) DeepCopy() RevokedProof { + return RevokedProof{ + Proof: o.Proof.DeepCopy(), + Diff: o.Diff.DeepCopy(), + Snoozed: o.Snoozed, + } +} + +type Identity struct { + Status *Status `codec:"status,omitempty" json:"status,omitempty"` + WhenLastTracked Time `codec:"whenLastTracked" json:"whenLastTracked"` + Proofs []IdentifyRow `codec:"proofs" json:"proofs"` + Cryptocurrency []Cryptocurrency `codec:"cryptocurrency" json:"cryptocurrency"` + Revoked []TrackDiff `codec:"revoked" json:"revoked"` + RevokedDetails []RevokedProof `codec:"revokedDetails" json:"revokedDetails"` + BreaksTracking bool `codec:"breaksTracking" json:"breaksTracking"` +} + +func (o Identity) DeepCopy() Identity { + return Identity{ + Status: (func(x *Status) *Status { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Status), + WhenLastTracked: o.WhenLastTracked.DeepCopy(), + Proofs: (func(x []IdentifyRow) []IdentifyRow { + if x == nil { + return nil + } + ret := make([]IdentifyRow, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Proofs), + Cryptocurrency: (func(x []Cryptocurrency) []Cryptocurrency { + if x == nil { + return nil + } + ret := make([]Cryptocurrency, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Cryptocurrency), + Revoked: (func(x []TrackDiff) []TrackDiff { + if x == nil { + return nil + } + ret := make([]TrackDiff, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Revoked), + RevokedDetails: (func(x []RevokedProof) []RevokedProof { + if x == nil { + return nil + } + ret := make([]RevokedProof, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RevokedDetails), + BreaksTracking: o.BreaksTracking, + } +} + +type SigHint struct { + RemoteId string `codec:"remoteId" json:"remoteId"` + HumanUrl string `codec:"humanUrl" json:"humanUrl"` + ApiUrl string `codec:"apiUrl" json:"apiUrl"` + CheckText string `codec:"checkText" json:"checkText"` +} + +func (o SigHint) DeepCopy() SigHint { + return SigHint{ + RemoteId: o.RemoteId, + HumanUrl: o.HumanUrl, + ApiUrl: o.ApiUrl, + CheckText: o.CheckText, + } +} + +type CheckResultFreshness int + +const ( + CheckResultFreshness_FRESH CheckResultFreshness = 0 + CheckResultFreshness_AGED CheckResultFreshness = 1 + CheckResultFreshness_RANCID CheckResultFreshness = 2 +) + +func (o CheckResultFreshness) DeepCopy() CheckResultFreshness { return o } + +var CheckResultFreshnessMap = map[string]CheckResultFreshness{ + "FRESH": 0, + "AGED": 1, + "RANCID": 2, +} + +var CheckResultFreshnessRevMap = map[CheckResultFreshness]string{ + 0: "FRESH", + 1: "AGED", + 2: "RANCID", +} + +func (e CheckResultFreshness) String() string { + if v, ok := CheckResultFreshnessRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type CheckResult struct { + ProofResult ProofResult `codec:"proofResult" json:"proofResult"` + Time Time `codec:"time" json:"time"` + Freshness CheckResultFreshness `codec:"freshness" json:"freshness"` +} + +func (o CheckResult) DeepCopy() CheckResult { + return CheckResult{ + ProofResult: o.ProofResult.DeepCopy(), + Time: o.Time.DeepCopy(), + Freshness: o.Freshness.DeepCopy(), + } +} + +type LinkCheckResult struct { + ProofId int `codec:"proofId" json:"proofId"` + ProofResult ProofResult `codec:"proofResult" json:"proofResult"` + SnoozedResult ProofResult `codec:"snoozedResult" json:"snoozedResult"` + TorWarning bool `codec:"torWarning" json:"torWarning"` + TmpTrackExpireTime Time `codec:"tmpTrackExpireTime" json:"tmpTrackExpireTime"` + Cached *CheckResult `codec:"cached,omitempty" json:"cached,omitempty"` + Diff *TrackDiff `codec:"diff,omitempty" json:"diff,omitempty"` + RemoteDiff *TrackDiff `codec:"remoteDiff,omitempty" json:"remoteDiff,omitempty"` + Hint *SigHint `codec:"hint,omitempty" json:"hint,omitempty"` + BreaksTracking bool `codec:"breaksTracking" json:"breaksTracking"` +} + +func (o LinkCheckResult) DeepCopy() LinkCheckResult { + return LinkCheckResult{ + ProofId: o.ProofId, + ProofResult: o.ProofResult.DeepCopy(), + SnoozedResult: o.SnoozedResult.DeepCopy(), + TorWarning: o.TorWarning, + TmpTrackExpireTime: o.TmpTrackExpireTime.DeepCopy(), + Cached: (func(x *CheckResult) *CheckResult { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Cached), + Diff: (func(x *TrackDiff) *TrackDiff { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Diff), + RemoteDiff: (func(x *TrackDiff) *TrackDiff { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.RemoteDiff), + Hint: (func(x *SigHint) *SigHint { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Hint), + BreaksTracking: o.BreaksTracking, + } +} + +type UserTeamShowcase struct { + FqName string `codec:"fqName" json:"fq_name"` + Open bool `codec:"open" json:"open"` + TeamIsShowcased bool `codec:"teamIsShowcased" json:"team_is_showcased"` + Description string `codec:"description" json:"description"` + Role TeamRole `codec:"role" json:"role"` + PublicAdmins []string `codec:"publicAdmins" json:"public_admins"` + NumMembers int `codec:"numMembers" json:"num_members"` +} + +func (o UserTeamShowcase) DeepCopy() UserTeamShowcase { + return UserTeamShowcase{ + FqName: o.FqName, + Open: o.Open, + TeamIsShowcased: o.TeamIsShowcased, + Description: o.Description, + Role: o.Role.DeepCopy(), + PublicAdmins: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.PublicAdmins), + NumMembers: o.NumMembers, + } +} + +type UserCard struct { + Following int `codec:"following" json:"following"` + Followers int `codec:"followers" json:"followers"` + Uid UID `codec:"uid" json:"uid"` + FullName string `codec:"fullName" json:"fullName"` + Location string `codec:"location" json:"location"` + Bio string `codec:"bio" json:"bio"` + BioDecorated string `codec:"bioDecorated" json:"bioDecorated"` + Website string `codec:"website" json:"website"` + Twitter string `codec:"twitter" json:"twitter"` + YouFollowThem bool `codec:"youFollowThem" json:"youFollowThem"` + TheyFollowYou bool `codec:"theyFollowYou" json:"theyFollowYou"` + TeamShowcase []UserTeamShowcase `codec:"teamShowcase" json:"teamShowcase"` + RegisteredForAirdrop bool `codec:"registeredForAirdrop" json:"registeredForAirdrop"` + StellarHidden bool `codec:"stellarHidden" json:"stellarHidden"` + Blocked bool `codec:"blocked" json:"blocked"` + HidFromFollowers bool `codec:"hidFromFollowers" json:"hidFromFollowers"` +} + +func (o UserCard) DeepCopy() UserCard { + return UserCard{ + Following: o.Following, + Followers: o.Followers, + Uid: o.Uid.DeepCopy(), + FullName: o.FullName, + Location: o.Location, + Bio: o.Bio, + BioDecorated: o.BioDecorated, + Website: o.Website, + Twitter: o.Twitter, + YouFollowThem: o.YouFollowThem, + TheyFollowYou: o.TheyFollowYou, + TeamShowcase: (func(x []UserTeamShowcase) []UserTeamShowcase { + if x == nil { + return nil + } + ret := make([]UserTeamShowcase, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.TeamShowcase), + RegisteredForAirdrop: o.RegisteredForAirdrop, + StellarHidden: o.StellarHidden, + Blocked: o.Blocked, + HidFromFollowers: o.HidFromFollowers, + } +} + +type ConfirmResult struct { + IdentityConfirmed bool `codec:"identityConfirmed" json:"identityConfirmed"` + RemoteConfirmed bool `codec:"remoteConfirmed" json:"remoteConfirmed"` + ExpiringLocal bool `codec:"expiringLocal" json:"expiringLocal"` + AutoConfirmed bool `codec:"autoConfirmed" json:"autoConfirmed"` +} + +func (o ConfirmResult) DeepCopy() ConfirmResult { + return ConfirmResult{ + IdentityConfirmed: o.IdentityConfirmed, + RemoteConfirmed: o.RemoteConfirmed, + ExpiringLocal: o.ExpiringLocal, + AutoConfirmed: o.AutoConfirmed, + } +} + +type DismissReasonType int + +const ( + DismissReasonType_NONE DismissReasonType = 0 + DismissReasonType_HANDLED_ELSEWHERE DismissReasonType = 1 +) + +func (o DismissReasonType) DeepCopy() DismissReasonType { return o } + +var DismissReasonTypeMap = map[string]DismissReasonType{ + "NONE": 0, + "HANDLED_ELSEWHERE": 1, +} + +var DismissReasonTypeRevMap = map[DismissReasonType]string{ + 0: "NONE", + 1: "HANDLED_ELSEWHERE", +} + +func (e DismissReasonType) String() string { + if v, ok := DismissReasonTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type DismissReason struct { + Type DismissReasonType `codec:"type" json:"type"` + Reason string `codec:"reason" json:"reason"` + Resource string `codec:"resource" json:"resource"` +} + +func (o DismissReason) DeepCopy() DismissReason { + return DismissReason{ + Type: o.Type.DeepCopy(), + Reason: o.Reason, + Resource: o.Resource, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/implicit_team_migration.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/implicit_team_migration.go new file mode 100644 index 00000000..703ac01d --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/implicit_team_migration.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/implicit_team_migration.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/install.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/install.go new file mode 100644 index 00000000..2b31fd3e --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/install.go @@ -0,0 +1,236 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/install.avdl + +package keybase1 + +// Install status describes state of install for a component or service. +type InstallStatus int + +const ( + InstallStatus_UNKNOWN InstallStatus = 0 + InstallStatus_ERROR InstallStatus = 1 + InstallStatus_NOT_INSTALLED InstallStatus = 2 + InstallStatus_INSTALLED InstallStatus = 4 +) + +func (o InstallStatus) DeepCopy() InstallStatus { return o } + +var InstallStatusMap = map[string]InstallStatus{ + "UNKNOWN": 0, + "ERROR": 1, + "NOT_INSTALLED": 2, + "INSTALLED": 4, +} + +var InstallStatusRevMap = map[InstallStatus]string{ + 0: "UNKNOWN", + 1: "ERROR", + 2: "NOT_INSTALLED", + 4: "INSTALLED", +} + +type InstallAction int + +const ( + InstallAction_UNKNOWN InstallAction = 0 + InstallAction_NONE InstallAction = 1 + InstallAction_UPGRADE InstallAction = 2 + InstallAction_REINSTALL InstallAction = 3 + InstallAction_INSTALL InstallAction = 4 +) + +func (o InstallAction) DeepCopy() InstallAction { return o } + +var InstallActionMap = map[string]InstallAction{ + "UNKNOWN": 0, + "NONE": 1, + "UPGRADE": 2, + "REINSTALL": 3, + "INSTALL": 4, +} + +var InstallActionRevMap = map[InstallAction]string{ + 0: "UNKNOWN", + 1: "NONE", + 2: "UPGRADE", + 3: "REINSTALL", + 4: "INSTALL", +} + +type ServiceStatus struct { + Version string `codec:"version" json:"version"` + Label string `codec:"label" json:"label"` + Pid string `codec:"pid" json:"pid"` + LastExitStatus string `codec:"lastExitStatus" json:"lastExitStatus"` + BundleVersion string `codec:"bundleVersion" json:"bundleVersion"` + InstallStatus InstallStatus `codec:"installStatus" json:"installStatus"` + InstallAction InstallAction `codec:"installAction" json:"installAction"` + Status Status `codec:"status" json:"status"` +} + +func (o ServiceStatus) DeepCopy() ServiceStatus { + return ServiceStatus{ + Version: o.Version, + Label: o.Label, + Pid: o.Pid, + LastExitStatus: o.LastExitStatus, + BundleVersion: o.BundleVersion, + InstallStatus: o.InstallStatus.DeepCopy(), + InstallAction: o.InstallAction.DeepCopy(), + Status: o.Status.DeepCopy(), + } +} + +type ServicesStatus struct { + Service []ServiceStatus `codec:"service" json:"service"` + Kbfs []ServiceStatus `codec:"kbfs" json:"kbfs"` + Updater []ServiceStatus `codec:"updater" json:"updater"` +} + +func (o ServicesStatus) DeepCopy() ServicesStatus { + return ServicesStatus{ + Service: (func(x []ServiceStatus) []ServiceStatus { + if x == nil { + return nil + } + ret := make([]ServiceStatus, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Service), + Kbfs: (func(x []ServiceStatus) []ServiceStatus { + if x == nil { + return nil + } + ret := make([]ServiceStatus, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Kbfs), + Updater: (func(x []ServiceStatus) []ServiceStatus { + if x == nil { + return nil + } + ret := make([]ServiceStatus, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Updater), + } +} + +type FuseMountInfo struct { + Path string `codec:"path" json:"path"` + Fstype string `codec:"fstype" json:"fstype"` + Output string `codec:"output" json:"output"` +} + +func (o FuseMountInfo) DeepCopy() FuseMountInfo { + return FuseMountInfo{ + Path: o.Path, + Fstype: o.Fstype, + Output: o.Output, + } +} + +type FuseStatus struct { + Version string `codec:"version" json:"version"` + BundleVersion string `codec:"bundleVersion" json:"bundleVersion"` + KextID string `codec:"kextID" json:"kextID"` + Path string `codec:"path" json:"path"` + KextStarted bool `codec:"kextStarted" json:"kextStarted"` + InstallStatus InstallStatus `codec:"installStatus" json:"installStatus"` + InstallAction InstallAction `codec:"installAction" json:"installAction"` + MountInfos []FuseMountInfo `codec:"mountInfos" json:"mountInfos"` + Status Status `codec:"status" json:"status"` +} + +func (o FuseStatus) DeepCopy() FuseStatus { + return FuseStatus{ + Version: o.Version, + BundleVersion: o.BundleVersion, + KextID: o.KextID, + Path: o.Path, + KextStarted: o.KextStarted, + InstallStatus: o.InstallStatus.DeepCopy(), + InstallAction: o.InstallAction.DeepCopy(), + MountInfos: (func(x []FuseMountInfo) []FuseMountInfo { + if x == nil { + return nil + } + ret := make([]FuseMountInfo, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.MountInfos), + Status: o.Status.DeepCopy(), + } +} + +type ComponentResult struct { + Name string `codec:"name" json:"name"` + Status Status `codec:"status" json:"status"` + ExitCode int `codec:"exitCode" json:"exitCode"` +} + +func (o ComponentResult) DeepCopy() ComponentResult { + return ComponentResult{ + Name: o.Name, + Status: o.Status.DeepCopy(), + ExitCode: o.ExitCode, + } +} + +type InstallResult struct { + ComponentResults []ComponentResult `codec:"componentResults" json:"componentResults"` + Status Status `codec:"status" json:"status"` + Fatal bool `codec:"fatal" json:"fatal"` +} + +func (o InstallResult) DeepCopy() InstallResult { + return InstallResult{ + ComponentResults: (func(x []ComponentResult) []ComponentResult { + if x == nil { + return nil + } + ret := make([]ComponentResult, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ComponentResults), + Status: o.Status.DeepCopy(), + Fatal: o.Fatal, + } +} + +type UninstallResult struct { + ComponentResults []ComponentResult `codec:"componentResults" json:"componentResults"` + Status Status `codec:"status" json:"status"` +} + +func (o UninstallResult) DeepCopy() UninstallResult { + return UninstallResult{ + ComponentResults: (func(x []ComponentResult) []ComponentResult { + if x == nil { + return nil + } + ret := make([]ComponentResult, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ComponentResults), + Status: o.Status.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kbfs.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kbfs.go new file mode 100644 index 00000000..b32228aa --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kbfs.go @@ -0,0 +1,14 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/kbfs.avdl + +package keybase1 + +type KBFSTeamSettings struct { + TlfID TLFID `codec:"tlfID" json:"tlfID"` +} + +func (o KBFSTeamSettings) DeepCopy() KBFSTeamSettings { + return KBFSTeamSettings{ + TlfID: o.TlfID.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kbfs_common.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kbfs_common.go new file mode 100644 index 00000000..682044fa --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kbfs_common.go @@ -0,0 +1,366 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/kbfs_common.avdl + +package keybase1 + +import ( + "fmt" +) + +type FSStatusCode int + +const ( + FSStatusCode_START FSStatusCode = 0 + FSStatusCode_FINISH FSStatusCode = 1 + FSStatusCode_ERROR FSStatusCode = 2 +) + +func (o FSStatusCode) DeepCopy() FSStatusCode { return o } + +var FSStatusCodeMap = map[string]FSStatusCode{ + "START": 0, + "FINISH": 1, + "ERROR": 2, +} + +var FSStatusCodeRevMap = map[FSStatusCode]string{ + 0: "START", + 1: "FINISH", + 2: "ERROR", +} + +func (e FSStatusCode) String() string { + if v, ok := FSStatusCodeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type FSNotificationType int + +const ( + FSNotificationType_ENCRYPTING FSNotificationType = 0 + FSNotificationType_DECRYPTING FSNotificationType = 1 + FSNotificationType_SIGNING FSNotificationType = 2 + FSNotificationType_VERIFYING FSNotificationType = 3 + FSNotificationType_REKEYING FSNotificationType = 4 + FSNotificationType_CONNECTION FSNotificationType = 5 + FSNotificationType_MD_READ_SUCCESS FSNotificationType = 6 + FSNotificationType_FILE_CREATED FSNotificationType = 7 + FSNotificationType_FILE_MODIFIED FSNotificationType = 8 + FSNotificationType_FILE_DELETED FSNotificationType = 9 + FSNotificationType_FILE_RENAMED FSNotificationType = 10 + FSNotificationType_INITIALIZED FSNotificationType = 11 + FSNotificationType_SYNC_CONFIG_CHANGED FSNotificationType = 12 +) + +func (o FSNotificationType) DeepCopy() FSNotificationType { return o } + +var FSNotificationTypeMap = map[string]FSNotificationType{ + "ENCRYPTING": 0, + "DECRYPTING": 1, + "SIGNING": 2, + "VERIFYING": 3, + "REKEYING": 4, + "CONNECTION": 5, + "MD_READ_SUCCESS": 6, + "FILE_CREATED": 7, + "FILE_MODIFIED": 8, + "FILE_DELETED": 9, + "FILE_RENAMED": 10, + "INITIALIZED": 11, + "SYNC_CONFIG_CHANGED": 12, +} + +var FSNotificationTypeRevMap = map[FSNotificationType]string{ + 0: "ENCRYPTING", + 1: "DECRYPTING", + 2: "SIGNING", + 3: "VERIFYING", + 4: "REKEYING", + 5: "CONNECTION", + 6: "MD_READ_SUCCESS", + 7: "FILE_CREATED", + 8: "FILE_MODIFIED", + 9: "FILE_DELETED", + 10: "FILE_RENAMED", + 11: "INITIALIZED", + 12: "SYNC_CONFIG_CHANGED", +} + +func (e FSNotificationType) String() string { + if v, ok := FSNotificationTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type FSErrorType int + +const ( + FSErrorType_ACCESS_DENIED FSErrorType = 0 + FSErrorType_USER_NOT_FOUND FSErrorType = 1 + FSErrorType_REVOKED_DATA_DETECTED FSErrorType = 2 + FSErrorType_NOT_LOGGED_IN FSErrorType = 3 + FSErrorType_TIMEOUT FSErrorType = 4 + FSErrorType_REKEY_NEEDED FSErrorType = 5 + FSErrorType_BAD_FOLDER FSErrorType = 6 + FSErrorType_NOT_IMPLEMENTED FSErrorType = 7 + FSErrorType_OLD_VERSION FSErrorType = 8 + FSErrorType_OVER_QUOTA FSErrorType = 9 + FSErrorType_NO_SIG_CHAIN FSErrorType = 10 + FSErrorType_TOO_MANY_FOLDERS FSErrorType = 11 + FSErrorType_EXDEV_NOT_SUPPORTED FSErrorType = 12 + FSErrorType_DISK_LIMIT_REACHED FSErrorType = 13 + FSErrorType_DISK_CACHE_ERROR_LOG_SEND FSErrorType = 14 + FSErrorType_OFFLINE_ARCHIVED FSErrorType = 15 + FSErrorType_OFFLINE_UNSYNCED FSErrorType = 16 +) + +func (o FSErrorType) DeepCopy() FSErrorType { return o } + +var FSErrorTypeMap = map[string]FSErrorType{ + "ACCESS_DENIED": 0, + "USER_NOT_FOUND": 1, + "REVOKED_DATA_DETECTED": 2, + "NOT_LOGGED_IN": 3, + "TIMEOUT": 4, + "REKEY_NEEDED": 5, + "BAD_FOLDER": 6, + "NOT_IMPLEMENTED": 7, + "OLD_VERSION": 8, + "OVER_QUOTA": 9, + "NO_SIG_CHAIN": 10, + "TOO_MANY_FOLDERS": 11, + "EXDEV_NOT_SUPPORTED": 12, + "DISK_LIMIT_REACHED": 13, + "DISK_CACHE_ERROR_LOG_SEND": 14, + "OFFLINE_ARCHIVED": 15, + "OFFLINE_UNSYNCED": 16, +} + +var FSErrorTypeRevMap = map[FSErrorType]string{ + 0: "ACCESS_DENIED", + 1: "USER_NOT_FOUND", + 2: "REVOKED_DATA_DETECTED", + 3: "NOT_LOGGED_IN", + 4: "TIMEOUT", + 5: "REKEY_NEEDED", + 6: "BAD_FOLDER", + 7: "NOT_IMPLEMENTED", + 8: "OLD_VERSION", + 9: "OVER_QUOTA", + 10: "NO_SIG_CHAIN", + 11: "TOO_MANY_FOLDERS", + 12: "EXDEV_NOT_SUPPORTED", + 13: "DISK_LIMIT_REACHED", + 14: "DISK_CACHE_ERROR_LOG_SEND", + 15: "OFFLINE_ARCHIVED", + 16: "OFFLINE_UNSYNCED", +} + +func (e FSErrorType) String() string { + if v, ok := FSErrorTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type FSNotification struct { + Filename string `codec:"filename" json:"filename"` + Status string `codec:"status" json:"status"` + StatusCode FSStatusCode `codec:"statusCode" json:"statusCode"` + NotificationType FSNotificationType `codec:"notificationType" json:"notificationType"` + ErrorType FSErrorType `codec:"errorType" json:"errorType"` + Params map[string]string `codec:"params" json:"params"` + WriterUid UID `codec:"writerUid" json:"writerUid"` + LocalTime Time `codec:"localTime" json:"localTime"` + FolderType FolderType `codec:"folderType" json:"folderType"` +} + +func (o FSNotification) DeepCopy() FSNotification { + return FSNotification{ + Filename: o.Filename, + Status: o.Status, + StatusCode: o.StatusCode.DeepCopy(), + NotificationType: o.NotificationType.DeepCopy(), + ErrorType: o.ErrorType.DeepCopy(), + Params: (func(x map[string]string) map[string]string { + if x == nil { + return nil + } + ret := make(map[string]string, len(x)) + for k, v := range x { + kCopy := k + vCopy := v + ret[kCopy] = vCopy + } + return ret + })(o.Params), + WriterUid: o.WriterUid.DeepCopy(), + LocalTime: o.LocalTime.DeepCopy(), + FolderType: o.FolderType.DeepCopy(), + } +} + +type FSEditListRequest struct { + Folder Folder `codec:"folder" json:"folder"` + RequestID int `codec:"requestID" json:"requestID"` +} + +func (o FSEditListRequest) DeepCopy() FSEditListRequest { + return FSEditListRequest{ + Folder: o.Folder.DeepCopy(), + RequestID: o.RequestID, + } +} + +type FSFolderWriterEdit struct { + Filename string `codec:"filename" json:"filename"` + NotificationType FSNotificationType `codec:"notificationType" json:"notificationType"` + ServerTime Time `codec:"serverTime" json:"serverTime"` +} + +func (o FSFolderWriterEdit) DeepCopy() FSFolderWriterEdit { + return FSFolderWriterEdit{ + Filename: o.Filename, + NotificationType: o.NotificationType.DeepCopy(), + ServerTime: o.ServerTime.DeepCopy(), + } +} + +type FSFolderWriterEditHistory struct { + WriterName string `codec:"writerName" json:"writerName"` + Edits []FSFolderWriterEdit `codec:"edits" json:"edits"` + Deletes []FSFolderWriterEdit `codec:"deletes" json:"deletes"` +} + +func (o FSFolderWriterEditHistory) DeepCopy() FSFolderWriterEditHistory { + return FSFolderWriterEditHistory{ + WriterName: o.WriterName, + Edits: (func(x []FSFolderWriterEdit) []FSFolderWriterEdit { + if x == nil { + return nil + } + ret := make([]FSFolderWriterEdit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Edits), + Deletes: (func(x []FSFolderWriterEdit) []FSFolderWriterEdit { + if x == nil { + return nil + } + ret := make([]FSFolderWriterEdit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Deletes), + } +} + +type FSFolderEditHistory struct { + Folder Folder `codec:"folder" json:"folder"` + ServerTime Time `codec:"serverTime" json:"serverTime"` + History []FSFolderWriterEditHistory `codec:"history" json:"history"` +} + +func (o FSFolderEditHistory) DeepCopy() FSFolderEditHistory { + return FSFolderEditHistory{ + Folder: o.Folder.DeepCopy(), + ServerTime: o.ServerTime.DeepCopy(), + History: (func(x []FSFolderWriterEditHistory) []FSFolderWriterEditHistory { + if x == nil { + return nil + } + ret := make([]FSFolderWriterEditHistory, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.History), + } +} + +type FSSyncStatusRequest struct { + RequestID int `codec:"requestID" json:"requestID"` +} + +func (o FSSyncStatusRequest) DeepCopy() FSSyncStatusRequest { + return FSSyncStatusRequest{ + RequestID: o.RequestID, + } +} + +type FSPathSyncStatus struct { + FolderType FolderType `codec:"folderType" json:"folderType"` + Path string `codec:"path" json:"path"` + SyncingBytes int64 `codec:"syncingBytes" json:"syncingBytes"` + SyncingOps int64 `codec:"syncingOps" json:"syncingOps"` + SyncedBytes int64 `codec:"syncedBytes" json:"syncedBytes"` +} + +func (o FSPathSyncStatus) DeepCopy() FSPathSyncStatus { + return FSPathSyncStatus{ + FolderType: o.FolderType.DeepCopy(), + Path: o.Path, + SyncingBytes: o.SyncingBytes, + SyncingOps: o.SyncingOps, + SyncedBytes: o.SyncedBytes, + } +} + +type FSSyncStatus struct { + TotalSyncingBytes int64 `codec:"totalSyncingBytes" json:"totalSyncingBytes"` + SyncingPaths []string `codec:"syncingPaths" json:"syncingPaths"` + EndEstimate *Time `codec:"endEstimate,omitempty" json:"endEstimate,omitempty"` +} + +func (o FSSyncStatus) DeepCopy() FSSyncStatus { + return FSSyncStatus{ + TotalSyncingBytes: o.TotalSyncingBytes, + SyncingPaths: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.SyncingPaths), + EndEstimate: (func(x *Time) *Time { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.EndEstimate), + } +} + +type FolderSyncStatus struct { + LocalDiskBytesAvailable int64 `codec:"localDiskBytesAvailable" json:"localDiskBytesAvailable"` + LocalDiskBytesTotal int64 `codec:"localDiskBytesTotal" json:"localDiskBytesTotal"` + PrefetchStatus PrefetchStatus `codec:"prefetchStatus" json:"prefetchStatus"` + PrefetchProgress PrefetchProgress `codec:"prefetchProgress" json:"prefetchProgress"` + StoredBytesTotal int64 `codec:"storedBytesTotal" json:"storedBytesTotal"` + OutOfSyncSpace bool `codec:"outOfSyncSpace" json:"outOfSyncSpace"` +} + +func (o FolderSyncStatus) DeepCopy() FolderSyncStatus { + return FolderSyncStatus{ + LocalDiskBytesAvailable: o.LocalDiskBytesAvailable, + LocalDiskBytesTotal: o.LocalDiskBytesTotal, + PrefetchStatus: o.PrefetchStatus.DeepCopy(), + PrefetchProgress: o.PrefetchProgress.DeepCopy(), + StoredBytesTotal: o.StoredBytesTotal, + OutOfSyncSpace: o.OutOfSyncSpace, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kbfs_git.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kbfs_git.go new file mode 100644 index 00000000..a9e81d83 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kbfs_git.go @@ -0,0 +1,20 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/kbfs_git.avdl + +package keybase1 + +type GcOptions struct { + MaxLooseRefs int `codec:"maxLooseRefs" json:"maxLooseRefs"` + PruneMinLooseObjects int `codec:"pruneMinLooseObjects" json:"pruneMinLooseObjects"` + PruneExpireTime Time `codec:"pruneExpireTime" json:"pruneExpireTime"` + MaxObjectPacks int `codec:"maxObjectPacks" json:"maxObjectPacks"` +} + +func (o GcOptions) DeepCopy() GcOptions { + return GcOptions{ + MaxLooseRefs: o.MaxLooseRefs, + PruneMinLooseObjects: o.PruneMinLooseObjects, + PruneExpireTime: o.PruneExpireTime.DeepCopy(), + MaxObjectPacks: o.MaxObjectPacks, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kbfsmount.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kbfsmount.go new file mode 100644 index 00000000..d9d727f1 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kbfsmount.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/kbfsmount.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kex2provisionee.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kex2provisionee.go new file mode 100644 index 00000000..1dc8010c --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kex2provisionee.go @@ -0,0 +1,39 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/kex2provisionee.avdl + +package keybase1 + +type PassphraseStream struct { + PassphraseStream []byte `codec:"passphraseStream" json:"passphraseStream"` + Generation int `codec:"generation" json:"generation"` +} + +func (o PassphraseStream) DeepCopy() PassphraseStream { + return PassphraseStream{ + PassphraseStream: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.PassphraseStream), + Generation: o.Generation, + } +} + +type SessionToken string + +func (o SessionToken) DeepCopy() SessionToken { + return o +} + +type CsrfToken string + +func (o CsrfToken) DeepCopy() CsrfToken { + return o +} + +type HelloRes string + +func (o HelloRes) DeepCopy() HelloRes { + return o +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kex2provisionee2.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kex2provisionee2.go new file mode 100644 index 00000000..148c8fad --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kex2provisionee2.go @@ -0,0 +1,32 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/kex2provisionee2.avdl + +package keybase1 + +type Hello2Res struct { + EncryptionKey KID `codec:"encryptionKey" json:"encryptionKey"` + SigPayload HelloRes `codec:"sigPayload" json:"sigPayload"` + DeviceEkKID KID `codec:"deviceEkKID" json:"deviceEkKID"` +} + +func (o Hello2Res) DeepCopy() Hello2Res { + return Hello2Res{ + EncryptionKey: o.EncryptionKey.DeepCopy(), + SigPayload: o.SigPayload.DeepCopy(), + DeviceEkKID: o.DeviceEkKID.DeepCopy(), + } +} + +type PerUserKeyBox struct { + Generation PerUserKeyGeneration `codec:"generation" json:"generation"` + Box string `codec:"box" json:"box"` + ReceiverKID KID `codec:"receiverKID" json:"receiver_kid"` +} + +func (o PerUserKeyBox) DeepCopy() PerUserKeyBox { + return PerUserKeyBox{ + Generation: o.Generation.DeepCopy(), + Box: o.Box, + ReceiverKID: o.ReceiverKID.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kex2provisioner.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kex2provisioner.go new file mode 100644 index 00000000..e24d4e88 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kex2provisioner.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/kex2provisioner.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kvstore.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kvstore.go new file mode 100644 index 00000000..cbb8d945 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/kvstore.go @@ -0,0 +1,150 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/kvstore.avdl + +package keybase1 + +type KVGetResult struct { + TeamName string `codec:"teamName" json:"teamName"` + Namespace string `codec:"namespace" json:"namespace"` + EntryKey string `codec:"entryKey" json:"entryKey"` + EntryValue string `codec:"entryValue" json:"entryValue"` + Revision int `codec:"revision" json:"revision"` +} + +func (o KVGetResult) DeepCopy() KVGetResult { + return KVGetResult{ + TeamName: o.TeamName, + Namespace: o.Namespace, + EntryKey: o.EntryKey, + EntryValue: o.EntryValue, + Revision: o.Revision, + } +} + +type KVPutResult struct { + TeamName string `codec:"teamName" json:"teamName"` + Namespace string `codec:"namespace" json:"namespace"` + EntryKey string `codec:"entryKey" json:"entryKey"` + Revision int `codec:"revision" json:"revision"` +} + +func (o KVPutResult) DeepCopy() KVPutResult { + return KVPutResult{ + TeamName: o.TeamName, + Namespace: o.Namespace, + EntryKey: o.EntryKey, + Revision: o.Revision, + } +} + +type KVEntryID struct { + TeamID TeamID `codec:"teamID" json:"teamID"` + Namespace string `codec:"namespace" json:"namespace"` + EntryKey string `codec:"entryKey" json:"entryKey"` +} + +func (o KVEntryID) DeepCopy() KVEntryID { + return KVEntryID{ + TeamID: o.TeamID.DeepCopy(), + Namespace: o.Namespace, + EntryKey: o.EntryKey, + } +} + +type EncryptedKVEntry struct { + V int `codec:"v" json:"v"` + E []byte `codec:"e" json:"e"` + N []byte `codec:"n" json:"n"` +} + +func (o EncryptedKVEntry) DeepCopy() EncryptedKVEntry { + return EncryptedKVEntry{ + V: o.V, + E: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.E), + N: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.N), + } +} + +type KVListNamespaceResult struct { + TeamName string `codec:"teamName" json:"teamName"` + Namespaces []string `codec:"namespaces" json:"namespaces"` +} + +func (o KVListNamespaceResult) DeepCopy() KVListNamespaceResult { + return KVListNamespaceResult{ + TeamName: o.TeamName, + Namespaces: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Namespaces), + } +} + +type KVListEntryKey struct { + EntryKey string `codec:"entryKey" json:"entryKey"` + Revision int `codec:"revision" json:"revision"` +} + +func (o KVListEntryKey) DeepCopy() KVListEntryKey { + return KVListEntryKey{ + EntryKey: o.EntryKey, + Revision: o.Revision, + } +} + +type KVListEntryResult struct { + TeamName string `codec:"teamName" json:"teamName"` + Namespace string `codec:"namespace" json:"namespace"` + EntryKeys []KVListEntryKey `codec:"entryKeys" json:"entryKeys"` +} + +func (o KVListEntryResult) DeepCopy() KVListEntryResult { + return KVListEntryResult{ + TeamName: o.TeamName, + Namespace: o.Namespace, + EntryKeys: (func(x []KVListEntryKey) []KVListEntryKey { + if x == nil { + return nil + } + ret := make([]KVListEntryKey, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.EntryKeys), + } +} + +type KVDeleteEntryResult struct { + TeamName string `codec:"teamName" json:"teamName"` + Namespace string `codec:"namespace" json:"namespace"` + EntryKey string `codec:"entryKey" json:"entryKey"` + Revision int `codec:"revision" json:"revision"` +} + +func (o KVDeleteEntryResult) DeepCopy() KVDeleteEntryResult { + return KVDeleteEntryResult{ + TeamName: o.TeamName, + Namespace: o.Namespace, + EntryKey: o.EntryKey, + Revision: o.Revision, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/log.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/log.go new file mode 100644 index 00000000..2874c1ef --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/log.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/log.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/log_ui.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/log_ui.go new file mode 100644 index 00000000..39bd218c --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/log_ui.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/log_ui.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/login.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/login.go new file mode 100644 index 00000000..86e383e8 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/login.go @@ -0,0 +1,20 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/login.avdl + +package keybase1 + +type ConfiguredAccount struct { + Username string `codec:"username" json:"username"` + Fullname FullName `codec:"fullname" json:"fullname"` + HasStoredSecret bool `codec:"hasStoredSecret" json:"hasStoredSecret"` + IsCurrent bool `codec:"isCurrent" json:"isCurrent"` +} + +func (o ConfiguredAccount) DeepCopy() ConfiguredAccount { + return ConfiguredAccount{ + Username: o.Username, + Fullname: o.Fullname.DeepCopy(), + HasStoredSecret: o.HasStoredSecret, + IsCurrent: o.IsCurrent, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/login_ui.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/login_ui.go new file mode 100644 index 00000000..124ff2b3 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/login_ui.go @@ -0,0 +1,196 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/login_ui.avdl + +package keybase1 + +import ( + "errors" + "fmt" +) + +type ResetPromptType int + +const ( + ResetPromptType_COMPLETE ResetPromptType = 0 + ResetPromptType_ENTER_NO_DEVICES ResetPromptType = 1 + ResetPromptType_ENTER_FORGOT_PW ResetPromptType = 2 + ResetPromptType_ENTER_RESET_PW ResetPromptType = 3 +) + +func (o ResetPromptType) DeepCopy() ResetPromptType { return o } + +var ResetPromptTypeMap = map[string]ResetPromptType{ + "COMPLETE": 0, + "ENTER_NO_DEVICES": 1, + "ENTER_FORGOT_PW": 2, + "ENTER_RESET_PW": 3, +} + +var ResetPromptTypeRevMap = map[ResetPromptType]string{ + 0: "COMPLETE", + 1: "ENTER_NO_DEVICES", + 2: "ENTER_FORGOT_PW", + 3: "ENTER_RESET_PW", +} + +func (e ResetPromptType) String() string { + if v, ok := ResetPromptTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ResetPromptInfo struct { + HasWallet bool `codec:"hasWallet" json:"hasWallet"` +} + +func (o ResetPromptInfo) DeepCopy() ResetPromptInfo { + return ResetPromptInfo{ + HasWallet: o.HasWallet, + } +} + +type ResetPrompt struct { + T__ ResetPromptType `codec:"t" json:"t"` + Complete__ *ResetPromptInfo `codec:"complete,omitempty" json:"complete,omitempty"` +} + +func (o *ResetPrompt) T() (ret ResetPromptType, err error) { + switch o.T__ { + case ResetPromptType_COMPLETE: + if o.Complete__ == nil { + err = errors.New("unexpected nil value for Complete__") + return ret, err + } + } + return o.T__, nil +} + +func (o ResetPrompt) Complete() (res ResetPromptInfo) { + if o.T__ != ResetPromptType_COMPLETE { + panic("wrong case accessed") + } + if o.Complete__ == nil { + return + } + return *o.Complete__ +} + +func NewResetPromptWithComplete(v ResetPromptInfo) ResetPrompt { + return ResetPrompt{ + T__: ResetPromptType_COMPLETE, + Complete__: &v, + } +} + +func NewResetPromptDefault(t ResetPromptType) ResetPrompt { + return ResetPrompt{ + T__: t, + } +} + +func (o ResetPrompt) DeepCopy() ResetPrompt { + return ResetPrompt{ + T__: o.T__.DeepCopy(), + Complete__: (func(x *ResetPromptInfo) *ResetPromptInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Complete__), + } +} + +type ResetPromptResponse int + +const ( + ResetPromptResponse_NOTHING ResetPromptResponse = 0 + ResetPromptResponse_CANCEL_RESET ResetPromptResponse = 1 + ResetPromptResponse_CONFIRM_RESET ResetPromptResponse = 2 +) + +func (o ResetPromptResponse) DeepCopy() ResetPromptResponse { return o } + +var ResetPromptResponseMap = map[string]ResetPromptResponse{ + "NOTHING": 0, + "CANCEL_RESET": 1, + "CONFIRM_RESET": 2, +} + +var ResetPromptResponseRevMap = map[ResetPromptResponse]string{ + 0: "NOTHING", + 1: "CANCEL_RESET", + 2: "CONFIRM_RESET", +} + +func (e ResetPromptResponse) String() string { + if v, ok := ResetPromptResponseRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type PassphraseRecoveryPromptType int + +const ( + PassphraseRecoveryPromptType_ENCRYPTED_PGP_KEYS PassphraseRecoveryPromptType = 0 +) + +func (o PassphraseRecoveryPromptType) DeepCopy() PassphraseRecoveryPromptType { return o } + +var PassphraseRecoveryPromptTypeMap = map[string]PassphraseRecoveryPromptType{ + "ENCRYPTED_PGP_KEYS": 0, +} + +var PassphraseRecoveryPromptTypeRevMap = map[PassphraseRecoveryPromptType]string{ + 0: "ENCRYPTED_PGP_KEYS", +} + +func (e PassphraseRecoveryPromptType) String() string { + if v, ok := PassphraseRecoveryPromptTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ResetMessage int + +const ( + ResetMessage_ENTERED_VERIFIED ResetMessage = 0 + ResetMessage_ENTERED_PASSWORDLESS ResetMessage = 1 + ResetMessage_REQUEST_VERIFIED ResetMessage = 2 + ResetMessage_NOT_COMPLETED ResetMessage = 3 + ResetMessage_CANCELED ResetMessage = 4 + ResetMessage_COMPLETED ResetMessage = 5 + ResetMessage_RESET_LINK_SENT ResetMessage = 6 +) + +func (o ResetMessage) DeepCopy() ResetMessage { return o } + +var ResetMessageMap = map[string]ResetMessage{ + "ENTERED_VERIFIED": 0, + "ENTERED_PASSWORDLESS": 1, + "REQUEST_VERIFIED": 2, + "NOT_COMPLETED": 3, + "CANCELED": 4, + "COMPLETED": 5, + "RESET_LINK_SENT": 6, +} + +var ResetMessageRevMap = map[ResetMessage]string{ + 0: "ENTERED_VERIFIED", + 1: "ENTERED_PASSWORDLESS", + 2: "REQUEST_VERIFIED", + 3: "NOT_COMPLETED", + 4: "CANCELED", + 5: "COMPLETED", + 6: "RESET_LINK_SENT", +} + +func (e ResetMessage) String() string { + if v, ok := ResetMessageRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/logsend.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/logsend.go new file mode 100644 index 00000000..55df5fb9 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/logsend.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/logsend.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/merkle.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/merkle.go new file mode 100644 index 00000000..f8c4320a --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/merkle.go @@ -0,0 +1,41 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/merkle.avdl + +package keybase1 + +type MerkleRootAndTime struct { + Root MerkleRootV2 `codec:"root" json:"root"` + UpdateTime Time `codec:"updateTime" json:"updateTime"` + FetchTime Time `codec:"fetchTime" json:"fetchTime"` +} + +func (o MerkleRootAndTime) DeepCopy() MerkleRootAndTime { + return MerkleRootAndTime{ + Root: o.Root.DeepCopy(), + UpdateTime: o.UpdateTime.DeepCopy(), + FetchTime: o.FetchTime.DeepCopy(), + } +} + +type KBFSRootHash []byte + +func (o KBFSRootHash) DeepCopy() KBFSRootHash { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type KBFSRoot struct { + TreeID MerkleTreeID `codec:"treeID" json:"treeID"` + Root KBFSRootHash `codec:"root" json:"root"` +} + +func (o KBFSRoot) DeepCopy() KBFSRoot { + return KBFSRoot{ + TreeID: o.TreeID.DeepCopy(), + Root: o.Root.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/merkle_store.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/merkle_store.go new file mode 100644 index 00000000..a8ea0091 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/merkle_store.go @@ -0,0 +1,40 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/merkle_store.avdl + +package keybase1 + +type MerkleStoreSupportedVersion int + +func (o MerkleStoreSupportedVersion) DeepCopy() MerkleStoreSupportedVersion { + return o +} + +type MerkleStoreKitHash string + +func (o MerkleStoreKitHash) DeepCopy() MerkleStoreKitHash { + return o +} + +type MerkleStoreKit string + +func (o MerkleStoreKit) DeepCopy() MerkleStoreKit { + return o +} + +type MerkleStoreEntryString string + +func (o MerkleStoreEntryString) DeepCopy() MerkleStoreEntryString { + return o +} + +type MerkleStoreEntry struct { + Hash MerkleStoreKitHash `codec:"hash" json:"hash"` + Entry MerkleStoreEntryString `codec:"entry" json:"entry"` +} + +func (o MerkleStoreEntry) DeepCopy() MerkleStoreEntry { + return MerkleStoreEntry{ + Hash: o.Hash.DeepCopy(), + Entry: o.Entry.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/metadata.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/metadata.go new file mode 100644 index 00000000..1dc761f0 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/metadata.go @@ -0,0 +1,175 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/metadata.avdl + +package keybase1 + +type KeyHalf struct { + User UID `codec:"user" json:"user"` + DeviceKID KID `codec:"deviceKID" json:"deviceKID"` + Key []byte `codec:"key" json:"key"` +} + +func (o KeyHalf) DeepCopy() KeyHalf { + return KeyHalf{ + User: o.User.DeepCopy(), + DeviceKID: o.DeviceKID.DeepCopy(), + Key: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.Key), + } +} + +type MDBlock struct { + Version int `codec:"version" json:"version"` + Timestamp Time `codec:"timestamp" json:"timestamp"` + Block []byte `codec:"block" json:"block"` +} + +func (o MDBlock) DeepCopy() MDBlock { + return MDBlock{ + Version: o.Version, + Timestamp: o.Timestamp.DeepCopy(), + Block: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.Block), + } +} + +type KeyBundle struct { + Version int `codec:"version" json:"version"` + Bundle []byte `codec:"bundle" json:"bundle"` +} + +func (o KeyBundle) DeepCopy() KeyBundle { + return KeyBundle{ + Version: o.Version, + Bundle: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.Bundle), + } +} + +type MetadataResponse struct { + FolderID string `codec:"folderID" json:"folderID"` + MdBlocks []MDBlock `codec:"mdBlocks" json:"mdBlocks"` +} + +func (o MetadataResponse) DeepCopy() MetadataResponse { + return MetadataResponse{ + FolderID: o.FolderID, + MdBlocks: (func(x []MDBlock) []MDBlock { + if x == nil { + return nil + } + ret := make([]MDBlock, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.MdBlocks), + } +} + +type MerkleRoot struct { + Version int `codec:"version" json:"version"` + Root []byte `codec:"root" json:"root"` +} + +func (o MerkleRoot) DeepCopy() MerkleRoot { + return MerkleRoot{ + Version: o.Version, + Root: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.Root), + } +} + +type PingResponse struct { + Timestamp Time `codec:"timestamp" json:"timestamp"` +} + +func (o PingResponse) DeepCopy() PingResponse { + return PingResponse{ + Timestamp: o.Timestamp.DeepCopy(), + } +} + +type KeyBundleResponse struct { + WriterBundle KeyBundle `codec:"WriterBundle" json:"WriterBundle"` + ReaderBundle KeyBundle `codec:"ReaderBundle" json:"ReaderBundle"` +} + +func (o KeyBundleResponse) DeepCopy() KeyBundleResponse { + return KeyBundleResponse{ + WriterBundle: o.WriterBundle.DeepCopy(), + ReaderBundle: o.ReaderBundle.DeepCopy(), + } +} + +type LockID int64 + +func (o LockID) DeepCopy() LockID { + return o +} + +type MDPriority int + +func (o MDPriority) DeepCopy() MDPriority { + return o +} + +type LockContext struct { + RequireLockID LockID `codec:"requireLockID" json:"requireLockID"` + ReleaseAfterSuccess bool `codec:"releaseAfterSuccess" json:"releaseAfterSuccess"` +} + +func (o LockContext) DeepCopy() LockContext { + return LockContext{ + RequireLockID: o.RequireLockID.DeepCopy(), + ReleaseAfterSuccess: o.ReleaseAfterSuccess, + } +} + +type FindNextMDResponse struct { + KbfsRoot MerkleRoot `codec:"kbfsRoot" json:"kbfsRoot"` + MerkleNodes [][]byte `codec:"merkleNodes" json:"merkleNodes"` + RootSeqno Seqno `codec:"rootSeqno" json:"rootSeqno"` + RootHash HashMeta `codec:"rootHash" json:"rootHash"` +} + +func (o FindNextMDResponse) DeepCopy() FindNextMDResponse { + return FindNextMDResponse{ + KbfsRoot: o.KbfsRoot.DeepCopy(), + MerkleNodes: (func(x [][]byte) [][]byte { + if x == nil { + return nil + } + ret := make([][]byte, len(x)) + for i, v := range x { + vCopy := (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(v) + ret[i] = vCopy + } + return ret + })(o.MerkleNodes), + RootSeqno: o.RootSeqno.DeepCopy(), + RootHash: o.RootHash.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/metadata_update.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/metadata_update.go new file mode 100644 index 00000000..85d49c81 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/metadata_update.go @@ -0,0 +1,16 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/metadata_update.avdl + +package keybase1 + +type RekeyRequest struct { + FolderID string `codec:"folderID" json:"folderID"` + Revision int64 `codec:"revision" json:"revision"` +} + +func (o RekeyRequest) DeepCopy() RekeyRequest { + return RekeyRequest{ + FolderID: o.FolderID, + Revision: o.Revision, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_app.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_app.go new file mode 100644 index 00000000..64f76c79 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_app.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_app.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_audit.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_audit.go new file mode 100644 index 00000000..8a39a98e --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_audit.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_audit.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_badges.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_badges.go new file mode 100644 index 00000000..b3541b99 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_badges.go @@ -0,0 +1,232 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_badges.avdl + +package keybase1 + +import ( + gregor1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1" +) + +type ChatConversationID []byte + +func (o ChatConversationID) DeepCopy() ChatConversationID { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type TeamMemberOutReset struct { + TeamID TeamID `codec:"teamID" json:"teamID"` + Teamname string `codec:"teamname" json:"teamname"` + Username string `codec:"username" json:"username"` + Uid UID `codec:"uid" json:"uid"` + Id gregor1.MsgID `codec:"id" json:"id"` +} + +func (o TeamMemberOutReset) DeepCopy() TeamMemberOutReset { + return TeamMemberOutReset{ + TeamID: o.TeamID.DeepCopy(), + Teamname: o.Teamname, + Username: o.Username, + Uid: o.Uid.DeepCopy(), + Id: o.Id.DeepCopy(), + } +} + +type DeletedTeamInfo struct { + TeamName string `codec:"teamName" json:"teamName"` + DeletedBy string `codec:"deletedBy" json:"deletedBy"` + Id gregor1.MsgID `codec:"id" json:"id"` +} + +func (o DeletedTeamInfo) DeepCopy() DeletedTeamInfo { + return DeletedTeamInfo{ + TeamName: o.TeamName, + DeletedBy: o.DeletedBy, + Id: o.Id.DeepCopy(), + } +} + +type WalletAccountInfo struct { + AccountID string `codec:"accountID" json:"accountID"` + NumUnread int `codec:"numUnread" json:"numUnread"` +} + +func (o WalletAccountInfo) DeepCopy() WalletAccountInfo { + return WalletAccountInfo{ + AccountID: o.AccountID, + NumUnread: o.NumUnread, + } +} + +type ResetState struct { + EndTime Time `codec:"endTime" json:"end_time"` + Active bool `codec:"active" json:"active"` +} + +func (o ResetState) DeepCopy() ResetState { + return ResetState{ + EndTime: o.EndTime.DeepCopy(), + Active: o.Active, + } +} + +type BadgeState struct { + NewTlfs int `codec:"newTlfs" json:"newTlfs"` + RekeysNeeded int `codec:"rekeysNeeded" json:"rekeysNeeded"` + NewFollowers int `codec:"newFollowers" json:"newFollowers"` + InboxVers int `codec:"inboxVers" json:"inboxVers"` + HomeTodoItems int `codec:"homeTodoItems" json:"homeTodoItems"` + UnverifiedEmails int `codec:"unverifiedEmails" json:"unverifiedEmails"` + UnverifiedPhones int `codec:"unverifiedPhones" json:"unverifiedPhones"` + NewDevices []DeviceID `codec:"newDevices" json:"newDevices"` + RevokedDevices []DeviceID `codec:"revokedDevices" json:"revokedDevices"` + Conversations []BadgeConversationInfo `codec:"conversations" json:"conversations"` + NewGitRepoGlobalUniqueIDs []string `codec:"newGitRepoGlobalUniqueIDs" json:"newGitRepoGlobalUniqueIDs"` + NewTeams []TeamID `codec:"newTeams" json:"newTeams"` + DeletedTeams []DeletedTeamInfo `codec:"deletedTeams" json:"deletedTeams"` + NewTeamAccessRequests []TeamID `codec:"newTeamAccessRequests" json:"newTeamAccessRequests"` + TeamsWithResetUsers []TeamMemberOutReset `codec:"teamsWithResetUsers" json:"teamsWithResetUsers"` + UnreadWalletAccounts []WalletAccountInfo `codec:"unreadWalletAccounts" json:"unreadWalletAccounts"` + ResetState ResetState `codec:"resetState" json:"resetState"` +} + +func (o BadgeState) DeepCopy() BadgeState { + return BadgeState{ + NewTlfs: o.NewTlfs, + RekeysNeeded: o.RekeysNeeded, + NewFollowers: o.NewFollowers, + InboxVers: o.InboxVers, + HomeTodoItems: o.HomeTodoItems, + UnverifiedEmails: o.UnverifiedEmails, + UnverifiedPhones: o.UnverifiedPhones, + NewDevices: (func(x []DeviceID) []DeviceID { + if x == nil { + return nil + } + ret := make([]DeviceID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.NewDevices), + RevokedDevices: (func(x []DeviceID) []DeviceID { + if x == nil { + return nil + } + ret := make([]DeviceID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RevokedDevices), + Conversations: (func(x []BadgeConversationInfo) []BadgeConversationInfo { + if x == nil { + return nil + } + ret := make([]BadgeConversationInfo, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Conversations), + NewGitRepoGlobalUniqueIDs: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.NewGitRepoGlobalUniqueIDs), + NewTeams: (func(x []TeamID) []TeamID { + if x == nil { + return nil + } + ret := make([]TeamID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.NewTeams), + DeletedTeams: (func(x []DeletedTeamInfo) []DeletedTeamInfo { + if x == nil { + return nil + } + ret := make([]DeletedTeamInfo, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.DeletedTeams), + NewTeamAccessRequests: (func(x []TeamID) []TeamID { + if x == nil { + return nil + } + ret := make([]TeamID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.NewTeamAccessRequests), + TeamsWithResetUsers: (func(x []TeamMemberOutReset) []TeamMemberOutReset { + if x == nil { + return nil + } + ret := make([]TeamMemberOutReset, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.TeamsWithResetUsers), + UnreadWalletAccounts: (func(x []WalletAccountInfo) []WalletAccountInfo { + if x == nil { + return nil + } + ret := make([]WalletAccountInfo, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.UnreadWalletAccounts), + ResetState: o.ResetState.DeepCopy(), + } +} + +type BadgeConversationInfo struct { + ConvID ChatConversationID `codec:"convID" json:"convID"` + BadgeCounts map[DeviceType]int `codec:"badgeCounts" json:"badgeCounts"` + UnreadMessages int `codec:"unreadMessages" json:"unreadMessages"` +} + +func (o BadgeConversationInfo) DeepCopy() BadgeConversationInfo { + return BadgeConversationInfo{ + ConvID: o.ConvID.DeepCopy(), + BadgeCounts: (func(x map[DeviceType]int) map[DeviceType]int { + if x == nil { + return nil + } + ret := make(map[DeviceType]int, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v + ret[kCopy] = vCopy + } + return ret + })(o.BadgeCounts), + UnreadMessages: o.UnreadMessages, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_can_user_perform.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_can_user_perform.go new file mode 100644 index 00000000..92be0aa3 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_can_user_perform.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_can_user_perform.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_ctl.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_ctl.go new file mode 100644 index 00000000..a937a7d6 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_ctl.go @@ -0,0 +1,70 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_ctl.avdl + +package keybase1 + +type NotificationChannels struct { + Session bool `codec:"session" json:"session"` + Users bool `codec:"users" json:"users"` + Kbfs bool `codec:"kbfs" json:"kbfs"` + Kbfsdesktop bool `codec:"kbfsdesktop" json:"kbfsdesktop"` + Kbfslegacy bool `codec:"kbfslegacy" json:"kbfslegacy"` + Kbfssubscription bool `codec:"kbfssubscription" json:"kbfssubscription"` + Tracking bool `codec:"tracking" json:"tracking"` + Favorites bool `codec:"favorites" json:"favorites"` + Paperkeys bool `codec:"paperkeys" json:"paperkeys"` + Keyfamily bool `codec:"keyfamily" json:"keyfamily"` + Service bool `codec:"service" json:"service"` + App bool `codec:"app" json:"app"` + Chat bool `codec:"chat" json:"chat"` + PGP bool `codec:"pgp" json:"pgp"` + Kbfsrequest bool `codec:"kbfsrequest" json:"kbfsrequest"` + Badges bool `codec:"badges" json:"badges"` + Reachability bool `codec:"reachability" json:"reachability"` + Team bool `codec:"team" json:"team"` + Ephemeral bool `codec:"ephemeral" json:"ephemeral"` + Teambot bool `codec:"teambot" json:"teambot"` + Chatkbfsedits bool `codec:"chatkbfsedits" json:"chatkbfsedits"` + Chatdev bool `codec:"chatdev" json:"chatdev"` + Deviceclone bool `codec:"deviceclone" json:"deviceclone"` + Chatattachments bool `codec:"chatattachments" json:"chatattachments"` + Wallet bool `codec:"wallet" json:"wallet"` + Audit bool `codec:"audit" json:"audit"` + Runtimestats bool `codec:"runtimestats" json:"runtimestats"` + FeaturedBots bool `codec:"featuredBots" json:"featuredBots"` + Saltpack bool `codec:"saltpack" json:"saltpack"` +} + +func (o NotificationChannels) DeepCopy() NotificationChannels { + return NotificationChannels{ + Session: o.Session, + Users: o.Users, + Kbfs: o.Kbfs, + Kbfsdesktop: o.Kbfsdesktop, + Kbfslegacy: o.Kbfslegacy, + Kbfssubscription: o.Kbfssubscription, + Tracking: o.Tracking, + Favorites: o.Favorites, + Paperkeys: o.Paperkeys, + Keyfamily: o.Keyfamily, + Service: o.Service, + App: o.App, + Chat: o.Chat, + PGP: o.PGP, + Kbfsrequest: o.Kbfsrequest, + Badges: o.Badges, + Reachability: o.Reachability, + Team: o.Team, + Ephemeral: o.Ephemeral, + Teambot: o.Teambot, + Chatkbfsedits: o.Chatkbfsedits, + Chatdev: o.Chatdev, + Deviceclone: o.Deviceclone, + Chatattachments: o.Chatattachments, + Wallet: o.Wallet, + Audit: o.Audit, + Runtimestats: o.Runtimestats, + FeaturedBots: o.FeaturedBots, + Saltpack: o.Saltpack, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_device_clone.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_device_clone.go new file mode 100644 index 00000000..61bfa51c --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_device_clone.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_device_clone.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_email.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_email.go new file mode 100644 index 00000000..297afae3 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_email.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_email.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_ephemeral.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_ephemeral.go new file mode 100644 index 00000000..f23a9fa0 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_ephemeral.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_ephemeral.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_favorites.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_favorites.go new file mode 100644 index 00000000..5a30b97f --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_favorites.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_favorites.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_featuredbots.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_featuredbots.go new file mode 100644 index 00000000..ac43c6bf --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_featuredbots.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_featuredbots.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_fs.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_fs.go new file mode 100644 index 00000000..aadffd81 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_fs.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_fs.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_fs_request.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_fs_request.go new file mode 100644 index 00000000..a5d9259f --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_fs_request.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_fs_request.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_keyfamily.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_keyfamily.go new file mode 100644 index 00000000..36fa67b3 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_keyfamily.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_keyfamily.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_paperkey.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_paperkey.go new file mode 100644 index 00000000..4ea5435c --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_paperkey.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_paperkey.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_pgp.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_pgp.go new file mode 100644 index 00000000..7f8a6070 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_pgp.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_pgp.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_phone.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_phone.go new file mode 100644 index 00000000..42c5e0f9 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_phone.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_phone.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_runtimestats.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_runtimestats.go new file mode 100644 index 00000000..99906ffa --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_runtimestats.go @@ -0,0 +1,141 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_runtimestats.avdl + +package keybase1 + +import ( + "fmt" +) + +type StatsSeverityLevel int + +const ( + StatsSeverityLevel_NORMAL StatsSeverityLevel = 0 + StatsSeverityLevel_WARNING StatsSeverityLevel = 1 + StatsSeverityLevel_SEVERE StatsSeverityLevel = 2 +) + +func (o StatsSeverityLevel) DeepCopy() StatsSeverityLevel { return o } + +var StatsSeverityLevelMap = map[string]StatsSeverityLevel{ + "NORMAL": 0, + "WARNING": 1, + "SEVERE": 2, +} + +var StatsSeverityLevelRevMap = map[StatsSeverityLevel]string{ + 0: "NORMAL", + 1: "WARNING", + 2: "SEVERE", +} + +func (e StatsSeverityLevel) String() string { + if v, ok := StatsSeverityLevelRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type DbStats struct { + Type DbType `codec:"type" json:"type"` + MemCompActive bool `codec:"memCompActive" json:"memCompActive"` + TableCompActive bool `codec:"tableCompActive" json:"tableCompActive"` +} + +func (o DbStats) DeepCopy() DbStats { + return DbStats{ + Type: o.Type.DeepCopy(), + MemCompActive: o.MemCompActive, + TableCompActive: o.TableCompActive, + } +} + +type ProcessType int + +const ( + ProcessType_MAIN ProcessType = 0 + ProcessType_KBFS ProcessType = 1 +) + +func (o ProcessType) DeepCopy() ProcessType { return o } + +var ProcessTypeMap = map[string]ProcessType{ + "MAIN": 0, + "KBFS": 1, +} + +var ProcessTypeRevMap = map[ProcessType]string{ + 0: "MAIN", + 1: "KBFS", +} + +func (e ProcessType) String() string { + if v, ok := ProcessTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ProcessRuntimeStats struct { + Type ProcessType `codec:"type" json:"type"` + Cpu string `codec:"cpu" json:"cpu"` + Resident string `codec:"resident" json:"resident"` + Virt string `codec:"virt" json:"virt"` + Free string `codec:"free" json:"free"` + Goheap string `codec:"goheap" json:"goheap"` + Goheapsys string `codec:"goheapsys" json:"goheapsys"` + Goreleased string `codec:"goreleased" json:"goreleased"` + CpuSeverity StatsSeverityLevel `codec:"cpuSeverity" json:"cpuSeverity"` + ResidentSeverity StatsSeverityLevel `codec:"residentSeverity" json:"residentSeverity"` +} + +func (o ProcessRuntimeStats) DeepCopy() ProcessRuntimeStats { + return ProcessRuntimeStats{ + Type: o.Type.DeepCopy(), + Cpu: o.Cpu, + Resident: o.Resident, + Virt: o.Virt, + Free: o.Free, + Goheap: o.Goheap, + Goheapsys: o.Goheapsys, + Goreleased: o.Goreleased, + CpuSeverity: o.CpuSeverity.DeepCopy(), + ResidentSeverity: o.ResidentSeverity.DeepCopy(), + } +} + +type RuntimeStats struct { + ProcessStats []ProcessRuntimeStats `codec:"processStats" json:"processStats"` + DbStats []DbStats `codec:"dbStats" json:"dbStats"` + ConvLoaderActive bool `codec:"convLoaderActive" json:"convLoaderActive"` + SelectiveSyncActive bool `codec:"selectiveSyncActive" json:"selectiveSyncActive"` +} + +func (o RuntimeStats) DeepCopy() RuntimeStats { + return RuntimeStats{ + ProcessStats: (func(x []ProcessRuntimeStats) []ProcessRuntimeStats { + if x == nil { + return nil + } + ret := make([]ProcessRuntimeStats, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ProcessStats), + DbStats: (func(x []DbStats) []DbStats { + if x == nil { + return nil + } + ret := make([]DbStats, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.DbStats), + ConvLoaderActive: o.ConvLoaderActive, + SelectiveSyncActive: o.SelectiveSyncActive, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_saltpack.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_saltpack.go new file mode 100644 index 00000000..8df8a8d9 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_saltpack.go @@ -0,0 +1,40 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_saltpack.avdl + +package keybase1 + +import ( + "fmt" +) + +type SaltpackOperationType int + +const ( + SaltpackOperationType_ENCRYPT SaltpackOperationType = 0 + SaltpackOperationType_DECRYPT SaltpackOperationType = 1 + SaltpackOperationType_SIGN SaltpackOperationType = 2 + SaltpackOperationType_VERIFY SaltpackOperationType = 3 +) + +func (o SaltpackOperationType) DeepCopy() SaltpackOperationType { return o } + +var SaltpackOperationTypeMap = map[string]SaltpackOperationType{ + "ENCRYPT": 0, + "DECRYPT": 1, + "SIGN": 2, + "VERIFY": 3, +} + +var SaltpackOperationTypeRevMap = map[SaltpackOperationType]string{ + 0: "ENCRYPT", + 1: "DECRYPT", + 2: "SIGN", + 3: "VERIFY", +} + +func (e SaltpackOperationType) String() string { + if v, ok := SaltpackOperationTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_service.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_service.go new file mode 100644 index 00000000..e96d4ddf --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_service.go @@ -0,0 +1,16 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_service.avdl + +package keybase1 + +type HttpSrvInfo struct { + Address string `codec:"address" json:"address"` + Token string `codec:"token" json:"token"` +} + +func (o HttpSrvInfo) DeepCopy() HttpSrvInfo { + return HttpSrvInfo{ + Address: o.Address, + Token: o.Token, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_session.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_session.go new file mode 100644 index 00000000..3f89041e --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_session.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_session.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_team.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_team.go new file mode 100644 index 00000000..b90f13e4 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_team.go @@ -0,0 +1,53 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_team.avdl + +package keybase1 + +import ( + "fmt" +) + +type TeamChangeSet struct { + MembershipChanged bool `codec:"membershipChanged" json:"membershipChanged"` + KeyRotated bool `codec:"keyRotated" json:"keyRotated"` + Renamed bool `codec:"renamed" json:"renamed"` + Misc bool `codec:"misc" json:"misc"` +} + +func (o TeamChangeSet) DeepCopy() TeamChangeSet { + return TeamChangeSet{ + MembershipChanged: o.MembershipChanged, + KeyRotated: o.KeyRotated, + Renamed: o.Renamed, + Misc: o.Misc, + } +} + +type AvatarUpdateType int + +const ( + AvatarUpdateType_NONE AvatarUpdateType = 0 + AvatarUpdateType_USER AvatarUpdateType = 1 + AvatarUpdateType_TEAM AvatarUpdateType = 2 +) + +func (o AvatarUpdateType) DeepCopy() AvatarUpdateType { return o } + +var AvatarUpdateTypeMap = map[string]AvatarUpdateType{ + "NONE": 0, + "USER": 1, + "TEAM": 2, +} + +var AvatarUpdateTypeRevMap = map[AvatarUpdateType]string{ + 0: "NONE", + 1: "USER", + 2: "TEAM", +} + +func (e AvatarUpdateType) String() string { + if v, ok := AvatarUpdateTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_teambot.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_teambot.go new file mode 100644 index 00000000..64d8242a --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_teambot.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_teambot.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_tracking.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_tracking.go new file mode 100644 index 00000000..ecb4a58a --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_tracking.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_tracking.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_users.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_users.go new file mode 100644 index 00000000..10aa26b9 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/notify_users.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/notify_users.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/os.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/os.go new file mode 100644 index 00000000..1efd93ed --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/os.go @@ -0,0 +1,40 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/os.avdl + +package keybase1 + +import ( + "fmt" +) + +type RuntimeGroup int + +const ( + RuntimeGroup_UNKNOWN RuntimeGroup = 0 + RuntimeGroup_LINUXLIKE RuntimeGroup = 1 + RuntimeGroup_DARWINLIKE RuntimeGroup = 2 + RuntimeGroup_WINDOWSLIKE RuntimeGroup = 3 +) + +func (o RuntimeGroup) DeepCopy() RuntimeGroup { return o } + +var RuntimeGroupMap = map[string]RuntimeGroup{ + "UNKNOWN": 0, + "LINUXLIKE": 1, + "DARWINLIKE": 2, + "WINDOWSLIKE": 3, +} + +var RuntimeGroupRevMap = map[RuntimeGroup]string{ + 0: "UNKNOWN", + 1: "LINUXLIKE", + 2: "DARWINLIKE", + 3: "WINDOWSLIKE", +} + +func (e RuntimeGroup) String() string { + if v, ok := RuntimeGroupRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/paperprovision.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/paperprovision.go new file mode 100644 index 00000000..eafff4e0 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/paperprovision.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/paperprovision.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/passphrase_common.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/passphrase_common.go new file mode 100644 index 00000000..1d31f46e --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/passphrase_common.go @@ -0,0 +1,102 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/passphrase_common.avdl + +package keybase1 + +import ( + "fmt" +) + +type Feature struct { + Allow bool `codec:"allow" json:"allow"` + DefaultValue bool `codec:"defaultValue" json:"defaultValue"` + Readonly bool `codec:"readonly" json:"readonly"` + Label string `codec:"label" json:"label"` +} + +func (o Feature) DeepCopy() Feature { + return Feature{ + Allow: o.Allow, + DefaultValue: o.DefaultValue, + Readonly: o.Readonly, + Label: o.Label, + } +} + +type GUIEntryFeatures struct { + ShowTyping Feature `codec:"showTyping" json:"showTyping"` +} + +func (o GUIEntryFeatures) DeepCopy() GUIEntryFeatures { + return GUIEntryFeatures{ + ShowTyping: o.ShowTyping.DeepCopy(), + } +} + +type PassphraseType int + +const ( + PassphraseType_NONE PassphraseType = 0 + PassphraseType_PAPER_KEY PassphraseType = 1 + PassphraseType_PASS_PHRASE PassphraseType = 2 + PassphraseType_VERIFY_PASS_PHRASE PassphraseType = 3 +) + +func (o PassphraseType) DeepCopy() PassphraseType { return o } + +var PassphraseTypeMap = map[string]PassphraseType{ + "NONE": 0, + "PAPER_KEY": 1, + "PASS_PHRASE": 2, + "VERIFY_PASS_PHRASE": 3, +} + +var PassphraseTypeRevMap = map[PassphraseType]string{ + 0: "NONE", + 1: "PAPER_KEY", + 2: "PASS_PHRASE", + 3: "VERIFY_PASS_PHRASE", +} + +func (e PassphraseType) String() string { + if v, ok := PassphraseTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type GUIEntryArg struct { + WindowTitle string `codec:"windowTitle" json:"windowTitle"` + Prompt string `codec:"prompt" json:"prompt"` + Username string `codec:"username" json:"username"` + SubmitLabel string `codec:"submitLabel" json:"submitLabel"` + CancelLabel string `codec:"cancelLabel" json:"cancelLabel"` + RetryLabel string `codec:"retryLabel" json:"retryLabel"` + Type PassphraseType `codec:"type" json:"type"` + Features GUIEntryFeatures `codec:"features" json:"features"` +} + +func (o GUIEntryArg) DeepCopy() GUIEntryArg { + return GUIEntryArg{ + WindowTitle: o.WindowTitle, + Prompt: o.Prompt, + Username: o.Username, + SubmitLabel: o.SubmitLabel, + CancelLabel: o.CancelLabel, + RetryLabel: o.RetryLabel, + Type: o.Type.DeepCopy(), + Features: o.Features.DeepCopy(), + } +} + +type GetPassphraseRes struct { + Passphrase string `codec:"passphrase" json:"passphrase"` + StoreSecret bool `codec:"storeSecret" json:"storeSecret"` +} + +func (o GetPassphraseRes) DeepCopy() GetPassphraseRes { + return GetPassphraseRes{ + Passphrase: o.Passphrase, + StoreSecret: o.StoreSecret, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/pgp.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/pgp.go new file mode 100644 index 00000000..c2869fa5 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/pgp.go @@ -0,0 +1,200 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/pgp.avdl + +package keybase1 + +import ( + "fmt" +) + +type SignMode int + +const ( + SignMode_ATTACHED SignMode = 0 + SignMode_DETACHED SignMode = 1 + SignMode_CLEAR SignMode = 2 +) + +func (o SignMode) DeepCopy() SignMode { return o } + +var SignModeMap = map[string]SignMode{ + "ATTACHED": 0, + "DETACHED": 1, + "CLEAR": 2, +} + +var SignModeRevMap = map[SignMode]string{ + 0: "ATTACHED", + 1: "DETACHED", + 2: "CLEAR", +} + +func (e SignMode) String() string { + if v, ok := SignModeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type PGPSignOptions struct { + KeyQuery string `codec:"keyQuery" json:"keyQuery"` + Mode SignMode `codec:"mode" json:"mode"` + BinaryIn bool `codec:"binaryIn" json:"binaryIn"` + BinaryOut bool `codec:"binaryOut" json:"binaryOut"` +} + +func (o PGPSignOptions) DeepCopy() PGPSignOptions { + return PGPSignOptions{ + KeyQuery: o.KeyQuery, + Mode: o.Mode.DeepCopy(), + BinaryIn: o.BinaryIn, + BinaryOut: o.BinaryOut, + } +} + +type PGPEncryptOptions struct { + Recipients []string `codec:"recipients" json:"recipients"` + NoSign bool `codec:"noSign" json:"noSign"` + NoSelf bool `codec:"noSelf" json:"noSelf"` + BinaryOut bool `codec:"binaryOut" json:"binaryOut"` + KeyQuery string `codec:"keyQuery" json:"keyQuery"` +} + +func (o PGPEncryptOptions) DeepCopy() PGPEncryptOptions { + return PGPEncryptOptions{ + Recipients: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Recipients), + NoSign: o.NoSign, + NoSelf: o.NoSelf, + BinaryOut: o.BinaryOut, + KeyQuery: o.KeyQuery, + } +} + +// PGPSigVerification is returned by pgpDecrypt and pgpVerify with information +// about the signature verification. If isSigned is false, there was no +// signature, and the rest of the fields should be ignored. +type PGPSigVerification struct { + IsSigned bool `codec:"isSigned" json:"isSigned"` + Verified bool `codec:"verified" json:"verified"` + Signer User `codec:"signer" json:"signer"` + SignKey PublicKey `codec:"signKey" json:"signKey"` +} + +func (o PGPSigVerification) DeepCopy() PGPSigVerification { + return PGPSigVerification{ + IsSigned: o.IsSigned, + Verified: o.Verified, + Signer: o.Signer.DeepCopy(), + SignKey: o.SignKey.DeepCopy(), + } +} + +type PGPDecryptOptions struct { + AssertSigned bool `codec:"assertSigned" json:"assertSigned"` + SignedBy string `codec:"signedBy" json:"signedBy"` +} + +func (o PGPDecryptOptions) DeepCopy() PGPDecryptOptions { + return PGPDecryptOptions{ + AssertSigned: o.AssertSigned, + SignedBy: o.SignedBy, + } +} + +type PGPVerifyOptions struct { + SignedBy string `codec:"signedBy" json:"signedBy"` + Signature []byte `codec:"signature" json:"signature"` +} + +func (o PGPVerifyOptions) DeepCopy() PGPVerifyOptions { + return PGPVerifyOptions{ + SignedBy: o.SignedBy, + Signature: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.Signature), + } +} + +type KeyInfo struct { + Fingerprint string `codec:"fingerprint" json:"fingerprint"` + Key string `codec:"key" json:"key"` + Desc string `codec:"desc" json:"desc"` +} + +func (o KeyInfo) DeepCopy() KeyInfo { + return KeyInfo{ + Fingerprint: o.Fingerprint, + Key: o.Key, + Desc: o.Desc, + } +} + +type PGPQuery struct { + Secret bool `codec:"secret" json:"secret"` + Query string `codec:"query" json:"query"` + ExactMatch bool `codec:"exactMatch" json:"exactMatch"` +} + +func (o PGPQuery) DeepCopy() PGPQuery { + return PGPQuery{ + Secret: o.Secret, + Query: o.Query, + ExactMatch: o.ExactMatch, + } +} + +type PGPCreateUids struct { + UseDefault bool `codec:"useDefault" json:"useDefault"` + Ids []PGPIdentity `codec:"ids" json:"ids"` +} + +func (o PGPCreateUids) DeepCopy() PGPCreateUids { + return PGPCreateUids{ + UseDefault: o.UseDefault, + Ids: (func(x []PGPIdentity) []PGPIdentity { + if x == nil { + return nil + } + ret := make([]PGPIdentity, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Ids), + } +} + +// Export all pgp keys in lksec, then if doPurge is true, remove the keys from lksec. +type PGPPurgeRes struct { + Filenames []string `codec:"filenames" json:"filenames"` +} + +func (o PGPPurgeRes) DeepCopy() PGPPurgeRes { + return PGPPurgeRes{ + Filenames: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Filenames), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/pgp_ui.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/pgp_ui.go new file mode 100644 index 00000000..1dd3ae74 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/pgp_ui.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/pgp_ui.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/phone_numbers.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/phone_numbers.go new file mode 100644 index 00000000..0ac2fe45 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/phone_numbers.go @@ -0,0 +1,61 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/phone_numbers.avdl + +package keybase1 + +// Phone number support for TOFU chats. +type UserPhoneNumber struct { + PhoneNumber PhoneNumber `codec:"phoneNumber" json:"phone_number"` + Verified bool `codec:"verified" json:"verified"` + Superseded bool `codec:"superseded" json:"superseded"` + Visibility IdentityVisibility `codec:"visibility" json:"visibility"` + Ctime UnixTime `codec:"ctime" json:"ctime"` +} + +func (o UserPhoneNumber) DeepCopy() UserPhoneNumber { + return UserPhoneNumber{ + PhoneNumber: o.PhoneNumber.DeepCopy(), + Verified: o.Verified, + Superseded: o.Superseded, + Visibility: o.Visibility.DeepCopy(), + Ctime: o.Ctime.DeepCopy(), + } +} + +type PhoneNumberLookupResult struct { + PhoneNumber RawPhoneNumber `codec:"phoneNumber" json:"phone_number"` + CoercedPhoneNumber PhoneNumber `codec:"coercedPhoneNumber" json:"coerced_phone_number"` + Err *string `codec:"err,omitempty" json:"err,omitempty"` + Uid *UID `codec:"uid,omitempty" json:"uid,omitempty"` +} + +func (o PhoneNumberLookupResult) DeepCopy() PhoneNumberLookupResult { + return PhoneNumberLookupResult{ + PhoneNumber: o.PhoneNumber.DeepCopy(), + CoercedPhoneNumber: o.CoercedPhoneNumber.DeepCopy(), + Err: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Err), + Uid: (func(x *UID) *UID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Uid), + } +} + +type PhoneNumberChangedMsg struct { + PhoneNumber PhoneNumber `codec:"phoneNumber" json:"phone"` +} + +func (o PhoneNumberChangedMsg) DeepCopy() PhoneNumberChangedMsg { + return PhoneNumberChangedMsg{ + PhoneNumber: o.PhoneNumber.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/pprof.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/pprof.go new file mode 100644 index 00000000..3670f9ae --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/pprof.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/pprof.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/process.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/process.go new file mode 100644 index 00000000..276acd63 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/process.go @@ -0,0 +1,73 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/process.avdl + +package keybase1 + +import ( + "fmt" +) + +type FileType int + +const ( + FileType_UNKNOWN FileType = 0 + FileType_DIRECTORY FileType = 1 + FileType_FILE FileType = 2 +) + +func (o FileType) DeepCopy() FileType { return o } + +var FileTypeMap = map[string]FileType{ + "UNKNOWN": 0, + "DIRECTORY": 1, + "FILE": 2, +} + +var FileTypeRevMap = map[FileType]string{ + 0: "UNKNOWN", + 1: "DIRECTORY", + 2: "FILE", +} + +func (e FileType) String() string { + if v, ok := FileTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type FileDescriptor struct { + Name string `codec:"name" json:"name"` + Type FileType `codec:"type" json:"type"` +} + +func (o FileDescriptor) DeepCopy() FileDescriptor { + return FileDescriptor{ + Name: o.Name, + Type: o.Type.DeepCopy(), + } +} + +type Process struct { + Pid string `codec:"pid" json:"pid"` + Command string `codec:"command" json:"command"` + FileDescriptors []FileDescriptor `codec:"fileDescriptors" json:"fileDescriptors"` +} + +func (o Process) DeepCopy() Process { + return Process{ + Pid: o.Pid, + Command: o.Command, + FileDescriptors: (func(x []FileDescriptor) []FileDescriptor { + if x == nil { + return nil + } + ret := make([]FileDescriptor, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.FileDescriptors), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/prove.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/prove.go new file mode 100644 index 00000000..4d5d8f5e --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/prove.go @@ -0,0 +1,30 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/prove.avdl + +package keybase1 + +type CheckProofStatus struct { + Found bool `codec:"found" json:"found"` + Status ProofStatus `codec:"status" json:"status"` + ProofText string `codec:"proofText" json:"proofText"` + State ProofState `codec:"state" json:"state"` +} + +func (o CheckProofStatus) DeepCopy() CheckProofStatus { + return CheckProofStatus{ + Found: o.Found, + Status: o.Status.DeepCopy(), + ProofText: o.ProofText, + State: o.State.DeepCopy(), + } +} + +type StartProofResult struct { + SigID SigID `codec:"sigID" json:"sigID"` +} + +func (o StartProofResult) DeepCopy() StartProofResult { + return StartProofResult{ + SigID: o.SigID.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/prove_common.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/prove_common.go new file mode 100644 index 00000000..b263e16e --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/prove_common.go @@ -0,0 +1,439 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/prove_common.avdl + +package keybase1 + +import ( + "fmt" +) + +type ProofState int + +const ( + ProofState_NONE ProofState = 0 + ProofState_OK ProofState = 1 + ProofState_TEMP_FAILURE ProofState = 2 + ProofState_PERM_FAILURE ProofState = 3 + ProofState_LOOKING ProofState = 4 + ProofState_SUPERSEDED ProofState = 5 + ProofState_POSTED ProofState = 6 + ProofState_REVOKED ProofState = 7 + ProofState_DELETED ProofState = 8 + ProofState_UNKNOWN_TYPE ProofState = 9 + ProofState_SIG_HINT_MISSING ProofState = 10 + ProofState_UNCHECKED ProofState = 11 +) + +func (o ProofState) DeepCopy() ProofState { return o } + +var ProofStateMap = map[string]ProofState{ + "NONE": 0, + "OK": 1, + "TEMP_FAILURE": 2, + "PERM_FAILURE": 3, + "LOOKING": 4, + "SUPERSEDED": 5, + "POSTED": 6, + "REVOKED": 7, + "DELETED": 8, + "UNKNOWN_TYPE": 9, + "SIG_HINT_MISSING": 10, + "UNCHECKED": 11, +} + +var ProofStateRevMap = map[ProofState]string{ + 0: "NONE", + 1: "OK", + 2: "TEMP_FAILURE", + 3: "PERM_FAILURE", + 4: "LOOKING", + 5: "SUPERSEDED", + 6: "POSTED", + 7: "REVOKED", + 8: "DELETED", + 9: "UNKNOWN_TYPE", + 10: "SIG_HINT_MISSING", + 11: "UNCHECKED", +} + +func (e ProofState) String() string { + if v, ok := ProofStateRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +// 3: It's been found in the hunt, but not proven yet +// 1xx: Retryable soft errors; note that this will be put in the proof_cache, but won't +// be returned from the proof cache in most cases. Their freshness will always be +// RANCID. +// 2xx: Will likely result in a hard error, if repeated enough +// 3xx: Hard final errors +type ProofStatus int + +const ( + ProofStatus_NONE ProofStatus = 0 + ProofStatus_OK ProofStatus = 1 + ProofStatus_LOCAL ProofStatus = 2 + ProofStatus_FOUND ProofStatus = 3 + ProofStatus_BASE_ERROR ProofStatus = 100 + ProofStatus_HOST_UNREACHABLE ProofStatus = 101 + ProofStatus_PERMISSION_DENIED ProofStatus = 103 + ProofStatus_FAILED_PARSE ProofStatus = 106 + ProofStatus_DNS_ERROR ProofStatus = 107 + ProofStatus_AUTH_FAILED ProofStatus = 108 + ProofStatus_HTTP_429 ProofStatus = 129 + ProofStatus_HTTP_500 ProofStatus = 150 + ProofStatus_TIMEOUT ProofStatus = 160 + ProofStatus_INTERNAL_ERROR ProofStatus = 170 + ProofStatus_UNCHECKED ProofStatus = 171 + ProofStatus_MISSING_PVL ProofStatus = 172 + ProofStatus_BASE_HARD_ERROR ProofStatus = 200 + ProofStatus_NOT_FOUND ProofStatus = 201 + ProofStatus_CONTENT_FAILURE ProofStatus = 202 + ProofStatus_BAD_USERNAME ProofStatus = 203 + ProofStatus_BAD_REMOTE_ID ProofStatus = 204 + ProofStatus_TEXT_NOT_FOUND ProofStatus = 205 + ProofStatus_BAD_ARGS ProofStatus = 206 + ProofStatus_CONTENT_MISSING ProofStatus = 207 + ProofStatus_TITLE_NOT_FOUND ProofStatus = 208 + ProofStatus_SERVICE_ERROR ProofStatus = 209 + ProofStatus_TOR_SKIPPED ProofStatus = 210 + ProofStatus_TOR_INCOMPATIBLE ProofStatus = 211 + ProofStatus_HTTP_300 ProofStatus = 230 + ProofStatus_HTTP_400 ProofStatus = 240 + ProofStatus_HTTP_OTHER ProofStatus = 260 + ProofStatus_EMPTY_JSON ProofStatus = 270 + ProofStatus_DELETED ProofStatus = 301 + ProofStatus_SERVICE_DEAD ProofStatus = 302 + ProofStatus_BAD_SIGNATURE ProofStatus = 303 + ProofStatus_BAD_API_URL ProofStatus = 304 + ProofStatus_UNKNOWN_TYPE ProofStatus = 305 + ProofStatus_NO_HINT ProofStatus = 306 + ProofStatus_BAD_HINT_TEXT ProofStatus = 307 + ProofStatus_INVALID_PVL ProofStatus = 308 +) + +func (o ProofStatus) DeepCopy() ProofStatus { return o } + +var ProofStatusMap = map[string]ProofStatus{ + "NONE": 0, + "OK": 1, + "LOCAL": 2, + "FOUND": 3, + "BASE_ERROR": 100, + "HOST_UNREACHABLE": 101, + "PERMISSION_DENIED": 103, + "FAILED_PARSE": 106, + "DNS_ERROR": 107, + "AUTH_FAILED": 108, + "HTTP_429": 129, + "HTTP_500": 150, + "TIMEOUT": 160, + "INTERNAL_ERROR": 170, + "UNCHECKED": 171, + "MISSING_PVL": 172, + "BASE_HARD_ERROR": 200, + "NOT_FOUND": 201, + "CONTENT_FAILURE": 202, + "BAD_USERNAME": 203, + "BAD_REMOTE_ID": 204, + "TEXT_NOT_FOUND": 205, + "BAD_ARGS": 206, + "CONTENT_MISSING": 207, + "TITLE_NOT_FOUND": 208, + "SERVICE_ERROR": 209, + "TOR_SKIPPED": 210, + "TOR_INCOMPATIBLE": 211, + "HTTP_300": 230, + "HTTP_400": 240, + "HTTP_OTHER": 260, + "EMPTY_JSON": 270, + "DELETED": 301, + "SERVICE_DEAD": 302, + "BAD_SIGNATURE": 303, + "BAD_API_URL": 304, + "UNKNOWN_TYPE": 305, + "NO_HINT": 306, + "BAD_HINT_TEXT": 307, + "INVALID_PVL": 308, +} + +var ProofStatusRevMap = map[ProofStatus]string{ + 0: "NONE", + 1: "OK", + 2: "LOCAL", + 3: "FOUND", + 100: "BASE_ERROR", + 101: "HOST_UNREACHABLE", + 103: "PERMISSION_DENIED", + 106: "FAILED_PARSE", + 107: "DNS_ERROR", + 108: "AUTH_FAILED", + 129: "HTTP_429", + 150: "HTTP_500", + 160: "TIMEOUT", + 170: "INTERNAL_ERROR", + 171: "UNCHECKED", + 172: "MISSING_PVL", + 200: "BASE_HARD_ERROR", + 201: "NOT_FOUND", + 202: "CONTENT_FAILURE", + 203: "BAD_USERNAME", + 204: "BAD_REMOTE_ID", + 205: "TEXT_NOT_FOUND", + 206: "BAD_ARGS", + 207: "CONTENT_MISSING", + 208: "TITLE_NOT_FOUND", + 209: "SERVICE_ERROR", + 210: "TOR_SKIPPED", + 211: "TOR_INCOMPATIBLE", + 230: "HTTP_300", + 240: "HTTP_400", + 260: "HTTP_OTHER", + 270: "EMPTY_JSON", + 301: "DELETED", + 302: "SERVICE_DEAD", + 303: "BAD_SIGNATURE", + 304: "BAD_API_URL", + 305: "UNKNOWN_TYPE", + 306: "NO_HINT", + 307: "BAD_HINT_TEXT", + 308: "INVALID_PVL", +} + +func (e ProofStatus) String() string { + if v, ok := ProofStatusRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ProofType int + +const ( + ProofType_NONE ProofType = 0 + ProofType_KEYBASE ProofType = 1 + ProofType_TWITTER ProofType = 2 + ProofType_GITHUB ProofType = 3 + ProofType_REDDIT ProofType = 4 + ProofType_COINBASE ProofType = 5 + ProofType_HACKERNEWS ProofType = 6 + ProofType_FACEBOOK ProofType = 8 + ProofType_GENERIC_SOCIAL ProofType = 9 + ProofType_GENERIC_WEB_SITE ProofType = 1000 + ProofType_DNS ProofType = 1001 + ProofType_PGP ProofType = 1002 + ProofType_ROOTER ProofType = 100001 +) + +func (o ProofType) DeepCopy() ProofType { return o } + +var ProofTypeMap = map[string]ProofType{ + "NONE": 0, + "KEYBASE": 1, + "TWITTER": 2, + "GITHUB": 3, + "REDDIT": 4, + "COINBASE": 5, + "HACKERNEWS": 6, + "FACEBOOK": 8, + "GENERIC_SOCIAL": 9, + "GENERIC_WEB_SITE": 1000, + "DNS": 1001, + "PGP": 1002, + "ROOTER": 100001, +} + +var ProofTypeRevMap = map[ProofType]string{ + 0: "NONE", + 1: "KEYBASE", + 2: "TWITTER", + 3: "GITHUB", + 4: "REDDIT", + 5: "COINBASE", + 6: "HACKERNEWS", + 8: "FACEBOOK", + 9: "GENERIC_SOCIAL", + 1000: "GENERIC_WEB_SITE", + 1001: "DNS", + 1002: "PGP", + 100001: "ROOTER", +} + +func (e ProofType) String() string { + if v, ok := ProofTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type SelectorEntry struct { + IsIndex bool `codec:"isIndex" json:"isIndex"` + Index int `codec:"index" json:"index"` + IsKey bool `codec:"isKey" json:"isKey"` + Key string `codec:"key" json:"key"` + IsAll bool `codec:"isAll" json:"isAll"` + IsContents bool `codec:"isContents" json:"isContents"` +} + +func (o SelectorEntry) DeepCopy() SelectorEntry { + return SelectorEntry{ + IsIndex: o.IsIndex, + Index: o.Index, + IsKey: o.IsKey, + Key: o.Key, + IsAll: o.IsAll, + IsContents: o.IsContents, + } +} + +type ParamProofJSON struct { + SigHash SigID `codec:"sigHash" json:"sig_hash"` + KbUsername string `codec:"kbUsername" json:"kb_username"` +} + +func (o ParamProofJSON) DeepCopy() ParamProofJSON { + return ParamProofJSON{ + SigHash: o.SigHash.DeepCopy(), + KbUsername: o.KbUsername, + } +} + +type ParamProofUsernameConfig struct { + Re string `codec:"re" json:"re"` + Min int `codec:"min" json:"min"` + Max int `codec:"max" json:"max"` +} + +func (o ParamProofUsernameConfig) DeepCopy() ParamProofUsernameConfig { + return ParamProofUsernameConfig{ + Re: o.Re, + Min: o.Min, + Max: o.Max, + } +} + +type ParamProofLogoConfig struct { + SvgBlack string `codec:"svgBlack" json:"svg_black"` + SvgFull string `codec:"svgFull" json:"svg_full"` + SvgWhite string `codec:"svgWhite" json:"svg_white"` +} + +func (o ParamProofLogoConfig) DeepCopy() ParamProofLogoConfig { + return ParamProofLogoConfig{ + SvgBlack: o.SvgBlack, + SvgFull: o.SvgFull, + SvgWhite: o.SvgWhite, + } +} + +type ParamProofServiceConfig struct { + Version int `codec:"version" json:"version"` + Domain string `codec:"domain" json:"domain"` + DisplayName string `codec:"displayName" json:"display_name"` + Logo *ParamProofLogoConfig `codec:"logo,omitempty" json:"logo,omitempty"` + Description string `codec:"description" json:"description"` + UsernameConfig ParamProofUsernameConfig `codec:"usernameConfig" json:"username"` + BrandColor string `codec:"brandColor" json:"brand_color"` + PrefillUrl string `codec:"prefillUrl" json:"prefill_url"` + ProfileUrl string `codec:"profileUrl" json:"profile_url"` + CheckUrl string `codec:"checkUrl" json:"check_url"` + CheckPath []SelectorEntry `codec:"checkPath" json:"check_path"` + AvatarPath []SelectorEntry `codec:"avatarPath" json:"avatar_path"` +} + +func (o ParamProofServiceConfig) DeepCopy() ParamProofServiceConfig { + return ParamProofServiceConfig{ + Version: o.Version, + Domain: o.Domain, + DisplayName: o.DisplayName, + Logo: (func(x *ParamProofLogoConfig) *ParamProofLogoConfig { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Logo), + Description: o.Description, + UsernameConfig: o.UsernameConfig.DeepCopy(), + BrandColor: o.BrandColor, + PrefillUrl: o.PrefillUrl, + ProfileUrl: o.ProfileUrl, + CheckUrl: o.CheckUrl, + CheckPath: (func(x []SelectorEntry) []SelectorEntry { + if x == nil { + return nil + } + ret := make([]SelectorEntry, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.CheckPath), + AvatarPath: (func(x []SelectorEntry) []SelectorEntry { + if x == nil { + return nil + } + ret := make([]SelectorEntry, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.AvatarPath), + } +} + +type ServiceDisplayConfig struct { + CreationDisabled bool `codec:"creationDisabled" json:"creation_disabled"` + Priority int `codec:"priority" json:"priority"` + Key string `codec:"key" json:"key"` + Group *string `codec:"group,omitempty" json:"group,omitempty"` + New bool `codec:"new" json:"new"` + LogoKey string `codec:"logoKey" json:"logo_key"` +} + +func (o ServiceDisplayConfig) DeepCopy() ServiceDisplayConfig { + return ServiceDisplayConfig{ + CreationDisabled: o.CreationDisabled, + Priority: o.Priority, + Key: o.Key, + Group: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Group), + New: o.New, + LogoKey: o.LogoKey, + } +} + +type ExternalServiceConfig struct { + SchemaVersion int `codec:"schemaVersion" json:"schema_version"` + Display *ServiceDisplayConfig `codec:"display,omitempty" json:"display,omitempty"` + Config *ParamProofServiceConfig `codec:"config,omitempty" json:"config,omitempty"` +} + +func (o ExternalServiceConfig) DeepCopy() ExternalServiceConfig { + return ExternalServiceConfig{ + SchemaVersion: o.SchemaVersion, + Display: (func(x *ServiceDisplayConfig) *ServiceDisplayConfig { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Display), + Config: (func(x *ParamProofServiceConfig) *ParamProofServiceConfig { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Config), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/prove_ui.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/prove_ui.go new file mode 100644 index 00000000..a9dc6a3b --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/prove_ui.go @@ -0,0 +1,86 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/prove_ui.avdl + +package keybase1 + +import ( + "fmt" +) + +type PromptOverwriteType int + +const ( + PromptOverwriteType_SOCIAL PromptOverwriteType = 0 + PromptOverwriteType_SITE PromptOverwriteType = 1 +) + +func (o PromptOverwriteType) DeepCopy() PromptOverwriteType { return o } + +var PromptOverwriteTypeMap = map[string]PromptOverwriteType{ + "SOCIAL": 0, + "SITE": 1, +} + +var PromptOverwriteTypeRevMap = map[PromptOverwriteType]string{ + 0: "SOCIAL", + 1: "SITE", +} + +func (e PromptOverwriteType) String() string { + if v, ok := PromptOverwriteTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ProveParameters struct { + LogoFull []SizedImage `codec:"logoFull" json:"logoFull"` + LogoBlack []SizedImage `codec:"logoBlack" json:"logoBlack"` + LogoWhite []SizedImage `codec:"logoWhite" json:"logoWhite"` + Title string `codec:"title" json:"title"` + Subtext string `codec:"subtext" json:"subtext"` + Suffix string `codec:"suffix" json:"suffix"` + ButtonLabel string `codec:"buttonLabel" json:"buttonLabel"` +} + +func (o ProveParameters) DeepCopy() ProveParameters { + return ProveParameters{ + LogoFull: (func(x []SizedImage) []SizedImage { + if x == nil { + return nil + } + ret := make([]SizedImage, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.LogoFull), + LogoBlack: (func(x []SizedImage) []SizedImage { + if x == nil { + return nil + } + ret := make([]SizedImage, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.LogoBlack), + LogoWhite: (func(x []SizedImage) []SizedImage { + if x == nil { + return nil + } + ret := make([]SizedImage, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.LogoWhite), + Title: o.Title, + Subtext: o.Subtext, + Suffix: o.Suffix, + ButtonLabel: o.ButtonLabel, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/provision_ui.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/provision_ui.go new file mode 100644 index 00000000..af88e609 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/provision_ui.go @@ -0,0 +1,116 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/provision_ui.avdl + +package keybase1 + +import ( + "fmt" +) + +type ProvisionMethod int + +const ( + ProvisionMethod_DEVICE ProvisionMethod = 0 + ProvisionMethod_PAPER_KEY ProvisionMethod = 1 + ProvisionMethod_PASSPHRASE ProvisionMethod = 2 + ProvisionMethod_GPG_IMPORT ProvisionMethod = 3 + ProvisionMethod_GPG_SIGN ProvisionMethod = 4 +) + +func (o ProvisionMethod) DeepCopy() ProvisionMethod { return o } + +var ProvisionMethodMap = map[string]ProvisionMethod{ + "DEVICE": 0, + "PAPER_KEY": 1, + "PASSPHRASE": 2, + "GPG_IMPORT": 3, + "GPG_SIGN": 4, +} + +var ProvisionMethodRevMap = map[ProvisionMethod]string{ + 0: "DEVICE", + 1: "PAPER_KEY", + 2: "PASSPHRASE", + 3: "GPG_IMPORT", + 4: "GPG_SIGN", +} + +func (e ProvisionMethod) String() string { + if v, ok := ProvisionMethodRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type GPGMethod int + +const ( + GPGMethod_GPG_NONE GPGMethod = 0 + GPGMethod_GPG_IMPORT GPGMethod = 1 + GPGMethod_GPG_SIGN GPGMethod = 2 +) + +func (o GPGMethod) DeepCopy() GPGMethod { return o } + +var GPGMethodMap = map[string]GPGMethod{ + "GPG_NONE": 0, + "GPG_IMPORT": 1, + "GPG_SIGN": 2, +} + +var GPGMethodRevMap = map[GPGMethod]string{ + 0: "GPG_NONE", + 1: "GPG_IMPORT", + 2: "GPG_SIGN", +} + +func (e GPGMethod) String() string { + if v, ok := GPGMethodRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ChooseType int + +const ( + ChooseType_EXISTING_DEVICE ChooseType = 0 + ChooseType_NEW_DEVICE ChooseType = 1 +) + +func (o ChooseType) DeepCopy() ChooseType { return o } + +var ChooseTypeMap = map[string]ChooseType{ + "EXISTING_DEVICE": 0, + "NEW_DEVICE": 1, +} + +var ChooseTypeRevMap = map[ChooseType]string{ + 0: "EXISTING_DEVICE", + 1: "NEW_DEVICE", +} + +func (e ChooseType) String() string { + if v, ok := ChooseTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +// SecretResponse should be returned by DisplayAndPromptSecret. Use either secret or phrase. +type SecretResponse struct { + Secret []byte `codec:"secret" json:"secret"` + Phrase string `codec:"phrase" json:"phrase"` +} + +func (o SecretResponse) DeepCopy() SecretResponse { + return SecretResponse{ + Secret: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.Secret), + Phrase: o.Phrase, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/quota.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/quota.go new file mode 100644 index 00000000..4656fae8 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/quota.go @@ -0,0 +1,20 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/quota.avdl + +package keybase1 + +type VerifySessionRes struct { + Uid UID `codec:"uid" json:"uid"` + Sid string `codec:"sid" json:"sid"` + Generated int `codec:"generated" json:"generated"` + Lifetime int `codec:"lifetime" json:"lifetime"` +} + +func (o VerifySessionRes) DeepCopy() VerifySessionRes { + return VerifySessionRes{ + Uid: o.Uid.DeepCopy(), + Sid: o.Sid, + Generated: o.Generated, + Lifetime: o.Lifetime, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/reachability.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/reachability.go new file mode 100644 index 00000000..20a8d4f2 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/reachability.go @@ -0,0 +1,47 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/reachability.avdl + +package keybase1 + +import ( + "fmt" +) + +type Reachable int + +const ( + Reachable_UNKNOWN Reachable = 0 + Reachable_YES Reachable = 1 + Reachable_NO Reachable = 2 +) + +func (o Reachable) DeepCopy() Reachable { return o } + +var ReachableMap = map[string]Reachable{ + "UNKNOWN": 0, + "YES": 1, + "NO": 2, +} + +var ReachableRevMap = map[Reachable]string{ + 0: "UNKNOWN", + 1: "YES", + 2: "NO", +} + +func (e Reachable) String() string { + if v, ok := ReachableRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type Reachability struct { + Reachable Reachable `codec:"reachable" json:"reachable"` +} + +func (o Reachability) DeepCopy() Reachability { + return Reachability{ + Reachable: o.Reachable.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/rekey.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/rekey.go new file mode 100644 index 00000000..d5e60c42 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/rekey.go @@ -0,0 +1,169 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/rekey.avdl + +package keybase1 + +import ( + "fmt" +) + +type TLF struct { + Id TLFID `codec:"id" json:"id"` + Name string `codec:"name" json:"name"` + Writers []string `codec:"writers" json:"writers"` + Readers []string `codec:"readers" json:"readers"` + IsPrivate bool `codec:"isPrivate" json:"isPrivate"` +} + +func (o TLF) DeepCopy() TLF { + return TLF{ + Id: o.Id.DeepCopy(), + Name: o.Name, + Writers: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Writers), + Readers: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Readers), + IsPrivate: o.IsPrivate, + } +} + +type ProblemTLF struct { + Tlf TLF `codec:"tlf" json:"tlf"` + Score int `codec:"score" json:"score"` + Solution_kids []KID `codec:"solution_kids" json:"solution_kids"` +} + +func (o ProblemTLF) DeepCopy() ProblemTLF { + return ProblemTLF{ + Tlf: o.Tlf.DeepCopy(), + Score: o.Score, + Solution_kids: (func(x []KID) []KID { + if x == nil { + return nil + } + ret := make([]KID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Solution_kids), + } +} + +// ProblemSet is for a particular (user,kid) that initiated a rekey problem. +// This problem consists of one or more problem TLFs, which are individually scored +// and have attendant solutions --- devices that if they came online can rekey and +// solve the ProblemTLF. +type ProblemSet struct { + User User `codec:"user" json:"user"` + Kid KID `codec:"kid" json:"kid"` + Tlfs []ProblemTLF `codec:"tlfs" json:"tlfs"` +} + +func (o ProblemSet) DeepCopy() ProblemSet { + return ProblemSet{ + User: o.User.DeepCopy(), + Kid: o.Kid.DeepCopy(), + Tlfs: (func(x []ProblemTLF) []ProblemTLF { + if x == nil { + return nil + } + ret := make([]ProblemTLF, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Tlfs), + } +} + +type ProblemSetDevices struct { + ProblemSet ProblemSet `codec:"problemSet" json:"problemSet"` + Devices []Device `codec:"devices" json:"devices"` +} + +func (o ProblemSetDevices) DeepCopy() ProblemSetDevices { + return ProblemSetDevices{ + ProblemSet: o.ProblemSet.DeepCopy(), + Devices: (func(x []Device) []Device { + if x == nil { + return nil + } + ret := make([]Device, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Devices), + } +} + +type Outcome int + +const ( + Outcome_NONE Outcome = 0 + Outcome_FIXED Outcome = 1 + Outcome_IGNORED Outcome = 2 +) + +func (o Outcome) DeepCopy() Outcome { return o } + +var OutcomeMap = map[string]Outcome{ + "NONE": 0, + "FIXED": 1, + "IGNORED": 2, +} + +var OutcomeRevMap = map[Outcome]string{ + 0: "NONE", + 1: "FIXED", + 2: "IGNORED", +} + +func (e Outcome) String() string { + if v, ok := OutcomeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type RevokeWarning struct { + EndangeredTLFs []TLF `codec:"endangeredTLFs" json:"endangeredTLFs"` +} + +func (o RevokeWarning) DeepCopy() RevokeWarning { + return RevokeWarning{ + EndangeredTLFs: (func(x []TLF) []TLF { + if x == nil { + return nil + } + ret := make([]TLF, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.EndangeredTLFs), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/rekey_ui.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/rekey_ui.go new file mode 100644 index 00000000..83798426 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/rekey_ui.go @@ -0,0 +1,67 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/rekey_ui.avdl + +package keybase1 + +import ( + "fmt" +) + +type RekeyEventType int + +const ( + RekeyEventType_NONE RekeyEventType = 0 + RekeyEventType_NOT_LOGGED_IN RekeyEventType = 1 + RekeyEventType_API_ERROR RekeyEventType = 2 + RekeyEventType_NO_PROBLEMS RekeyEventType = 3 + RekeyEventType_LOAD_ME_ERROR RekeyEventType = 4 + RekeyEventType_CURRENT_DEVICE_CAN_REKEY RekeyEventType = 5 + RekeyEventType_DEVICE_LOAD_ERROR RekeyEventType = 6 + RekeyEventType_HARASS RekeyEventType = 7 + RekeyEventType_NO_GREGOR_MESSAGES RekeyEventType = 8 +) + +func (o RekeyEventType) DeepCopy() RekeyEventType { return o } + +var RekeyEventTypeMap = map[string]RekeyEventType{ + "NONE": 0, + "NOT_LOGGED_IN": 1, + "API_ERROR": 2, + "NO_PROBLEMS": 3, + "LOAD_ME_ERROR": 4, + "CURRENT_DEVICE_CAN_REKEY": 5, + "DEVICE_LOAD_ERROR": 6, + "HARASS": 7, + "NO_GREGOR_MESSAGES": 8, +} + +var RekeyEventTypeRevMap = map[RekeyEventType]string{ + 0: "NONE", + 1: "NOT_LOGGED_IN", + 2: "API_ERROR", + 3: "NO_PROBLEMS", + 4: "LOAD_ME_ERROR", + 5: "CURRENT_DEVICE_CAN_REKEY", + 6: "DEVICE_LOAD_ERROR", + 7: "HARASS", + 8: "NO_GREGOR_MESSAGES", +} + +func (e RekeyEventType) String() string { + if v, ok := RekeyEventTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type RekeyEvent struct { + EventType RekeyEventType `codec:"eventType" json:"eventType"` + InterruptType int `codec:"interruptType" json:"interruptType"` +} + +func (o RekeyEvent) DeepCopy() RekeyEvent { + return RekeyEvent{ + EventType: o.EventType.DeepCopy(), + InterruptType: o.InterruptType, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/reset.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/reset.go new file mode 100644 index 00000000..c7d28b81 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/reset.go @@ -0,0 +1,118 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/reset.avdl + +package keybase1 + +import ( + "fmt" +) + +type SHA512 []byte + +func (o SHA512) DeepCopy() SHA512 { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type ResetType int + +const ( + ResetType_NONE ResetType = 0 + ResetType_RESET ResetType = 1 + ResetType_DELETE ResetType = 2 +) + +func (o ResetType) DeepCopy() ResetType { return o } + +var ResetTypeMap = map[string]ResetType{ + "NONE": 0, + "RESET": 1, + "DELETE": 2, +} + +var ResetTypeRevMap = map[ResetType]string{ + 0: "NONE", + 1: "RESET", + 2: "DELETE", +} + +func (e ResetType) String() string { + if v, ok := ResetTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ResetMerkleRoot struct { + HashMeta HashMeta `codec:"hashMeta" json:"hash_meta"` + Seqno Seqno `codec:"seqno" json:"seqno"` +} + +func (o ResetMerkleRoot) DeepCopy() ResetMerkleRoot { + return ResetMerkleRoot{ + HashMeta: o.HashMeta.DeepCopy(), + Seqno: o.Seqno.DeepCopy(), + } +} + +type ResetPrev struct { + EldestKID *KID `codec:"eldestKID,omitempty" json:"eldest_kid,omitempty"` + LastSeqno Seqno `codec:"lastSeqno" json:"public_seqno"` + Reset SHA512 `codec:"reset" json:"reset"` +} + +func (o ResetPrev) DeepCopy() ResetPrev { + return ResetPrev{ + EldestKID: (func(x *KID) *KID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.EldestKID), + LastSeqno: o.LastSeqno.DeepCopy(), + Reset: o.Reset.DeepCopy(), + } +} + +type ResetLink struct { + Ctime UnixTime `codec:"ctime" json:"ctime"` + MerkleRoot ResetMerkleRoot `codec:"merkleRoot" json:"merkle_root"` + Prev ResetPrev `codec:"prev" json:"prev"` + ResetSeqno Seqno `codec:"resetSeqno" json:"reset_seqno"` + Type ResetType `codec:"type" json:"type"` + Uid UID `codec:"uid" json:"uid"` +} + +func (o ResetLink) DeepCopy() ResetLink { + return ResetLink{ + Ctime: o.Ctime.DeepCopy(), + MerkleRoot: o.MerkleRoot.DeepCopy(), + Prev: o.Prev.DeepCopy(), + ResetSeqno: o.ResetSeqno.DeepCopy(), + Type: o.Type.DeepCopy(), + Uid: o.Uid.DeepCopy(), + } +} + +type ResetSummary struct { + Ctime UnixTime `codec:"ctime" json:"ctime"` + MerkleRoot ResetMerkleRoot `codec:"merkleRoot" json:"merkleRoot"` + ResetSeqno Seqno `codec:"resetSeqno" json:"resetSeqno"` + EldestSeqno Seqno `codec:"eldestSeqno" json:"eldestSeqno"` + Type ResetType `codec:"type" json:"type"` +} + +func (o ResetSummary) DeepCopy() ResetSummary { + return ResetSummary{ + Ctime: o.Ctime.DeepCopy(), + MerkleRoot: o.MerkleRoot.DeepCopy(), + ResetSeqno: o.ResetSeqno.DeepCopy(), + EldestSeqno: o.EldestSeqno.DeepCopy(), + Type: o.Type.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/revoke.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/revoke.go new file mode 100644 index 00000000..0f7faab8 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/revoke.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/revoke.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/saltpack.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/saltpack.go new file mode 100644 index 00000000..994648cd --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/saltpack.go @@ -0,0 +1,280 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/saltpack.avdl + +package keybase1 + +import ( + "fmt" +) + +type AuthenticityType int + +const ( + AuthenticityType_SIGNED AuthenticityType = 0 + AuthenticityType_REPUDIABLE AuthenticityType = 1 + AuthenticityType_ANONYMOUS AuthenticityType = 2 +) + +func (o AuthenticityType) DeepCopy() AuthenticityType { return o } + +var AuthenticityTypeMap = map[string]AuthenticityType{ + "SIGNED": 0, + "REPUDIABLE": 1, + "ANONYMOUS": 2, +} + +var AuthenticityTypeRevMap = map[AuthenticityType]string{ + 0: "SIGNED", + 1: "REPUDIABLE", + 2: "ANONYMOUS", +} + +func (e AuthenticityType) String() string { + if v, ok := AuthenticityTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type SaltpackEncryptOptions struct { + Recipients []string `codec:"recipients" json:"recipients"` + TeamRecipients []string `codec:"teamRecipients" json:"teamRecipients"` + AuthenticityType AuthenticityType `codec:"authenticityType" json:"authenticityType"` + UseEntityKeys bool `codec:"useEntityKeys" json:"useEntityKeys"` + UseDeviceKeys bool `codec:"useDeviceKeys" json:"useDeviceKeys"` + UsePaperKeys bool `codec:"usePaperKeys" json:"usePaperKeys"` + NoSelfEncrypt bool `codec:"noSelfEncrypt" json:"noSelfEncrypt"` + Binary bool `codec:"binary" json:"binary"` + SaltpackVersion int `codec:"saltpackVersion" json:"saltpackVersion"` + UseKBFSKeysOnlyForTesting bool `codec:"useKBFSKeysOnlyForTesting" json:"useKBFSKeysOnlyForTesting"` +} + +func (o SaltpackEncryptOptions) DeepCopy() SaltpackEncryptOptions { + return SaltpackEncryptOptions{ + Recipients: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Recipients), + TeamRecipients: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.TeamRecipients), + AuthenticityType: o.AuthenticityType.DeepCopy(), + UseEntityKeys: o.UseEntityKeys, + UseDeviceKeys: o.UseDeviceKeys, + UsePaperKeys: o.UsePaperKeys, + NoSelfEncrypt: o.NoSelfEncrypt, + Binary: o.Binary, + SaltpackVersion: o.SaltpackVersion, + UseKBFSKeysOnlyForTesting: o.UseKBFSKeysOnlyForTesting, + } +} + +type SaltpackDecryptOptions struct { + Interactive bool `codec:"interactive" json:"interactive"` + ForceRemoteCheck bool `codec:"forceRemoteCheck" json:"forceRemoteCheck"` + UsePaperKey bool `codec:"usePaperKey" json:"usePaperKey"` +} + +func (o SaltpackDecryptOptions) DeepCopy() SaltpackDecryptOptions { + return SaltpackDecryptOptions{ + Interactive: o.Interactive, + ForceRemoteCheck: o.ForceRemoteCheck, + UsePaperKey: o.UsePaperKey, + } +} + +type SaltpackSignOptions struct { + Detached bool `codec:"detached" json:"detached"` + Binary bool `codec:"binary" json:"binary"` + SaltpackVersion int `codec:"saltpackVersion" json:"saltpackVersion"` +} + +func (o SaltpackSignOptions) DeepCopy() SaltpackSignOptions { + return SaltpackSignOptions{ + Detached: o.Detached, + Binary: o.Binary, + SaltpackVersion: o.SaltpackVersion, + } +} + +type SaltpackVerifyOptions struct { + SignedBy string `codec:"signedBy" json:"signedBy"` + Signature []byte `codec:"signature" json:"signature"` +} + +func (o SaltpackVerifyOptions) DeepCopy() SaltpackVerifyOptions { + return SaltpackVerifyOptions{ + SignedBy: o.SignedBy, + Signature: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.Signature), + } +} + +type SaltpackEncryptResult struct { + UsedUnresolvedSBS bool `codec:"usedUnresolvedSBS" json:"usedUnresolvedSBS"` + UnresolvedSBSAssertion string `codec:"unresolvedSBSAssertion" json:"unresolvedSBSAssertion"` +} + +func (o SaltpackEncryptResult) DeepCopy() SaltpackEncryptResult { + return SaltpackEncryptResult{ + UsedUnresolvedSBS: o.UsedUnresolvedSBS, + UnresolvedSBSAssertion: o.UnresolvedSBSAssertion, + } +} + +type SaltpackEncryptedMessageInfo struct { + Devices []Device `codec:"devices" json:"devices"` + NumAnonReceivers int `codec:"numAnonReceivers" json:"numAnonReceivers"` + ReceiverIsAnon bool `codec:"receiverIsAnon" json:"receiverIsAnon"` + Sender SaltpackSender `codec:"sender" json:"sender"` +} + +func (o SaltpackEncryptedMessageInfo) DeepCopy() SaltpackEncryptedMessageInfo { + return SaltpackEncryptedMessageInfo{ + Devices: (func(x []Device) []Device { + if x == nil { + return nil + } + ret := make([]Device, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Devices), + NumAnonReceivers: o.NumAnonReceivers, + ReceiverIsAnon: o.ReceiverIsAnon, + Sender: o.Sender.DeepCopy(), + } +} + +type SaltpackFrontendEncryptOptions struct { + Recipients []string `codec:"recipients" json:"recipients"` + Signed bool `codec:"signed" json:"signed"` + IncludeSelf bool `codec:"includeSelf" json:"includeSelf"` +} + +func (o SaltpackFrontendEncryptOptions) DeepCopy() SaltpackFrontendEncryptOptions { + return SaltpackFrontendEncryptOptions{ + Recipients: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Recipients), + Signed: o.Signed, + IncludeSelf: o.IncludeSelf, + } +} + +type SaltpackEncryptStringResult struct { + UsedUnresolvedSBS bool `codec:"usedUnresolvedSBS" json:"usedUnresolvedSBS"` + UnresolvedSBSAssertion string `codec:"unresolvedSBSAssertion" json:"unresolvedSBSAssertion"` + Ciphertext string `codec:"ciphertext" json:"ciphertext"` +} + +func (o SaltpackEncryptStringResult) DeepCopy() SaltpackEncryptStringResult { + return SaltpackEncryptStringResult{ + UsedUnresolvedSBS: o.UsedUnresolvedSBS, + UnresolvedSBSAssertion: o.UnresolvedSBSAssertion, + Ciphertext: o.Ciphertext, + } +} + +type SaltpackEncryptFileResult struct { + UsedUnresolvedSBS bool `codec:"usedUnresolvedSBS" json:"usedUnresolvedSBS"` + UnresolvedSBSAssertion string `codec:"unresolvedSBSAssertion" json:"unresolvedSBSAssertion"` + Filename string `codec:"filename" json:"filename"` +} + +func (o SaltpackEncryptFileResult) DeepCopy() SaltpackEncryptFileResult { + return SaltpackEncryptFileResult{ + UsedUnresolvedSBS: o.UsedUnresolvedSBS, + UnresolvedSBSAssertion: o.UnresolvedSBSAssertion, + Filename: o.Filename, + } +} + +type SaltpackPlaintextResult struct { + Info SaltpackEncryptedMessageInfo `codec:"info" json:"info"` + Plaintext string `codec:"plaintext" json:"plaintext"` + Signed bool `codec:"signed" json:"signed"` +} + +func (o SaltpackPlaintextResult) DeepCopy() SaltpackPlaintextResult { + return SaltpackPlaintextResult{ + Info: o.Info.DeepCopy(), + Plaintext: o.Plaintext, + Signed: o.Signed, + } +} + +type SaltpackFileResult struct { + Info SaltpackEncryptedMessageInfo `codec:"info" json:"info"` + DecryptedFilename string `codec:"decryptedFilename" json:"decryptedFilename"` + Signed bool `codec:"signed" json:"signed"` +} + +func (o SaltpackFileResult) DeepCopy() SaltpackFileResult { + return SaltpackFileResult{ + Info: o.Info.DeepCopy(), + DecryptedFilename: o.DecryptedFilename, + Signed: o.Signed, + } +} + +type SaltpackVerifyResult struct { + SigningKID KID `codec:"signingKID" json:"signingKID"` + Sender SaltpackSender `codec:"sender" json:"sender"` + Plaintext string `codec:"plaintext" json:"plaintext"` + Verified bool `codec:"verified" json:"verified"` +} + +func (o SaltpackVerifyResult) DeepCopy() SaltpackVerifyResult { + return SaltpackVerifyResult{ + SigningKID: o.SigningKID.DeepCopy(), + Sender: o.Sender.DeepCopy(), + Plaintext: o.Plaintext, + Verified: o.Verified, + } +} + +type SaltpackVerifyFileResult struct { + SigningKID KID `codec:"signingKID" json:"signingKID"` + Sender SaltpackSender `codec:"sender" json:"sender"` + VerifiedFilename string `codec:"verifiedFilename" json:"verifiedFilename"` + Verified bool `codec:"verified" json:"verified"` +} + +func (o SaltpackVerifyFileResult) DeepCopy() SaltpackVerifyFileResult { + return SaltpackVerifyFileResult{ + SigningKID: o.SigningKID.DeepCopy(), + Sender: o.Sender.DeepCopy(), + VerifiedFilename: o.VerifiedFilename, + Verified: o.Verified, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/saltpack_ui.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/saltpack_ui.go new file mode 100644 index 00000000..39748b8e --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/saltpack_ui.go @@ -0,0 +1,66 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/saltpack_ui.avdl + +package keybase1 + +import ( + "fmt" +) + +type SaltpackSenderType int + +const ( + SaltpackSenderType_NOT_TRACKED SaltpackSenderType = 0 + SaltpackSenderType_UNKNOWN SaltpackSenderType = 1 + SaltpackSenderType_ANONYMOUS SaltpackSenderType = 2 + SaltpackSenderType_TRACKING_BROKE SaltpackSenderType = 3 + SaltpackSenderType_TRACKING_OK SaltpackSenderType = 4 + SaltpackSenderType_SELF SaltpackSenderType = 5 + SaltpackSenderType_REVOKED SaltpackSenderType = 6 + SaltpackSenderType_EXPIRED SaltpackSenderType = 7 +) + +func (o SaltpackSenderType) DeepCopy() SaltpackSenderType { return o } + +var SaltpackSenderTypeMap = map[string]SaltpackSenderType{ + "NOT_TRACKED": 0, + "UNKNOWN": 1, + "ANONYMOUS": 2, + "TRACKING_BROKE": 3, + "TRACKING_OK": 4, + "SELF": 5, + "REVOKED": 6, + "EXPIRED": 7, +} + +var SaltpackSenderTypeRevMap = map[SaltpackSenderType]string{ + 0: "NOT_TRACKED", + 1: "UNKNOWN", + 2: "ANONYMOUS", + 3: "TRACKING_BROKE", + 4: "TRACKING_OK", + 5: "SELF", + 6: "REVOKED", + 7: "EXPIRED", +} + +func (e SaltpackSenderType) String() string { + if v, ok := SaltpackSenderTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type SaltpackSender struct { + Uid UID `codec:"uid" json:"uid"` + Username string `codec:"username" json:"username"` + SenderType SaltpackSenderType `codec:"senderType" json:"senderType"` +} + +func (o SaltpackSender) DeepCopy() SaltpackSender { + return SaltpackSender{ + Uid: o.Uid.DeepCopy(), + Username: o.Username, + SenderType: o.SenderType.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/scanproofs.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/scanproofs.go new file mode 100644 index 00000000..61e1140d --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/scanproofs.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/scanproofs.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/secret_ui.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/secret_ui.go new file mode 100644 index 00000000..d48e8b48 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/secret_ui.go @@ -0,0 +1,40 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/secret_ui.avdl + +package keybase1 + +type SecretEntryArg struct { + Desc string `codec:"desc" json:"desc"` + Prompt string `codec:"prompt" json:"prompt"` + Err string `codec:"err" json:"err"` + Cancel string `codec:"cancel" json:"cancel"` + Ok string `codec:"ok" json:"ok"` + Reason string `codec:"reason" json:"reason"` + ShowTyping bool `codec:"showTyping" json:"showTyping"` +} + +func (o SecretEntryArg) DeepCopy() SecretEntryArg { + return SecretEntryArg{ + Desc: o.Desc, + Prompt: o.Prompt, + Err: o.Err, + Cancel: o.Cancel, + Ok: o.Ok, + Reason: o.Reason, + ShowTyping: o.ShowTyping, + } +} + +type SecretEntryRes struct { + Text string `codec:"text" json:"text"` + Canceled bool `codec:"canceled" json:"canceled"` + StoreSecret bool `codec:"storeSecret" json:"storeSecret"` +} + +func (o SecretEntryRes) DeepCopy() SecretEntryRes { + return SecretEntryRes{ + Text: o.Text, + Canceled: o.Canceled, + StoreSecret: o.StoreSecret, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/secretkeys.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/secretkeys.go new file mode 100644 index 00000000..e7aeb754 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/secretkeys.go @@ -0,0 +1,48 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/secretkeys.avdl + +package keybase1 + +type NaclSigningKeyPublic [32]byte + +func (o NaclSigningKeyPublic) DeepCopy() NaclSigningKeyPublic { + var ret NaclSigningKeyPublic + copy(ret[:], o[:]) + return ret +} + +type NaclSigningKeyPrivate [64]byte + +func (o NaclSigningKeyPrivate) DeepCopy() NaclSigningKeyPrivate { + var ret NaclSigningKeyPrivate + copy(ret[:], o[:]) + return ret +} + +type NaclDHKeyPublic [32]byte + +func (o NaclDHKeyPublic) DeepCopy() NaclDHKeyPublic { + var ret NaclDHKeyPublic + copy(ret[:], o[:]) + return ret +} + +type NaclDHKeyPrivate [32]byte + +func (o NaclDHKeyPrivate) DeepCopy() NaclDHKeyPrivate { + var ret NaclDHKeyPrivate + copy(ret[:], o[:]) + return ret +} + +type SecretKeys struct { + Signing NaclSigningKeyPrivate `codec:"signing" json:"signing"` + Encryption NaclDHKeyPrivate `codec:"encryption" json:"encryption"` +} + +func (o SecretKeys) DeepCopy() SecretKeys { + return SecretKeys{ + Signing: o.Signing.DeepCopy(), + Encryption: o.Encryption.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/selfprovision.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/selfprovision.go new file mode 100644 index 00000000..3a89450a --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/selfprovision.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/selfprovision.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/session.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/session.go new file mode 100644 index 00000000..0c13b9e3 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/session.go @@ -0,0 +1,22 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/session.avdl + +package keybase1 + +type Session struct { + Uid UID `codec:"uid" json:"uid"` + Username string `codec:"username" json:"username"` + Token string `codec:"token" json:"token"` + DeviceSubkeyKid KID `codec:"deviceSubkeyKid" json:"deviceSubkeyKid"` + DeviceSibkeyKid KID `codec:"deviceSibkeyKid" json:"deviceSibkeyKid"` +} + +func (o Session) DeepCopy() Session { + return Session{ + Uid: o.Uid.DeepCopy(), + Username: o.Username, + Token: o.Token, + DeviceSubkeyKid: o.DeviceSubkeyKid.DeepCopy(), + DeviceSibkeyKid: o.DeviceSibkeyKid.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/signup.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/signup.go new file mode 100644 index 00000000..fb8fa57a --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/signup.go @@ -0,0 +1,20 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/signup.avdl + +package keybase1 + +type SignupRes struct { + PassphraseOk bool `codec:"passphraseOk" json:"passphraseOk"` + PostOk bool `codec:"postOk" json:"postOk"` + WriteOk bool `codec:"writeOk" json:"writeOk"` + PaperKey string `codec:"paperKey" json:"paperKey"` +} + +func (o SignupRes) DeepCopy() SignupRes { + return SignupRes{ + PassphraseOk: o.PassphraseOk, + PostOk: o.PostOk, + WriteOk: o.WriteOk, + PaperKey: o.PaperKey, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/sigs.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/sigs.go new file mode 100644 index 00000000..09abc8ca --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/sigs.go @@ -0,0 +1,74 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/sigs.avdl + +package keybase1 + +type Sig struct { + Seqno Seqno `codec:"seqno" json:"seqno"` + SigID SigID `codec:"sigID" json:"sigID"` + SigIDDisplay string `codec:"sigIDDisplay" json:"sigIDDisplay"` + Type string `codec:"type" json:"type"` + CTime Time `codec:"cTime" json:"cTime"` + Revoked bool `codec:"revoked" json:"revoked"` + Active bool `codec:"active" json:"active"` + Key string `codec:"key" json:"key"` + Body string `codec:"body" json:"body"` +} + +func (o Sig) DeepCopy() Sig { + return Sig{ + Seqno: o.Seqno.DeepCopy(), + SigID: o.SigID.DeepCopy(), + SigIDDisplay: o.SigIDDisplay, + Type: o.Type, + CTime: o.CTime.DeepCopy(), + Revoked: o.Revoked, + Active: o.Active, + Key: o.Key, + Body: o.Body, + } +} + +type SigTypes struct { + Track bool `codec:"track" json:"track"` + Proof bool `codec:"proof" json:"proof"` + Cryptocurrency bool `codec:"cryptocurrency" json:"cryptocurrency"` + IsSelf bool `codec:"isSelf" json:"isSelf"` +} + +func (o SigTypes) DeepCopy() SigTypes { + return SigTypes{ + Track: o.Track, + Proof: o.Proof, + Cryptocurrency: o.Cryptocurrency, + IsSelf: o.IsSelf, + } +} + +type SigListArgs struct { + SessionID int `codec:"sessionID" json:"sessionID"` + Username string `codec:"username" json:"username"` + AllKeys bool `codec:"allKeys" json:"allKeys"` + Types *SigTypes `codec:"types,omitempty" json:"types,omitempty"` + Filterx string `codec:"filterx" json:"filterx"` + Verbose bool `codec:"verbose" json:"verbose"` + Revoked bool `codec:"revoked" json:"revoked"` +} + +func (o SigListArgs) DeepCopy() SigListArgs { + return SigListArgs{ + SessionID: o.SessionID, + Username: o.Username, + AllKeys: o.AllKeys, + Types: (func(x *SigTypes) *SigTypes { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Types), + Filterx: o.Filterx, + Verbose: o.Verbose, + Revoked: o.Revoked, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/simple_fs.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/simple_fs.go new file mode 100644 index 00000000..0fb77019 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/simple_fs.go @@ -0,0 +1,1565 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/simple_fs.avdl + +package keybase1 + +import ( + "errors" + "fmt" +) + +type OpID [16]byte + +func (o OpID) DeepCopy() OpID { + var ret OpID + copy(ret[:], o[:]) + return ret +} + +type KBFSRevision int64 + +func (o KBFSRevision) DeepCopy() KBFSRevision { + return o +} + +type KBFSArchivedType int + +const ( + KBFSArchivedType_REVISION KBFSArchivedType = 0 + KBFSArchivedType_TIME KBFSArchivedType = 1 + KBFSArchivedType_TIME_STRING KBFSArchivedType = 2 + KBFSArchivedType_REL_TIME_STRING KBFSArchivedType = 3 +) + +func (o KBFSArchivedType) DeepCopy() KBFSArchivedType { return o } + +var KBFSArchivedTypeMap = map[string]KBFSArchivedType{ + "REVISION": 0, + "TIME": 1, + "TIME_STRING": 2, + "REL_TIME_STRING": 3, +} + +var KBFSArchivedTypeRevMap = map[KBFSArchivedType]string{ + 0: "REVISION", + 1: "TIME", + 2: "TIME_STRING", + 3: "REL_TIME_STRING", +} + +func (e KBFSArchivedType) String() string { + if v, ok := KBFSArchivedTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type KBFSArchivedParam struct { + KBFSArchivedType__ KBFSArchivedType `codec:"KBFSArchivedType" json:"KBFSArchivedType"` + Revision__ *KBFSRevision `codec:"revision,omitempty" json:"revision,omitempty"` + Time__ *Time `codec:"time,omitempty" json:"time,omitempty"` + TimeString__ *string `codec:"timeString,omitempty" json:"timeString,omitempty"` + RelTimeString__ *string `codec:"relTimeString,omitempty" json:"relTimeString,omitempty"` +} + +func (o *KBFSArchivedParam) KBFSArchivedType() (ret KBFSArchivedType, err error) { + switch o.KBFSArchivedType__ { + case KBFSArchivedType_REVISION: + if o.Revision__ == nil { + err = errors.New("unexpected nil value for Revision__") + return ret, err + } + case KBFSArchivedType_TIME: + if o.Time__ == nil { + err = errors.New("unexpected nil value for Time__") + return ret, err + } + case KBFSArchivedType_TIME_STRING: + if o.TimeString__ == nil { + err = errors.New("unexpected nil value for TimeString__") + return ret, err + } + case KBFSArchivedType_REL_TIME_STRING: + if o.RelTimeString__ == nil { + err = errors.New("unexpected nil value for RelTimeString__") + return ret, err + } + } + return o.KBFSArchivedType__, nil +} + +func (o KBFSArchivedParam) Revision() (res KBFSRevision) { + if o.KBFSArchivedType__ != KBFSArchivedType_REVISION { + panic("wrong case accessed") + } + if o.Revision__ == nil { + return + } + return *o.Revision__ +} + +func (o KBFSArchivedParam) Time() (res Time) { + if o.KBFSArchivedType__ != KBFSArchivedType_TIME { + panic("wrong case accessed") + } + if o.Time__ == nil { + return + } + return *o.Time__ +} + +func (o KBFSArchivedParam) TimeString() (res string) { + if o.KBFSArchivedType__ != KBFSArchivedType_TIME_STRING { + panic("wrong case accessed") + } + if o.TimeString__ == nil { + return + } + return *o.TimeString__ +} + +func (o KBFSArchivedParam) RelTimeString() (res string) { + if o.KBFSArchivedType__ != KBFSArchivedType_REL_TIME_STRING { + panic("wrong case accessed") + } + if o.RelTimeString__ == nil { + return + } + return *o.RelTimeString__ +} + +func NewKBFSArchivedParamWithRevision(v KBFSRevision) KBFSArchivedParam { + return KBFSArchivedParam{ + KBFSArchivedType__: KBFSArchivedType_REVISION, + Revision__: &v, + } +} + +func NewKBFSArchivedParamWithTime(v Time) KBFSArchivedParam { + return KBFSArchivedParam{ + KBFSArchivedType__: KBFSArchivedType_TIME, + Time__: &v, + } +} + +func NewKBFSArchivedParamWithTimeString(v string) KBFSArchivedParam { + return KBFSArchivedParam{ + KBFSArchivedType__: KBFSArchivedType_TIME_STRING, + TimeString__: &v, + } +} + +func NewKBFSArchivedParamWithRelTimeString(v string) KBFSArchivedParam { + return KBFSArchivedParam{ + KBFSArchivedType__: KBFSArchivedType_REL_TIME_STRING, + RelTimeString__: &v, + } +} + +func (o KBFSArchivedParam) DeepCopy() KBFSArchivedParam { + return KBFSArchivedParam{ + KBFSArchivedType__: o.KBFSArchivedType__.DeepCopy(), + Revision__: (func(x *KBFSRevision) *KBFSRevision { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Revision__), + Time__: (func(x *Time) *Time { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Time__), + TimeString__: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.TimeString__), + RelTimeString__: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.RelTimeString__), + } +} + +type KBFSArchivedPath struct { + Path string `codec:"path" json:"path"` + ArchivedParam KBFSArchivedParam `codec:"archivedParam" json:"archivedParam"` + IdentifyBehavior *TLFIdentifyBehavior `codec:"identifyBehavior,omitempty" json:"identifyBehavior,omitempty"` +} + +func (o KBFSArchivedPath) DeepCopy() KBFSArchivedPath { + return KBFSArchivedPath{ + Path: o.Path, + ArchivedParam: o.ArchivedParam.DeepCopy(), + IdentifyBehavior: (func(x *TLFIdentifyBehavior) *TLFIdentifyBehavior { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.IdentifyBehavior), + } +} + +type KBFSPath struct { + Path string `codec:"path" json:"path"` + IdentifyBehavior *TLFIdentifyBehavior `codec:"identifyBehavior,omitempty" json:"identifyBehavior,omitempty"` +} + +func (o KBFSPath) DeepCopy() KBFSPath { + return KBFSPath{ + Path: o.Path, + IdentifyBehavior: (func(x *TLFIdentifyBehavior) *TLFIdentifyBehavior { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.IdentifyBehavior), + } +} + +type PathType int + +const ( + PathType_LOCAL PathType = 0 + PathType_KBFS PathType = 1 + PathType_KBFS_ARCHIVED PathType = 2 +) + +func (o PathType) DeepCopy() PathType { return o } + +var PathTypeMap = map[string]PathType{ + "LOCAL": 0, + "KBFS": 1, + "KBFS_ARCHIVED": 2, +} + +var PathTypeRevMap = map[PathType]string{ + 0: "LOCAL", + 1: "KBFS", + 2: "KBFS_ARCHIVED", +} + +func (e PathType) String() string { + if v, ok := PathTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type Path struct { + PathType__ PathType `codec:"PathType" json:"PathType"` + Local__ *string `codec:"local,omitempty" json:"local,omitempty"` + Kbfs__ *KBFSPath `codec:"kbfs,omitempty" json:"kbfs,omitempty"` + KbfsArchived__ *KBFSArchivedPath `codec:"kbfsArchived,omitempty" json:"kbfsArchived,omitempty"` +} + +func (o *Path) PathType() (ret PathType, err error) { + switch o.PathType__ { + case PathType_LOCAL: + if o.Local__ == nil { + err = errors.New("unexpected nil value for Local__") + return ret, err + } + case PathType_KBFS: + if o.Kbfs__ == nil { + err = errors.New("unexpected nil value for Kbfs__") + return ret, err + } + case PathType_KBFS_ARCHIVED: + if o.KbfsArchived__ == nil { + err = errors.New("unexpected nil value for KbfsArchived__") + return ret, err + } + } + return o.PathType__, nil +} + +func (o Path) Local() (res string) { + if o.PathType__ != PathType_LOCAL { + panic("wrong case accessed") + } + if o.Local__ == nil { + return + } + return *o.Local__ +} + +func (o Path) Kbfs() (res KBFSPath) { + if o.PathType__ != PathType_KBFS { + panic("wrong case accessed") + } + if o.Kbfs__ == nil { + return + } + return *o.Kbfs__ +} + +func (o Path) KbfsArchived() (res KBFSArchivedPath) { + if o.PathType__ != PathType_KBFS_ARCHIVED { + panic("wrong case accessed") + } + if o.KbfsArchived__ == nil { + return + } + return *o.KbfsArchived__ +} + +func NewPathWithLocal(v string) Path { + return Path{ + PathType__: PathType_LOCAL, + Local__: &v, + } +} + +func NewPathWithKbfs(v KBFSPath) Path { + return Path{ + PathType__: PathType_KBFS, + Kbfs__: &v, + } +} + +func NewPathWithKbfsArchived(v KBFSArchivedPath) Path { + return Path{ + PathType__: PathType_KBFS_ARCHIVED, + KbfsArchived__: &v, + } +} + +func (o Path) DeepCopy() Path { + return Path{ + PathType__: o.PathType__.DeepCopy(), + Local__: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Local__), + Kbfs__: (func(x *KBFSPath) *KBFSPath { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Kbfs__), + KbfsArchived__: (func(x *KBFSArchivedPath) *KBFSArchivedPath { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.KbfsArchived__), + } +} + +type DirentType int + +const ( + DirentType_FILE DirentType = 0 + DirentType_DIR DirentType = 1 + DirentType_SYM DirentType = 2 + DirentType_EXEC DirentType = 3 +) + +func (o DirentType) DeepCopy() DirentType { return o } + +var DirentTypeMap = map[string]DirentType{ + "FILE": 0, + "DIR": 1, + "SYM": 2, + "EXEC": 3, +} + +var DirentTypeRevMap = map[DirentType]string{ + 0: "FILE", + 1: "DIR", + 2: "SYM", + 3: "EXEC", +} + +func (e DirentType) String() string { + if v, ok := DirentTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type PrefetchStatus int + +const ( + PrefetchStatus_NOT_STARTED PrefetchStatus = 0 + PrefetchStatus_IN_PROGRESS PrefetchStatus = 1 + PrefetchStatus_COMPLETE PrefetchStatus = 2 +) + +func (o PrefetchStatus) DeepCopy() PrefetchStatus { return o } + +var PrefetchStatusMap = map[string]PrefetchStatus{ + "NOT_STARTED": 0, + "IN_PROGRESS": 1, + "COMPLETE": 2, +} + +var PrefetchStatusRevMap = map[PrefetchStatus]string{ + 0: "NOT_STARTED", + 1: "IN_PROGRESS", + 2: "COMPLETE", +} + +func (e PrefetchStatus) String() string { + if v, ok := PrefetchStatusRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type PrefetchProgress struct { + Start Time `codec:"start" json:"start"` + EndEstimate Time `codec:"endEstimate" json:"endEstimate"` + BytesTotal int64 `codec:"bytesTotal" json:"bytesTotal"` + BytesFetched int64 `codec:"bytesFetched" json:"bytesFetched"` +} + +func (o PrefetchProgress) DeepCopy() PrefetchProgress { + return PrefetchProgress{ + Start: o.Start.DeepCopy(), + EndEstimate: o.EndEstimate.DeepCopy(), + BytesTotal: o.BytesTotal, + BytesFetched: o.BytesFetched, + } +} + +type Dirent struct { + Time Time `codec:"time" json:"time"` + Size int `codec:"size" json:"size"` + Name string `codec:"name" json:"name"` + DirentType DirentType `codec:"direntType" json:"direntType"` + LastWriterUnverified User `codec:"lastWriterUnverified" json:"lastWriterUnverified"` + Writable bool `codec:"writable" json:"writable"` + PrefetchStatus PrefetchStatus `codec:"prefetchStatus" json:"prefetchStatus"` + PrefetchProgress PrefetchProgress `codec:"prefetchProgress" json:"prefetchProgress"` + SymlinkTarget string `codec:"symlinkTarget" json:"symlinkTarget"` +} + +func (o Dirent) DeepCopy() Dirent { + return Dirent{ + Time: o.Time.DeepCopy(), + Size: o.Size, + Name: o.Name, + DirentType: o.DirentType.DeepCopy(), + LastWriterUnverified: o.LastWriterUnverified.DeepCopy(), + Writable: o.Writable, + PrefetchStatus: o.PrefetchStatus.DeepCopy(), + PrefetchProgress: o.PrefetchProgress.DeepCopy(), + SymlinkTarget: o.SymlinkTarget, + } +} + +type DirentWithRevision struct { + Entry Dirent `codec:"entry" json:"entry"` + Revision KBFSRevision `codec:"revision" json:"revision"` +} + +func (o DirentWithRevision) DeepCopy() DirentWithRevision { + return DirentWithRevision{ + Entry: o.Entry.DeepCopy(), + Revision: o.Revision.DeepCopy(), + } +} + +type RevisionSpanType int + +const ( + RevisionSpanType_DEFAULT RevisionSpanType = 0 + RevisionSpanType_LAST_FIVE RevisionSpanType = 1 +) + +func (o RevisionSpanType) DeepCopy() RevisionSpanType { return o } + +var RevisionSpanTypeMap = map[string]RevisionSpanType{ + "DEFAULT": 0, + "LAST_FIVE": 1, +} + +var RevisionSpanTypeRevMap = map[RevisionSpanType]string{ + 0: "DEFAULT", + 1: "LAST_FIVE", +} + +func (e RevisionSpanType) String() string { + if v, ok := RevisionSpanTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ErrorNum int + +func (o ErrorNum) DeepCopy() ErrorNum { + return o +} + +type OpenFlags int + +const ( + OpenFlags_READ OpenFlags = 0 + OpenFlags_REPLACE OpenFlags = 1 + OpenFlags_EXISTING OpenFlags = 2 + OpenFlags_WRITE OpenFlags = 4 + OpenFlags_APPEND OpenFlags = 8 + OpenFlags_DIRECTORY OpenFlags = 16 +) + +func (o OpenFlags) DeepCopy() OpenFlags { return o } + +var OpenFlagsMap = map[string]OpenFlags{ + "READ": 0, + "REPLACE": 1, + "EXISTING": 2, + "WRITE": 4, + "APPEND": 8, + "DIRECTORY": 16, +} + +var OpenFlagsRevMap = map[OpenFlags]string{ + 0: "READ", + 1: "REPLACE", + 2: "EXISTING", + 4: "WRITE", + 8: "APPEND", + 16: "DIRECTORY", +} + +func (e OpenFlags) String() string { + if v, ok := OpenFlagsRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type Progress int + +func (o Progress) DeepCopy() Progress { + return o +} + +type SimpleFSListResult struct { + Entries []Dirent `codec:"entries" json:"entries"` + Progress Progress `codec:"progress" json:"progress"` +} + +func (o SimpleFSListResult) DeepCopy() SimpleFSListResult { + return SimpleFSListResult{ + Entries: (func(x []Dirent) []Dirent { + if x == nil { + return nil + } + ret := make([]Dirent, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Entries), + Progress: o.Progress.DeepCopy(), + } +} + +type FileContent struct { + Data []byte `codec:"data" json:"data"` + Progress Progress `codec:"progress" json:"progress"` +} + +func (o FileContent) DeepCopy() FileContent { + return FileContent{ + Data: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.Data), + Progress: o.Progress.DeepCopy(), + } +} + +type AsyncOps int + +const ( + AsyncOps_LIST AsyncOps = 0 + AsyncOps_LIST_RECURSIVE AsyncOps = 1 + AsyncOps_READ AsyncOps = 2 + AsyncOps_WRITE AsyncOps = 3 + AsyncOps_COPY AsyncOps = 4 + AsyncOps_MOVE AsyncOps = 5 + AsyncOps_REMOVE AsyncOps = 6 + AsyncOps_LIST_RECURSIVE_TO_DEPTH AsyncOps = 7 + AsyncOps_GET_REVISIONS AsyncOps = 8 +) + +func (o AsyncOps) DeepCopy() AsyncOps { return o } + +var AsyncOpsMap = map[string]AsyncOps{ + "LIST": 0, + "LIST_RECURSIVE": 1, + "READ": 2, + "WRITE": 3, + "COPY": 4, + "MOVE": 5, + "REMOVE": 6, + "LIST_RECURSIVE_TO_DEPTH": 7, + "GET_REVISIONS": 8, +} + +var AsyncOpsRevMap = map[AsyncOps]string{ + 0: "LIST", + 1: "LIST_RECURSIVE", + 2: "READ", + 3: "WRITE", + 4: "COPY", + 5: "MOVE", + 6: "REMOVE", + 7: "LIST_RECURSIVE_TO_DEPTH", + 8: "GET_REVISIONS", +} + +func (e AsyncOps) String() string { + if v, ok := AsyncOpsRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ListFilter int + +const ( + ListFilter_NO_FILTER ListFilter = 0 + ListFilter_FILTER_ALL_HIDDEN ListFilter = 1 + ListFilter_FILTER_SYSTEM_HIDDEN ListFilter = 2 +) + +func (o ListFilter) DeepCopy() ListFilter { return o } + +var ListFilterMap = map[string]ListFilter{ + "NO_FILTER": 0, + "FILTER_ALL_HIDDEN": 1, + "FILTER_SYSTEM_HIDDEN": 2, +} + +var ListFilterRevMap = map[ListFilter]string{ + 0: "NO_FILTER", + 1: "FILTER_ALL_HIDDEN", + 2: "FILTER_SYSTEM_HIDDEN", +} + +func (e ListFilter) String() string { + if v, ok := ListFilterRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ListArgs struct { + OpID OpID `codec:"opID" json:"opID"` + Path Path `codec:"path" json:"path"` + Filter ListFilter `codec:"filter" json:"filter"` +} + +func (o ListArgs) DeepCopy() ListArgs { + return ListArgs{ + OpID: o.OpID.DeepCopy(), + Path: o.Path.DeepCopy(), + Filter: o.Filter.DeepCopy(), + } +} + +type ListToDepthArgs struct { + OpID OpID `codec:"opID" json:"opID"` + Path Path `codec:"path" json:"path"` + Filter ListFilter `codec:"filter" json:"filter"` + Depth int `codec:"depth" json:"depth"` +} + +func (o ListToDepthArgs) DeepCopy() ListToDepthArgs { + return ListToDepthArgs{ + OpID: o.OpID.DeepCopy(), + Path: o.Path.DeepCopy(), + Filter: o.Filter.DeepCopy(), + Depth: o.Depth, + } +} + +type RemoveArgs struct { + OpID OpID `codec:"opID" json:"opID"` + Path Path `codec:"path" json:"path"` + Recursive bool `codec:"recursive" json:"recursive"` +} + +func (o RemoveArgs) DeepCopy() RemoveArgs { + return RemoveArgs{ + OpID: o.OpID.DeepCopy(), + Path: o.Path.DeepCopy(), + Recursive: o.Recursive, + } +} + +type ReadArgs struct { + OpID OpID `codec:"opID" json:"opID"` + Path Path `codec:"path" json:"path"` + Offset int64 `codec:"offset" json:"offset"` + Size int `codec:"size" json:"size"` +} + +func (o ReadArgs) DeepCopy() ReadArgs { + return ReadArgs{ + OpID: o.OpID.DeepCopy(), + Path: o.Path.DeepCopy(), + Offset: o.Offset, + Size: o.Size, + } +} + +type WriteArgs struct { + OpID OpID `codec:"opID" json:"opID"` + Path Path `codec:"path" json:"path"` + Offset int64 `codec:"offset" json:"offset"` +} + +func (o WriteArgs) DeepCopy() WriteArgs { + return WriteArgs{ + OpID: o.OpID.DeepCopy(), + Path: o.Path.DeepCopy(), + Offset: o.Offset, + } +} + +type CopyArgs struct { + OpID OpID `codec:"opID" json:"opID"` + Src Path `codec:"src" json:"src"` + Dest Path `codec:"dest" json:"dest"` +} + +func (o CopyArgs) DeepCopy() CopyArgs { + return CopyArgs{ + OpID: o.OpID.DeepCopy(), + Src: o.Src.DeepCopy(), + Dest: o.Dest.DeepCopy(), + } +} + +type MoveArgs struct { + OpID OpID `codec:"opID" json:"opID"` + Src Path `codec:"src" json:"src"` + Dest Path `codec:"dest" json:"dest"` +} + +func (o MoveArgs) DeepCopy() MoveArgs { + return MoveArgs{ + OpID: o.OpID.DeepCopy(), + Src: o.Src.DeepCopy(), + Dest: o.Dest.DeepCopy(), + } +} + +type GetRevisionsArgs struct { + OpID OpID `codec:"opID" json:"opID"` + Path Path `codec:"path" json:"path"` + SpanType RevisionSpanType `codec:"spanType" json:"spanType"` +} + +func (o GetRevisionsArgs) DeepCopy() GetRevisionsArgs { + return GetRevisionsArgs{ + OpID: o.OpID.DeepCopy(), + Path: o.Path.DeepCopy(), + SpanType: o.SpanType.DeepCopy(), + } +} + +type OpDescription struct { + AsyncOp__ AsyncOps `codec:"asyncOp" json:"asyncOp"` + List__ *ListArgs `codec:"list,omitempty" json:"list,omitempty"` + ListRecursive__ *ListArgs `codec:"listRecursive,omitempty" json:"listRecursive,omitempty"` + ListRecursiveToDepth__ *ListToDepthArgs `codec:"listRecursiveToDepth,omitempty" json:"listRecursiveToDepth,omitempty"` + Read__ *ReadArgs `codec:"read,omitempty" json:"read,omitempty"` + Write__ *WriteArgs `codec:"write,omitempty" json:"write,omitempty"` + Copy__ *CopyArgs `codec:"copy,omitempty" json:"copy,omitempty"` + Move__ *MoveArgs `codec:"move,omitempty" json:"move,omitempty"` + Remove__ *RemoveArgs `codec:"remove,omitempty" json:"remove,omitempty"` + GetRevisions__ *GetRevisionsArgs `codec:"getRevisions,omitempty" json:"getRevisions,omitempty"` +} + +func (o *OpDescription) AsyncOp() (ret AsyncOps, err error) { + switch o.AsyncOp__ { + case AsyncOps_LIST: + if o.List__ == nil { + err = errors.New("unexpected nil value for List__") + return ret, err + } + case AsyncOps_LIST_RECURSIVE: + if o.ListRecursive__ == nil { + err = errors.New("unexpected nil value for ListRecursive__") + return ret, err + } + case AsyncOps_LIST_RECURSIVE_TO_DEPTH: + if o.ListRecursiveToDepth__ == nil { + err = errors.New("unexpected nil value for ListRecursiveToDepth__") + return ret, err + } + case AsyncOps_READ: + if o.Read__ == nil { + err = errors.New("unexpected nil value for Read__") + return ret, err + } + case AsyncOps_WRITE: + if o.Write__ == nil { + err = errors.New("unexpected nil value for Write__") + return ret, err + } + case AsyncOps_COPY: + if o.Copy__ == nil { + err = errors.New("unexpected nil value for Copy__") + return ret, err + } + case AsyncOps_MOVE: + if o.Move__ == nil { + err = errors.New("unexpected nil value for Move__") + return ret, err + } + case AsyncOps_REMOVE: + if o.Remove__ == nil { + err = errors.New("unexpected nil value for Remove__") + return ret, err + } + case AsyncOps_GET_REVISIONS: + if o.GetRevisions__ == nil { + err = errors.New("unexpected nil value for GetRevisions__") + return ret, err + } + } + return o.AsyncOp__, nil +} + +func (o OpDescription) List() (res ListArgs) { + if o.AsyncOp__ != AsyncOps_LIST { + panic("wrong case accessed") + } + if o.List__ == nil { + return + } + return *o.List__ +} + +func (o OpDescription) ListRecursive() (res ListArgs) { + if o.AsyncOp__ != AsyncOps_LIST_RECURSIVE { + panic("wrong case accessed") + } + if o.ListRecursive__ == nil { + return + } + return *o.ListRecursive__ +} + +func (o OpDescription) ListRecursiveToDepth() (res ListToDepthArgs) { + if o.AsyncOp__ != AsyncOps_LIST_RECURSIVE_TO_DEPTH { + panic("wrong case accessed") + } + if o.ListRecursiveToDepth__ == nil { + return + } + return *o.ListRecursiveToDepth__ +} + +func (o OpDescription) Read() (res ReadArgs) { + if o.AsyncOp__ != AsyncOps_READ { + panic("wrong case accessed") + } + if o.Read__ == nil { + return + } + return *o.Read__ +} + +func (o OpDescription) Write() (res WriteArgs) { + if o.AsyncOp__ != AsyncOps_WRITE { + panic("wrong case accessed") + } + if o.Write__ == nil { + return + } + return *o.Write__ +} + +func (o OpDescription) Copy() (res CopyArgs) { + if o.AsyncOp__ != AsyncOps_COPY { + panic("wrong case accessed") + } + if o.Copy__ == nil { + return + } + return *o.Copy__ +} + +func (o OpDescription) Move() (res MoveArgs) { + if o.AsyncOp__ != AsyncOps_MOVE { + panic("wrong case accessed") + } + if o.Move__ == nil { + return + } + return *o.Move__ +} + +func (o OpDescription) Remove() (res RemoveArgs) { + if o.AsyncOp__ != AsyncOps_REMOVE { + panic("wrong case accessed") + } + if o.Remove__ == nil { + return + } + return *o.Remove__ +} + +func (o OpDescription) GetRevisions() (res GetRevisionsArgs) { + if o.AsyncOp__ != AsyncOps_GET_REVISIONS { + panic("wrong case accessed") + } + if o.GetRevisions__ == nil { + return + } + return *o.GetRevisions__ +} + +func NewOpDescriptionWithList(v ListArgs) OpDescription { + return OpDescription{ + AsyncOp__: AsyncOps_LIST, + List__: &v, + } +} + +func NewOpDescriptionWithListRecursive(v ListArgs) OpDescription { + return OpDescription{ + AsyncOp__: AsyncOps_LIST_RECURSIVE, + ListRecursive__: &v, + } +} + +func NewOpDescriptionWithListRecursiveToDepth(v ListToDepthArgs) OpDescription { + return OpDescription{ + AsyncOp__: AsyncOps_LIST_RECURSIVE_TO_DEPTH, + ListRecursiveToDepth__: &v, + } +} + +func NewOpDescriptionWithRead(v ReadArgs) OpDescription { + return OpDescription{ + AsyncOp__: AsyncOps_READ, + Read__: &v, + } +} + +func NewOpDescriptionWithWrite(v WriteArgs) OpDescription { + return OpDescription{ + AsyncOp__: AsyncOps_WRITE, + Write__: &v, + } +} + +func NewOpDescriptionWithCopy(v CopyArgs) OpDescription { + return OpDescription{ + AsyncOp__: AsyncOps_COPY, + Copy__: &v, + } +} + +func NewOpDescriptionWithMove(v MoveArgs) OpDescription { + return OpDescription{ + AsyncOp__: AsyncOps_MOVE, + Move__: &v, + } +} + +func NewOpDescriptionWithRemove(v RemoveArgs) OpDescription { + return OpDescription{ + AsyncOp__: AsyncOps_REMOVE, + Remove__: &v, + } +} + +func NewOpDescriptionWithGetRevisions(v GetRevisionsArgs) OpDescription { + return OpDescription{ + AsyncOp__: AsyncOps_GET_REVISIONS, + GetRevisions__: &v, + } +} + +func (o OpDescription) DeepCopy() OpDescription { + return OpDescription{ + AsyncOp__: o.AsyncOp__.DeepCopy(), + List__: (func(x *ListArgs) *ListArgs { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.List__), + ListRecursive__: (func(x *ListArgs) *ListArgs { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ListRecursive__), + ListRecursiveToDepth__: (func(x *ListToDepthArgs) *ListToDepthArgs { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ListRecursiveToDepth__), + Read__: (func(x *ReadArgs) *ReadArgs { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Read__), + Write__: (func(x *WriteArgs) *WriteArgs { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Write__), + Copy__: (func(x *CopyArgs) *CopyArgs { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Copy__), + Move__: (func(x *MoveArgs) *MoveArgs { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Move__), + Remove__: (func(x *RemoveArgs) *RemoveArgs { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Remove__), + GetRevisions__: (func(x *GetRevisionsArgs) *GetRevisionsArgs { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.GetRevisions__), + } +} + +type GetRevisionsResult struct { + Revisions []DirentWithRevision `codec:"revisions" json:"revisions"` + Progress Progress `codec:"progress" json:"progress"` +} + +func (o GetRevisionsResult) DeepCopy() GetRevisionsResult { + return GetRevisionsResult{ + Revisions: (func(x []DirentWithRevision) []DirentWithRevision { + if x == nil { + return nil + } + ret := make([]DirentWithRevision, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Revisions), + Progress: o.Progress.DeepCopy(), + } +} + +type OpProgress struct { + Start Time `codec:"start" json:"start"` + EndEstimate Time `codec:"endEstimate" json:"endEstimate"` + OpType AsyncOps `codec:"opType" json:"opType"` + BytesTotal int64 `codec:"bytesTotal" json:"bytesTotal"` + BytesRead int64 `codec:"bytesRead" json:"bytesRead"` + BytesWritten int64 `codec:"bytesWritten" json:"bytesWritten"` + FilesTotal int64 `codec:"filesTotal" json:"filesTotal"` + FilesRead int64 `codec:"filesRead" json:"filesRead"` + FilesWritten int64 `codec:"filesWritten" json:"filesWritten"` +} + +func (o OpProgress) DeepCopy() OpProgress { + return OpProgress{ + Start: o.Start.DeepCopy(), + EndEstimate: o.EndEstimate.DeepCopy(), + OpType: o.OpType.DeepCopy(), + BytesTotal: o.BytesTotal, + BytesRead: o.BytesRead, + BytesWritten: o.BytesWritten, + FilesTotal: o.FilesTotal, + FilesRead: o.FilesRead, + FilesWritten: o.FilesWritten, + } +} + +type SimpleFSQuotaUsage struct { + UsageBytes int64 `codec:"usageBytes" json:"usageBytes"` + ArchiveBytes int64 `codec:"archiveBytes" json:"archiveBytes"` + LimitBytes int64 `codec:"limitBytes" json:"limitBytes"` + GitUsageBytes int64 `codec:"gitUsageBytes" json:"gitUsageBytes"` + GitArchiveBytes int64 `codec:"gitArchiveBytes" json:"gitArchiveBytes"` + GitLimitBytes int64 `codec:"gitLimitBytes" json:"gitLimitBytes"` +} + +func (o SimpleFSQuotaUsage) DeepCopy() SimpleFSQuotaUsage { + return SimpleFSQuotaUsage{ + UsageBytes: o.UsageBytes, + ArchiveBytes: o.ArchiveBytes, + LimitBytes: o.LimitBytes, + GitUsageBytes: o.GitUsageBytes, + GitArchiveBytes: o.GitArchiveBytes, + GitLimitBytes: o.GitLimitBytes, + } +} + +type FolderSyncMode int + +const ( + FolderSyncMode_DISABLED FolderSyncMode = 0 + FolderSyncMode_ENABLED FolderSyncMode = 1 + FolderSyncMode_PARTIAL FolderSyncMode = 2 +) + +func (o FolderSyncMode) DeepCopy() FolderSyncMode { return o } + +var FolderSyncModeMap = map[string]FolderSyncMode{ + "DISABLED": 0, + "ENABLED": 1, + "PARTIAL": 2, +} + +var FolderSyncModeRevMap = map[FolderSyncMode]string{ + 0: "DISABLED", + 1: "ENABLED", + 2: "PARTIAL", +} + +func (e FolderSyncMode) String() string { + if v, ok := FolderSyncModeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type FolderSyncConfig struct { + Mode FolderSyncMode `codec:"mode" json:"mode"` + Paths []string `codec:"paths" json:"paths"` +} + +func (o FolderSyncConfig) DeepCopy() FolderSyncConfig { + return FolderSyncConfig{ + Mode: o.Mode.DeepCopy(), + Paths: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Paths), + } +} + +type FolderSyncConfigAndStatus struct { + Config FolderSyncConfig `codec:"config" json:"config"` + Status FolderSyncStatus `codec:"status" json:"status"` +} + +func (o FolderSyncConfigAndStatus) DeepCopy() FolderSyncConfigAndStatus { + return FolderSyncConfigAndStatus{ + Config: o.Config.DeepCopy(), + Status: o.Status.DeepCopy(), + } +} + +type FolderSyncConfigAndStatusWithFolder struct { + Folder Folder `codec:"folder" json:"folder"` + Config FolderSyncConfig `codec:"config" json:"config"` + Status FolderSyncStatus `codec:"status" json:"status"` +} + +func (o FolderSyncConfigAndStatusWithFolder) DeepCopy() FolderSyncConfigAndStatusWithFolder { + return FolderSyncConfigAndStatusWithFolder{ + Folder: o.Folder.DeepCopy(), + Config: o.Config.DeepCopy(), + Status: o.Status.DeepCopy(), + } +} + +type SyncConfigAndStatusRes struct { + Folders []FolderSyncConfigAndStatusWithFolder `codec:"folders" json:"folders"` + OverallStatus FolderSyncStatus `codec:"overallStatus" json:"overallStatus"` +} + +func (o SyncConfigAndStatusRes) DeepCopy() SyncConfigAndStatusRes { + return SyncConfigAndStatusRes{ + Folders: (func(x []FolderSyncConfigAndStatusWithFolder) []FolderSyncConfigAndStatusWithFolder { + if x == nil { + return nil + } + ret := make([]FolderSyncConfigAndStatusWithFolder, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Folders), + OverallStatus: o.OverallStatus.DeepCopy(), + } +} + +type FolderWithFavFlags struct { + Folder Folder `codec:"folder" json:"folder"` + IsFavorite bool `codec:"isFavorite" json:"isFavorite"` + IsIgnored bool `codec:"isIgnored" json:"isIgnored"` + IsNew bool `codec:"isNew" json:"isNew"` +} + +func (o FolderWithFavFlags) DeepCopy() FolderWithFavFlags { + return FolderWithFavFlags{ + Folder: o.Folder.DeepCopy(), + IsFavorite: o.IsFavorite, + IsIgnored: o.IsIgnored, + IsNew: o.IsNew, + } +} + +type KbfsOnlineStatus int + +const ( + KbfsOnlineStatus_OFFLINE KbfsOnlineStatus = 0 + KbfsOnlineStatus_TRYING KbfsOnlineStatus = 1 + KbfsOnlineStatus_ONLINE KbfsOnlineStatus = 2 +) + +func (o KbfsOnlineStatus) DeepCopy() KbfsOnlineStatus { return o } + +var KbfsOnlineStatusMap = map[string]KbfsOnlineStatus{ + "OFFLINE": 0, + "TRYING": 1, + "ONLINE": 2, +} + +var KbfsOnlineStatusRevMap = map[KbfsOnlineStatus]string{ + 0: "OFFLINE", + 1: "TRYING", + 2: "ONLINE", +} + +func (e KbfsOnlineStatus) String() string { + if v, ok := KbfsOnlineStatusRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type FSSettings struct { + SpaceAvailableNotificationThreshold int64 `codec:"spaceAvailableNotificationThreshold" json:"spaceAvailableNotificationThreshold"` + SfmiBannerDismissed bool `codec:"sfmiBannerDismissed" json:"sfmiBannerDismissed"` +} + +func (o FSSettings) DeepCopy() FSSettings { + return FSSettings{ + SpaceAvailableNotificationThreshold: o.SpaceAvailableNotificationThreshold, + SfmiBannerDismissed: o.SfmiBannerDismissed, + } +} + +type SimpleFSStats struct { + ProcessStats ProcessRuntimeStats `codec:"processStats" json:"processStats"` + BlockCacheDbStats []string `codec:"blockCacheDbStats" json:"blockCacheDbStats"` + SyncCacheDbStats []string `codec:"syncCacheDbStats" json:"syncCacheDbStats"` + RuntimeDbStats []DbStats `codec:"runtimeDbStats" json:"runtimeDbStats"` +} + +func (o SimpleFSStats) DeepCopy() SimpleFSStats { + return SimpleFSStats{ + ProcessStats: o.ProcessStats.DeepCopy(), + BlockCacheDbStats: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.BlockCacheDbStats), + SyncCacheDbStats: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.SyncCacheDbStats), + RuntimeDbStats: (func(x []DbStats) []DbStats { + if x == nil { + return nil + } + ret := make([]DbStats, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RuntimeDbStats), + } +} + +type SubscriptionTopic int + +const ( + SubscriptionTopic_FAVORITES SubscriptionTopic = 0 + SubscriptionTopic_JOURNAL_STATUS SubscriptionTopic = 1 + SubscriptionTopic_ONLINE_STATUS SubscriptionTopic = 2 + SubscriptionTopic_DOWNLOAD_STATUS SubscriptionTopic = 3 + SubscriptionTopic_FILES_TAB_BADGE SubscriptionTopic = 4 + SubscriptionTopic_OVERALL_SYNC_STATUS SubscriptionTopic = 5 + SubscriptionTopic_SETTINGS SubscriptionTopic = 6 +) + +func (o SubscriptionTopic) DeepCopy() SubscriptionTopic { return o } + +var SubscriptionTopicMap = map[string]SubscriptionTopic{ + "FAVORITES": 0, + "JOURNAL_STATUS": 1, + "ONLINE_STATUS": 2, + "DOWNLOAD_STATUS": 3, + "FILES_TAB_BADGE": 4, + "OVERALL_SYNC_STATUS": 5, + "SETTINGS": 6, +} + +var SubscriptionTopicRevMap = map[SubscriptionTopic]string{ + 0: "FAVORITES", + 1: "JOURNAL_STATUS", + 2: "ONLINE_STATUS", + 3: "DOWNLOAD_STATUS", + 4: "FILES_TAB_BADGE", + 5: "OVERALL_SYNC_STATUS", + 6: "SETTINGS", +} + +func (e SubscriptionTopic) String() string { + if v, ok := SubscriptionTopicRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type PathSubscriptionTopic int + +const ( + PathSubscriptionTopic_CHILDREN PathSubscriptionTopic = 0 + PathSubscriptionTopic_STAT PathSubscriptionTopic = 1 +) + +func (o PathSubscriptionTopic) DeepCopy() PathSubscriptionTopic { return o } + +var PathSubscriptionTopicMap = map[string]PathSubscriptionTopic{ + "CHILDREN": 0, + "STAT": 1, +} + +var PathSubscriptionTopicRevMap = map[PathSubscriptionTopic]string{ + 0: "CHILDREN", + 1: "STAT", +} + +func (e PathSubscriptionTopic) String() string { + if v, ok := PathSubscriptionTopicRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type DownloadInfo struct { + DownloadID string `codec:"downloadID" json:"downloadID"` + Path KBFSPath `codec:"path" json:"path"` + Filename string `codec:"filename" json:"filename"` + StartTime Time `codec:"startTime" json:"startTime"` + IsRegularDownload bool `codec:"isRegularDownload" json:"isRegularDownload"` +} + +func (o DownloadInfo) DeepCopy() DownloadInfo { + return DownloadInfo{ + DownloadID: o.DownloadID, + Path: o.Path.DeepCopy(), + Filename: o.Filename, + StartTime: o.StartTime.DeepCopy(), + IsRegularDownload: o.IsRegularDownload, + } +} + +type DownloadState struct { + DownloadID string `codec:"downloadID" json:"downloadID"` + Progress float64 `codec:"progress" json:"progress"` + EndEstimate Time `codec:"endEstimate" json:"endEstimate"` + LocalPath string `codec:"localPath" json:"localPath"` + Error string `codec:"error" json:"error"` + Done bool `codec:"done" json:"done"` + Canceled bool `codec:"canceled" json:"canceled"` +} + +func (o DownloadState) DeepCopy() DownloadState { + return DownloadState{ + DownloadID: o.DownloadID, + Progress: o.Progress, + EndEstimate: o.EndEstimate.DeepCopy(), + LocalPath: o.LocalPath, + Error: o.Error, + Done: o.Done, + Canceled: o.Canceled, + } +} + +type DownloadStatus struct { + RegularDownloadIDs []string `codec:"regularDownloadIDs" json:"regularDownloadIDs"` + States []DownloadState `codec:"states" json:"states"` +} + +func (o DownloadStatus) DeepCopy() DownloadStatus { + return DownloadStatus{ + RegularDownloadIDs: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.RegularDownloadIDs), + States: (func(x []DownloadState) []DownloadState { + if x == nil { + return nil + } + ret := make([]DownloadState, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.States), + } +} + +type FilesTabBadge int + +const ( + FilesTabBadge_NONE FilesTabBadge = 0 + FilesTabBadge_UPLOADING_STUCK FilesTabBadge = 1 + FilesTabBadge_AWAITING_UPLOAD FilesTabBadge = 2 + FilesTabBadge_UPLOADING FilesTabBadge = 3 +) + +func (o FilesTabBadge) DeepCopy() FilesTabBadge { return o } + +var FilesTabBadgeMap = map[string]FilesTabBadge{ + "NONE": 0, + "UPLOADING_STUCK": 1, + "AWAITING_UPLOAD": 2, + "UPLOADING": 3, +} + +var FilesTabBadgeRevMap = map[FilesTabBadge]string{ + 0: "NONE", + 1: "UPLOADING_STUCK", + 2: "AWAITING_UPLOAD", + 3: "UPLOADING", +} + +func (e FilesTabBadge) String() string { + if v, ok := FilesTabBadgeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type GUIViewType int + +const ( + GUIViewType_DEFAULT GUIViewType = 0 + GUIViewType_TEXT GUIViewType = 1 + GUIViewType_IMAGE GUIViewType = 2 + GUIViewType_AUDIO GUIViewType = 3 + GUIViewType_VIDEO GUIViewType = 4 + GUIViewType_PDF GUIViewType = 5 +) + +func (o GUIViewType) DeepCopy() GUIViewType { return o } + +var GUIViewTypeMap = map[string]GUIViewType{ + "DEFAULT": 0, + "TEXT": 1, + "IMAGE": 2, + "AUDIO": 3, + "VIDEO": 4, + "PDF": 5, +} + +var GUIViewTypeRevMap = map[GUIViewType]string{ + 0: "DEFAULT", + 1: "TEXT", + 2: "IMAGE", + 3: "AUDIO", + 4: "VIDEO", + 5: "PDF", +} + +func (e GUIViewType) String() string { + if v, ok := GUIViewTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type GUIFileContext struct { + ViewType GUIViewType `codec:"viewType" json:"viewType"` + ContentType string `codec:"contentType" json:"contentType"` + Url string `codec:"url" json:"url"` +} + +func (o GUIFileContext) DeepCopy() GUIFileContext { + return GUIFileContext{ + ViewType: o.ViewType.DeepCopy(), + ContentType: o.ContentType, + Url: o.Url, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/stream_ui.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/stream_ui.go new file mode 100644 index 00000000..ac4f43c9 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/stream_ui.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/stream_ui.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/teambot.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/teambot.go new file mode 100644 index 00000000..e9be6638 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/teambot.go @@ -0,0 +1,52 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/teambot.avdl + +package keybase1 + +type TeambotKeyGeneration int64 + +func (o TeambotKeyGeneration) DeepCopy() TeambotKeyGeneration { + return o +} + +type TeambotKeyMetadata struct { + Kid KID `codec:"kid" json:"teambot_dh_public"` + Generation TeambotKeyGeneration `codec:"generation" json:"generation"` + Uid UID `codec:"uid" json:"uid"` + PukGeneration PerUserKeyGeneration `codec:"pukGeneration" json:"puk_generation"` + Application TeamApplication `codec:"application" json:"application"` +} + +func (o TeambotKeyMetadata) DeepCopy() TeambotKeyMetadata { + return TeambotKeyMetadata{ + Kid: o.Kid.DeepCopy(), + Generation: o.Generation.DeepCopy(), + Uid: o.Uid.DeepCopy(), + PukGeneration: o.PukGeneration.DeepCopy(), + Application: o.Application.DeepCopy(), + } +} + +type TeambotKeyBoxed struct { + Box string `codec:"box" json:"box"` + Metadata TeambotKeyMetadata `codec:"metadata" json:"metadata"` +} + +func (o TeambotKeyBoxed) DeepCopy() TeambotKeyBoxed { + return TeambotKeyBoxed{ + Box: o.Box, + Metadata: o.Metadata.DeepCopy(), + } +} + +type TeambotKey struct { + Seed Bytes32 `codec:"seed" json:"seed"` + Metadata TeambotKeyMetadata `codec:"metadata" json:"metadata"` +} + +func (o TeambotKey) DeepCopy() TeambotKey { + return TeambotKey{ + Seed: o.Seed.DeepCopy(), + Metadata: o.Metadata.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/teams.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/teams.go new file mode 100644 index 00000000..bc2648fa --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/teams.go @@ -0,0 +1,3514 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/teams.avdl + +package keybase1 + +import ( + "errors" + "fmt" +) + +type TeamRole int + +const ( + TeamRole_NONE TeamRole = 0 + TeamRole_READER TeamRole = 1 + TeamRole_WRITER TeamRole = 2 + TeamRole_ADMIN TeamRole = 3 + TeamRole_OWNER TeamRole = 4 + TeamRole_BOT TeamRole = 5 + TeamRole_RESTRICTEDBOT TeamRole = 6 +) + +func (o TeamRole) DeepCopy() TeamRole { return o } + +var TeamRoleMap = map[string]TeamRole{ + "NONE": 0, + "READER": 1, + "WRITER": 2, + "ADMIN": 3, + "OWNER": 4, + "BOT": 5, + "RESTRICTEDBOT": 6, +} + +var TeamRoleRevMap = map[TeamRole]string{ + 0: "NONE", + 1: "READER", + 2: "WRITER", + 3: "ADMIN", + 4: "OWNER", + 5: "BOT", + 6: "RESTRICTEDBOT", +} + +func (e TeamRole) String() string { + if v, ok := TeamRoleRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type TeamApplication int + +const ( + TeamApplication_KBFS TeamApplication = 1 + TeamApplication_CHAT TeamApplication = 2 + TeamApplication_SALTPACK TeamApplication = 3 + TeamApplication_GIT_METADATA TeamApplication = 4 + TeamApplication_SEITAN_INVITE_TOKEN TeamApplication = 5 + TeamApplication_STELLAR_RELAY TeamApplication = 6 + TeamApplication_KVSTORE TeamApplication = 7 +) + +func (o TeamApplication) DeepCopy() TeamApplication { return o } + +var TeamApplicationMap = map[string]TeamApplication{ + "KBFS": 1, + "CHAT": 2, + "SALTPACK": 3, + "GIT_METADATA": 4, + "SEITAN_INVITE_TOKEN": 5, + "STELLAR_RELAY": 6, + "KVSTORE": 7, +} + +var TeamApplicationRevMap = map[TeamApplication]string{ + 1: "KBFS", + 2: "CHAT", + 3: "SALTPACK", + 4: "GIT_METADATA", + 5: "SEITAN_INVITE_TOKEN", + 6: "STELLAR_RELAY", + 7: "KVSTORE", +} + +func (e TeamApplication) String() string { + if v, ok := TeamApplicationRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type TeamStatus int + +const ( + TeamStatus_NONE TeamStatus = 0 + TeamStatus_LIVE TeamStatus = 1 + TeamStatus_DELETED TeamStatus = 2 + TeamStatus_ABANDONED TeamStatus = 3 +) + +func (o TeamStatus) DeepCopy() TeamStatus { return o } + +var TeamStatusMap = map[string]TeamStatus{ + "NONE": 0, + "LIVE": 1, + "DELETED": 2, + "ABANDONED": 3, +} + +var TeamStatusRevMap = map[TeamStatus]string{ + 0: "NONE", + 1: "LIVE", + 2: "DELETED", + 3: "ABANDONED", +} + +func (e TeamStatus) String() string { + if v, ok := TeamStatusRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type AuditMode int + +const ( + AuditMode_STANDARD AuditMode = 0 + AuditMode_JUST_CREATED AuditMode = 1 + AuditMode_SKIP AuditMode = 2 + AuditMode_STANDARD_NO_HIDDEN AuditMode = 3 +) + +func (o AuditMode) DeepCopy() AuditMode { return o } + +var AuditModeMap = map[string]AuditMode{ + "STANDARD": 0, + "JUST_CREATED": 1, + "SKIP": 2, + "STANDARD_NO_HIDDEN": 3, +} + +var AuditModeRevMap = map[AuditMode]string{ + 0: "STANDARD", + 1: "JUST_CREATED", + 2: "SKIP", + 3: "STANDARD_NO_HIDDEN", +} + +func (e AuditMode) String() string { + if v, ok := AuditModeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type PerTeamKeyGeneration int + +func (o PerTeamKeyGeneration) DeepCopy() PerTeamKeyGeneration { + return o +} + +type PTKType int + +const ( + PTKType_READER PTKType = 0 +) + +func (o PTKType) DeepCopy() PTKType { return o } + +var PTKTypeMap = map[string]PTKType{ + "READER": 0, +} + +var PTKTypeRevMap = map[PTKType]string{ + 0: "READER", +} + +func (e PTKType) String() string { + if v, ok := PTKTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type PerTeamSeedCheckVersion int + +const ( + PerTeamSeedCheckVersion_V1 PerTeamSeedCheckVersion = 1 +) + +func (o PerTeamSeedCheckVersion) DeepCopy() PerTeamSeedCheckVersion { return o } + +var PerTeamSeedCheckVersionMap = map[string]PerTeamSeedCheckVersion{ + "V1": 1, +} + +var PerTeamSeedCheckVersionRevMap = map[PerTeamSeedCheckVersion]string{ + 1: "V1", +} + +func (e PerTeamSeedCheckVersion) String() string { + if v, ok := PerTeamSeedCheckVersionRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type PerTeamSeedCheck struct { + Version PerTeamSeedCheckVersion `codec:"version" json:"version"` + Value PerTeamSeedCheckValue `codec:"value" json:"value"` +} + +func (o PerTeamSeedCheck) DeepCopy() PerTeamSeedCheck { + return PerTeamSeedCheck{ + Version: o.Version.DeepCopy(), + Value: o.Value.DeepCopy(), + } +} + +type PerTeamSeedCheckValue []byte + +func (o PerTeamSeedCheckValue) DeepCopy() PerTeamSeedCheckValue { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type PerTeamSeedCheckValuePostImage []byte + +func (o PerTeamSeedCheckValuePostImage) DeepCopy() PerTeamSeedCheckValuePostImage { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type PerTeamSeedCheckPostImage struct { + Value PerTeamSeedCheckValuePostImage `codec:"h" json:"h"` + Version PerTeamSeedCheckVersion `codec:"v" json:"v"` +} + +func (o PerTeamSeedCheckPostImage) DeepCopy() PerTeamSeedCheckPostImage { + return PerTeamSeedCheckPostImage{ + Value: o.Value.DeepCopy(), + Version: o.Version.DeepCopy(), + } +} + +type TeamApplicationKey struct { + Application TeamApplication `codec:"application" json:"application"` + KeyGeneration PerTeamKeyGeneration `codec:"keyGeneration" json:"keyGeneration"` + Key Bytes32 `codec:"key" json:"key"` +} + +func (o TeamApplicationKey) DeepCopy() TeamApplicationKey { + return TeamApplicationKey{ + Application: o.Application.DeepCopy(), + KeyGeneration: o.KeyGeneration.DeepCopy(), + Key: o.Key.DeepCopy(), + } +} + +type MaskB64 []byte + +func (o MaskB64) DeepCopy() MaskB64 { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type TeamInviteID string + +func (o TeamInviteID) DeepCopy() TeamInviteID { + return o +} + +type ReaderKeyMask struct { + Application TeamApplication `codec:"application" json:"application"` + Generation PerTeamKeyGeneration `codec:"generation" json:"generation"` + Mask MaskB64 `codec:"mask" json:"mask"` +} + +func (o ReaderKeyMask) DeepCopy() ReaderKeyMask { + return ReaderKeyMask{ + Application: o.Application.DeepCopy(), + Generation: o.Generation.DeepCopy(), + Mask: o.Mask.DeepCopy(), + } +} + +type PerTeamKey struct { + Gen PerTeamKeyGeneration `codec:"gen" json:"gen"` + Seqno Seqno `codec:"seqno" json:"seqno"` + SigKID KID `codec:"sigKID" json:"sigKID"` + EncKID KID `codec:"encKID" json:"encKID"` +} + +func (o PerTeamKey) DeepCopy() PerTeamKey { + return PerTeamKey{ + Gen: o.Gen.DeepCopy(), + Seqno: o.Seqno.DeepCopy(), + SigKID: o.SigKID.DeepCopy(), + EncKID: o.EncKID.DeepCopy(), + } +} + +type PerTeamKeyAndCheck struct { + Ptk PerTeamKey `codec:"ptk" json:"ptk"` + Check PerTeamSeedCheckPostImage `codec:"check" json:"check"` +} + +func (o PerTeamKeyAndCheck) DeepCopy() PerTeamKeyAndCheck { + return PerTeamKeyAndCheck{ + Ptk: o.Ptk.DeepCopy(), + Check: o.Check.DeepCopy(), + } +} + +type PerTeamKeySeed [32]byte + +func (o PerTeamKeySeed) DeepCopy() PerTeamKeySeed { + var ret PerTeamKeySeed + copy(ret[:], o[:]) + return ret +} + +type PerTeamKeySeedItem struct { + Seed PerTeamKeySeed `codec:"seed" json:"seed"` + Generation PerTeamKeyGeneration `codec:"generation" json:"generation"` + Seqno Seqno `codec:"seqno" json:"seqno"` + Check *PerTeamSeedCheck `codec:"check,omitempty" json:"check,omitempty"` +} + +func (o PerTeamKeySeedItem) DeepCopy() PerTeamKeySeedItem { + return PerTeamKeySeedItem{ + Seed: o.Seed.DeepCopy(), + Generation: o.Generation.DeepCopy(), + Seqno: o.Seqno.DeepCopy(), + Check: (func(x *PerTeamSeedCheck) *PerTeamSeedCheck { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Check), + } +} + +type TeamMember struct { + Uid UID `codec:"uid" json:"uid"` + Role TeamRole `codec:"role" json:"role"` + EldestSeqno Seqno `codec:"eldestSeqno" json:"eldestSeqno"` + Status TeamMemberStatus `codec:"status" json:"status"` + BotSettings *TeamBotSettings `codec:"botSettings,omitempty" json:"botSettings,omitempty"` +} + +func (o TeamMember) DeepCopy() TeamMember { + return TeamMember{ + Uid: o.Uid.DeepCopy(), + Role: o.Role.DeepCopy(), + EldestSeqno: o.EldestSeqno.DeepCopy(), + Status: o.Status.DeepCopy(), + BotSettings: (func(x *TeamBotSettings) *TeamBotSettings { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.BotSettings), + } +} + +type TeamMembers struct { + Owners []UserVersion `codec:"owners" json:"owners"` + Admins []UserVersion `codec:"admins" json:"admins"` + Writers []UserVersion `codec:"writers" json:"writers"` + Readers []UserVersion `codec:"readers" json:"readers"` + Bots []UserVersion `codec:"bots" json:"bots"` + RestrictedBots []UserVersion `codec:"restrictedBots" json:"restrictedBots"` +} + +func (o TeamMembers) DeepCopy() TeamMembers { + return TeamMembers{ + Owners: (func(x []UserVersion) []UserVersion { + if x == nil { + return nil + } + ret := make([]UserVersion, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Owners), + Admins: (func(x []UserVersion) []UserVersion { + if x == nil { + return nil + } + ret := make([]UserVersion, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Admins), + Writers: (func(x []UserVersion) []UserVersion { + if x == nil { + return nil + } + ret := make([]UserVersion, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Writers), + Readers: (func(x []UserVersion) []UserVersion { + if x == nil { + return nil + } + ret := make([]UserVersion, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Readers), + Bots: (func(x []UserVersion) []UserVersion { + if x == nil { + return nil + } + ret := make([]UserVersion, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Bots), + RestrictedBots: (func(x []UserVersion) []UserVersion { + if x == nil { + return nil + } + ret := make([]UserVersion, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RestrictedBots), + } +} + +type TeamMemberStatus int + +const ( + TeamMemberStatus_ACTIVE TeamMemberStatus = 0 + TeamMemberStatus_RESET TeamMemberStatus = 1 + TeamMemberStatus_DELETED TeamMemberStatus = 2 +) + +func (o TeamMemberStatus) DeepCopy() TeamMemberStatus { return o } + +var TeamMemberStatusMap = map[string]TeamMemberStatus{ + "ACTIVE": 0, + "RESET": 1, + "DELETED": 2, +} + +var TeamMemberStatusRevMap = map[TeamMemberStatus]string{ + 0: "ACTIVE", + 1: "RESET", + 2: "DELETED", +} + +func (e TeamMemberStatus) String() string { + if v, ok := TeamMemberStatusRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type TeamMemberDetails struct { + Uv UserVersion `codec:"uv" json:"uv"` + Username string `codec:"username" json:"username"` + FullName FullName `codec:"fullName" json:"fullName"` + NeedsPUK bool `codec:"needsPUK" json:"needsPUK"` + Status TeamMemberStatus `codec:"status" json:"status"` +} + +func (o TeamMemberDetails) DeepCopy() TeamMemberDetails { + return TeamMemberDetails{ + Uv: o.Uv.DeepCopy(), + Username: o.Username, + FullName: o.FullName.DeepCopy(), + NeedsPUK: o.NeedsPUK, + Status: o.Status.DeepCopy(), + } +} + +type TeamMembersDetails struct { + Owners []TeamMemberDetails `codec:"owners" json:"owners"` + Admins []TeamMemberDetails `codec:"admins" json:"admins"` + Writers []TeamMemberDetails `codec:"writers" json:"writers"` + Readers []TeamMemberDetails `codec:"readers" json:"readers"` + Bots []TeamMemberDetails `codec:"bots" json:"bots"` + RestrictedBots []TeamMemberDetails `codec:"restrictedBots" json:"restrictedBots"` +} + +func (o TeamMembersDetails) DeepCopy() TeamMembersDetails { + return TeamMembersDetails{ + Owners: (func(x []TeamMemberDetails) []TeamMemberDetails { + if x == nil { + return nil + } + ret := make([]TeamMemberDetails, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Owners), + Admins: (func(x []TeamMemberDetails) []TeamMemberDetails { + if x == nil { + return nil + } + ret := make([]TeamMemberDetails, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Admins), + Writers: (func(x []TeamMemberDetails) []TeamMemberDetails { + if x == nil { + return nil + } + ret := make([]TeamMemberDetails, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Writers), + Readers: (func(x []TeamMemberDetails) []TeamMemberDetails { + if x == nil { + return nil + } + ret := make([]TeamMemberDetails, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Readers), + Bots: (func(x []TeamMemberDetails) []TeamMemberDetails { + if x == nil { + return nil + } + ret := make([]TeamMemberDetails, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Bots), + RestrictedBots: (func(x []TeamMemberDetails) []TeamMemberDetails { + if x == nil { + return nil + } + ret := make([]TeamMemberDetails, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.RestrictedBots), + } +} + +type TeamDetails struct { + Name string `codec:"name" json:"name"` + Members TeamMembersDetails `codec:"members" json:"members"` + KeyGeneration PerTeamKeyGeneration `codec:"keyGeneration" json:"keyGeneration"` + AnnotatedActiveInvites map[TeamInviteID]AnnotatedTeamInvite `codec:"annotatedActiveInvites" json:"annotatedActiveInvites"` + Settings TeamSettings `codec:"settings" json:"settings"` + Showcase TeamShowcase `codec:"showcase" json:"showcase"` +} + +func (o TeamDetails) DeepCopy() TeamDetails { + return TeamDetails{ + Name: o.Name, + Members: o.Members.DeepCopy(), + KeyGeneration: o.KeyGeneration.DeepCopy(), + AnnotatedActiveInvites: (func(x map[TeamInviteID]AnnotatedTeamInvite) map[TeamInviteID]AnnotatedTeamInvite { + if x == nil { + return nil + } + ret := make(map[TeamInviteID]AnnotatedTeamInvite, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.AnnotatedActiveInvites), + Settings: o.Settings.DeepCopy(), + Showcase: o.Showcase.DeepCopy(), + } +} + +type UserVersionPercentForm string + +func (o UserVersionPercentForm) DeepCopy() UserVersionPercentForm { + return o +} + +type TeamChangeReq struct { + Owners []UserVersion `codec:"owners" json:"owners"` + Admins []UserVersion `codec:"admins" json:"admins"` + Writers []UserVersion `codec:"writers" json:"writers"` + Readers []UserVersion `codec:"readers" json:"readers"` + Bots []UserVersion `codec:"bots" json:"bots"` + RestrictedBots map[UserVersion]TeamBotSettings `codec:"restrictedBots" json:"restrictedBots"` + None []UserVersion `codec:"none" json:"none"` + CompletedInvites map[TeamInviteID]UserVersionPercentForm `codec:"completedInvites" json:"completedInvites"` +} + +func (o TeamChangeReq) DeepCopy() TeamChangeReq { + return TeamChangeReq{ + Owners: (func(x []UserVersion) []UserVersion { + if x == nil { + return nil + } + ret := make([]UserVersion, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Owners), + Admins: (func(x []UserVersion) []UserVersion { + if x == nil { + return nil + } + ret := make([]UserVersion, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Admins), + Writers: (func(x []UserVersion) []UserVersion { + if x == nil { + return nil + } + ret := make([]UserVersion, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Writers), + Readers: (func(x []UserVersion) []UserVersion { + if x == nil { + return nil + } + ret := make([]UserVersion, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Readers), + Bots: (func(x []UserVersion) []UserVersion { + if x == nil { + return nil + } + ret := make([]UserVersion, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Bots), + RestrictedBots: (func(x map[UserVersion]TeamBotSettings) map[UserVersion]TeamBotSettings { + if x == nil { + return nil + } + ret := make(map[UserVersion]TeamBotSettings, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.RestrictedBots), + None: (func(x []UserVersion) []UserVersion { + if x == nil { + return nil + } + ret := make([]UserVersion, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.None), + CompletedInvites: (func(x map[TeamInviteID]UserVersionPercentForm) map[TeamInviteID]UserVersionPercentForm { + if x == nil { + return nil + } + ret := make(map[TeamInviteID]UserVersionPercentForm, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.CompletedInvites), + } +} + +type TeamPlusApplicationKeys struct { + Id TeamID `codec:"id" json:"id"` + Name string `codec:"name" json:"name"` + Implicit bool `codec:"implicit" json:"implicit"` + Public bool `codec:"public" json:"public"` + Application TeamApplication `codec:"application" json:"application"` + Writers []UserVersion `codec:"writers" json:"writers"` + OnlyReaders []UserVersion `codec:"onlyReaders" json:"onlyReaders"` + OnlyRestrictedBots []UserVersion `codec:"onlyRestrictedBots" json:"onlyRestrictedBots"` + ApplicationKeys []TeamApplicationKey `codec:"applicationKeys" json:"applicationKeys"` +} + +func (o TeamPlusApplicationKeys) DeepCopy() TeamPlusApplicationKeys { + return TeamPlusApplicationKeys{ + Id: o.Id.DeepCopy(), + Name: o.Name, + Implicit: o.Implicit, + Public: o.Public, + Application: o.Application.DeepCopy(), + Writers: (func(x []UserVersion) []UserVersion { + if x == nil { + return nil + } + ret := make([]UserVersion, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Writers), + OnlyReaders: (func(x []UserVersion) []UserVersion { + if x == nil { + return nil + } + ret := make([]UserVersion, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.OnlyReaders), + OnlyRestrictedBots: (func(x []UserVersion) []UserVersion { + if x == nil { + return nil + } + ret := make([]UserVersion, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.OnlyRestrictedBots), + ApplicationKeys: (func(x []TeamApplicationKey) []TeamApplicationKey { + if x == nil { + return nil + } + ret := make([]TeamApplicationKey, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ApplicationKeys), + } +} + +type TeamData struct { + Subversion int `codec:"v" json:"v"` + Frozen bool `codec:"frozen" json:"frozen"` + Tombstoned bool `codec:"tombstoned" json:"tombstoned"` + Secretless bool `codec:"secretless" json:"secretless"` + Name TeamName `codec:"name" json:"name"` + Chain TeamSigChainState `codec:"chain" json:"chain"` + PerTeamKeySeedsUnverified map[PerTeamKeyGeneration]PerTeamKeySeedItem `codec:"perTeamKeySeeds" json:"perTeamKeySeedsUnverified"` + ReaderKeyMasks map[TeamApplication]map[PerTeamKeyGeneration]MaskB64 `codec:"readerKeyMasks" json:"readerKeyMasks"` + LatestSeqnoHint Seqno `codec:"latestSeqnoHint" json:"latestSeqnoHint"` + CachedAt Time `codec:"cachedAt" json:"cachedAt"` + TlfCryptKeys map[TeamApplication][]CryptKey `codec:"tlfCryptKeys" json:"tlfCryptKeys"` +} + +func (o TeamData) DeepCopy() TeamData { + return TeamData{ + Subversion: o.Subversion, + Frozen: o.Frozen, + Tombstoned: o.Tombstoned, + Secretless: o.Secretless, + Name: o.Name.DeepCopy(), + Chain: o.Chain.DeepCopy(), + PerTeamKeySeedsUnverified: (func(x map[PerTeamKeyGeneration]PerTeamKeySeedItem) map[PerTeamKeyGeneration]PerTeamKeySeedItem { + if x == nil { + return nil + } + ret := make(map[PerTeamKeyGeneration]PerTeamKeySeedItem, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.PerTeamKeySeedsUnverified), + ReaderKeyMasks: (func(x map[TeamApplication]map[PerTeamKeyGeneration]MaskB64) map[TeamApplication]map[PerTeamKeyGeneration]MaskB64 { + if x == nil { + return nil + } + ret := make(map[TeamApplication]map[PerTeamKeyGeneration]MaskB64, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := (func(x map[PerTeamKeyGeneration]MaskB64) map[PerTeamKeyGeneration]MaskB64 { + if x == nil { + return nil + } + ret := make(map[PerTeamKeyGeneration]MaskB64, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(v) + ret[kCopy] = vCopy + } + return ret + })(o.ReaderKeyMasks), + LatestSeqnoHint: o.LatestSeqnoHint.DeepCopy(), + CachedAt: o.CachedAt.DeepCopy(), + TlfCryptKeys: (func(x map[TeamApplication][]CryptKey) map[TeamApplication][]CryptKey { + if x == nil { + return nil + } + ret := make(map[TeamApplication][]CryptKey, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := (func(x []CryptKey) []CryptKey { + if x == nil { + return nil + } + ret := make([]CryptKey, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(v) + ret[kCopy] = vCopy + } + return ret + })(o.TlfCryptKeys), + } +} + +type FastTeamData struct { + Frozen bool `codec:"frozen" json:"frozen"` + Subversion int `codec:"subversion" json:"subversion"` + Tombstoned bool `codec:"tombstoned" json:"tombstoned"` + Name TeamName `codec:"name" json:"name"` + Chain FastTeamSigChainState `codec:"chain" json:"chain"` + PerTeamKeySeedsUnverified map[PerTeamKeyGeneration]PerTeamKeySeed `codec:"perTeamKeySeeds" json:"perTeamKeySeedsUnverified"` + MaxContinuousPTKGeneration PerTeamKeyGeneration `codec:"maxContinuousPTKGeneration" json:"maxContinuousPTKGeneration"` + SeedChecks map[PerTeamKeyGeneration]PerTeamSeedCheck `codec:"seedChecks" json:"seedChecks"` + LatestKeyGeneration PerTeamKeyGeneration `codec:"latestKeyGeneration" json:"latestKeyGeneration"` + ReaderKeyMasks map[TeamApplication]map[PerTeamKeyGeneration]MaskB64 `codec:"readerKeyMasks" json:"readerKeyMasks"` + LatestSeqnoHint Seqno `codec:"latestSeqnoHint" json:"latestSeqnoHint"` + CachedAt Time `codec:"cachedAt" json:"cachedAt"` + LoadedLatest bool `codec:"loadedLatest" json:"loadedLatest"` +} + +func (o FastTeamData) DeepCopy() FastTeamData { + return FastTeamData{ + Frozen: o.Frozen, + Subversion: o.Subversion, + Tombstoned: o.Tombstoned, + Name: o.Name.DeepCopy(), + Chain: o.Chain.DeepCopy(), + PerTeamKeySeedsUnverified: (func(x map[PerTeamKeyGeneration]PerTeamKeySeed) map[PerTeamKeyGeneration]PerTeamKeySeed { + if x == nil { + return nil + } + ret := make(map[PerTeamKeyGeneration]PerTeamKeySeed, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.PerTeamKeySeedsUnverified), + MaxContinuousPTKGeneration: o.MaxContinuousPTKGeneration.DeepCopy(), + SeedChecks: (func(x map[PerTeamKeyGeneration]PerTeamSeedCheck) map[PerTeamKeyGeneration]PerTeamSeedCheck { + if x == nil { + return nil + } + ret := make(map[PerTeamKeyGeneration]PerTeamSeedCheck, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.SeedChecks), + LatestKeyGeneration: o.LatestKeyGeneration.DeepCopy(), + ReaderKeyMasks: (func(x map[TeamApplication]map[PerTeamKeyGeneration]MaskB64) map[TeamApplication]map[PerTeamKeyGeneration]MaskB64 { + if x == nil { + return nil + } + ret := make(map[TeamApplication]map[PerTeamKeyGeneration]MaskB64, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := (func(x map[PerTeamKeyGeneration]MaskB64) map[PerTeamKeyGeneration]MaskB64 { + if x == nil { + return nil + } + ret := make(map[PerTeamKeyGeneration]MaskB64, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(v) + ret[kCopy] = vCopy + } + return ret + })(o.ReaderKeyMasks), + LatestSeqnoHint: o.LatestSeqnoHint.DeepCopy(), + CachedAt: o.CachedAt.DeepCopy(), + LoadedLatest: o.LoadedLatest, + } +} + +type RatchetType int + +const ( + RatchetType_MAIN RatchetType = 0 + RatchetType_BLINDED RatchetType = 1 + RatchetType_SELF RatchetType = 2 + RatchetType_UNCOMMITTED RatchetType = 3 +) + +func (o RatchetType) DeepCopy() RatchetType { return o } + +var RatchetTypeMap = map[string]RatchetType{ + "MAIN": 0, + "BLINDED": 1, + "SELF": 2, + "UNCOMMITTED": 3, +} + +var RatchetTypeRevMap = map[RatchetType]string{ + 0: "MAIN", + 1: "BLINDED", + 2: "SELF", + 3: "UNCOMMITTED", +} + +func (e RatchetType) String() string { + if v, ok := RatchetTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type HiddenTeamChainRatchetSet struct { + Ratchets map[RatchetType]LinkTripleAndTime `codec:"ratchets" json:"ratchets"` +} + +func (o HiddenTeamChainRatchetSet) DeepCopy() HiddenTeamChainRatchetSet { + return HiddenTeamChainRatchetSet{ + Ratchets: (func(x map[RatchetType]LinkTripleAndTime) map[RatchetType]LinkTripleAndTime { + if x == nil { + return nil + } + ret := make(map[RatchetType]LinkTripleAndTime, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.Ratchets), + } +} + +type HiddenTeamChain struct { + Id TeamID `codec:"id" json:"id"` + Subversion int `codec:"subversion" json:"subversion"` + Public bool `codec:"public" json:"public"` + Frozen bool `codec:"frozen" json:"frozen"` + Tombstoned bool `codec:"tombstoned" json:"tombstoned"` + Last Seqno `codec:"last" json:"last"` + LastFull Seqno `codec:"lastFull" json:"lastFull"` + LatestSeqnoHint Seqno `codec:"latestSeqnoHint" json:"latestSeqnoHint"` + LastCommittedSeqno Seqno `codec:"lastCommittedSeqno" json:"lastCommittedSeqno"` + LinkReceiptTimes map[Seqno]Time `codec:"linkReceiptTimes" json:"linkReceiptTimes"` + LastPerTeamKeys map[PTKType]Seqno `codec:"lastPerTeamKeys" json:"lastPerTeamKeys"` + Outer map[Seqno]LinkID `codec:"outer" json:"outer"` + Inner map[Seqno]HiddenTeamChainLink `codec:"inner" json:"inner"` + ReaderPerTeamKeys map[PerTeamKeyGeneration]Seqno `codec:"readerPerTeamKeys" json:"readerPerTeamKeys"` + RatchetSet HiddenTeamChainRatchetSet `codec:"ratchetSet" json:"ratchetSet"` + CachedAt Time `codec:"cachedAt" json:"cachedAt"` + NeedRotate bool `codec:"needRotate" json:"needRotate"` + MerkleRoots map[Seqno]MerkleRootV2 `codec:"merkleRoots" json:"merkleRoots"` +} + +func (o HiddenTeamChain) DeepCopy() HiddenTeamChain { + return HiddenTeamChain{ + Id: o.Id.DeepCopy(), + Subversion: o.Subversion, + Public: o.Public, + Frozen: o.Frozen, + Tombstoned: o.Tombstoned, + Last: o.Last.DeepCopy(), + LastFull: o.LastFull.DeepCopy(), + LatestSeqnoHint: o.LatestSeqnoHint.DeepCopy(), + LastCommittedSeqno: o.LastCommittedSeqno.DeepCopy(), + LinkReceiptTimes: (func(x map[Seqno]Time) map[Seqno]Time { + if x == nil { + return nil + } + ret := make(map[Seqno]Time, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.LinkReceiptTimes), + LastPerTeamKeys: (func(x map[PTKType]Seqno) map[PTKType]Seqno { + if x == nil { + return nil + } + ret := make(map[PTKType]Seqno, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.LastPerTeamKeys), + Outer: (func(x map[Seqno]LinkID) map[Seqno]LinkID { + if x == nil { + return nil + } + ret := make(map[Seqno]LinkID, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.Outer), + Inner: (func(x map[Seqno]HiddenTeamChainLink) map[Seqno]HiddenTeamChainLink { + if x == nil { + return nil + } + ret := make(map[Seqno]HiddenTeamChainLink, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.Inner), + ReaderPerTeamKeys: (func(x map[PerTeamKeyGeneration]Seqno) map[PerTeamKeyGeneration]Seqno { + if x == nil { + return nil + } + ret := make(map[PerTeamKeyGeneration]Seqno, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.ReaderPerTeamKeys), + RatchetSet: o.RatchetSet.DeepCopy(), + CachedAt: o.CachedAt.DeepCopy(), + NeedRotate: o.NeedRotate, + MerkleRoots: (func(x map[Seqno]MerkleRootV2) map[Seqno]MerkleRootV2 { + if x == nil { + return nil + } + ret := make(map[Seqno]MerkleRootV2, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.MerkleRoots), + } +} + +type LinkTriple struct { + Seqno Seqno `codec:"seqno" json:"seqno"` + SeqType SeqType `codec:"seqType" json:"seqType"` + LinkID LinkID `codec:"linkID" json:"linkID"` +} + +func (o LinkTriple) DeepCopy() LinkTriple { + return LinkTriple{ + Seqno: o.Seqno.DeepCopy(), + SeqType: o.SeqType.DeepCopy(), + LinkID: o.LinkID.DeepCopy(), + } +} + +type LinkTripleAndTime struct { + Triple LinkTriple `codec:"triple" json:"triple"` + Time Time `codec:"time" json:"time"` +} + +func (o LinkTripleAndTime) DeepCopy() LinkTripleAndTime { + return LinkTripleAndTime{ + Triple: o.Triple.DeepCopy(), + Time: o.Time.DeepCopy(), + } +} + +type UpPointer struct { + OurSeqno Seqno `codec:"ourSeqno" json:"ourSeqno"` + ParentID TeamID `codec:"parentID" json:"parentID"` + ParentSeqno Seqno `codec:"parentSeqno" json:"parentSeqno"` + Deletion bool `codec:"deletion" json:"deletion"` +} + +func (o UpPointer) DeepCopy() UpPointer { + return UpPointer{ + OurSeqno: o.OurSeqno.DeepCopy(), + ParentID: o.ParentID.DeepCopy(), + ParentSeqno: o.ParentSeqno.DeepCopy(), + Deletion: o.Deletion, + } +} + +type DownPointer struct { + Id TeamID `codec:"id" json:"id"` + NameComponent string `codec:"nameComponent" json:"nameComponent"` + IsDeleted bool `codec:"isDeleted" json:"isDeleted"` +} + +func (o DownPointer) DeepCopy() DownPointer { + return DownPointer{ + Id: o.Id.DeepCopy(), + NameComponent: o.NameComponent, + IsDeleted: o.IsDeleted, + } +} + +type Signer struct { + E Seqno `codec:"e" json:"e"` + K KID `codec:"k" json:"k"` + U UID `codec:"u" json:"u"` +} + +func (o Signer) DeepCopy() Signer { + return Signer{ + E: o.E.DeepCopy(), + K: o.K.DeepCopy(), + U: o.U.DeepCopy(), + } +} + +type HiddenTeamChainLink struct { + MerkleRoot MerkleRootV2 `codec:"m" json:"m"` + ParentChain LinkTriple `codec:"p" json:"p"` + Signer Signer `codec:"s" json:"s"` + Ptk map[PTKType]PerTeamKeyAndCheck `codec:"k" json:"k"` +} + +func (o HiddenTeamChainLink) DeepCopy() HiddenTeamChainLink { + return HiddenTeamChainLink{ + MerkleRoot: o.MerkleRoot.DeepCopy(), + ParentChain: o.ParentChain.DeepCopy(), + Signer: o.Signer.DeepCopy(), + Ptk: (func(x map[PTKType]PerTeamKeyAndCheck) map[PTKType]PerTeamKeyAndCheck { + if x == nil { + return nil + } + ret := make(map[PTKType]PerTeamKeyAndCheck, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.Ptk), + } +} + +type FastTeamSigChainState struct { + ID TeamID `codec:"ID" json:"ID"` + Public bool `codec:"public" json:"public"` + RootAncestor TeamName `codec:"rootAncestor" json:"rootAncestor"` + NameDepth int `codec:"nameDepth" json:"nameDepth"` + Last *LinkTriple `codec:"last,omitempty" json:"last,omitempty"` + PerTeamKeys map[PerTeamKeyGeneration]PerTeamKey `codec:"perTeamKeys" json:"perTeamKeys"` + PerTeamKeySeedsVerified map[PerTeamKeyGeneration]PerTeamKeySeed `codec:"perTeamKeySeedsVerified" json:"perTeamKeySeedsVerified"` + DownPointers map[Seqno]DownPointer `codec:"downPointers" json:"downPointers"` + LastUpPointer *UpPointer `codec:"lastUpPointer,omitempty" json:"lastUpPointer,omitempty"` + PerTeamKeyCTime UnixTime `codec:"perTeamKeyCTime" json:"perTeamKeyCTime"` + LinkIDs map[Seqno]LinkID `codec:"linkIDs" json:"linkIDs"` + MerkleInfo map[Seqno]MerkleRootV2 `codec:"merkleInfo" json:"merkleInfo"` +} + +func (o FastTeamSigChainState) DeepCopy() FastTeamSigChainState { + return FastTeamSigChainState{ + ID: o.ID.DeepCopy(), + Public: o.Public, + RootAncestor: o.RootAncestor.DeepCopy(), + NameDepth: o.NameDepth, + Last: (func(x *LinkTriple) *LinkTriple { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Last), + PerTeamKeys: (func(x map[PerTeamKeyGeneration]PerTeamKey) map[PerTeamKeyGeneration]PerTeamKey { + if x == nil { + return nil + } + ret := make(map[PerTeamKeyGeneration]PerTeamKey, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.PerTeamKeys), + PerTeamKeySeedsVerified: (func(x map[PerTeamKeyGeneration]PerTeamKeySeed) map[PerTeamKeyGeneration]PerTeamKeySeed { + if x == nil { + return nil + } + ret := make(map[PerTeamKeyGeneration]PerTeamKeySeed, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.PerTeamKeySeedsVerified), + DownPointers: (func(x map[Seqno]DownPointer) map[Seqno]DownPointer { + if x == nil { + return nil + } + ret := make(map[Seqno]DownPointer, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.DownPointers), + LastUpPointer: (func(x *UpPointer) *UpPointer { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.LastUpPointer), + PerTeamKeyCTime: o.PerTeamKeyCTime.DeepCopy(), + LinkIDs: (func(x map[Seqno]LinkID) map[Seqno]LinkID { + if x == nil { + return nil + } + ret := make(map[Seqno]LinkID, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.LinkIDs), + MerkleInfo: (func(x map[Seqno]MerkleRootV2) map[Seqno]MerkleRootV2 { + if x == nil { + return nil + } + ret := make(map[Seqno]MerkleRootV2, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.MerkleInfo), + } +} + +type Audit struct { + Time Time `codec:"time" json:"time"` + MaxMerkleSeqno Seqno `codec:"mms" json:"mms"` + MaxChainSeqno Seqno `codec:"mcs" json:"mcs"` + MaxHiddenSeqno Seqno `codec:"mhs" json:"mhs"` + MaxMerkleProbe Seqno `codec:"mmp" json:"mmp"` +} + +func (o Audit) DeepCopy() Audit { + return Audit{ + Time: o.Time.DeepCopy(), + MaxMerkleSeqno: o.MaxMerkleSeqno.DeepCopy(), + MaxChainSeqno: o.MaxChainSeqno.DeepCopy(), + MaxHiddenSeqno: o.MaxHiddenSeqno.DeepCopy(), + MaxMerkleProbe: o.MaxMerkleProbe.DeepCopy(), + } +} + +type Probe struct { + Index int `codec:"i" json:"i"` + TeamSeqno Seqno `codec:"s" json:"t"` + TeamHiddenSeqno Seqno `codec:"h" json:"h"` +} + +func (o Probe) DeepCopy() Probe { + return Probe{ + Index: o.Index, + TeamSeqno: o.TeamSeqno.DeepCopy(), + TeamHiddenSeqno: o.TeamHiddenSeqno.DeepCopy(), + } +} + +type AuditVersion int + +const ( + AuditVersion_V0 AuditVersion = 0 + AuditVersion_V1 AuditVersion = 1 + AuditVersion_V2 AuditVersion = 2 + AuditVersion_V3 AuditVersion = 3 + AuditVersion_V4 AuditVersion = 4 +) + +func (o AuditVersion) DeepCopy() AuditVersion { return o } + +var AuditVersionMap = map[string]AuditVersion{ + "V0": 0, + "V1": 1, + "V2": 2, + "V3": 3, + "V4": 4, +} + +var AuditVersionRevMap = map[AuditVersion]string{ + 0: "V0", + 1: "V1", + 2: "V2", + 3: "V3", + 4: "V4", +} + +func (e AuditVersion) String() string { + if v, ok := AuditVersionRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type AuditHistory struct { + ID TeamID `codec:"ID" json:"ID"` + Public bool `codec:"public" json:"public"` + PriorMerkleSeqno Seqno `codec:"priorMerkleSeqno" json:"priorMerkleSeqno"` + Version AuditVersion `codec:"version" json:"version"` + Audits []Audit `codec:"audits" json:"audits"` + PreProbes map[Seqno]Probe `codec:"preProbes" json:"preProbes"` + PostProbes map[Seqno]Probe `codec:"postProbes" json:"postProbes"` + Tails map[Seqno]LinkID `codec:"tails" json:"tails"` + HiddenTails map[Seqno]LinkID `codec:"hiddenTails" json:"hiddenTails"` + SkipUntil Time `codec:"skipUntil" json:"skipUntil"` +} + +func (o AuditHistory) DeepCopy() AuditHistory { + return AuditHistory{ + ID: o.ID.DeepCopy(), + Public: o.Public, + PriorMerkleSeqno: o.PriorMerkleSeqno.DeepCopy(), + Version: o.Version.DeepCopy(), + Audits: (func(x []Audit) []Audit { + if x == nil { + return nil + } + ret := make([]Audit, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Audits), + PreProbes: (func(x map[Seqno]Probe) map[Seqno]Probe { + if x == nil { + return nil + } + ret := make(map[Seqno]Probe, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.PreProbes), + PostProbes: (func(x map[Seqno]Probe) map[Seqno]Probe { + if x == nil { + return nil + } + ret := make(map[Seqno]Probe, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.PostProbes), + Tails: (func(x map[Seqno]LinkID) map[Seqno]LinkID { + if x == nil { + return nil + } + ret := make(map[Seqno]LinkID, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.Tails), + HiddenTails: (func(x map[Seqno]LinkID) map[Seqno]LinkID { + if x == nil { + return nil + } + ret := make(map[Seqno]LinkID, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.HiddenTails), + SkipUntil: o.SkipUntil.DeepCopy(), + } +} + +type TeamInviteCategory int + +const ( + TeamInviteCategory_NONE TeamInviteCategory = 0 + TeamInviteCategory_UNKNOWN TeamInviteCategory = 1 + TeamInviteCategory_KEYBASE TeamInviteCategory = 2 + TeamInviteCategory_EMAIL TeamInviteCategory = 3 + TeamInviteCategory_SBS TeamInviteCategory = 4 + TeamInviteCategory_SEITAN TeamInviteCategory = 5 + TeamInviteCategory_PHONE TeamInviteCategory = 6 +) + +func (o TeamInviteCategory) DeepCopy() TeamInviteCategory { return o } + +var TeamInviteCategoryMap = map[string]TeamInviteCategory{ + "NONE": 0, + "UNKNOWN": 1, + "KEYBASE": 2, + "EMAIL": 3, + "SBS": 4, + "SEITAN": 5, + "PHONE": 6, +} + +var TeamInviteCategoryRevMap = map[TeamInviteCategory]string{ + 0: "NONE", + 1: "UNKNOWN", + 2: "KEYBASE", + 3: "EMAIL", + 4: "SBS", + 5: "SEITAN", + 6: "PHONE", +} + +func (e TeamInviteCategory) String() string { + if v, ok := TeamInviteCategoryRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type TeamInviteType struct { + C__ TeamInviteCategory `codec:"c" json:"c"` + Unknown__ *string `codec:"unknown,omitempty" json:"unknown,omitempty"` + Sbs__ *TeamInviteSocialNetwork `codec:"sbs,omitempty" json:"sbs,omitempty"` +} + +func (o *TeamInviteType) C() (ret TeamInviteCategory, err error) { + switch o.C__ { + case TeamInviteCategory_UNKNOWN: + if o.Unknown__ == nil { + err = errors.New("unexpected nil value for Unknown__") + return ret, err + } + case TeamInviteCategory_SBS: + if o.Sbs__ == nil { + err = errors.New("unexpected nil value for Sbs__") + return ret, err + } + } + return o.C__, nil +} + +func (o TeamInviteType) Unknown() (res string) { + if o.C__ != TeamInviteCategory_UNKNOWN { + panic("wrong case accessed") + } + if o.Unknown__ == nil { + return + } + return *o.Unknown__ +} + +func (o TeamInviteType) Sbs() (res TeamInviteSocialNetwork) { + if o.C__ != TeamInviteCategory_SBS { + panic("wrong case accessed") + } + if o.Sbs__ == nil { + return + } + return *o.Sbs__ +} + +func NewTeamInviteTypeWithUnknown(v string) TeamInviteType { + return TeamInviteType{ + C__: TeamInviteCategory_UNKNOWN, + Unknown__: &v, + } +} + +func NewTeamInviteTypeWithSbs(v TeamInviteSocialNetwork) TeamInviteType { + return TeamInviteType{ + C__: TeamInviteCategory_SBS, + Sbs__: &v, + } +} + +func NewTeamInviteTypeDefault(c TeamInviteCategory) TeamInviteType { + return TeamInviteType{ + C__: c, + } +} + +func (o TeamInviteType) DeepCopy() TeamInviteType { + return TeamInviteType{ + C__: o.C__.DeepCopy(), + Unknown__: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Unknown__), + Sbs__: (func(x *TeamInviteSocialNetwork) *TeamInviteSocialNetwork { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Sbs__), + } +} + +type TeamInviteSocialNetwork string + +func (o TeamInviteSocialNetwork) DeepCopy() TeamInviteSocialNetwork { + return o +} + +type TeamInviteName string + +func (o TeamInviteName) DeepCopy() TeamInviteName { + return o +} + +type TeamInvite struct { + Role TeamRole `codec:"role" json:"role"` + Id TeamInviteID `codec:"id" json:"id"` + Type TeamInviteType `codec:"type" json:"type"` + Name TeamInviteName `codec:"name" json:"name"` + Inviter UserVersion `codec:"inviter" json:"inviter"` +} + +func (o TeamInvite) DeepCopy() TeamInvite { + return TeamInvite{ + Role: o.Role.DeepCopy(), + Id: o.Id.DeepCopy(), + Type: o.Type.DeepCopy(), + Name: o.Name.DeepCopy(), + Inviter: o.Inviter.DeepCopy(), + } +} + +type AnnotatedTeamInvite struct { + Role TeamRole `codec:"role" json:"role"` + Id TeamInviteID `codec:"id" json:"id"` + Type TeamInviteType `codec:"type" json:"type"` + Name TeamInviteName `codec:"name" json:"name"` + Uv UserVersion `codec:"uv" json:"uv"` + Inviter UserVersion `codec:"inviter" json:"inviter"` + InviterUsername string `codec:"inviterUsername" json:"inviterUsername"` + TeamName string `codec:"teamName" json:"teamName"` + Status TeamMemberStatus `codec:"status" json:"status"` +} + +func (o AnnotatedTeamInvite) DeepCopy() AnnotatedTeamInvite { + return AnnotatedTeamInvite{ + Role: o.Role.DeepCopy(), + Id: o.Id.DeepCopy(), + Type: o.Type.DeepCopy(), + Name: o.Name.DeepCopy(), + Uv: o.Uv.DeepCopy(), + Inviter: o.Inviter.DeepCopy(), + InviterUsername: o.InviterUsername, + TeamName: o.TeamName, + Status: o.Status.DeepCopy(), + } +} + +type TeamEncryptedKBFSKeyset struct { + V int `codec:"v" json:"v"` + E []byte `codec:"e" json:"e"` + N []byte `codec:"n" json:"n"` +} + +func (o TeamEncryptedKBFSKeyset) DeepCopy() TeamEncryptedKBFSKeyset { + return TeamEncryptedKBFSKeyset{ + V: o.V, + E: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.E), + N: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.N), + } +} + +type TeamGetLegacyTLFUpgrade struct { + EncryptedKeyset string `codec:"encryptedKeyset" json:"encrypted_keyset"` + TeamGeneration PerTeamKeyGeneration `codec:"teamGeneration" json:"team_generation"` + LegacyGeneration int `codec:"legacyGeneration" json:"legacy_generation"` + AppType TeamApplication `codec:"appType" json:"app_type"` +} + +func (o TeamGetLegacyTLFUpgrade) DeepCopy() TeamGetLegacyTLFUpgrade { + return TeamGetLegacyTLFUpgrade{ + EncryptedKeyset: o.EncryptedKeyset, + TeamGeneration: o.TeamGeneration.DeepCopy(), + LegacyGeneration: o.LegacyGeneration, + AppType: o.AppType.DeepCopy(), + } +} + +type TeamEncryptedKBFSKeysetHash string + +func (o TeamEncryptedKBFSKeysetHash) DeepCopy() TeamEncryptedKBFSKeysetHash { + return o +} + +type TeamLegacyTLFUpgradeChainInfo struct { + KeysetHash TeamEncryptedKBFSKeysetHash `codec:"keysetHash" json:"keysetHash"` + TeamGeneration PerTeamKeyGeneration `codec:"teamGeneration" json:"teamGeneration"` + LegacyGeneration int `codec:"legacyGeneration" json:"legacyGeneration"` + AppType TeamApplication `codec:"appType" json:"appType"` +} + +func (o TeamLegacyTLFUpgradeChainInfo) DeepCopy() TeamLegacyTLFUpgradeChainInfo { + return TeamLegacyTLFUpgradeChainInfo{ + KeysetHash: o.KeysetHash.DeepCopy(), + TeamGeneration: o.TeamGeneration.DeepCopy(), + LegacyGeneration: o.LegacyGeneration, + AppType: o.AppType.DeepCopy(), + } +} + +type TeamSigChainState struct { + Reader UserVersion `codec:"reader" json:"reader"` + Id TeamID `codec:"id" json:"id"` + Implicit bool `codec:"implicit" json:"implicit"` + Public bool `codec:"public" json:"public"` + RootAncestor TeamName `codec:"rootAncestor" json:"rootAncestor"` + NameDepth int `codec:"nameDepth" json:"nameDepth"` + NameLog []TeamNameLogPoint `codec:"nameLog" json:"nameLog"` + LastSeqno Seqno `codec:"lastSeqno" json:"lastSeqno"` + LastLinkID LinkID `codec:"lastLinkID" json:"lastLinkID"` + LastHighSeqno Seqno `codec:"lastHighSeqno" json:"lastHighSeqno"` + LastHighLinkID LinkID `codec:"lastHighLinkID" json:"lastHighLinkID"` + ParentID *TeamID `codec:"parentID,omitempty" json:"parentID,omitempty"` + UserLog map[UserVersion][]UserLogPoint `codec:"userLog" json:"userLog"` + SubteamLog map[TeamID][]SubteamLogPoint `codec:"subteamLog" json:"subteamLog"` + PerTeamKeys map[PerTeamKeyGeneration]PerTeamKey `codec:"perTeamKeys" json:"perTeamKeys"` + MaxPerTeamKeyGeneration PerTeamKeyGeneration `codec:"maxPerTeamKeyGeneration" json:"maxPerTeamKeyGeneration"` + PerTeamKeyCTime UnixTime `codec:"perTeamKeyCTime" json:"perTeamKeyCTime"` + LinkIDs map[Seqno]LinkID `codec:"linkIDs" json:"linkIDs"` + StubbedLinks map[Seqno]bool `codec:"stubbedLinks" json:"stubbedLinks"` + ActiveInvites map[TeamInviteID]TeamInvite `codec:"activeInvites" json:"activeInvites"` + ObsoleteInvites map[TeamInviteID]TeamInvite `codec:"obsoleteInvites" json:"obsoleteInvites"` + Open bool `codec:"open" json:"open"` + OpenTeamJoinAs TeamRole `codec:"openTeamJoinAs" json:"openTeamJoinAs"` + Bots map[UserVersion]TeamBotSettings `codec:"bots" json:"bots"` + TlfIDs []TLFID `codec:"tlfIDs" json:"tlfIDs"` + TlfLegacyUpgrade map[TeamApplication]TeamLegacyTLFUpgradeChainInfo `codec:"tlfLegacyUpgrade" json:"tlfLegacyUpgrade"` + HeadMerkle *MerkleRootV2 `codec:"headMerkle,omitempty" json:"headMerkle,omitempty"` + MerkleRoots map[Seqno]MerkleRootV2 `codec:"merkleRoots" json:"merkleRoots"` +} + +func (o TeamSigChainState) DeepCopy() TeamSigChainState { + return TeamSigChainState{ + Reader: o.Reader.DeepCopy(), + Id: o.Id.DeepCopy(), + Implicit: o.Implicit, + Public: o.Public, + RootAncestor: o.RootAncestor.DeepCopy(), + NameDepth: o.NameDepth, + NameLog: (func(x []TeamNameLogPoint) []TeamNameLogPoint { + if x == nil { + return nil + } + ret := make([]TeamNameLogPoint, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.NameLog), + LastSeqno: o.LastSeqno.DeepCopy(), + LastLinkID: o.LastLinkID.DeepCopy(), + LastHighSeqno: o.LastHighSeqno.DeepCopy(), + LastHighLinkID: o.LastHighLinkID.DeepCopy(), + ParentID: (func(x *TeamID) *TeamID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ParentID), + UserLog: (func(x map[UserVersion][]UserLogPoint) map[UserVersion][]UserLogPoint { + if x == nil { + return nil + } + ret := make(map[UserVersion][]UserLogPoint, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := (func(x []UserLogPoint) []UserLogPoint { + if x == nil { + return nil + } + ret := make([]UserLogPoint, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(v) + ret[kCopy] = vCopy + } + return ret + })(o.UserLog), + SubteamLog: (func(x map[TeamID][]SubteamLogPoint) map[TeamID][]SubteamLogPoint { + if x == nil { + return nil + } + ret := make(map[TeamID][]SubteamLogPoint, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := (func(x []SubteamLogPoint) []SubteamLogPoint { + if x == nil { + return nil + } + ret := make([]SubteamLogPoint, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(v) + ret[kCopy] = vCopy + } + return ret + })(o.SubteamLog), + PerTeamKeys: (func(x map[PerTeamKeyGeneration]PerTeamKey) map[PerTeamKeyGeneration]PerTeamKey { + if x == nil { + return nil + } + ret := make(map[PerTeamKeyGeneration]PerTeamKey, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.PerTeamKeys), + MaxPerTeamKeyGeneration: o.MaxPerTeamKeyGeneration.DeepCopy(), + PerTeamKeyCTime: o.PerTeamKeyCTime.DeepCopy(), + LinkIDs: (func(x map[Seqno]LinkID) map[Seqno]LinkID { + if x == nil { + return nil + } + ret := make(map[Seqno]LinkID, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.LinkIDs), + StubbedLinks: (func(x map[Seqno]bool) map[Seqno]bool { + if x == nil { + return nil + } + ret := make(map[Seqno]bool, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v + ret[kCopy] = vCopy + } + return ret + })(o.StubbedLinks), + ActiveInvites: (func(x map[TeamInviteID]TeamInvite) map[TeamInviteID]TeamInvite { + if x == nil { + return nil + } + ret := make(map[TeamInviteID]TeamInvite, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.ActiveInvites), + ObsoleteInvites: (func(x map[TeamInviteID]TeamInvite) map[TeamInviteID]TeamInvite { + if x == nil { + return nil + } + ret := make(map[TeamInviteID]TeamInvite, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.ObsoleteInvites), + Open: o.Open, + OpenTeamJoinAs: o.OpenTeamJoinAs.DeepCopy(), + Bots: (func(x map[UserVersion]TeamBotSettings) map[UserVersion]TeamBotSettings { + if x == nil { + return nil + } + ret := make(map[UserVersion]TeamBotSettings, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.Bots), + TlfIDs: (func(x []TLFID) []TLFID { + if x == nil { + return nil + } + ret := make([]TLFID, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.TlfIDs), + TlfLegacyUpgrade: (func(x map[TeamApplication]TeamLegacyTLFUpgradeChainInfo) map[TeamApplication]TeamLegacyTLFUpgradeChainInfo { + if x == nil { + return nil + } + ret := make(map[TeamApplication]TeamLegacyTLFUpgradeChainInfo, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.TlfLegacyUpgrade), + HeadMerkle: (func(x *MerkleRootV2) *MerkleRootV2 { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.HeadMerkle), + MerkleRoots: (func(x map[Seqno]MerkleRootV2) map[Seqno]MerkleRootV2 { + if x == nil { + return nil + } + ret := make(map[Seqno]MerkleRootV2, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.MerkleRoots), + } +} + +type BoxSummaryHash string + +func (o BoxSummaryHash) DeepCopy() BoxSummaryHash { + return o +} + +type TeamNameLogPoint struct { + LastPart TeamNamePart `codec:"lastPart" json:"lastPart"` + Seqno Seqno `codec:"seqno" json:"seqno"` +} + +func (o TeamNameLogPoint) DeepCopy() TeamNameLogPoint { + return TeamNameLogPoint{ + LastPart: o.LastPart.DeepCopy(), + Seqno: o.Seqno.DeepCopy(), + } +} + +type UserLogPoint struct { + Role TeamRole `codec:"role" json:"role"` + SigMeta SignatureMetadata `codec:"sigMeta" json:"sigMeta"` +} + +func (o UserLogPoint) DeepCopy() UserLogPoint { + return UserLogPoint{ + Role: o.Role.DeepCopy(), + SigMeta: o.SigMeta.DeepCopy(), + } +} + +type SubteamLogPoint struct { + Name TeamName `codec:"name" json:"name"` + Seqno Seqno `codec:"seqno" json:"seqno"` +} + +func (o SubteamLogPoint) DeepCopy() SubteamLogPoint { + return SubteamLogPoint{ + Name: o.Name.DeepCopy(), + Seqno: o.Seqno.DeepCopy(), + } +} + +type TeamNamePart string + +func (o TeamNamePart) DeepCopy() TeamNamePart { + return o +} + +type TeamName struct { + Parts []TeamNamePart `codec:"parts" json:"parts"` +} + +func (o TeamName) DeepCopy() TeamName { + return TeamName{ + Parts: (func(x []TeamNamePart) []TeamNamePart { + if x == nil { + return nil + } + ret := make([]TeamNamePart, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Parts), + } +} + +type TeamCLKRResetUser struct { + Uid UID `codec:"uid" json:"uid"` + UserEldestSeqno Seqno `codec:"userEldestSeqno" json:"user_eldest"` + MemberEldestSeqno Seqno `codec:"memberEldestSeqno" json:"member_eldest"` +} + +func (o TeamCLKRResetUser) DeepCopy() TeamCLKRResetUser { + return TeamCLKRResetUser{ + Uid: o.Uid.DeepCopy(), + UserEldestSeqno: o.UserEldestSeqno.DeepCopy(), + MemberEldestSeqno: o.MemberEldestSeqno.DeepCopy(), + } +} + +type TeamCLKRMsg struct { + TeamID TeamID `codec:"teamID" json:"team_id"` + Generation PerTeamKeyGeneration `codec:"generation" json:"generation"` + Score int `codec:"score" json:"score"` + ResetUsersUntrusted []TeamCLKRResetUser `codec:"resetUsersUntrusted" json:"reset_users"` +} + +func (o TeamCLKRMsg) DeepCopy() TeamCLKRMsg { + return TeamCLKRMsg{ + TeamID: o.TeamID.DeepCopy(), + Generation: o.Generation.DeepCopy(), + Score: o.Score, + ResetUsersUntrusted: (func(x []TeamCLKRResetUser) []TeamCLKRResetUser { + if x == nil { + return nil + } + ret := make([]TeamCLKRResetUser, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ResetUsersUntrusted), + } +} + +type TeamResetUser struct { + Username string `codec:"username" json:"username"` + Uid UID `codec:"uid" json:"uid"` + EldestSeqno Seqno `codec:"eldestSeqno" json:"eldest_seqno"` + IsDelete bool `codec:"isDelete" json:"is_delete"` +} + +func (o TeamResetUser) DeepCopy() TeamResetUser { + return TeamResetUser{ + Username: o.Username, + Uid: o.Uid.DeepCopy(), + EldestSeqno: o.EldestSeqno.DeepCopy(), + IsDelete: o.IsDelete, + } +} + +type TeamMemberOutFromReset struct { + TeamID TeamID `codec:"teamID" json:"team_id"` + TeamName string `codec:"teamName" json:"team_name"` + ResetUser TeamResetUser `codec:"resetUser" json:"reset_user"` +} + +func (o TeamMemberOutFromReset) DeepCopy() TeamMemberOutFromReset { + return TeamMemberOutFromReset{ + TeamID: o.TeamID.DeepCopy(), + TeamName: o.TeamName, + ResetUser: o.ResetUser.DeepCopy(), + } +} + +type TeamChangeRow struct { + Id TeamID `codec:"id" json:"id"` + Name string `codec:"name" json:"name"` + KeyRotated bool `codec:"keyRotated" json:"key_rotated"` + MembershipChanged bool `codec:"membershipChanged" json:"membership_changed"` + LatestSeqno Seqno `codec:"latestSeqno" json:"latest_seqno"` + LatestHiddenSeqno Seqno `codec:"latestHiddenSeqno" json:"latest_hidden_seqno"` + LatestOffchainSeqno Seqno `codec:"latestOffchainSeqno" json:"latest_offchain_seqno"` + ImplicitTeam bool `codec:"implicitTeam" json:"implicit_team"` + Misc bool `codec:"misc" json:"misc"` + RemovedResetUsers bool `codec:"removedResetUsers" json:"removed_reset_users"` +} + +func (o TeamChangeRow) DeepCopy() TeamChangeRow { + return TeamChangeRow{ + Id: o.Id.DeepCopy(), + Name: o.Name, + KeyRotated: o.KeyRotated, + MembershipChanged: o.MembershipChanged, + LatestSeqno: o.LatestSeqno.DeepCopy(), + LatestHiddenSeqno: o.LatestHiddenSeqno.DeepCopy(), + LatestOffchainSeqno: o.LatestOffchainSeqno.DeepCopy(), + ImplicitTeam: o.ImplicitTeam, + Misc: o.Misc, + RemovedResetUsers: o.RemovedResetUsers, + } +} + +type TeamExitRow struct { + Id TeamID `codec:"id" json:"id"` +} + +func (o TeamExitRow) DeepCopy() TeamExitRow { + return TeamExitRow{ + Id: o.Id.DeepCopy(), + } +} + +type TeamNewlyAddedRow struct { + Id TeamID `codec:"id" json:"id"` + Name string `codec:"name" json:"name"` +} + +func (o TeamNewlyAddedRow) DeepCopy() TeamNewlyAddedRow { + return TeamNewlyAddedRow{ + Id: o.Id.DeepCopy(), + Name: o.Name, + } +} + +type TeamInvitee struct { + InviteID TeamInviteID `codec:"inviteID" json:"invite_id"` + Uid UID `codec:"uid" json:"uid"` + EldestSeqno Seqno `codec:"eldestSeqno" json:"eldest_seqno"` + Role TeamRole `codec:"role" json:"role"` +} + +func (o TeamInvitee) DeepCopy() TeamInvitee { + return TeamInvitee{ + InviteID: o.InviteID.DeepCopy(), + Uid: o.Uid.DeepCopy(), + EldestSeqno: o.EldestSeqno.DeepCopy(), + Role: o.Role.DeepCopy(), + } +} + +type TeamSBSMsg struct { + TeamID TeamID `codec:"teamID" json:"team_id"` + Score int `codec:"score" json:"score"` + Invitees []TeamInvitee `codec:"invitees" json:"invitees"` +} + +func (o TeamSBSMsg) DeepCopy() TeamSBSMsg { + return TeamSBSMsg{ + TeamID: o.TeamID.DeepCopy(), + Score: o.Score, + Invitees: (func(x []TeamInvitee) []TeamInvitee { + if x == nil { + return nil + } + ret := make([]TeamInvitee, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Invitees), + } +} + +type TeamAccessRequest struct { + Uid UID `codec:"uid" json:"uid"` + EldestSeqno Seqno `codec:"eldestSeqno" json:"eldest_seqno"` +} + +func (o TeamAccessRequest) DeepCopy() TeamAccessRequest { + return TeamAccessRequest{ + Uid: o.Uid.DeepCopy(), + EldestSeqno: o.EldestSeqno.DeepCopy(), + } +} + +type TeamOpenReqMsg struct { + TeamID TeamID `codec:"teamID" json:"team_id"` + Tars []TeamAccessRequest `codec:"tars" json:"tars"` +} + +func (o TeamOpenReqMsg) DeepCopy() TeamOpenReqMsg { + return TeamOpenReqMsg{ + TeamID: o.TeamID.DeepCopy(), + Tars: (func(x []TeamAccessRequest) []TeamAccessRequest { + if x == nil { + return nil + } + ret := make([]TeamAccessRequest, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Tars), + } +} + +type SeitanAKey string + +func (o SeitanAKey) DeepCopy() SeitanAKey { + return o +} + +type SeitanIKey string + +func (o SeitanIKey) DeepCopy() SeitanIKey { + return o +} + +type SeitanPubKey string + +func (o SeitanPubKey) DeepCopy() SeitanPubKey { + return o +} + +type SeitanIKeyV2 string + +func (o SeitanIKeyV2) DeepCopy() SeitanIKeyV2 { + return o +} + +type SeitanKeyAndLabelVersion int + +const ( + SeitanKeyAndLabelVersion_V1 SeitanKeyAndLabelVersion = 1 + SeitanKeyAndLabelVersion_V2 SeitanKeyAndLabelVersion = 2 +) + +func (o SeitanKeyAndLabelVersion) DeepCopy() SeitanKeyAndLabelVersion { return o } + +var SeitanKeyAndLabelVersionMap = map[string]SeitanKeyAndLabelVersion{ + "V1": 1, + "V2": 2, +} + +var SeitanKeyAndLabelVersionRevMap = map[SeitanKeyAndLabelVersion]string{ + 1: "V1", + 2: "V2", +} + +func (e SeitanKeyAndLabelVersion) String() string { + if v, ok := SeitanKeyAndLabelVersionRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type SeitanKeyAndLabel struct { + V__ SeitanKeyAndLabelVersion `codec:"v" json:"v"` + V1__ *SeitanKeyAndLabelVersion1 `codec:"v1,omitempty" json:"v1,omitempty"` + V2__ *SeitanKeyAndLabelVersion2 `codec:"v2,omitempty" json:"v2,omitempty"` +} + +func (o *SeitanKeyAndLabel) V() (ret SeitanKeyAndLabelVersion, err error) { + switch o.V__ { + case SeitanKeyAndLabelVersion_V1: + if o.V1__ == nil { + err = errors.New("unexpected nil value for V1__") + return ret, err + } + case SeitanKeyAndLabelVersion_V2: + if o.V2__ == nil { + err = errors.New("unexpected nil value for V2__") + return ret, err + } + } + return o.V__, nil +} + +func (o SeitanKeyAndLabel) V1() (res SeitanKeyAndLabelVersion1) { + if o.V__ != SeitanKeyAndLabelVersion_V1 { + panic("wrong case accessed") + } + if o.V1__ == nil { + return + } + return *o.V1__ +} + +func (o SeitanKeyAndLabel) V2() (res SeitanKeyAndLabelVersion2) { + if o.V__ != SeitanKeyAndLabelVersion_V2 { + panic("wrong case accessed") + } + if o.V2__ == nil { + return + } + return *o.V2__ +} + +func NewSeitanKeyAndLabelWithV1(v SeitanKeyAndLabelVersion1) SeitanKeyAndLabel { + return SeitanKeyAndLabel{ + V__: SeitanKeyAndLabelVersion_V1, + V1__: &v, + } +} + +func NewSeitanKeyAndLabelWithV2(v SeitanKeyAndLabelVersion2) SeitanKeyAndLabel { + return SeitanKeyAndLabel{ + V__: SeitanKeyAndLabelVersion_V2, + V2__: &v, + } +} + +func NewSeitanKeyAndLabelDefault(v SeitanKeyAndLabelVersion) SeitanKeyAndLabel { + return SeitanKeyAndLabel{ + V__: v, + } +} + +func (o SeitanKeyAndLabel) DeepCopy() SeitanKeyAndLabel { + return SeitanKeyAndLabel{ + V__: o.V__.DeepCopy(), + V1__: (func(x *SeitanKeyAndLabelVersion1) *SeitanKeyAndLabelVersion1 { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V1__), + V2__: (func(x *SeitanKeyAndLabelVersion2) *SeitanKeyAndLabelVersion2 { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V2__), + } +} + +type SeitanKeyAndLabelVersion1 struct { + I SeitanIKey `codec:"i" json:"i"` + L SeitanKeyLabel `codec:"l" json:"l"` +} + +func (o SeitanKeyAndLabelVersion1) DeepCopy() SeitanKeyAndLabelVersion1 { + return SeitanKeyAndLabelVersion1{ + I: o.I.DeepCopy(), + L: o.L.DeepCopy(), + } +} + +type SeitanKeyAndLabelVersion2 struct { + K SeitanPubKey `codec:"k" json:"k"` + L SeitanKeyLabel `codec:"l" json:"l"` +} + +func (o SeitanKeyAndLabelVersion2) DeepCopy() SeitanKeyAndLabelVersion2 { + return SeitanKeyAndLabelVersion2{ + K: o.K.DeepCopy(), + L: o.L.DeepCopy(), + } +} + +type SeitanKeyLabelType int + +const ( + SeitanKeyLabelType_SMS SeitanKeyLabelType = 1 +) + +func (o SeitanKeyLabelType) DeepCopy() SeitanKeyLabelType { return o } + +var SeitanKeyLabelTypeMap = map[string]SeitanKeyLabelType{ + "SMS": 1, +} + +var SeitanKeyLabelTypeRevMap = map[SeitanKeyLabelType]string{ + 1: "SMS", +} + +func (e SeitanKeyLabelType) String() string { + if v, ok := SeitanKeyLabelTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type SeitanKeyLabel struct { + T__ SeitanKeyLabelType `codec:"t" json:"t"` + Sms__ *SeitanKeyLabelSms `codec:"sms,omitempty" json:"sms,omitempty"` +} + +func (o *SeitanKeyLabel) T() (ret SeitanKeyLabelType, err error) { + switch o.T__ { + case SeitanKeyLabelType_SMS: + if o.Sms__ == nil { + err = errors.New("unexpected nil value for Sms__") + return ret, err + } + } + return o.T__, nil +} + +func (o SeitanKeyLabel) Sms() (res SeitanKeyLabelSms) { + if o.T__ != SeitanKeyLabelType_SMS { + panic("wrong case accessed") + } + if o.Sms__ == nil { + return + } + return *o.Sms__ +} + +func NewSeitanKeyLabelWithSms(v SeitanKeyLabelSms) SeitanKeyLabel { + return SeitanKeyLabel{ + T__: SeitanKeyLabelType_SMS, + Sms__: &v, + } +} + +func NewSeitanKeyLabelDefault(t SeitanKeyLabelType) SeitanKeyLabel { + return SeitanKeyLabel{ + T__: t, + } +} + +func (o SeitanKeyLabel) DeepCopy() SeitanKeyLabel { + return SeitanKeyLabel{ + T__: o.T__.DeepCopy(), + Sms__: (func(x *SeitanKeyLabelSms) *SeitanKeyLabelSms { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Sms__), + } +} + +type SeitanKeyLabelSms struct { + F string `codec:"f" json:"f"` + N string `codec:"n" json:"n"` +} + +func (o SeitanKeyLabelSms) DeepCopy() SeitanKeyLabelSms { + return SeitanKeyLabelSms{ + F: o.F, + N: o.N, + } +} + +type TeamSeitanRequest struct { + InviteID TeamInviteID `codec:"inviteID" json:"invite_id"` + Uid UID `codec:"uid" json:"uid"` + EldestSeqno Seqno `codec:"eldestSeqno" json:"eldest_seqno"` + Akey SeitanAKey `codec:"akey" json:"akey"` + Role TeamRole `codec:"role" json:"role"` + UnixCTime int64 `codec:"unixCTime" json:"ctime"` +} + +func (o TeamSeitanRequest) DeepCopy() TeamSeitanRequest { + return TeamSeitanRequest{ + InviteID: o.InviteID.DeepCopy(), + Uid: o.Uid.DeepCopy(), + EldestSeqno: o.EldestSeqno.DeepCopy(), + Akey: o.Akey.DeepCopy(), + Role: o.Role.DeepCopy(), + UnixCTime: o.UnixCTime, + } +} + +type TeamSeitanMsg struct { + TeamID TeamID `codec:"teamID" json:"team_id"` + Seitans []TeamSeitanRequest `codec:"seitans" json:"seitans"` +} + +func (o TeamSeitanMsg) DeepCopy() TeamSeitanMsg { + return TeamSeitanMsg{ + TeamID: o.TeamID.DeepCopy(), + Seitans: (func(x []TeamSeitanRequest) []TeamSeitanRequest { + if x == nil { + return nil + } + ret := make([]TeamSeitanRequest, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Seitans), + } +} + +type TeamOpenSweepMsg struct { + TeamID TeamID `codec:"teamID" json:"team_id"` + ResetUsersUntrusted []TeamCLKRResetUser `codec:"resetUsersUntrusted" json:"reset_users"` +} + +func (o TeamOpenSweepMsg) DeepCopy() TeamOpenSweepMsg { + return TeamOpenSweepMsg{ + TeamID: o.TeamID.DeepCopy(), + ResetUsersUntrusted: (func(x []TeamCLKRResetUser) []TeamCLKRResetUser { + if x == nil { + return nil + } + ret := make([]TeamCLKRResetUser, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ResetUsersUntrusted), + } +} + +type TeamKBFSKeyRefresher struct { + Generation int `codec:"generation" json:"generation"` + AppType TeamApplication `codec:"appType" json:"appType"` +} + +func (o TeamKBFSKeyRefresher) DeepCopy() TeamKBFSKeyRefresher { + return TeamKBFSKeyRefresher{ + Generation: o.Generation, + AppType: o.AppType.DeepCopy(), + } +} + +// * TeamRefreshData are needed or wanted data requirements that, if unmet, will cause +// * a refresh of the cache. +type TeamRefreshers struct { + NeedKeyGeneration PerTeamKeyGeneration `codec:"needKeyGeneration" json:"needKeyGeneration"` + NeedApplicationsAtGenerations map[PerTeamKeyGeneration][]TeamApplication `codec:"needApplicationsAtGenerations" json:"needApplicationsAtGenerations"` + NeedApplicationsAtGenerationsWithKBFS map[PerTeamKeyGeneration][]TeamApplication `codec:"needApplicationsAtGenerationsWithKBFS" json:"needApplicationsAtGenerationsWithKBFS"` + WantMembers []UserVersion `codec:"wantMembers" json:"wantMembers"` + WantMembersRole TeamRole `codec:"wantMembersRole" json:"wantMembersRole"` + NeedKBFSKeyGeneration TeamKBFSKeyRefresher `codec:"needKBFSKeyGeneration" json:"needKBFSKeyGeneration"` +} + +func (o TeamRefreshers) DeepCopy() TeamRefreshers { + return TeamRefreshers{ + NeedKeyGeneration: o.NeedKeyGeneration.DeepCopy(), + NeedApplicationsAtGenerations: (func(x map[PerTeamKeyGeneration][]TeamApplication) map[PerTeamKeyGeneration][]TeamApplication { + if x == nil { + return nil + } + ret := make(map[PerTeamKeyGeneration][]TeamApplication, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := (func(x []TeamApplication) []TeamApplication { + if x == nil { + return nil + } + ret := make([]TeamApplication, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(v) + ret[kCopy] = vCopy + } + return ret + })(o.NeedApplicationsAtGenerations), + NeedApplicationsAtGenerationsWithKBFS: (func(x map[PerTeamKeyGeneration][]TeamApplication) map[PerTeamKeyGeneration][]TeamApplication { + if x == nil { + return nil + } + ret := make(map[PerTeamKeyGeneration][]TeamApplication, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := (func(x []TeamApplication) []TeamApplication { + if x == nil { + return nil + } + ret := make([]TeamApplication, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(v) + ret[kCopy] = vCopy + } + return ret + })(o.NeedApplicationsAtGenerationsWithKBFS), + WantMembers: (func(x []UserVersion) []UserVersion { + if x == nil { + return nil + } + ret := make([]UserVersion, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.WantMembers), + WantMembersRole: o.WantMembersRole.DeepCopy(), + NeedKBFSKeyGeneration: o.NeedKBFSKeyGeneration.DeepCopy(), + } +} + +type LoadTeamArg struct { + ID TeamID `codec:"ID" json:"ID"` + Name string `codec:"name" json:"name"` + Public bool `codec:"public" json:"public"` + NeedAdmin bool `codec:"needAdmin" json:"needAdmin"` + RefreshUIDMapper bool `codec:"refreshUIDMapper" json:"refreshUIDMapper"` + Refreshers TeamRefreshers `codec:"refreshers" json:"refreshers"` + ForceFullReload bool `codec:"forceFullReload" json:"forceFullReload"` + ForceRepoll bool `codec:"forceRepoll" json:"forceRepoll"` + StaleOK bool `codec:"staleOK" json:"staleOK"` + AllowNameLookupBurstCache bool `codec:"allowNameLookupBurstCache" json:"allowNameLookupBurstCache"` + SkipNeedHiddenRotateCheck bool `codec:"skipNeedHiddenRotateCheck" json:"skipNeedHiddenRotateCheck"` + AuditMode AuditMode `codec:"auditMode" json:"auditMode"` +} + +func (o LoadTeamArg) DeepCopy() LoadTeamArg { + return LoadTeamArg{ + ID: o.ID.DeepCopy(), + Name: o.Name, + Public: o.Public, + NeedAdmin: o.NeedAdmin, + RefreshUIDMapper: o.RefreshUIDMapper, + Refreshers: o.Refreshers.DeepCopy(), + ForceFullReload: o.ForceFullReload, + ForceRepoll: o.ForceRepoll, + StaleOK: o.StaleOK, + AllowNameLookupBurstCache: o.AllowNameLookupBurstCache, + SkipNeedHiddenRotateCheck: o.SkipNeedHiddenRotateCheck, + AuditMode: o.AuditMode.DeepCopy(), + } +} + +type FastTeamLoadArg struct { + ID TeamID `codec:"ID" json:"ID"` + Public bool `codec:"public" json:"public"` + AssertTeamName *TeamName `codec:"assertTeamName,omitempty" json:"assertTeamName,omitempty"` + Applications []TeamApplication `codec:"applications" json:"applications"` + KeyGenerationsNeeded []PerTeamKeyGeneration `codec:"keyGenerationsNeeded" json:"keyGenerationsNeeded"` + NeedLatestKey bool `codec:"needLatestKey" json:"needLatestKey"` + ForceRefresh bool `codec:"forceRefresh" json:"forceRefresh"` + HiddenChainIsOptional bool `codec:"hiddenChainIsOptional" json:"hiddenChainIsOptional"` +} + +func (o FastTeamLoadArg) DeepCopy() FastTeamLoadArg { + return FastTeamLoadArg{ + ID: o.ID.DeepCopy(), + Public: o.Public, + AssertTeamName: (func(x *TeamName) *TeamName { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.AssertTeamName), + Applications: (func(x []TeamApplication) []TeamApplication { + if x == nil { + return nil + } + ret := make([]TeamApplication, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Applications), + KeyGenerationsNeeded: (func(x []PerTeamKeyGeneration) []PerTeamKeyGeneration { + if x == nil { + return nil + } + ret := make([]PerTeamKeyGeneration, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.KeyGenerationsNeeded), + NeedLatestKey: o.NeedLatestKey, + ForceRefresh: o.ForceRefresh, + HiddenChainIsOptional: o.HiddenChainIsOptional, + } +} + +type FastTeamLoadRes struct { + Name TeamName `codec:"name" json:"name"` + ApplicationKeys []TeamApplicationKey `codec:"applicationKeys" json:"applicationKeys"` +} + +func (o FastTeamLoadRes) DeepCopy() FastTeamLoadRes { + return FastTeamLoadRes{ + Name: o.Name.DeepCopy(), + ApplicationKeys: (func(x []TeamApplicationKey) []TeamApplicationKey { + if x == nil { + return nil + } + ret := make([]TeamApplicationKey, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ApplicationKeys), + } +} + +type ImplicitRole struct { + Role TeamRole `codec:"role" json:"role"` + Ancestor TeamID `codec:"ancestor" json:"ancestor"` +} + +func (o ImplicitRole) DeepCopy() ImplicitRole { + return ImplicitRole{ + Role: o.Role.DeepCopy(), + Ancestor: o.Ancestor.DeepCopy(), + } +} + +type MemberInfo struct { + UserID UID `codec:"userID" json:"uid"` + TeamID TeamID `codec:"teamID" json:"team_id"` + FqName string `codec:"fqName" json:"fq_name"` + IsImplicitTeam bool `codec:"isImplicitTeam" json:"is_implicit_team"` + IsOpenTeam bool `codec:"isOpenTeam" json:"is_open_team"` + Role TeamRole `codec:"role" json:"role"` + Implicit *ImplicitRole `codec:"implicit,omitempty" json:"implicit,omitempty"` + MemberCount int `codec:"memberCount" json:"member_count"` + AllowProfilePromote bool `codec:"allowProfilePromote" json:"allow_profile_promote"` + IsMemberShowcased bool `codec:"isMemberShowcased" json:"is_member_showcased"` +} + +func (o MemberInfo) DeepCopy() MemberInfo { + return MemberInfo{ + UserID: o.UserID.DeepCopy(), + TeamID: o.TeamID.DeepCopy(), + FqName: o.FqName, + IsImplicitTeam: o.IsImplicitTeam, + IsOpenTeam: o.IsOpenTeam, + Role: o.Role.DeepCopy(), + Implicit: (func(x *ImplicitRole) *ImplicitRole { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Implicit), + MemberCount: o.MemberCount, + AllowProfilePromote: o.AllowProfilePromote, + IsMemberShowcased: o.IsMemberShowcased, + } +} + +type TeamList struct { + Teams []MemberInfo `codec:"teams" json:"teams"` +} + +func (o TeamList) DeepCopy() TeamList { + return TeamList{ + Teams: (func(x []MemberInfo) []MemberInfo { + if x == nil { + return nil + } + ret := make([]MemberInfo, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Teams), + } +} + +type AnnotatedMemberInfo struct { + UserID UID `codec:"userID" json:"uid"` + TeamID TeamID `codec:"teamID" json:"team_id"` + Username string `codec:"username" json:"username"` + FullName string `codec:"fullName" json:"full_name"` + FqName string `codec:"fqName" json:"fq_name"` + IsImplicitTeam bool `codec:"isImplicitTeam" json:"is_implicit_team"` + ImpTeamDisplayName string `codec:"impTeamDisplayName" json:"implicit_team_display_name"` + IsOpenTeam bool `codec:"isOpenTeam" json:"is_open_team"` + Role TeamRole `codec:"role" json:"role"` + Implicit *ImplicitRole `codec:"implicit,omitempty" json:"implicit,omitempty"` + NeedsPUK bool `codec:"needsPUK" json:"needsPUK"` + MemberCount int `codec:"memberCount" json:"member_count"` + EldestSeqno Seqno `codec:"eldestSeqno" json:"member_eldest_seqno"` + AllowProfilePromote bool `codec:"allowProfilePromote" json:"allow_profile_promote"` + IsMemberShowcased bool `codec:"isMemberShowcased" json:"is_member_showcased"` + Status TeamMemberStatus `codec:"status" json:"status"` +} + +func (o AnnotatedMemberInfo) DeepCopy() AnnotatedMemberInfo { + return AnnotatedMemberInfo{ + UserID: o.UserID.DeepCopy(), + TeamID: o.TeamID.DeepCopy(), + Username: o.Username, + FullName: o.FullName, + FqName: o.FqName, + IsImplicitTeam: o.IsImplicitTeam, + ImpTeamDisplayName: o.ImpTeamDisplayName, + IsOpenTeam: o.IsOpenTeam, + Role: o.Role.DeepCopy(), + Implicit: (func(x *ImplicitRole) *ImplicitRole { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Implicit), + NeedsPUK: o.NeedsPUK, + MemberCount: o.MemberCount, + EldestSeqno: o.EldestSeqno.DeepCopy(), + AllowProfilePromote: o.AllowProfilePromote, + IsMemberShowcased: o.IsMemberShowcased, + Status: o.Status.DeepCopy(), + } +} + +type AnnotatedTeamList struct { + Teams []AnnotatedMemberInfo `codec:"teams" json:"teams"` + AnnotatedActiveInvites map[TeamInviteID]AnnotatedTeamInvite `codec:"annotatedActiveInvites" json:"annotatedActiveInvites"` +} + +func (o AnnotatedTeamList) DeepCopy() AnnotatedTeamList { + return AnnotatedTeamList{ + Teams: (func(x []AnnotatedMemberInfo) []AnnotatedMemberInfo { + if x == nil { + return nil + } + ret := make([]AnnotatedMemberInfo, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Teams), + AnnotatedActiveInvites: (func(x map[TeamInviteID]AnnotatedTeamInvite) map[TeamInviteID]AnnotatedTeamInvite { + if x == nil { + return nil + } + ret := make(map[TeamInviteID]AnnotatedTeamInvite, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.AnnotatedActiveInvites), + } +} + +type TeamAddMemberResult struct { + Invited bool `codec:"invited" json:"invited"` + User *User `codec:"user,omitempty" json:"user,omitempty"` + ChatSending bool `codec:"chatSending" json:"chatSending"` +} + +func (o TeamAddMemberResult) DeepCopy() TeamAddMemberResult { + return TeamAddMemberResult{ + Invited: o.Invited, + User: (func(x *User) *User { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.User), + ChatSending: o.ChatSending, + } +} + +type TeamAddMembersResult struct { + NotAdded []User `codec:"notAdded" json:"notAdded"` +} + +func (o TeamAddMembersResult) DeepCopy() TeamAddMembersResult { + return TeamAddMembersResult{ + NotAdded: (func(x []User) []User { + if x == nil { + return nil + } + ret := make([]User, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.NotAdded), + } +} + +type TeamJoinRequest struct { + Name string `codec:"name" json:"name"` + Username string `codec:"username" json:"username"` +} + +func (o TeamJoinRequest) DeepCopy() TeamJoinRequest { + return TeamJoinRequest{ + Name: o.Name, + Username: o.Username, + } +} + +type TeamTreeResult struct { + Entries []TeamTreeEntry `codec:"entries" json:"entries"` +} + +func (o TeamTreeResult) DeepCopy() TeamTreeResult { + return TeamTreeResult{ + Entries: (func(x []TeamTreeEntry) []TeamTreeEntry { + if x == nil { + return nil + } + ret := make([]TeamTreeEntry, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Entries), + } +} + +type TeamTreeEntry struct { + Name TeamName `codec:"name" json:"name"` + Admin bool `codec:"admin" json:"admin"` +} + +func (o TeamTreeEntry) DeepCopy() TeamTreeEntry { + return TeamTreeEntry{ + Name: o.Name.DeepCopy(), + Admin: o.Admin, + } +} + +type SubteamListEntry struct { + Name TeamName `codec:"name" json:"name"` + TeamID TeamID `codec:"teamID" json:"teamID"` + MemberCount int `codec:"memberCount" json:"memberCount"` +} + +func (o SubteamListEntry) DeepCopy() SubteamListEntry { + return SubteamListEntry{ + Name: o.Name.DeepCopy(), + TeamID: o.TeamID.DeepCopy(), + MemberCount: o.MemberCount, + } +} + +type SubteamListResult struct { + Entries []SubteamListEntry `codec:"entries" json:"entries"` +} + +func (o SubteamListResult) DeepCopy() SubteamListResult { + return SubteamListResult{ + Entries: (func(x []SubteamListEntry) []SubteamListEntry { + if x == nil { + return nil + } + ret := make([]SubteamListEntry, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Entries), + } +} + +type TeamCreateResult struct { + TeamID TeamID `codec:"teamID" json:"teamID"` + ChatSent bool `codec:"chatSent" json:"chatSent"` + CreatorAdded bool `codec:"creatorAdded" json:"creatorAdded"` +} + +func (o TeamCreateResult) DeepCopy() TeamCreateResult { + return TeamCreateResult{ + TeamID: o.TeamID.DeepCopy(), + ChatSent: o.ChatSent, + CreatorAdded: o.CreatorAdded, + } +} + +type TeamSettings struct { + Open bool `codec:"open" json:"open"` + JoinAs TeamRole `codec:"joinAs" json:"joinAs"` +} + +func (o TeamSettings) DeepCopy() TeamSettings { + return TeamSettings{ + Open: o.Open, + JoinAs: o.JoinAs.DeepCopy(), + } +} + +type TeamBotSettings struct { + Cmds bool `codec:"cmds" json:"cmds"` + Mentions bool `codec:"mentions" json:"mentions"` + Triggers []string `codec:"triggers" json:"triggers"` + Convs []string `codec:"convs" json:"convs"` +} + +func (o TeamBotSettings) DeepCopy() TeamBotSettings { + return TeamBotSettings{ + Cmds: o.Cmds, + Mentions: o.Mentions, + Triggers: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Triggers), + Convs: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Convs), + } +} + +type TeamRequestAccessResult struct { + Open bool `codec:"open" json:"open"` +} + +func (o TeamRequestAccessResult) DeepCopy() TeamRequestAccessResult { + return TeamRequestAccessResult{ + Open: o.Open, + } +} + +type TeamAcceptOrRequestResult struct { + WasToken bool `codec:"wasToken" json:"wasToken"` + WasSeitan bool `codec:"wasSeitan" json:"wasSeitan"` + WasTeamName bool `codec:"wasTeamName" json:"wasTeamName"` + WasOpenTeam bool `codec:"wasOpenTeam" json:"wasOpenTeam"` +} + +func (o TeamAcceptOrRequestResult) DeepCopy() TeamAcceptOrRequestResult { + return TeamAcceptOrRequestResult{ + WasToken: o.WasToken, + WasSeitan: o.WasSeitan, + WasTeamName: o.WasTeamName, + WasOpenTeam: o.WasOpenTeam, + } +} + +type TeamShowcase struct { + IsShowcased bool `codec:"isShowcased" json:"is_showcased"` + Description *string `codec:"description,omitempty" json:"description,omitempty"` + SetByUID *UID `codec:"setByUID,omitempty" json:"set_by_uid,omitempty"` + AnyMemberShowcase bool `codec:"anyMemberShowcase" json:"any_member_showcase"` +} + +func (o TeamShowcase) DeepCopy() TeamShowcase { + return TeamShowcase{ + IsShowcased: o.IsShowcased, + Description: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Description), + SetByUID: (func(x *UID) *UID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.SetByUID), + AnyMemberShowcase: o.AnyMemberShowcase, + } +} + +type TeamAndMemberShowcase struct { + TeamShowcase TeamShowcase `codec:"teamShowcase" json:"teamShowcase"` + IsMemberShowcased bool `codec:"isMemberShowcased" json:"isMemberShowcased"` +} + +func (o TeamAndMemberShowcase) DeepCopy() TeamAndMemberShowcase { + return TeamAndMemberShowcase{ + TeamShowcase: o.TeamShowcase.DeepCopy(), + IsMemberShowcased: o.IsMemberShowcased, + } +} + +type UserRolePair struct { + AssertionOrEmail string `codec:"assertionOrEmail" json:"assertionOrEmail"` + Role TeamRole `codec:"role" json:"role"` + BotSettings *TeamBotSettings `codec:"botSettings,omitempty" json:"botSettings,omitempty"` +} + +func (o UserRolePair) DeepCopy() UserRolePair { + return UserRolePair{ + AssertionOrEmail: o.AssertionOrEmail, + Role: o.Role.DeepCopy(), + BotSettings: (func(x *TeamBotSettings) *TeamBotSettings { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.BotSettings), + } +} + +type BulkRes struct { + Invited []string `codec:"invited" json:"invited"` + AlreadyInvited []string `codec:"alreadyInvited" json:"alreadyInvited"` + Malformed []string `codec:"malformed" json:"malformed"` +} + +func (o BulkRes) DeepCopy() BulkRes { + return BulkRes{ + Invited: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Invited), + AlreadyInvited: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.AlreadyInvited), + Malformed: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Malformed), + } +} + +type ImplicitTeamUserSet struct { + KeybaseUsers []string `codec:"keybaseUsers" json:"keybaseUsers"` + UnresolvedUsers []SocialAssertion `codec:"unresolvedUsers" json:"unresolvedUsers"` +} + +func (o ImplicitTeamUserSet) DeepCopy() ImplicitTeamUserSet { + return ImplicitTeamUserSet{ + KeybaseUsers: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.KeybaseUsers), + UnresolvedUsers: (func(x []SocialAssertion) []SocialAssertion { + if x == nil { + return nil + } + ret := make([]SocialAssertion, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.UnresolvedUsers), + } +} + +// * iTeams +type ImplicitTeamDisplayName struct { + IsPublic bool `codec:"isPublic" json:"isPublic"` + Writers ImplicitTeamUserSet `codec:"writers" json:"writers"` + Readers ImplicitTeamUserSet `codec:"readers" json:"readers"` + ConflictInfo *ImplicitTeamConflictInfo `codec:"conflictInfo,omitempty" json:"conflictInfo,omitempty"` +} + +func (o ImplicitTeamDisplayName) DeepCopy() ImplicitTeamDisplayName { + return ImplicitTeamDisplayName{ + IsPublic: o.IsPublic, + Writers: o.Writers.DeepCopy(), + Readers: o.Readers.DeepCopy(), + ConflictInfo: (func(x *ImplicitTeamConflictInfo) *ImplicitTeamConflictInfo { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ConflictInfo), + } +} + +type ConflictGeneration int + +func (o ConflictGeneration) DeepCopy() ConflictGeneration { + return o +} + +type ImplicitTeamConflictInfo struct { + Generation ConflictGeneration `codec:"generation" json:"generation"` + Time Time `codec:"time" json:"time"` +} + +func (o ImplicitTeamConflictInfo) DeepCopy() ImplicitTeamConflictInfo { + return ImplicitTeamConflictInfo{ + Generation: o.Generation.DeepCopy(), + Time: o.Time.DeepCopy(), + } +} + +type LookupImplicitTeamRes struct { + TeamID TeamID `codec:"teamID" json:"teamID"` + Name TeamName `codec:"name" json:"name"` + DisplayName ImplicitTeamDisplayName `codec:"displayName" json:"displayName"` + TlfID TLFID `codec:"tlfID" json:"tlfID"` +} + +func (o LookupImplicitTeamRes) DeepCopy() LookupImplicitTeamRes { + return LookupImplicitTeamRes{ + TeamID: o.TeamID.DeepCopy(), + Name: o.Name.DeepCopy(), + DisplayName: o.DisplayName.DeepCopy(), + TlfID: o.TlfID.DeepCopy(), + } +} + +type TeamOperation struct { + ManageMembers bool `codec:"manageMembers" json:"manageMembers"` + ManageSubteams bool `codec:"manageSubteams" json:"manageSubteams"` + CreateChannel bool `codec:"createChannel" json:"createChannel"` + Chat bool `codec:"chat" json:"chat"` + DeleteChannel bool `codec:"deleteChannel" json:"deleteChannel"` + RenameChannel bool `codec:"renameChannel" json:"renameChannel"` + RenameTeam bool `codec:"renameTeam" json:"renameTeam"` + EditChannelDescription bool `codec:"editChannelDescription" json:"editChannelDescription"` + EditTeamDescription bool `codec:"editTeamDescription" json:"editTeamDescription"` + SetTeamShowcase bool `codec:"setTeamShowcase" json:"setTeamShowcase"` + SetMemberShowcase bool `codec:"setMemberShowcase" json:"setMemberShowcase"` + SetRetentionPolicy bool `codec:"setRetentionPolicy" json:"setRetentionPolicy"` + SetMinWriterRole bool `codec:"setMinWriterRole" json:"setMinWriterRole"` + ChangeOpenTeam bool `codec:"changeOpenTeam" json:"changeOpenTeam"` + LeaveTeam bool `codec:"leaveTeam" json:"leaveTeam"` + JoinTeam bool `codec:"joinTeam" json:"joinTeam"` + SetPublicityAny bool `codec:"setPublicityAny" json:"setPublicityAny"` + ListFirst bool `codec:"listFirst" json:"listFirst"` + ChangeTarsDisabled bool `codec:"changeTarsDisabled" json:"changeTarsDisabled"` + DeleteChatHistory bool `codec:"deleteChatHistory" json:"deleteChatHistory"` + DeleteOtherMessages bool `codec:"deleteOtherMessages" json:"deleteOtherMessages"` + DeleteTeam bool `codec:"deleteTeam" json:"deleteTeam"` + PinMessage bool `codec:"pinMessage" json:"pinMessage"` + ManageBots bool `codec:"manageBots" json:"manageBots"` +} + +func (o TeamOperation) DeepCopy() TeamOperation { + return TeamOperation{ + ManageMembers: o.ManageMembers, + ManageSubteams: o.ManageSubteams, + CreateChannel: o.CreateChannel, + Chat: o.Chat, + DeleteChannel: o.DeleteChannel, + RenameChannel: o.RenameChannel, + RenameTeam: o.RenameTeam, + EditChannelDescription: o.EditChannelDescription, + EditTeamDescription: o.EditTeamDescription, + SetTeamShowcase: o.SetTeamShowcase, + SetMemberShowcase: o.SetMemberShowcase, + SetRetentionPolicy: o.SetRetentionPolicy, + SetMinWriterRole: o.SetMinWriterRole, + ChangeOpenTeam: o.ChangeOpenTeam, + LeaveTeam: o.LeaveTeam, + JoinTeam: o.JoinTeam, + SetPublicityAny: o.SetPublicityAny, + ListFirst: o.ListFirst, + ChangeTarsDisabled: o.ChangeTarsDisabled, + DeleteChatHistory: o.DeleteChatHistory, + DeleteOtherMessages: o.DeleteOtherMessages, + DeleteTeam: o.DeleteTeam, + PinMessage: o.PinMessage, + ManageBots: o.ManageBots, + } +} + +type ProfileTeamLoadRes struct { + LoadTimeNsec int64 `codec:"loadTimeNsec" json:"loadTimeNsec"` +} + +func (o ProfileTeamLoadRes) DeepCopy() ProfileTeamLoadRes { + return ProfileTeamLoadRes{ + LoadTimeNsec: o.LoadTimeNsec, + } +} + +type RotationType int + +const ( + RotationType_VISIBLE RotationType = 0 + RotationType_HIDDEN RotationType = 1 + RotationType_CLKR RotationType = 2 +) + +func (o RotationType) DeepCopy() RotationType { return o } + +var RotationTypeMap = map[string]RotationType{ + "VISIBLE": 0, + "HIDDEN": 1, + "CLKR": 2, +} + +var RotationTypeRevMap = map[RotationType]string{ + 0: "VISIBLE", + 1: "HIDDEN", + 2: "CLKR", +} + +func (e RotationType) String() string { + if v, ok := RotationTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type TeamDebugRes struct { + Chain TeamSigChainState `codec:"chain" json:"chain"` +} + +func (o TeamDebugRes) DeepCopy() TeamDebugRes { + return TeamDebugRes{ + Chain: o.Chain.DeepCopy(), + } +} + +type TeamProfileAddEntry struct { + TeamID TeamID `codec:"teamID" json:"teamID"` + TeamName TeamName `codec:"teamName" json:"teamName"` + Open bool `codec:"open" json:"open"` + DisabledReason string `codec:"disabledReason" json:"disabledReason"` +} + +func (o TeamProfileAddEntry) DeepCopy() TeamProfileAddEntry { + return TeamProfileAddEntry{ + TeamID: o.TeamID.DeepCopy(), + TeamName: o.TeamName.DeepCopy(), + Open: o.Open, + DisabledReason: o.DisabledReason, + } +} + +type MemberEmail struct { + Email string `codec:"email" json:"email"` + Role string `codec:"role" json:"role"` +} + +func (o MemberEmail) DeepCopy() MemberEmail { + return MemberEmail{ + Email: o.Email, + Role: o.Role, + } +} + +type MemberUsername struct { + Username string `codec:"username" json:"username"` + Role string `codec:"role" json:"role"` +} + +func (o MemberUsername) DeepCopy() MemberUsername { + return MemberUsername{ + Username: o.Username, + Role: o.Role, + } +} + +type TeamRolePair struct { + Role TeamRole `codec:"role" json:"role"` + ImplicitRole TeamRole `codec:"implicitRole" json:"implicit_role"` +} + +func (o TeamRolePair) DeepCopy() TeamRolePair { + return TeamRolePair{ + Role: o.Role.DeepCopy(), + ImplicitRole: o.ImplicitRole.DeepCopy(), + } +} + +type TeamRoleMapAndVersion struct { + Teams map[TeamID]TeamRolePair `codec:"teams" json:"teams"` + Version UserTeamVersion `codec:"version" json:"user_team_version"` +} + +func (o TeamRoleMapAndVersion) DeepCopy() TeamRoleMapAndVersion { + return TeamRoleMapAndVersion{ + Teams: (func(x map[TeamID]TeamRolePair) map[TeamID]TeamRolePair { + if x == nil { + return nil + } + ret := make(map[TeamID]TeamRolePair, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.Teams), + Version: o.Version.DeepCopy(), + } +} + +type TeamRoleMapStored struct { + Data TeamRoleMapAndVersion `codec:"data" json:"data"` + CachedAt Time `codec:"cachedAt" json:"cachedAt"` +} + +func (o TeamRoleMapStored) DeepCopy() TeamRoleMapStored { + return TeamRoleMapStored{ + Data: o.Data.DeepCopy(), + CachedAt: o.CachedAt.DeepCopy(), + } +} + +type UserTeamVersion int + +func (o UserTeamVersion) DeepCopy() UserTeamVersion { + return o +} + +type UserTeamVersionUpdate struct { + Version UserTeamVersion `codec:"version" json:"version"` +} + +func (o UserTeamVersionUpdate) DeepCopy() UserTeamVersionUpdate { + return UserTeamVersionUpdate{ + Version: o.Version.DeepCopy(), + } +} + +type AnnotatedTeamMemberDetails struct { + Details TeamMemberDetails `codec:"details" json:"details"` + Role TeamRole `codec:"role" json:"role"` +} + +func (o AnnotatedTeamMemberDetails) DeepCopy() AnnotatedTeamMemberDetails { + return AnnotatedTeamMemberDetails{ + Details: o.Details.DeepCopy(), + Role: o.Role.DeepCopy(), + } +} + +type AnnotatedTeam struct { + TeamID TeamID `codec:"teamID" json:"teamID"` + Name string `codec:"name" json:"name"` + TransitiveSubteamsUnverified SubteamListResult `codec:"transitiveSubteamsUnverified" json:"transitiveSubteamsUnverified"` + Members []AnnotatedTeamMemberDetails `codec:"members" json:"members"` + Invites []AnnotatedTeamInvite `codec:"invites" json:"invites"` + JoinRequests []TeamJoinRequest `codec:"joinRequests" json:"joinRequests"` + UserIsShowcasing bool `codec:"userIsShowcasing" json:"userIsShowcasing"` + TarsDisabled bool `codec:"tarsDisabled" json:"tarsDisabled"` + Settings TeamSettings `codec:"settings" json:"settings"` + Showcase TeamShowcase `codec:"showcase" json:"showcase"` +} + +func (o AnnotatedTeam) DeepCopy() AnnotatedTeam { + return AnnotatedTeam{ + TeamID: o.TeamID.DeepCopy(), + Name: o.Name, + TransitiveSubteamsUnverified: o.TransitiveSubteamsUnverified.DeepCopy(), + Members: (func(x []AnnotatedTeamMemberDetails) []AnnotatedTeamMemberDetails { + if x == nil { + return nil + } + ret := make([]AnnotatedTeamMemberDetails, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Members), + Invites: (func(x []AnnotatedTeamInvite) []AnnotatedTeamInvite { + if x == nil { + return nil + } + ret := make([]AnnotatedTeamInvite, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Invites), + JoinRequests: (func(x []TeamJoinRequest) []TeamJoinRequest { + if x == nil { + return nil + } + ret := make([]TeamJoinRequest, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.JoinRequests), + UserIsShowcasing: o.UserIsShowcasing, + TarsDisabled: o.TarsDisabled, + Settings: o.Settings.DeepCopy(), + Showcase: o.Showcase.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/teams_ui.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/teams_ui.go new file mode 100644 index 00000000..2c713aa6 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/teams_ui.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/teams_ui.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/test.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/test.go new file mode 100644 index 00000000..d8d6dd8a --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/test.go @@ -0,0 +1,64 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/test.avdl + +package keybase1 + +// Result from calling test(..). +type Test struct { + Reply string `codec:"reply" json:"reply"` +} + +func (o Test) DeepCopy() Test { + return Test{ + Reply: o.Reply, + } +} + +type Generic struct { + M map[string]Generic `codec:"m" json:"m"` + A []Generic `codec:"a" json:"a"` + S *string `codec:"s,omitempty" json:"s,omitempty"` + I *int `codec:"i,omitempty" json:"i,omitempty"` +} + +func (o Generic) DeepCopy() Generic { + return Generic{ + M: (func(x map[string]Generic) map[string]Generic { + if x == nil { + return nil + } + ret := make(map[string]Generic, len(x)) + for k, v := range x { + kCopy := k + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.M), + A: (func(x []Generic) []Generic { + if x == nil { + return nil + } + ret := make([]Generic, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.A), + S: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.S), + I: (func(x *int) *int { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.I), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/tlf.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/tlf.go new file mode 100644 index 00000000..ec803243 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/tlf.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/tlf.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/tlf_keys.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/tlf_keys.go new file mode 100644 index 00000000..2aa0ee50 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/tlf_keys.go @@ -0,0 +1,180 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/tlf_keys.avdl + +package keybase1 + +import ( + "fmt" +) + +type TLFIdentifyBehavior int + +const ( + TLFIdentifyBehavior_UNSET TLFIdentifyBehavior = 0 + TLFIdentifyBehavior_CHAT_CLI TLFIdentifyBehavior = 1 + TLFIdentifyBehavior_CHAT_GUI TLFIdentifyBehavior = 2 + TLFIdentifyBehavior_REMOVED_AND_UNUSED TLFIdentifyBehavior = 3 + TLFIdentifyBehavior_KBFS_REKEY TLFIdentifyBehavior = 4 + TLFIdentifyBehavior_KBFS_QR TLFIdentifyBehavior = 5 + TLFIdentifyBehavior_CHAT_SKIP TLFIdentifyBehavior = 6 + TLFIdentifyBehavior_SALTPACK TLFIdentifyBehavior = 7 + TLFIdentifyBehavior_CLI TLFIdentifyBehavior = 8 + TLFIdentifyBehavior_GUI TLFIdentifyBehavior = 9 + TLFIdentifyBehavior_DEFAULT_KBFS TLFIdentifyBehavior = 10 + TLFIdentifyBehavior_KBFS_CHAT TLFIdentifyBehavior = 11 + TLFIdentifyBehavior_RESOLVE_AND_CHECK TLFIdentifyBehavior = 12 + TLFIdentifyBehavior_GUI_PROFILE TLFIdentifyBehavior = 13 + TLFIdentifyBehavior_KBFS_INIT TLFIdentifyBehavior = 14 + TLFIdentifyBehavior_FS_GUI TLFIdentifyBehavior = 15 +) + +func (o TLFIdentifyBehavior) DeepCopy() TLFIdentifyBehavior { return o } + +var TLFIdentifyBehaviorMap = map[string]TLFIdentifyBehavior{ + "UNSET": 0, + "CHAT_CLI": 1, + "CHAT_GUI": 2, + "REMOVED_AND_UNUSED": 3, + "KBFS_REKEY": 4, + "KBFS_QR": 5, + "CHAT_SKIP": 6, + "SALTPACK": 7, + "CLI": 8, + "GUI": 9, + "DEFAULT_KBFS": 10, + "KBFS_CHAT": 11, + "RESOLVE_AND_CHECK": 12, + "GUI_PROFILE": 13, + "KBFS_INIT": 14, + "FS_GUI": 15, +} + +var TLFIdentifyBehaviorRevMap = map[TLFIdentifyBehavior]string{ + 0: "UNSET", + 1: "CHAT_CLI", + 2: "CHAT_GUI", + 3: "REMOVED_AND_UNUSED", + 4: "KBFS_REKEY", + 5: "KBFS_QR", + 6: "CHAT_SKIP", + 7: "SALTPACK", + 8: "CLI", + 9: "GUI", + 10: "DEFAULT_KBFS", + 11: "KBFS_CHAT", + 12: "RESOLVE_AND_CHECK", + 13: "GUI_PROFILE", + 14: "KBFS_INIT", + 15: "FS_GUI", +} + +func (e TLFIdentifyBehavior) String() string { + if v, ok := TLFIdentifyBehaviorRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type CanonicalTlfName string + +func (o CanonicalTlfName) DeepCopy() CanonicalTlfName { + return o +} + +type CryptKey struct { + KeyGeneration int `codec:"KeyGeneration" json:"KeyGeneration"` + Key Bytes32 `codec:"Key" json:"Key"` +} + +func (o CryptKey) DeepCopy() CryptKey { + return CryptKey{ + KeyGeneration: o.KeyGeneration, + Key: o.Key.DeepCopy(), + } +} + +type TLFBreak struct { + Breaks []TLFIdentifyFailure `codec:"breaks" json:"breaks"` +} + +func (o TLFBreak) DeepCopy() TLFBreak { + return TLFBreak{ + Breaks: (func(x []TLFIdentifyFailure) []TLFIdentifyFailure { + if x == nil { + return nil + } + ret := make([]TLFIdentifyFailure, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Breaks), + } +} + +type TLFIdentifyFailure struct { + User User `codec:"user" json:"user"` + Breaks *IdentifyTrackBreaks `codec:"breaks,omitempty" json:"breaks,omitempty"` +} + +func (o TLFIdentifyFailure) DeepCopy() TLFIdentifyFailure { + return TLFIdentifyFailure{ + User: o.User.DeepCopy(), + Breaks: (func(x *IdentifyTrackBreaks) *IdentifyTrackBreaks { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Breaks), + } +} + +type CanonicalTLFNameAndIDWithBreaks struct { + TlfID TLFID `codec:"tlfID" json:"tlfID"` + CanonicalName CanonicalTlfName `codec:"CanonicalName" json:"CanonicalName"` + Breaks TLFBreak `codec:"breaks" json:"breaks"` +} + +func (o CanonicalTLFNameAndIDWithBreaks) DeepCopy() CanonicalTLFNameAndIDWithBreaks { + return CanonicalTLFNameAndIDWithBreaks{ + TlfID: o.TlfID.DeepCopy(), + CanonicalName: o.CanonicalName.DeepCopy(), + Breaks: o.Breaks.DeepCopy(), + } +} + +type GetTLFCryptKeysRes struct { + NameIDBreaks CanonicalTLFNameAndIDWithBreaks `codec:"nameIDBreaks" json:"nameIDBreaks"` + CryptKeys []CryptKey `codec:"CryptKeys" json:"CryptKeys"` +} + +func (o GetTLFCryptKeysRes) DeepCopy() GetTLFCryptKeysRes { + return GetTLFCryptKeysRes{ + NameIDBreaks: o.NameIDBreaks.DeepCopy(), + CryptKeys: (func(x []CryptKey) []CryptKey { + if x == nil { + return nil + } + ret := make([]CryptKey, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.CryptKeys), + } +} + +type TLFQuery struct { + TlfName string `codec:"tlfName" json:"tlfName"` + IdentifyBehavior TLFIdentifyBehavior `codec:"identifyBehavior" json:"identifyBehavior"` +} + +func (o TLFQuery) DeepCopy() TLFQuery { + return TLFQuery{ + TlfName: o.TlfName, + IdentifyBehavior: o.IdentifyBehavior.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/track.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/track.go new file mode 100644 index 00000000..23ce1678 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/track.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/track.avdl + +package keybase1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/ui.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/ui.go new file mode 100644 index 00000000..7eb6201c --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/ui.go @@ -0,0 +1,37 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/ui.avdl + +package keybase1 + +import ( + "fmt" +) + +type PromptDefault int + +const ( + PromptDefault_NONE PromptDefault = 0 + PromptDefault_YES PromptDefault = 1 + PromptDefault_NO PromptDefault = 2 +) + +func (o PromptDefault) DeepCopy() PromptDefault { return o } + +var PromptDefaultMap = map[string]PromptDefault{ + "NONE": 0, + "YES": 1, + "NO": 2, +} + +var PromptDefaultRevMap = map[PromptDefault]string{ + 0: "NONE", + 1: "YES", + 2: "NO", +} + +func (e PromptDefault) String() string { + if v, ok := PromptDefaultRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/upk.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/upk.go new file mode 100644 index 00000000..3148b115 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/upk.go @@ -0,0 +1,626 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/upk.avdl + +package keybase1 + +import ( + "errors" + "fmt" +) + +type KeyType int + +const ( + KeyType_NONE KeyType = 0 + KeyType_NACL KeyType = 1 + KeyType_PGP KeyType = 2 +) + +func (o KeyType) DeepCopy() KeyType { return o } + +var KeyTypeMap = map[string]KeyType{ + "NONE": 0, + "NACL": 1, + "PGP": 2, +} + +var KeyTypeRevMap = map[KeyType]string{ + 0: "NONE", + 1: "NACL", + 2: "PGP", +} + +func (e KeyType) String() string { + if v, ok := KeyTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UPK2MinorVersion int + +const ( + UPK2MinorVersion_V0 UPK2MinorVersion = 0 + UPK2MinorVersion_V1 UPK2MinorVersion = 1 + UPK2MinorVersion_V2 UPK2MinorVersion = 2 + UPK2MinorVersion_V3 UPK2MinorVersion = 3 + UPK2MinorVersion_V4 UPK2MinorVersion = 4 + UPK2MinorVersion_V5 UPK2MinorVersion = 5 + UPK2MinorVersion_V6 UPK2MinorVersion = 6 +) + +func (o UPK2MinorVersion) DeepCopy() UPK2MinorVersion { return o } + +var UPK2MinorVersionMap = map[string]UPK2MinorVersion{ + "V0": 0, + "V1": 1, + "V2": 2, + "V3": 3, + "V4": 4, + "V5": 5, + "V6": 6, +} + +var UPK2MinorVersionRevMap = map[UPK2MinorVersion]string{ + 0: "V0", + 1: "V1", + 2: "V2", + 3: "V3", + 4: "V4", + 5: "V5", + 6: "V6", +} + +func (e UPK2MinorVersion) String() string { + if v, ok := UPK2MinorVersionRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type MerkleRootV2 struct { + Seqno Seqno `codec:"seqno" json:"seqno"` + HashMeta HashMeta `codec:"hashMeta" json:"hashMeta"` +} + +func (o MerkleRootV2) DeepCopy() MerkleRootV2 { + return MerkleRootV2{ + Seqno: o.Seqno.DeepCopy(), + HashMeta: o.HashMeta.DeepCopy(), + } +} + +type SigChainLocation struct { + Seqno Seqno `codec:"seqno" json:"seqno"` + SeqType SeqType `codec:"seqType" json:"seqType"` +} + +func (o SigChainLocation) DeepCopy() SigChainLocation { + return SigChainLocation{ + Seqno: o.Seqno.DeepCopy(), + SeqType: o.SeqType.DeepCopy(), + } +} + +type MerkleTreeLocation struct { + Leaf UserOrTeamID `codec:"leaf" json:"leaf"` + Loc SigChainLocation `codec:"loc" json:"loc"` +} + +func (o MerkleTreeLocation) DeepCopy() MerkleTreeLocation { + return MerkleTreeLocation{ + Leaf: o.Leaf.DeepCopy(), + Loc: o.Loc.DeepCopy(), + } +} + +type SignatureMetadata struct { + SigningKID KID `codec:"signingKID" json:"signingKID"` + PrevMerkleRootSigned MerkleRootV2 `codec:"prevMerkleRootSigned" json:"prevMerkleRootSigned"` + FirstAppearedUnverified Seqno `codec:"firstAppearedUnverified" json:"firstAppearedUnverified"` + Time Time `codec:"time" json:"time"` + SigChainLocation SigChainLocation `codec:"sigChainLocation" json:"sigChainLocation"` +} + +func (o SignatureMetadata) DeepCopy() SignatureMetadata { + return SignatureMetadata{ + SigningKID: o.SigningKID.DeepCopy(), + PrevMerkleRootSigned: o.PrevMerkleRootSigned.DeepCopy(), + FirstAppearedUnverified: o.FirstAppearedUnverified.DeepCopy(), + Time: o.Time.DeepCopy(), + SigChainLocation: o.SigChainLocation.DeepCopy(), + } +} + +type PublicKeyV2Base struct { + Kid KID `codec:"kid" json:"kid"` + IsSibkey bool `codec:"isSibkey" json:"isSibkey"` + IsEldest bool `codec:"isEldest" json:"isEldest"` + CTime Time `codec:"cTime" json:"cTime"` + ETime Time `codec:"eTime" json:"eTime"` + Provisioning SignatureMetadata `codec:"provisioning" json:"provisioning"` + Revocation *SignatureMetadata `codec:"revocation,omitempty" json:"revocation,omitempty"` +} + +func (o PublicKeyV2Base) DeepCopy() PublicKeyV2Base { + return PublicKeyV2Base{ + Kid: o.Kid.DeepCopy(), + IsSibkey: o.IsSibkey, + IsEldest: o.IsEldest, + CTime: o.CTime.DeepCopy(), + ETime: o.ETime.DeepCopy(), + Provisioning: o.Provisioning.DeepCopy(), + Revocation: (func(x *SignatureMetadata) *SignatureMetadata { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Revocation), + } +} + +type PublicKeyV2NaCl struct { + Base PublicKeyV2Base `codec:"base" json:"base"` + Parent *KID `codec:"parent,omitempty" json:"parent,omitempty"` + DeviceID DeviceID `codec:"deviceID" json:"deviceID"` + DeviceDescription string `codec:"deviceDescription" json:"deviceDescription"` + DeviceType string `codec:"deviceType" json:"deviceType"` +} + +func (o PublicKeyV2NaCl) DeepCopy() PublicKeyV2NaCl { + return PublicKeyV2NaCl{ + Base: o.Base.DeepCopy(), + Parent: (func(x *KID) *KID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Parent), + DeviceID: o.DeviceID.DeepCopy(), + DeviceDescription: o.DeviceDescription, + DeviceType: o.DeviceType, + } +} + +type PGPFingerprint [20]byte + +func (o PGPFingerprint) DeepCopy() PGPFingerprint { + var ret PGPFingerprint + copy(ret[:], o[:]) + return ret +} + +type PublicKeyV2PGPSummary struct { + Base PublicKeyV2Base `codec:"base" json:"base"` + Fingerprint PGPFingerprint `codec:"fingerprint" json:"fingerprint"` + Identities []PGPIdentity `codec:"identities" json:"identities"` +} + +func (o PublicKeyV2PGPSummary) DeepCopy() PublicKeyV2PGPSummary { + return PublicKeyV2PGPSummary{ + Base: o.Base.DeepCopy(), + Fingerprint: o.Fingerprint.DeepCopy(), + Identities: (func(x []PGPIdentity) []PGPIdentity { + if x == nil { + return nil + } + ret := make([]PGPIdentity, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Identities), + } +} + +type PublicKeyV2 struct { + KeyType__ KeyType `codec:"keyType" json:"keyType"` + Nacl__ *PublicKeyV2NaCl `codec:"nacl,omitempty" json:"nacl,omitempty"` + PGP__ *PublicKeyV2PGPSummary `codec:"pgp,omitempty" json:"pgp,omitempty"` +} + +func (o *PublicKeyV2) KeyType() (ret KeyType, err error) { + switch o.KeyType__ { + case KeyType_NACL: + if o.Nacl__ == nil { + err = errors.New("unexpected nil value for Nacl__") + return ret, err + } + case KeyType_PGP: + if o.PGP__ == nil { + err = errors.New("unexpected nil value for PGP__") + return ret, err + } + } + return o.KeyType__, nil +} + +func (o PublicKeyV2) Nacl() (res PublicKeyV2NaCl) { + if o.KeyType__ != KeyType_NACL { + panic("wrong case accessed") + } + if o.Nacl__ == nil { + return + } + return *o.Nacl__ +} + +func (o PublicKeyV2) Pgp() (res PublicKeyV2PGPSummary) { + if o.KeyType__ != KeyType_PGP { + panic("wrong case accessed") + } + if o.PGP__ == nil { + return + } + return *o.PGP__ +} + +func NewPublicKeyV2WithNacl(v PublicKeyV2NaCl) PublicKeyV2 { + return PublicKeyV2{ + KeyType__: KeyType_NACL, + Nacl__: &v, + } +} + +func NewPublicKeyV2WithPgp(v PublicKeyV2PGPSummary) PublicKeyV2 { + return PublicKeyV2{ + KeyType__: KeyType_PGP, + PGP__: &v, + } +} + +func NewPublicKeyV2Default(keyType KeyType) PublicKeyV2 { + return PublicKeyV2{ + KeyType__: keyType, + } +} + +func (o PublicKeyV2) DeepCopy() PublicKeyV2 { + return PublicKeyV2{ + KeyType__: o.KeyType__.DeepCopy(), + Nacl__: (func(x *PublicKeyV2NaCl) *PublicKeyV2NaCl { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Nacl__), + PGP__: (func(x *PublicKeyV2PGPSummary) *PublicKeyV2PGPSummary { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.PGP__), + } +} + +type UserPlusKeysV2 struct { + Uid UID `codec:"uid" json:"uid"` + Username string `codec:"username" json:"username"` + EldestSeqno Seqno `codec:"eldestSeqno" json:"eldestSeqno"` + Status StatusCode `codec:"status" json:"status"` + PerUserKeys []PerUserKey `codec:"perUserKeys" json:"perUserKeys"` + DeviceKeys map[KID]PublicKeyV2NaCl `codec:"deviceKeys" json:"deviceKeys"` + PGPKeys map[KID]PublicKeyV2PGPSummary `codec:"pgpKeys" json:"pgpKeys"` + StellarAccountID *string `codec:"stellarAccountID,omitempty" json:"stellarAccountID,omitempty"` + RemoteTracks map[UID]RemoteTrack `codec:"remoteTracks" json:"remoteTracks"` + Reset *ResetSummary `codec:"reset,omitempty" json:"reset,omitempty"` + Unstubbed bool `codec:"unstubbed" json:"unstubbed"` +} + +func (o UserPlusKeysV2) DeepCopy() UserPlusKeysV2 { + return UserPlusKeysV2{ + Uid: o.Uid.DeepCopy(), + Username: o.Username, + EldestSeqno: o.EldestSeqno.DeepCopy(), + Status: o.Status.DeepCopy(), + PerUserKeys: (func(x []PerUserKey) []PerUserKey { + if x == nil { + return nil + } + ret := make([]PerUserKey, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.PerUserKeys), + DeviceKeys: (func(x map[KID]PublicKeyV2NaCl) map[KID]PublicKeyV2NaCl { + if x == nil { + return nil + } + ret := make(map[KID]PublicKeyV2NaCl, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.DeviceKeys), + PGPKeys: (func(x map[KID]PublicKeyV2PGPSummary) map[KID]PublicKeyV2PGPSummary { + if x == nil { + return nil + } + ret := make(map[KID]PublicKeyV2PGPSummary, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.PGPKeys), + StellarAccountID: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.StellarAccountID), + RemoteTracks: (func(x map[UID]RemoteTrack) map[UID]RemoteTrack { + if x == nil { + return nil + } + ret := make(map[UID]RemoteTrack, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.RemoteTracks), + Reset: (func(x *ResetSummary) *ResetSummary { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Reset), + Unstubbed: o.Unstubbed, + } +} + +type UserPlusKeysV2AllIncarnations struct { + Current UserPlusKeysV2 `codec:"current" json:"current"` + PastIncarnations []UserPlusKeysV2 `codec:"pastIncarnations" json:"pastIncarnations"` + Uvv UserVersionVector `codec:"uvv" json:"uvv"` + SeqnoLinkIDs map[Seqno]LinkID `codec:"seqnoLinkIDs" json:"seqnoLinkIDs"` + MinorVersion UPK2MinorVersion `codec:"minorVersion" json:"minorVersion"` + Stale bool `codec:"stale" json:"stale"` +} + +func (o UserPlusKeysV2AllIncarnations) DeepCopy() UserPlusKeysV2AllIncarnations { + return UserPlusKeysV2AllIncarnations{ + Current: o.Current.DeepCopy(), + PastIncarnations: (func(x []UserPlusKeysV2) []UserPlusKeysV2 { + if x == nil { + return nil + } + ret := make([]UserPlusKeysV2, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.PastIncarnations), + Uvv: o.Uvv.DeepCopy(), + SeqnoLinkIDs: (func(x map[Seqno]LinkID) map[Seqno]LinkID { + if x == nil { + return nil + } + ret := make(map[Seqno]LinkID, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.SeqnoLinkIDs), + MinorVersion: o.MinorVersion.DeepCopy(), + Stale: o.Stale, + } +} + +type UPAKVersion int + +const ( + UPAKVersion_V1 UPAKVersion = 1 + UPAKVersion_V2 UPAKVersion = 2 +) + +func (o UPAKVersion) DeepCopy() UPAKVersion { return o } + +var UPAKVersionMap = map[string]UPAKVersion{ + "V1": 1, + "V2": 2, +} + +var UPAKVersionRevMap = map[UPAKVersion]string{ + 1: "V1", + 2: "V2", +} + +func (e UPAKVersion) String() string { + if v, ok := UPAKVersionRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +// * What we're storing for each user. At first it was UPAKs, as defined +// * in common.avdl. But going forward, we're going to use UserPlusKeysV2AllIncarnations. +type UPAKVersioned struct { + V__ UPAKVersion `codec:"v" json:"v"` + V1__ *UserPlusAllKeys `codec:"v1,omitempty" json:"v1,omitempty"` + V2__ *UserPlusKeysV2AllIncarnations `codec:"v2,omitempty" json:"v2,omitempty"` +} + +func (o *UPAKVersioned) V() (ret UPAKVersion, err error) { + switch o.V__ { + case UPAKVersion_V1: + if o.V1__ == nil { + err = errors.New("unexpected nil value for V1__") + return ret, err + } + case UPAKVersion_V2: + if o.V2__ == nil { + err = errors.New("unexpected nil value for V2__") + return ret, err + } + } + return o.V__, nil +} + +func (o UPAKVersioned) V1() (res UserPlusAllKeys) { + if o.V__ != UPAKVersion_V1 { + panic("wrong case accessed") + } + if o.V1__ == nil { + return + } + return *o.V1__ +} + +func (o UPAKVersioned) V2() (res UserPlusKeysV2AllIncarnations) { + if o.V__ != UPAKVersion_V2 { + panic("wrong case accessed") + } + if o.V2__ == nil { + return + } + return *o.V2__ +} + +func NewUPAKVersionedWithV1(v UserPlusAllKeys) UPAKVersioned { + return UPAKVersioned{ + V__: UPAKVersion_V1, + V1__: &v, + } +} + +func NewUPAKVersionedWithV2(v UserPlusKeysV2AllIncarnations) UPAKVersioned { + return UPAKVersioned{ + V__: UPAKVersion_V2, + V2__: &v, + } +} + +func (o UPAKVersioned) DeepCopy() UPAKVersioned { + return UPAKVersioned{ + V__: o.V__.DeepCopy(), + V1__: (func(x *UserPlusAllKeys) *UserPlusAllKeys { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V1__), + V2__: (func(x *UserPlusKeysV2AllIncarnations) *UserPlusKeysV2AllIncarnations { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V2__), + } +} + +type UPKLiteMinorVersion int + +const ( + UPKLiteMinorVersion_V0 UPKLiteMinorVersion = 0 +) + +func (o UPKLiteMinorVersion) DeepCopy() UPKLiteMinorVersion { return o } + +var UPKLiteMinorVersionMap = map[string]UPKLiteMinorVersion{ + "V0": 0, +} + +var UPKLiteMinorVersionRevMap = map[UPKLiteMinorVersion]string{ + 0: "V0", +} + +func (e UPKLiteMinorVersion) String() string { + if v, ok := UPKLiteMinorVersionRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UPKLiteV1 struct { + Uid UID `codec:"uid" json:"uid"` + Username string `codec:"username" json:"username"` + EldestSeqno Seqno `codec:"eldestSeqno" json:"eldestSeqno"` + Status StatusCode `codec:"status" json:"status"` + DeviceKeys map[KID]PublicKeyV2NaCl `codec:"deviceKeys" json:"deviceKeys"` + Reset *ResetSummary `codec:"reset,omitempty" json:"reset,omitempty"` +} + +func (o UPKLiteV1) DeepCopy() UPKLiteV1 { + return UPKLiteV1{ + Uid: o.Uid.DeepCopy(), + Username: o.Username, + EldestSeqno: o.EldestSeqno.DeepCopy(), + Status: o.Status.DeepCopy(), + DeviceKeys: (func(x map[KID]PublicKeyV2NaCl) map[KID]PublicKeyV2NaCl { + if x == nil { + return nil + } + ret := make(map[KID]PublicKeyV2NaCl, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.DeviceKeys), + Reset: (func(x *ResetSummary) *ResetSummary { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Reset), + } +} + +type UPKLiteV1AllIncarnations struct { + Current UPKLiteV1 `codec:"current" json:"current"` + PastIncarnations []UPKLiteV1 `codec:"pastIncarnations" json:"pastIncarnations"` + SeqnoLinkIDs map[Seqno]LinkID `codec:"seqnoLinkIDs" json:"seqnoLinkIDs"` + MinorVersion UPKLiteMinorVersion `codec:"minorVersion" json:"minorVersion"` +} + +func (o UPKLiteV1AllIncarnations) DeepCopy() UPKLiteV1AllIncarnations { + return UPKLiteV1AllIncarnations{ + Current: o.Current.DeepCopy(), + PastIncarnations: (func(x []UPKLiteV1) []UPKLiteV1 { + if x == nil { + return nil + } + ret := make([]UPKLiteV1, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.PastIncarnations), + SeqnoLinkIDs: (func(x map[Seqno]LinkID) map[Seqno]LinkID { + if x == nil { + return nil + } + ret := make(map[Seqno]LinkID, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.SeqnoLinkIDs), + MinorVersion: o.MinorVersion.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/user.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/user.go new file mode 100644 index 00000000..47b3ab9b --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/user.go @@ -0,0 +1,587 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/user.avdl + +package keybase1 + +import ( + "fmt" +) + +type TrackProof struct { + ProofType string `codec:"proofType" json:"proofType"` + ProofName string `codec:"proofName" json:"proofName"` + IdString string `codec:"idString" json:"idString"` +} + +func (o TrackProof) DeepCopy() TrackProof { + return TrackProof{ + ProofType: o.ProofType, + ProofName: o.ProofName, + IdString: o.IdString, + } +} + +type WebProof struct { + Hostname string `codec:"hostname" json:"hostname"` + Protocols []string `codec:"protocols" json:"protocols"` +} + +func (o WebProof) DeepCopy() WebProof { + return WebProof{ + Hostname: o.Hostname, + Protocols: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Protocols), + } +} + +type Proofs struct { + Social []TrackProof `codec:"social" json:"social"` + Web []WebProof `codec:"web" json:"web"` + PublicKeys []PublicKey `codec:"publicKeys" json:"publicKeys"` +} + +func (o Proofs) DeepCopy() Proofs { + return Proofs{ + Social: (func(x []TrackProof) []TrackProof { + if x == nil { + return nil + } + ret := make([]TrackProof, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Social), + Web: (func(x []WebProof) []WebProof { + if x == nil { + return nil + } + ret := make([]WebProof, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Web), + PublicKeys: (func(x []PublicKey) []PublicKey { + if x == nil { + return nil + } + ret := make([]PublicKey, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.PublicKeys), + } +} + +type UserSummary struct { + Uid UID `codec:"uid" json:"uid"` + Username string `codec:"username" json:"username"` + Thumbnail string `codec:"thumbnail" json:"thumbnail"` + IdVersion int `codec:"idVersion" json:"idVersion"` + FullName string `codec:"fullName" json:"fullName"` + Bio string `codec:"bio" json:"bio"` + Proofs Proofs `codec:"proofs" json:"proofs"` + SigIDDisplay string `codec:"sigIDDisplay" json:"sigIDDisplay"` + TrackTime Time `codec:"trackTime" json:"trackTime"` +} + +func (o UserSummary) DeepCopy() UserSummary { + return UserSummary{ + Uid: o.Uid.DeepCopy(), + Username: o.Username, + Thumbnail: o.Thumbnail, + IdVersion: o.IdVersion, + FullName: o.FullName, + Bio: o.Bio, + Proofs: o.Proofs.DeepCopy(), + SigIDDisplay: o.SigIDDisplay, + TrackTime: o.TrackTime.DeepCopy(), + } +} + +type EmailAddress string + +func (o EmailAddress) DeepCopy() EmailAddress { + return o +} + +type Email struct { + Email EmailAddress `codec:"email" json:"email"` + IsVerified bool `codec:"isVerified" json:"isVerified"` + IsPrimary bool `codec:"isPrimary" json:"isPrimary"` + Visibility IdentityVisibility `codec:"visibility" json:"visibility"` + LastVerifyEmailDate UnixTime `codec:"lastVerifyEmailDate" json:"lastVerifyEmailDate"` +} + +func (o Email) DeepCopy() Email { + return Email{ + Email: o.Email.DeepCopy(), + IsVerified: o.IsVerified, + IsPrimary: o.IsPrimary, + Visibility: o.Visibility.DeepCopy(), + LastVerifyEmailDate: o.LastVerifyEmailDate.DeepCopy(), + } +} + +type UserSettings struct { + Emails []Email `codec:"emails" json:"emails"` + PhoneNumbers []UserPhoneNumber `codec:"phoneNumbers" json:"phoneNumbers"` +} + +func (o UserSettings) DeepCopy() UserSettings { + return UserSettings{ + Emails: (func(x []Email) []Email { + if x == nil { + return nil + } + ret := make([]Email, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Emails), + PhoneNumbers: (func(x []UserPhoneNumber) []UserPhoneNumber { + if x == nil { + return nil + } + ret := make([]UserPhoneNumber, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.PhoneNumbers), + } +} + +type UserSummary2 struct { + Uid UID `codec:"uid" json:"uid"` + Username string `codec:"username" json:"username"` + Thumbnail string `codec:"thumbnail" json:"thumbnail"` + FullName string `codec:"fullName" json:"fullName"` + IsFollower bool `codec:"isFollower" json:"isFollower"` + IsFollowee bool `codec:"isFollowee" json:"isFollowee"` +} + +func (o UserSummary2) DeepCopy() UserSummary2 { + return UserSummary2{ + Uid: o.Uid.DeepCopy(), + Username: o.Username, + Thumbnail: o.Thumbnail, + FullName: o.FullName, + IsFollower: o.IsFollower, + IsFollowee: o.IsFollowee, + } +} + +type UserSummary2Set struct { + Users []UserSummary2 `codec:"users" json:"users"` + Time Time `codec:"time" json:"time"` + Version int `codec:"version" json:"version"` +} + +func (o UserSummary2Set) DeepCopy() UserSummary2Set { + return UserSummary2Set{ + Users: (func(x []UserSummary2) []UserSummary2 { + if x == nil { + return nil + } + ret := make([]UserSummary2, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Users), + Time: o.Time.DeepCopy(), + Version: o.Version, + } +} + +type InterestingPerson struct { + Uid UID `codec:"uid" json:"uid"` + Username string `codec:"username" json:"username"` + Fullname string `codec:"fullname" json:"fullname"` + ServiceMap map[string]string `codec:"serviceMap" json:"serviceMap"` +} + +func (o InterestingPerson) DeepCopy() InterestingPerson { + return InterestingPerson{ + Uid: o.Uid.DeepCopy(), + Username: o.Username, + Fullname: o.Fullname, + ServiceMap: (func(x map[string]string) map[string]string { + if x == nil { + return nil + } + ret := make(map[string]string, len(x)) + for k, v := range x { + kCopy := k + vCopy := v + ret[kCopy] = vCopy + } + return ret + })(o.ServiceMap), + } +} + +type ProofSuggestionsRes struct { + Suggestions []ProofSuggestion `codec:"suggestions" json:"suggestions"` + ShowMore bool `codec:"showMore" json:"showMore"` +} + +func (o ProofSuggestionsRes) DeepCopy() ProofSuggestionsRes { + return ProofSuggestionsRes{ + Suggestions: (func(x []ProofSuggestion) []ProofSuggestion { + if x == nil { + return nil + } + ret := make([]ProofSuggestion, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Suggestions), + ShowMore: o.ShowMore, + } +} + +type ProofSuggestion struct { + Key string `codec:"key" json:"key"` + BelowFold bool `codec:"belowFold" json:"belowFold"` + ProfileText string `codec:"profileText" json:"profileText"` + ProfileIcon []SizedImage `codec:"profileIcon" json:"profileIcon"` + ProfileIconWhite []SizedImage `codec:"profileIconWhite" json:"profileIconWhite"` + PickerText string `codec:"pickerText" json:"pickerText"` + PickerSubtext string `codec:"pickerSubtext" json:"pickerSubtext"` + PickerIcon []SizedImage `codec:"pickerIcon" json:"pickerIcon"` + Metas []Identify3RowMeta `codec:"metas" json:"metas"` +} + +func (o ProofSuggestion) DeepCopy() ProofSuggestion { + return ProofSuggestion{ + Key: o.Key, + BelowFold: o.BelowFold, + ProfileText: o.ProfileText, + ProfileIcon: (func(x []SizedImage) []SizedImage { + if x == nil { + return nil + } + ret := make([]SizedImage, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ProfileIcon), + ProfileIconWhite: (func(x []SizedImage) []SizedImage { + if x == nil { + return nil + } + ret := make([]SizedImage, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.ProfileIconWhite), + PickerText: o.PickerText, + PickerSubtext: o.PickerSubtext, + PickerIcon: (func(x []SizedImage) []SizedImage { + if x == nil { + return nil + } + ret := make([]SizedImage, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.PickerIcon), + Metas: (func(x []Identify3RowMeta) []Identify3RowMeta { + if x == nil { + return nil + } + ret := make([]Identify3RowMeta, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Metas), + } +} + +type NextMerkleRootRes struct { + Res *MerkleRootV2 `codec:"res,omitempty" json:"res,omitempty"` +} + +func (o NextMerkleRootRes) DeepCopy() NextMerkleRootRes { + return NextMerkleRootRes{ + Res: (func(x *MerkleRootV2) *MerkleRootV2 { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Res), + } +} + +// PassphraseState values are used in .config.json, so should not be changed without a migration strategy +type PassphraseState int + +const ( + PassphraseState_KNOWN PassphraseState = 0 + PassphraseState_RANDOM PassphraseState = 1 +) + +func (o PassphraseState) DeepCopy() PassphraseState { return o } + +var PassphraseStateMap = map[string]PassphraseState{ + "KNOWN": 0, + "RANDOM": 1, +} + +var PassphraseStateRevMap = map[PassphraseState]string{ + 0: "KNOWN", + 1: "RANDOM", +} + +func (e PassphraseState) String() string { + if v, ok := PassphraseStateRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type CanLogoutRes struct { + CanLogout bool `codec:"canLogout" json:"canLogout"` + Reason string `codec:"reason" json:"reason"` + PassphraseState PassphraseState `codec:"passphraseState" json:"passphraseState"` +} + +func (o CanLogoutRes) DeepCopy() CanLogoutRes { + return CanLogoutRes{ + CanLogout: o.CanLogout, + Reason: o.Reason, + PassphraseState: o.PassphraseState.DeepCopy(), + } +} + +type UserPassphraseStateMsg struct { + PassphraseState PassphraseState `codec:"passphraseState" json:"state"` +} + +func (o UserPassphraseStateMsg) DeepCopy() UserPassphraseStateMsg { + return UserPassphraseStateMsg{ + PassphraseState: o.PassphraseState.DeepCopy(), + } +} + +type UserBlockedRow struct { + Uid UID `codec:"uid" json:"block_uid"` + Username string `codec:"username" json:"block_username"` + Chat *bool `codec:"chat,omitempty" json:"chat,omitempty"` + Follow *bool `codec:"follow,omitempty" json:"follow,omitempty"` +} + +func (o UserBlockedRow) DeepCopy() UserBlockedRow { + return UserBlockedRow{ + Uid: o.Uid.DeepCopy(), + Username: o.Username, + Chat: (func(x *bool) *bool { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Chat), + Follow: (func(x *bool) *bool { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Follow), + } +} + +type UserBlockType int + +const ( + UserBlockType_CHAT UserBlockType = 0 + UserBlockType_FOLLOW UserBlockType = 1 +) + +func (o UserBlockType) DeepCopy() UserBlockType { return o } + +var UserBlockTypeMap = map[string]UserBlockType{ + "CHAT": 0, + "FOLLOW": 1, +} + +var UserBlockTypeRevMap = map[UserBlockType]string{ + 0: "CHAT", + 1: "FOLLOW", +} + +func (e UserBlockType) String() string { + if v, ok := UserBlockTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type UserBlockedBody struct { + Blocks []UserBlockedRow `codec:"blocks" json:"blocks"` + Uid UID `codec:"uid" json:"blocker_uid"` + Username string `codec:"username" json:"blocker_username"` +} + +func (o UserBlockedBody) DeepCopy() UserBlockedBody { + return UserBlockedBody{ + Blocks: (func(x []UserBlockedRow) []UserBlockedRow { + if x == nil { + return nil + } + ret := make([]UserBlockedRow, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Blocks), + Uid: o.Uid.DeepCopy(), + Username: o.Username, + } +} + +type UserBlockState struct { + BlockType UserBlockType `codec:"blockType" json:"blockType"` + Blocked bool `codec:"blocked" json:"blocked"` +} + +func (o UserBlockState) DeepCopy() UserBlockState { + return UserBlockState{ + BlockType: o.BlockType.DeepCopy(), + Blocked: o.Blocked, + } +} + +type UserBlockedSummary struct { + Blocker string `codec:"blocker" json:"blocker"` + Blocks map[string][]UserBlockState `codec:"blocks" json:"blocks"` +} + +func (o UserBlockedSummary) DeepCopy() UserBlockedSummary { + return UserBlockedSummary{ + Blocker: o.Blocker, + Blocks: (func(x map[string][]UserBlockState) map[string][]UserBlockState { + if x == nil { + return nil + } + ret := make(map[string][]UserBlockState, len(x)) + for k, v := range x { + kCopy := k + vCopy := (func(x []UserBlockState) []UserBlockState { + if x == nil { + return nil + } + ret := make([]UserBlockState, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(v) + ret[kCopy] = vCopy + } + return ret + })(o.Blocks), + } +} + +type UserBlock struct { + Username string `codec:"username" json:"username"` + ChatBlocked bool `codec:"chatBlocked" json:"chatBlocked"` + FollowBlocked bool `codec:"followBlocked" json:"followBlocked"` + CreateTime *Time `codec:"createTime,omitempty" json:"createTime,omitempty"` + ModifyTime *Time `codec:"modifyTime,omitempty" json:"modifyTime,omitempty"` +} + +func (o UserBlock) DeepCopy() UserBlock { + return UserBlock{ + Username: o.Username, + ChatBlocked: o.ChatBlocked, + FollowBlocked: o.FollowBlocked, + CreateTime: (func(x *Time) *Time { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.CreateTime), + ModifyTime: (func(x *Time) *Time { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ModifyTime), + } +} + +type UserBlockArg struct { + Username string `codec:"username" json:"username"` + SetChatBlock *bool `codec:"setChatBlock,omitempty" json:"setChatBlock,omitempty"` + SetFollowBlock *bool `codec:"setFollowBlock,omitempty" json:"setFollowBlock,omitempty"` +} + +func (o UserBlockArg) DeepCopy() UserBlockArg { + return UserBlockArg{ + Username: o.Username, + SetChatBlock: (func(x *bool) *bool { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.SetChatBlock), + SetFollowBlock: (func(x *bool) *bool { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.SetFollowBlock), + } +} + +type TeamBlock struct { + TeamName string `codec:"teamName" json:"fq_name"` + CreateTime Time `codec:"createTime" json:"ctime"` +} + +func (o TeamBlock) DeepCopy() TeamBlock { + return TeamBlock{ + TeamName: o.TeamName, + CreateTime: o.CreateTime.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/usersearch.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/usersearch.go new file mode 100644 index 00000000..3c66adf0 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1/usersearch.go @@ -0,0 +1,235 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/keybase1/usersearch.avdl + +package keybase1 + +type APIUserServiceID string + +func (o APIUserServiceID) DeepCopy() APIUserServiceID { + return o +} + +type APIUserKeybaseResult struct { + Username string `codec:"username" json:"username"` + Uid UID `codec:"uid" json:"uid"` + PictureUrl *string `codec:"pictureUrl,omitempty" json:"picture_url,omitempty"` + FullName *string `codec:"fullName,omitempty" json:"full_name,omitempty"` + RawScore float64 `codec:"rawScore" json:"raw_score"` + Stellar *string `codec:"stellar,omitempty" json:"stellar,omitempty"` + IsFollowee bool `codec:"isFollowee" json:"is_followee"` +} + +func (o APIUserKeybaseResult) DeepCopy() APIUserKeybaseResult { + return APIUserKeybaseResult{ + Username: o.Username, + Uid: o.Uid.DeepCopy(), + PictureUrl: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.PictureUrl), + FullName: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.FullName), + RawScore: o.RawScore, + Stellar: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Stellar), + IsFollowee: o.IsFollowee, + } +} + +type APIUserServiceResult struct { + ServiceName APIUserServiceID `codec:"serviceName" json:"service_name"` + Username string `codec:"username" json:"username"` + PictureUrl string `codec:"pictureUrl" json:"picture_url"` + Bio string `codec:"bio" json:"bio"` + Location string `codec:"location" json:"location"` + FullName string `codec:"fullName" json:"full_name"` + Confirmed *bool `codec:"confirmed,omitempty" json:"confirmed,omitempty"` +} + +func (o APIUserServiceResult) DeepCopy() APIUserServiceResult { + return APIUserServiceResult{ + ServiceName: o.ServiceName.DeepCopy(), + Username: o.Username, + PictureUrl: o.PictureUrl, + Bio: o.Bio, + Location: o.Location, + FullName: o.FullName, + Confirmed: (func(x *bool) *bool { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Confirmed), + } +} + +type APIUserServiceSummary struct { + ServiceName APIUserServiceID `codec:"serviceName" json:"service_name"` + Username string `codec:"username" json:"username"` +} + +func (o APIUserServiceSummary) DeepCopy() APIUserServiceSummary { + return APIUserServiceSummary{ + ServiceName: o.ServiceName.DeepCopy(), + Username: o.Username, + } +} + +type ImpTofuSearchResult struct { + Assertion string `codec:"assertion" json:"assertion"` + AssertionValue string `codec:"assertionValue" json:"assertionValue"` + AssertionKey string `codec:"assertionKey" json:"assertionKey"` + Label string `codec:"label" json:"label"` + PrettyName string `codec:"prettyName" json:"prettyName"` + KeybaseUsername string `codec:"keybaseUsername" json:"keybaseUsername"` +} + +func (o ImpTofuSearchResult) DeepCopy() ImpTofuSearchResult { + return ImpTofuSearchResult{ + Assertion: o.Assertion, + AssertionValue: o.AssertionValue, + AssertionKey: o.AssertionKey, + Label: o.Label, + PrettyName: o.PrettyName, + KeybaseUsername: o.KeybaseUsername, + } +} + +type APIUserSearchResult struct { + Score float64 `codec:"score" json:"score"` + Keybase *APIUserKeybaseResult `codec:"keybase,omitempty" json:"keybase,omitempty"` + Service *APIUserServiceResult `codec:"service,omitempty" json:"service,omitempty"` + Contact *ProcessedContact `codec:"contact,omitempty" json:"contact,omitempty"` + Imptofu *ImpTofuSearchResult `codec:"imptofu,omitempty" json:"imptofu,omitempty"` + ServicesSummary map[APIUserServiceID]APIUserServiceSummary `codec:"servicesSummary" json:"services_summary"` + RawScore float64 `codec:"rawScore" json:"rawScore"` +} + +func (o APIUserSearchResult) DeepCopy() APIUserSearchResult { + return APIUserSearchResult{ + Score: o.Score, + Keybase: (func(x *APIUserKeybaseResult) *APIUserKeybaseResult { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Keybase), + Service: (func(x *APIUserServiceResult) *APIUserServiceResult { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Service), + Contact: (func(x *ProcessedContact) *ProcessedContact { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Contact), + Imptofu: (func(x *ImpTofuSearchResult) *ImpTofuSearchResult { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Imptofu), + ServicesSummary: (func(x map[APIUserServiceID]APIUserServiceSummary) map[APIUserServiceID]APIUserServiceSummary { + if x == nil { + return nil + } + ret := make(map[APIUserServiceID]APIUserServiceSummary, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.ServicesSummary), + RawScore: o.RawScore, + } +} + +type NonUserDetails struct { + IsNonUser bool `codec:"isNonUser" json:"isNonUser"` + AssertionValue string `codec:"assertionValue" json:"assertionValue"` + AssertionKey string `codec:"assertionKey" json:"assertionKey"` + Description string `codec:"description" json:"description"` + Contact *ProcessedContact `codec:"contact,omitempty" json:"contact,omitempty"` + Service *APIUserServiceResult `codec:"service,omitempty" json:"service,omitempty"` + SiteIcon []SizedImage `codec:"siteIcon" json:"siteIcon"` + SiteIconFull []SizedImage `codec:"siteIconFull" json:"siteIconFull"` + SiteIconWhite []SizedImage `codec:"siteIconWhite" json:"siteIconWhite"` +} + +func (o NonUserDetails) DeepCopy() NonUserDetails { + return NonUserDetails{ + IsNonUser: o.IsNonUser, + AssertionValue: o.AssertionValue, + AssertionKey: o.AssertionKey, + Description: o.Description, + Contact: (func(x *ProcessedContact) *ProcessedContact { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Contact), + Service: (func(x *APIUserServiceResult) *APIUserServiceResult { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Service), + SiteIcon: (func(x []SizedImage) []SizedImage { + if x == nil { + return nil + } + ret := make([]SizedImage, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.SiteIcon), + SiteIconFull: (func(x []SizedImage) []SizedImage { + if x == nil { + return nil + } + ret := make([]SizedImage, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.SiteIconFull), + SiteIconWhite: (func(x []SizedImage) []SizedImage { + if x == nil { + return nil + } + ret := make([]SizedImage, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.SiteIconWhite), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/bundle.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/bundle.go new file mode 100644 index 00000000..d5102ad9 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/bundle.go @@ -0,0 +1,988 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/stellar1/bundle.avdl + +package stellar1 + +import ( + "errors" + "fmt" + + keybase1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1" +) + +type BundleRevision uint64 + +func (o BundleRevision) DeepCopy() BundleRevision { + return o +} + +type EncryptedBundle struct { + V int `codec:"v" json:"v"` + E []byte `codec:"e" json:"e"` + N keybase1.BoxNonce `codec:"n" json:"n"` + Gen keybase1.PerUserKeyGeneration `codec:"gen" json:"gen"` +} + +func (o EncryptedBundle) DeepCopy() EncryptedBundle { + return EncryptedBundle{ + V: o.V, + E: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.E), + N: o.N.DeepCopy(), + Gen: o.Gen.DeepCopy(), + } +} + +type BundleVersion int + +const ( + BundleVersion_V1 BundleVersion = 1 + BundleVersion_V2 BundleVersion = 2 + BundleVersion_V3 BundleVersion = 3 + BundleVersion_V4 BundleVersion = 4 + BundleVersion_V5 BundleVersion = 5 + BundleVersion_V6 BundleVersion = 6 + BundleVersion_V7 BundleVersion = 7 + BundleVersion_V8 BundleVersion = 8 + BundleVersion_V9 BundleVersion = 9 + BundleVersion_V10 BundleVersion = 10 +) + +func (o BundleVersion) DeepCopy() BundleVersion { return o } + +var BundleVersionMap = map[string]BundleVersion{ + "V1": 1, + "V2": 2, + "V3": 3, + "V4": 4, + "V5": 5, + "V6": 6, + "V7": 7, + "V8": 8, + "V9": 9, + "V10": 10, +} + +var BundleVersionRevMap = map[BundleVersion]string{ + 1: "V1", + 2: "V2", + 3: "V3", + 4: "V4", + 5: "V5", + 6: "V6", + 7: "V7", + 8: "V8", + 9: "V9", + 10: "V10", +} + +func (e BundleVersion) String() string { + if v, ok := BundleVersionRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type BundleSecretVersioned struct { + Version__ BundleVersion `codec:"version" json:"version"` + V1__ *BundleSecretUnsupported `codec:"v1,omitempty" json:"v1,omitempty"` + V2__ *BundleSecretV2 `codec:"v2,omitempty" json:"v2,omitempty"` + V3__ *BundleSecretUnsupported `codec:"v3,omitempty" json:"v3,omitempty"` + V4__ *BundleSecretUnsupported `codec:"v4,omitempty" json:"v4,omitempty"` + V5__ *BundleSecretUnsupported `codec:"v5,omitempty" json:"v5,omitempty"` + V6__ *BundleSecretUnsupported `codec:"v6,omitempty" json:"v6,omitempty"` + V7__ *BundleSecretUnsupported `codec:"v7,omitempty" json:"v7,omitempty"` + V8__ *BundleSecretUnsupported `codec:"v8,omitempty" json:"v8,omitempty"` + V9__ *BundleSecretUnsupported `codec:"v9,omitempty" json:"v9,omitempty"` + V10__ *BundleSecretUnsupported `codec:"v10,omitempty" json:"v10,omitempty"` +} + +func (o *BundleSecretVersioned) Version() (ret BundleVersion, err error) { + switch o.Version__ { + case BundleVersion_V1: + if o.V1__ == nil { + err = errors.New("unexpected nil value for V1__") + return ret, err + } + case BundleVersion_V2: + if o.V2__ == nil { + err = errors.New("unexpected nil value for V2__") + return ret, err + } + case BundleVersion_V3: + if o.V3__ == nil { + err = errors.New("unexpected nil value for V3__") + return ret, err + } + case BundleVersion_V4: + if o.V4__ == nil { + err = errors.New("unexpected nil value for V4__") + return ret, err + } + case BundleVersion_V5: + if o.V5__ == nil { + err = errors.New("unexpected nil value for V5__") + return ret, err + } + case BundleVersion_V6: + if o.V6__ == nil { + err = errors.New("unexpected nil value for V6__") + return ret, err + } + case BundleVersion_V7: + if o.V7__ == nil { + err = errors.New("unexpected nil value for V7__") + return ret, err + } + case BundleVersion_V8: + if o.V8__ == nil { + err = errors.New("unexpected nil value for V8__") + return ret, err + } + case BundleVersion_V9: + if o.V9__ == nil { + err = errors.New("unexpected nil value for V9__") + return ret, err + } + case BundleVersion_V10: + if o.V10__ == nil { + err = errors.New("unexpected nil value for V10__") + return ret, err + } + } + return o.Version__, nil +} + +func (o BundleSecretVersioned) V1() (res BundleSecretUnsupported) { + if o.Version__ != BundleVersion_V1 { + panic("wrong case accessed") + } + if o.V1__ == nil { + return + } + return *o.V1__ +} + +func (o BundleSecretVersioned) V2() (res BundleSecretV2) { + if o.Version__ != BundleVersion_V2 { + panic("wrong case accessed") + } + if o.V2__ == nil { + return + } + return *o.V2__ +} + +func (o BundleSecretVersioned) V3() (res BundleSecretUnsupported) { + if o.Version__ != BundleVersion_V3 { + panic("wrong case accessed") + } + if o.V3__ == nil { + return + } + return *o.V3__ +} + +func (o BundleSecretVersioned) V4() (res BundleSecretUnsupported) { + if o.Version__ != BundleVersion_V4 { + panic("wrong case accessed") + } + if o.V4__ == nil { + return + } + return *o.V4__ +} + +func (o BundleSecretVersioned) V5() (res BundleSecretUnsupported) { + if o.Version__ != BundleVersion_V5 { + panic("wrong case accessed") + } + if o.V5__ == nil { + return + } + return *o.V5__ +} + +func (o BundleSecretVersioned) V6() (res BundleSecretUnsupported) { + if o.Version__ != BundleVersion_V6 { + panic("wrong case accessed") + } + if o.V6__ == nil { + return + } + return *o.V6__ +} + +func (o BundleSecretVersioned) V7() (res BundleSecretUnsupported) { + if o.Version__ != BundleVersion_V7 { + panic("wrong case accessed") + } + if o.V7__ == nil { + return + } + return *o.V7__ +} + +func (o BundleSecretVersioned) V8() (res BundleSecretUnsupported) { + if o.Version__ != BundleVersion_V8 { + panic("wrong case accessed") + } + if o.V8__ == nil { + return + } + return *o.V8__ +} + +func (o BundleSecretVersioned) V9() (res BundleSecretUnsupported) { + if o.Version__ != BundleVersion_V9 { + panic("wrong case accessed") + } + if o.V9__ == nil { + return + } + return *o.V9__ +} + +func (o BundleSecretVersioned) V10() (res BundleSecretUnsupported) { + if o.Version__ != BundleVersion_V10 { + panic("wrong case accessed") + } + if o.V10__ == nil { + return + } + return *o.V10__ +} + +func NewBundleSecretVersionedWithV1(v BundleSecretUnsupported) BundleSecretVersioned { + return BundleSecretVersioned{ + Version__: BundleVersion_V1, + V1__: &v, + } +} + +func NewBundleSecretVersionedWithV2(v BundleSecretV2) BundleSecretVersioned { + return BundleSecretVersioned{ + Version__: BundleVersion_V2, + V2__: &v, + } +} + +func NewBundleSecretVersionedWithV3(v BundleSecretUnsupported) BundleSecretVersioned { + return BundleSecretVersioned{ + Version__: BundleVersion_V3, + V3__: &v, + } +} + +func NewBundleSecretVersionedWithV4(v BundleSecretUnsupported) BundleSecretVersioned { + return BundleSecretVersioned{ + Version__: BundleVersion_V4, + V4__: &v, + } +} + +func NewBundleSecretVersionedWithV5(v BundleSecretUnsupported) BundleSecretVersioned { + return BundleSecretVersioned{ + Version__: BundleVersion_V5, + V5__: &v, + } +} + +func NewBundleSecretVersionedWithV6(v BundleSecretUnsupported) BundleSecretVersioned { + return BundleSecretVersioned{ + Version__: BundleVersion_V6, + V6__: &v, + } +} + +func NewBundleSecretVersionedWithV7(v BundleSecretUnsupported) BundleSecretVersioned { + return BundleSecretVersioned{ + Version__: BundleVersion_V7, + V7__: &v, + } +} + +func NewBundleSecretVersionedWithV8(v BundleSecretUnsupported) BundleSecretVersioned { + return BundleSecretVersioned{ + Version__: BundleVersion_V8, + V8__: &v, + } +} + +func NewBundleSecretVersionedWithV9(v BundleSecretUnsupported) BundleSecretVersioned { + return BundleSecretVersioned{ + Version__: BundleVersion_V9, + V9__: &v, + } +} + +func NewBundleSecretVersionedWithV10(v BundleSecretUnsupported) BundleSecretVersioned { + return BundleSecretVersioned{ + Version__: BundleVersion_V10, + V10__: &v, + } +} + +func (o BundleSecretVersioned) DeepCopy() BundleSecretVersioned { + return BundleSecretVersioned{ + Version__: o.Version__.DeepCopy(), + V1__: (func(x *BundleSecretUnsupported) *BundleSecretUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V1__), + V2__: (func(x *BundleSecretV2) *BundleSecretV2 { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V2__), + V3__: (func(x *BundleSecretUnsupported) *BundleSecretUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V3__), + V4__: (func(x *BundleSecretUnsupported) *BundleSecretUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V4__), + V5__: (func(x *BundleSecretUnsupported) *BundleSecretUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V5__), + V6__: (func(x *BundleSecretUnsupported) *BundleSecretUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V6__), + V7__: (func(x *BundleSecretUnsupported) *BundleSecretUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V7__), + V8__: (func(x *BundleSecretUnsupported) *BundleSecretUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V8__), + V9__: (func(x *BundleSecretUnsupported) *BundleSecretUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V9__), + V10__: (func(x *BundleSecretUnsupported) *BundleSecretUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V10__), + } +} + +type BundleVisibleV2 struct { + Revision BundleRevision `codec:"revision" json:"revision"` + Prev Hash `codec:"prev" json:"prev"` + Accounts []BundleVisibleEntryV2 `codec:"accounts" json:"accounts"` +} + +func (o BundleVisibleV2) DeepCopy() BundleVisibleV2 { + return BundleVisibleV2{ + Revision: o.Revision.DeepCopy(), + Prev: o.Prev.DeepCopy(), + Accounts: (func(x []BundleVisibleEntryV2) []BundleVisibleEntryV2 { + if x == nil { + return nil + } + ret := make([]BundleVisibleEntryV2, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Accounts), + } +} + +type BundleSecretV2 struct { + VisibleHash Hash `codec:"visibleHash" json:"visibleHash"` + Accounts []BundleSecretEntryV2 `codec:"accounts" json:"accounts"` +} + +func (o BundleSecretV2) DeepCopy() BundleSecretV2 { + return BundleSecretV2{ + VisibleHash: o.VisibleHash.DeepCopy(), + Accounts: (func(x []BundleSecretEntryV2) []BundleSecretEntryV2 { + if x == nil { + return nil + } + ret := make([]BundleSecretEntryV2, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Accounts), + } +} + +type BundleVisibleEntryV2 struct { + AccountID AccountID `codec:"accountID" json:"accountID"` + Mode AccountMode `codec:"mode" json:"mode"` + IsPrimary bool `codec:"isPrimary" json:"isPrimary"` + AcctBundleRevision BundleRevision `codec:"acctBundleRevision" json:"acctBundleRevision"` + EncAcctBundleHash Hash `codec:"encAcctBundleHash" json:"encAcctBundleHash"` +} + +func (o BundleVisibleEntryV2) DeepCopy() BundleVisibleEntryV2 { + return BundleVisibleEntryV2{ + AccountID: o.AccountID.DeepCopy(), + Mode: o.Mode.DeepCopy(), + IsPrimary: o.IsPrimary, + AcctBundleRevision: o.AcctBundleRevision.DeepCopy(), + EncAcctBundleHash: o.EncAcctBundleHash.DeepCopy(), + } +} + +type BundleSecretEntryV2 struct { + AccountID AccountID `codec:"accountID" json:"accountID"` + Name string `codec:"name" json:"name"` +} + +func (o BundleSecretEntryV2) DeepCopy() BundleSecretEntryV2 { + return BundleSecretEntryV2{ + AccountID: o.AccountID.DeepCopy(), + Name: o.Name, + } +} + +type BundleSecretUnsupported struct { +} + +func (o BundleSecretUnsupported) DeepCopy() BundleSecretUnsupported { + return BundleSecretUnsupported{} +} + +type EncryptedAccountBundle struct { + V int `codec:"v" json:"v"` + E []byte `codec:"e" json:"e"` + N keybase1.BoxNonce `codec:"n" json:"n"` + Gen keybase1.PerUserKeyGeneration `codec:"gen" json:"gen"` +} + +func (o EncryptedAccountBundle) DeepCopy() EncryptedAccountBundle { + return EncryptedAccountBundle{ + V: o.V, + E: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.E), + N: o.N.DeepCopy(), + Gen: o.Gen.DeepCopy(), + } +} + +type AccountBundleVersion int + +const ( + AccountBundleVersion_V1 AccountBundleVersion = 1 + AccountBundleVersion_V2 AccountBundleVersion = 2 + AccountBundleVersion_V3 AccountBundleVersion = 3 + AccountBundleVersion_V4 AccountBundleVersion = 4 + AccountBundleVersion_V5 AccountBundleVersion = 5 + AccountBundleVersion_V6 AccountBundleVersion = 6 + AccountBundleVersion_V7 AccountBundleVersion = 7 + AccountBundleVersion_V8 AccountBundleVersion = 8 + AccountBundleVersion_V9 AccountBundleVersion = 9 + AccountBundleVersion_V10 AccountBundleVersion = 10 +) + +func (o AccountBundleVersion) DeepCopy() AccountBundleVersion { return o } + +var AccountBundleVersionMap = map[string]AccountBundleVersion{ + "V1": 1, + "V2": 2, + "V3": 3, + "V4": 4, + "V5": 5, + "V6": 6, + "V7": 7, + "V8": 8, + "V9": 9, + "V10": 10, +} + +var AccountBundleVersionRevMap = map[AccountBundleVersion]string{ + 1: "V1", + 2: "V2", + 3: "V3", + 4: "V4", + 5: "V5", + 6: "V6", + 7: "V7", + 8: "V8", + 9: "V9", + 10: "V10", +} + +func (e AccountBundleVersion) String() string { + if v, ok := AccountBundleVersionRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type AccountBundleSecretVersioned struct { + Version__ AccountBundleVersion `codec:"version" json:"version"` + V1__ *AccountBundleSecretV1 `codec:"v1,omitempty" json:"v1,omitempty"` + V2__ *AccountBundleSecretUnsupported `codec:"v2,omitempty" json:"v2,omitempty"` + V3__ *AccountBundleSecretUnsupported `codec:"v3,omitempty" json:"v3,omitempty"` + V4__ *AccountBundleSecretUnsupported `codec:"v4,omitempty" json:"v4,omitempty"` + V5__ *AccountBundleSecretUnsupported `codec:"v5,omitempty" json:"v5,omitempty"` + V6__ *AccountBundleSecretUnsupported `codec:"v6,omitempty" json:"v6,omitempty"` + V7__ *AccountBundleSecretUnsupported `codec:"v7,omitempty" json:"v7,omitempty"` + V8__ *AccountBundleSecretUnsupported `codec:"v8,omitempty" json:"v8,omitempty"` + V9__ *AccountBundleSecretUnsupported `codec:"v9,omitempty" json:"v9,omitempty"` + V10__ *AccountBundleSecretUnsupported `codec:"v10,omitempty" json:"v10,omitempty"` +} + +func (o *AccountBundleSecretVersioned) Version() (ret AccountBundleVersion, err error) { + switch o.Version__ { + case AccountBundleVersion_V1: + if o.V1__ == nil { + err = errors.New("unexpected nil value for V1__") + return ret, err + } + case AccountBundleVersion_V2: + if o.V2__ == nil { + err = errors.New("unexpected nil value for V2__") + return ret, err + } + case AccountBundleVersion_V3: + if o.V3__ == nil { + err = errors.New("unexpected nil value for V3__") + return ret, err + } + case AccountBundleVersion_V4: + if o.V4__ == nil { + err = errors.New("unexpected nil value for V4__") + return ret, err + } + case AccountBundleVersion_V5: + if o.V5__ == nil { + err = errors.New("unexpected nil value for V5__") + return ret, err + } + case AccountBundleVersion_V6: + if o.V6__ == nil { + err = errors.New("unexpected nil value for V6__") + return ret, err + } + case AccountBundleVersion_V7: + if o.V7__ == nil { + err = errors.New("unexpected nil value for V7__") + return ret, err + } + case AccountBundleVersion_V8: + if o.V8__ == nil { + err = errors.New("unexpected nil value for V8__") + return ret, err + } + case AccountBundleVersion_V9: + if o.V9__ == nil { + err = errors.New("unexpected nil value for V9__") + return ret, err + } + case AccountBundleVersion_V10: + if o.V10__ == nil { + err = errors.New("unexpected nil value for V10__") + return ret, err + } + } + return o.Version__, nil +} + +func (o AccountBundleSecretVersioned) V1() (res AccountBundleSecretV1) { + if o.Version__ != AccountBundleVersion_V1 { + panic("wrong case accessed") + } + if o.V1__ == nil { + return + } + return *o.V1__ +} + +func (o AccountBundleSecretVersioned) V2() (res AccountBundleSecretUnsupported) { + if o.Version__ != AccountBundleVersion_V2 { + panic("wrong case accessed") + } + if o.V2__ == nil { + return + } + return *o.V2__ +} + +func (o AccountBundleSecretVersioned) V3() (res AccountBundleSecretUnsupported) { + if o.Version__ != AccountBundleVersion_V3 { + panic("wrong case accessed") + } + if o.V3__ == nil { + return + } + return *o.V3__ +} + +func (o AccountBundleSecretVersioned) V4() (res AccountBundleSecretUnsupported) { + if o.Version__ != AccountBundleVersion_V4 { + panic("wrong case accessed") + } + if o.V4__ == nil { + return + } + return *o.V4__ +} + +func (o AccountBundleSecretVersioned) V5() (res AccountBundleSecretUnsupported) { + if o.Version__ != AccountBundleVersion_V5 { + panic("wrong case accessed") + } + if o.V5__ == nil { + return + } + return *o.V5__ +} + +func (o AccountBundleSecretVersioned) V6() (res AccountBundleSecretUnsupported) { + if o.Version__ != AccountBundleVersion_V6 { + panic("wrong case accessed") + } + if o.V6__ == nil { + return + } + return *o.V6__ +} + +func (o AccountBundleSecretVersioned) V7() (res AccountBundleSecretUnsupported) { + if o.Version__ != AccountBundleVersion_V7 { + panic("wrong case accessed") + } + if o.V7__ == nil { + return + } + return *o.V7__ +} + +func (o AccountBundleSecretVersioned) V8() (res AccountBundleSecretUnsupported) { + if o.Version__ != AccountBundleVersion_V8 { + panic("wrong case accessed") + } + if o.V8__ == nil { + return + } + return *o.V8__ +} + +func (o AccountBundleSecretVersioned) V9() (res AccountBundleSecretUnsupported) { + if o.Version__ != AccountBundleVersion_V9 { + panic("wrong case accessed") + } + if o.V9__ == nil { + return + } + return *o.V9__ +} + +func (o AccountBundleSecretVersioned) V10() (res AccountBundleSecretUnsupported) { + if o.Version__ != AccountBundleVersion_V10 { + panic("wrong case accessed") + } + if o.V10__ == nil { + return + } + return *o.V10__ +} + +func NewAccountBundleSecretVersionedWithV1(v AccountBundleSecretV1) AccountBundleSecretVersioned { + return AccountBundleSecretVersioned{ + Version__: AccountBundleVersion_V1, + V1__: &v, + } +} + +func NewAccountBundleSecretVersionedWithV2(v AccountBundleSecretUnsupported) AccountBundleSecretVersioned { + return AccountBundleSecretVersioned{ + Version__: AccountBundleVersion_V2, + V2__: &v, + } +} + +func NewAccountBundleSecretVersionedWithV3(v AccountBundleSecretUnsupported) AccountBundleSecretVersioned { + return AccountBundleSecretVersioned{ + Version__: AccountBundleVersion_V3, + V3__: &v, + } +} + +func NewAccountBundleSecretVersionedWithV4(v AccountBundleSecretUnsupported) AccountBundleSecretVersioned { + return AccountBundleSecretVersioned{ + Version__: AccountBundleVersion_V4, + V4__: &v, + } +} + +func NewAccountBundleSecretVersionedWithV5(v AccountBundleSecretUnsupported) AccountBundleSecretVersioned { + return AccountBundleSecretVersioned{ + Version__: AccountBundleVersion_V5, + V5__: &v, + } +} + +func NewAccountBundleSecretVersionedWithV6(v AccountBundleSecretUnsupported) AccountBundleSecretVersioned { + return AccountBundleSecretVersioned{ + Version__: AccountBundleVersion_V6, + V6__: &v, + } +} + +func NewAccountBundleSecretVersionedWithV7(v AccountBundleSecretUnsupported) AccountBundleSecretVersioned { + return AccountBundleSecretVersioned{ + Version__: AccountBundleVersion_V7, + V7__: &v, + } +} + +func NewAccountBundleSecretVersionedWithV8(v AccountBundleSecretUnsupported) AccountBundleSecretVersioned { + return AccountBundleSecretVersioned{ + Version__: AccountBundleVersion_V8, + V8__: &v, + } +} + +func NewAccountBundleSecretVersionedWithV9(v AccountBundleSecretUnsupported) AccountBundleSecretVersioned { + return AccountBundleSecretVersioned{ + Version__: AccountBundleVersion_V9, + V9__: &v, + } +} + +func NewAccountBundleSecretVersionedWithV10(v AccountBundleSecretUnsupported) AccountBundleSecretVersioned { + return AccountBundleSecretVersioned{ + Version__: AccountBundleVersion_V10, + V10__: &v, + } +} + +func (o AccountBundleSecretVersioned) DeepCopy() AccountBundleSecretVersioned { + return AccountBundleSecretVersioned{ + Version__: o.Version__.DeepCopy(), + V1__: (func(x *AccountBundleSecretV1) *AccountBundleSecretV1 { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V1__), + V2__: (func(x *AccountBundleSecretUnsupported) *AccountBundleSecretUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V2__), + V3__: (func(x *AccountBundleSecretUnsupported) *AccountBundleSecretUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V3__), + V4__: (func(x *AccountBundleSecretUnsupported) *AccountBundleSecretUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V4__), + V5__: (func(x *AccountBundleSecretUnsupported) *AccountBundleSecretUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V5__), + V6__: (func(x *AccountBundleSecretUnsupported) *AccountBundleSecretUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V6__), + V7__: (func(x *AccountBundleSecretUnsupported) *AccountBundleSecretUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V7__), + V8__: (func(x *AccountBundleSecretUnsupported) *AccountBundleSecretUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V8__), + V9__: (func(x *AccountBundleSecretUnsupported) *AccountBundleSecretUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V9__), + V10__: (func(x *AccountBundleSecretUnsupported) *AccountBundleSecretUnsupported { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.V10__), + } +} + +type AccountBundleSecretV1 struct { + AccountID AccountID `codec:"accountID" json:"accountID"` + Signers []SecretKey `codec:"signers" json:"signers"` +} + +func (o AccountBundleSecretV1) DeepCopy() AccountBundleSecretV1 { + return AccountBundleSecretV1{ + AccountID: o.AccountID.DeepCopy(), + Signers: (func(x []SecretKey) []SecretKey { + if x == nil { + return nil + } + ret := make([]SecretKey, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Signers), + } +} + +type AccountBundleSecretUnsupported struct { +} + +func (o AccountBundleSecretUnsupported) DeepCopy() AccountBundleSecretUnsupported { + return AccountBundleSecretUnsupported{} +} + +type Bundle struct { + Revision BundleRevision `codec:"revision" json:"revision"` + Prev Hash `codec:"prev" json:"prev"` + OwnHash Hash `codec:"ownHash" json:"ownHash"` + Accounts []BundleEntry `codec:"accounts" json:"accounts"` + AccountBundles map[AccountID]AccountBundle `codec:"accountBundles" json:"accountBundles"` +} + +func (o Bundle) DeepCopy() Bundle { + return Bundle{ + Revision: o.Revision.DeepCopy(), + Prev: o.Prev.DeepCopy(), + OwnHash: o.OwnHash.DeepCopy(), + Accounts: (func(x []BundleEntry) []BundleEntry { + if x == nil { + return nil + } + ret := make([]BundleEntry, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Accounts), + AccountBundles: (func(x map[AccountID]AccountBundle) map[AccountID]AccountBundle { + if x == nil { + return nil + } + ret := make(map[AccountID]AccountBundle, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.AccountBundles), + } +} + +type BundleEntry struct { + AccountID AccountID `codec:"accountID" json:"accountID"` + Mode AccountMode `codec:"mode" json:"mode"` + IsPrimary bool `codec:"isPrimary" json:"isPrimary"` + Name string `codec:"name" json:"name"` + AcctBundleRevision BundleRevision `codec:"acctBundleRevision" json:"acctBundleRevision"` + EncAcctBundleHash Hash `codec:"encAcctBundleHash" json:"encAcctBundleHash"` +} + +func (o BundleEntry) DeepCopy() BundleEntry { + return BundleEntry{ + AccountID: o.AccountID.DeepCopy(), + Mode: o.Mode.DeepCopy(), + IsPrimary: o.IsPrimary, + Name: o.Name, + AcctBundleRevision: o.AcctBundleRevision.DeepCopy(), + EncAcctBundleHash: o.EncAcctBundleHash.DeepCopy(), + } +} + +type AccountBundle struct { + Prev Hash `codec:"prev" json:"prev"` + OwnHash Hash `codec:"ownHash" json:"ownHash"` + AccountID AccountID `codec:"accountID" json:"accountID"` + Signers []SecretKey `codec:"signers" json:"signers"` +} + +func (o AccountBundle) DeepCopy() AccountBundle { + return AccountBundle{ + Prev: o.Prev.DeepCopy(), + OwnHash: o.OwnHash.DeepCopy(), + AccountID: o.AccountID.DeepCopy(), + Signers: (func(x []SecretKey) []SecretKey { + if x == nil { + return nil + } + ret := make([]SecretKey, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Signers), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/common.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/common.go new file mode 100644 index 00000000..cf49a1d8 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/common.go @@ -0,0 +1,548 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/stellar1/common.avdl + +package stellar1 + +import ( + "fmt" + + keybase1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1" +) + +type AccountID string + +func (o AccountID) DeepCopy() AccountID { + return o +} + +type SecretKey string + +func (o SecretKey) DeepCopy() SecretKey { + return o +} + +type TransactionID string + +func (o TransactionID) DeepCopy() TransactionID { + return o +} + +type PaymentID string + +func (o PaymentID) DeepCopy() PaymentID { + return o +} + +type KeybaseTransactionID string + +func (o KeybaseTransactionID) DeepCopy() KeybaseTransactionID { + return o +} + +type TimeMs int64 + +func (o TimeMs) DeepCopy() TimeMs { + return o +} + +type Hash []byte + +func (o Hash) DeepCopy() Hash { + return (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o) +} + +type KeybaseRequestID string + +func (o KeybaseRequestID) DeepCopy() KeybaseRequestID { + return o +} + +type AssetCode string + +func (o AssetCode) DeepCopy() AssetCode { + return o +} + +type Asset struct { + Type string `codec:"type" json:"type"` + Code string `codec:"code" json:"code"` + Issuer string `codec:"issuer" json:"issuer"` + VerifiedDomain string `codec:"verifiedDomain" json:"verifiedDomain"` + IssuerName string `codec:"issuerName" json:"issuerName"` + Desc string `codec:"desc" json:"desc"` + InfoUrl string `codec:"infoUrl" json:"infoUrl"` + InfoUrlText string `codec:"infoUrlText" json:"infoUrlText"` + ShowDepositButton bool `codec:"showDepositButton" json:"showDepositButton"` + DepositButtonText string `codec:"depositButtonText" json:"depositButtonText"` + ShowWithdrawButton bool `codec:"showWithdrawButton" json:"showWithdrawButton"` + WithdrawButtonText string `codec:"withdrawButtonText" json:"withdrawButtonText"` + WithdrawType string `codec:"withdrawType" json:"withdrawType"` + TransferServer string `codec:"transferServer" json:"transferServer"` + AuthEndpoint string `codec:"authEndpoint" json:"authEndpoint"` + DepositReqAuth bool `codec:"depositReqAuth" json:"depositReqAuth"` + WithdrawReqAuth bool `codec:"withdrawReqAuth" json:"withdrawReqAuth"` +} + +func (o Asset) DeepCopy() Asset { + return Asset{ + Type: o.Type, + Code: o.Code, + Issuer: o.Issuer, + VerifiedDomain: o.VerifiedDomain, + IssuerName: o.IssuerName, + Desc: o.Desc, + InfoUrl: o.InfoUrl, + InfoUrlText: o.InfoUrlText, + ShowDepositButton: o.ShowDepositButton, + DepositButtonText: o.DepositButtonText, + ShowWithdrawButton: o.ShowWithdrawButton, + WithdrawButtonText: o.WithdrawButtonText, + WithdrawType: o.WithdrawType, + TransferServer: o.TransferServer, + AuthEndpoint: o.AuthEndpoint, + DepositReqAuth: o.DepositReqAuth, + WithdrawReqAuth: o.WithdrawReqAuth, + } +} + +type AssetListResult struct { + Assets []Asset `codec:"assets" json:"assets"` + TotalCount int `codec:"totalCount" json:"totalCount"` +} + +func (o AssetListResult) DeepCopy() AssetListResult { + return AssetListResult{ + Assets: (func(x []Asset) []Asset { + if x == nil { + return nil + } + ret := make([]Asset, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Assets), + TotalCount: o.TotalCount, + } +} + +type Balance struct { + Asset Asset `codec:"asset" json:"asset"` + Amount string `codec:"amount" json:"amount"` + Limit string `codec:"limit" json:"limit"` + IsAuthorized bool `codec:"isAuthorized" json:"isAuthorized"` +} + +func (o Balance) DeepCopy() Balance { + return Balance{ + Asset: o.Asset.DeepCopy(), + Amount: o.Amount, + Limit: o.Limit, + IsAuthorized: o.IsAuthorized, + } +} + +type AccountReserve struct { + Amount string `codec:"amount" json:"amount"` + Description string `codec:"description" json:"description"` +} + +func (o AccountReserve) DeepCopy() AccountReserve { + return AccountReserve{ + Amount: o.Amount, + Description: o.Description, + } +} + +type TransactionStatus int + +const ( + TransactionStatus_NONE TransactionStatus = 0 + TransactionStatus_PENDING TransactionStatus = 1 + TransactionStatus_SUCCESS TransactionStatus = 2 + TransactionStatus_ERROR_TRANSIENT TransactionStatus = 3 + TransactionStatus_ERROR_PERMANENT TransactionStatus = 4 +) + +func (o TransactionStatus) DeepCopy() TransactionStatus { return o } + +var TransactionStatusMap = map[string]TransactionStatus{ + "NONE": 0, + "PENDING": 1, + "SUCCESS": 2, + "ERROR_TRANSIENT": 3, + "ERROR_PERMANENT": 4, +} + +var TransactionStatusRevMap = map[TransactionStatus]string{ + 0: "NONE", + 1: "PENDING", + 2: "SUCCESS", + 3: "ERROR_TRANSIENT", + 4: "ERROR_PERMANENT", +} + +func (e TransactionStatus) String() string { + if v, ok := TransactionStatusRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type RequestStatus int + +const ( + RequestStatus_OK RequestStatus = 0 + RequestStatus_CANCELED RequestStatus = 1 + RequestStatus_DONE RequestStatus = 2 +) + +func (o RequestStatus) DeepCopy() RequestStatus { return o } + +var RequestStatusMap = map[string]RequestStatus{ + "OK": 0, + "CANCELED": 1, + "DONE": 2, +} + +var RequestStatusRevMap = map[RequestStatus]string{ + 0: "OK", + 1: "CANCELED", + 2: "DONE", +} + +func (e RequestStatus) String() string { + if v, ok := RequestStatusRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type PaymentStrategy int + +const ( + PaymentStrategy_NONE PaymentStrategy = 0 + PaymentStrategy_DIRECT PaymentStrategy = 1 + PaymentStrategy_RELAY PaymentStrategy = 2 +) + +func (o PaymentStrategy) DeepCopy() PaymentStrategy { return o } + +var PaymentStrategyMap = map[string]PaymentStrategy{ + "NONE": 0, + "DIRECT": 1, + "RELAY": 2, +} + +var PaymentStrategyRevMap = map[PaymentStrategy]string{ + 0: "NONE", + 1: "DIRECT", + 2: "RELAY", +} + +func (e PaymentStrategy) String() string { + if v, ok := PaymentStrategyRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type RelayDirection int + +const ( + RelayDirection_CLAIM RelayDirection = 0 + RelayDirection_YANK RelayDirection = 1 +) + +func (o RelayDirection) DeepCopy() RelayDirection { return o } + +var RelayDirectionMap = map[string]RelayDirection{ + "CLAIM": 0, + "YANK": 1, +} + +var RelayDirectionRevMap = map[RelayDirection]string{ + 0: "CLAIM", + 1: "YANK", +} + +func (e RelayDirection) String() string { + if v, ok := RelayDirectionRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type PaymentResult struct { + SenderAccountID AccountID `codec:"senderAccountID" json:"senderAccountID"` + KeybaseID KeybaseTransactionID `codec:"keybaseID" json:"keybaseID"` + StellarID TransactionID `codec:"stellarID" json:"stellarID"` + Pending bool `codec:"pending" json:"pending"` +} + +func (o PaymentResult) DeepCopy() PaymentResult { + return PaymentResult{ + SenderAccountID: o.SenderAccountID.DeepCopy(), + KeybaseID: o.KeybaseID.DeepCopy(), + StellarID: o.StellarID.DeepCopy(), + Pending: o.Pending, + } +} + +type RelayClaimResult struct { + ClaimStellarID TransactionID `codec:"claimStellarID" json:"claimStellarID"` +} + +func (o RelayClaimResult) DeepCopy() RelayClaimResult { + return RelayClaimResult{ + ClaimStellarID: o.ClaimStellarID.DeepCopy(), + } +} + +type EncryptedNote struct { + V int `codec:"v" json:"v"` + E []byte `codec:"e" json:"e"` + N keybase1.BoxNonce `codec:"n" json:"n"` + Sender NoteRecipient `codec:"sender" json:"sender"` + Recipient *NoteRecipient `codec:"recipient,omitempty" json:"recipient,omitempty"` +} + +func (o EncryptedNote) DeepCopy() EncryptedNote { + return EncryptedNote{ + V: o.V, + E: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.E), + N: o.N.DeepCopy(), + Sender: o.Sender.DeepCopy(), + Recipient: (func(x *NoteRecipient) *NoteRecipient { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Recipient), + } +} + +type NoteRecipient struct { + User keybase1.UserVersion `codec:"user" json:"user"` + PukGen keybase1.PerUserKeyGeneration `codec:"pukGen" json:"pukGen"` +} + +func (o NoteRecipient) DeepCopy() NoteRecipient { + return NoteRecipient{ + User: o.User.DeepCopy(), + PukGen: o.PukGen.DeepCopy(), + } +} + +type NoteContents struct { + Note string `codec:"note" json:"note"` + StellarID TransactionID `codec:"stellarID" json:"stellarID"` +} + +func (o NoteContents) DeepCopy() NoteContents { + return NoteContents{ + Note: o.Note, + StellarID: o.StellarID.DeepCopy(), + } +} + +type EncryptedRelaySecret struct { + V int `codec:"v" json:"v"` + E []byte `codec:"e" json:"e"` + N keybase1.BoxNonce `codec:"n" json:"n"` + Gen keybase1.PerTeamKeyGeneration `codec:"gen" json:"gen"` +} + +func (o EncryptedRelaySecret) DeepCopy() EncryptedRelaySecret { + return EncryptedRelaySecret{ + V: o.V, + E: (func(x []byte) []byte { + if x == nil { + return nil + } + return append([]byte{}, x...) + })(o.E), + N: o.N.DeepCopy(), + Gen: o.Gen.DeepCopy(), + } +} + +type RelayContents struct { + StellarID TransactionID `codec:"stellarID" json:"stellarID"` + Sk SecretKey `codec:"sk" json:"sk"` + Note string `codec:"note" json:"note"` +} + +func (o RelayContents) DeepCopy() RelayContents { + return RelayContents{ + StellarID: o.StellarID.DeepCopy(), + Sk: o.Sk.DeepCopy(), + Note: o.Note, + } +} + +type OutsideCurrencyCode string + +func (o OutsideCurrencyCode) DeepCopy() OutsideCurrencyCode { + return o +} + +type OutsideExchangeRate struct { + Currency OutsideCurrencyCode `codec:"currency" json:"currency"` + Rate string `codec:"rate" json:"rate"` +} + +func (o OutsideExchangeRate) DeepCopy() OutsideExchangeRate { + return OutsideExchangeRate{ + Currency: o.Currency.DeepCopy(), + Rate: o.Rate, + } +} + +type CurrencySymbol struct { + Symbol string `codec:"symbol" json:"str"` + Ambigious bool `codec:"ambigious" json:"ambigious"` + Postfix bool `codec:"postfix" json:"postfix"` +} + +func (o CurrencySymbol) DeepCopy() CurrencySymbol { + return CurrencySymbol{ + Symbol: o.Symbol, + Ambigious: o.Ambigious, + Postfix: o.Postfix, + } +} + +type OutsideCurrencyDefinition struct { + Name string `codec:"name" json:"name"` + Symbol CurrencySymbol `codec:"symbol" json:"symbol"` +} + +func (o OutsideCurrencyDefinition) DeepCopy() OutsideCurrencyDefinition { + return OutsideCurrencyDefinition{ + Name: o.Name, + Symbol: o.Symbol.DeepCopy(), + } +} + +type StellarServerDefinitions struct { + Revision int `codec:"revision" json:"revision"` + Currencies map[OutsideCurrencyCode]OutsideCurrencyDefinition `codec:"currencies" json:"currencies"` +} + +func (o StellarServerDefinitions) DeepCopy() StellarServerDefinitions { + return StellarServerDefinitions{ + Revision: o.Revision, + Currencies: (func(x map[OutsideCurrencyCode]OutsideCurrencyDefinition) map[OutsideCurrencyCode]OutsideCurrencyDefinition { + if x == nil { + return nil + } + ret := make(map[OutsideCurrencyCode]OutsideCurrencyDefinition, len(x)) + for k, v := range x { + kCopy := k.DeepCopy() + vCopy := v.DeepCopy() + ret[kCopy] = vCopy + } + return ret + })(o.Currencies), + } +} + +type PageCursor struct { + HorizonCursor string `codec:"horizonCursor" json:"horizonCursor"` + DirectCursor string `codec:"directCursor" json:"directCursor"` + RelayCursor string `codec:"relayCursor" json:"relayCursor"` +} + +func (o PageCursor) DeepCopy() PageCursor { + return PageCursor{ + HorizonCursor: o.HorizonCursor, + DirectCursor: o.DirectCursor, + RelayCursor: o.RelayCursor, + } +} + +type AccountMode int + +const ( + AccountMode_NONE AccountMode = 0 + AccountMode_USER AccountMode = 1 + AccountMode_MOBILE AccountMode = 2 +) + +func (o AccountMode) DeepCopy() AccountMode { return o } + +var AccountModeMap = map[string]AccountMode{ + "NONE": 0, + "USER": 1, + "MOBILE": 2, +} + +var AccountModeRevMap = map[AccountMode]string{ + 0: "NONE", + 1: "USER", + 2: "MOBILE", +} + +func (e AccountMode) String() string { + if v, ok := AccountModeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type Trustline struct { + AssetCode AssetCode `codec:"assetCode" json:"assetCode"` + Issuer AccountID `codec:"issuer" json:"issuer"` +} + +func (o Trustline) DeepCopy() Trustline { + return Trustline{ + AssetCode: o.AssetCode.DeepCopy(), + Issuer: o.Issuer.DeepCopy(), + } +} + +type PaymentPath struct { + SourceAmount string `codec:"sourceAmount" json:"sourceAmount"` + SourceAmountMax string `codec:"sourceAmountMax" json:"sourceAmountMax"` + SourceAsset Asset `codec:"sourceAsset" json:"sourceAsset"` + Path []Asset `codec:"path" json:"path"` + DestinationAmount string `codec:"destinationAmount" json:"destinationAmount"` + DestinationAsset Asset `codec:"destinationAsset" json:"destinationAsset"` + SourceInsufficientBalance string `codec:"sourceInsufficientBalance" json:"sourceInsufficientBalance"` +} + +func (o PaymentPath) DeepCopy() PaymentPath { + return PaymentPath{ + SourceAmount: o.SourceAmount, + SourceAmountMax: o.SourceAmountMax, + SourceAsset: o.SourceAsset.DeepCopy(), + Path: (func(x []Asset) []Asset { + if x == nil { + return nil + } + ret := make([]Asset, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Path), + DestinationAmount: o.DestinationAmount, + DestinationAsset: o.DestinationAsset.DeepCopy(), + SourceInsufficientBalance: o.SourceInsufficientBalance, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/gregor.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/gregor.go new file mode 100644 index 00000000..bcdf8592 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/gregor.go @@ -0,0 +1,40 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/stellar1/gregor.avdl + +package stellar1 + +type PaymentStatusMsg struct { + AccountID AccountID `codec:"accountID" json:"accountID"` + KbTxID KeybaseTransactionID `codec:"kbTxID" json:"kbTxID"` + TxID TransactionID `codec:"txID" json:"txID"` +} + +func (o PaymentStatusMsg) DeepCopy() PaymentStatusMsg { + return PaymentStatusMsg{ + AccountID: o.AccountID.DeepCopy(), + KbTxID: o.KbTxID.DeepCopy(), + TxID: o.TxID.DeepCopy(), + } +} + +type RequestStatusMsg struct { + ReqID KeybaseRequestID `codec:"reqID" json:"reqID"` +} + +func (o RequestStatusMsg) DeepCopy() RequestStatusMsg { + return RequestStatusMsg{ + ReqID: o.ReqID.DeepCopy(), + } +} + +type PaymentNotificationMsg struct { + AccountID AccountID `codec:"accountID" json:"accountID"` + PaymentID PaymentID `codec:"paymentID" json:"paymentID"` +} + +func (o PaymentNotificationMsg) DeepCopy() PaymentNotificationMsg { + return PaymentNotificationMsg{ + AccountID: o.AccountID.DeepCopy(), + PaymentID: o.PaymentID.DeepCopy(), + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/local.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/local.go new file mode 100644 index 00000000..ec474d28 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/local.go @@ -0,0 +1,1311 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/stellar1/local.avdl + +package stellar1 + +import ( + "fmt" +) + +type WalletAccountLocal struct { + AccountID AccountID `codec:"accountID" json:"accountID"` + IsDefault bool `codec:"isDefault" json:"isDefault"` + Name string `codec:"name" json:"name"` + BalanceDescription string `codec:"balanceDescription" json:"balanceDescription"` + Seqno string `codec:"seqno" json:"seqno"` + CurrencyLocal CurrencyLocal `codec:"currencyLocal" json:"currencyLocal"` + AccountMode AccountMode `codec:"accountMode" json:"accountMode"` + AccountModeEditable bool `codec:"accountModeEditable" json:"accountModeEditable"` + DeviceReadOnly bool `codec:"deviceReadOnly" json:"deviceReadOnly"` + IsFunded bool `codec:"isFunded" json:"isFunded"` + CanSubmitTx bool `codec:"canSubmitTx" json:"canSubmitTx"` + CanAddTrustline bool `codec:"canAddTrustline" json:"canAddTrustline"` +} + +func (o WalletAccountLocal) DeepCopy() WalletAccountLocal { + return WalletAccountLocal{ + AccountID: o.AccountID.DeepCopy(), + IsDefault: o.IsDefault, + Name: o.Name, + BalanceDescription: o.BalanceDescription, + Seqno: o.Seqno, + CurrencyLocal: o.CurrencyLocal.DeepCopy(), + AccountMode: o.AccountMode.DeepCopy(), + AccountModeEditable: o.AccountModeEditable, + DeviceReadOnly: o.DeviceReadOnly, + IsFunded: o.IsFunded, + CanSubmitTx: o.CanSubmitTx, + CanAddTrustline: o.CanAddTrustline, + } +} + +type AccountAssetLocal struct { + Name string `codec:"name" json:"name"` + AssetCode string `codec:"assetCode" json:"assetCode"` + IssuerName string `codec:"issuerName" json:"issuerName"` + IssuerAccountID string `codec:"issuerAccountID" json:"issuerAccountID"` + IssuerVerifiedDomain string `codec:"issuerVerifiedDomain" json:"issuerVerifiedDomain"` + BalanceTotal string `codec:"balanceTotal" json:"balanceTotal"` + BalanceAvailableToSend string `codec:"balanceAvailableToSend" json:"balanceAvailableToSend"` + WorthCurrency string `codec:"worthCurrency" json:"worthCurrency"` + Worth string `codec:"worth" json:"worth"` + AvailableToSendWorth string `codec:"availableToSendWorth" json:"availableToSendWorth"` + Reserves []AccountReserve `codec:"reserves" json:"reserves"` + Desc string `codec:"desc" json:"desc"` + InfoUrl string `codec:"infoUrl" json:"infoUrl"` + InfoUrlText string `codec:"infoUrlText" json:"infoUrlText"` + ShowDepositButton bool `codec:"showDepositButton" json:"showDepositButton"` + DepositButtonText string `codec:"depositButtonText" json:"depositButtonText"` + ShowWithdrawButton bool `codec:"showWithdrawButton" json:"showWithdrawButton"` + WithdrawButtonText string `codec:"withdrawButtonText" json:"withdrawButtonText"` +} + +func (o AccountAssetLocal) DeepCopy() AccountAssetLocal { + return AccountAssetLocal{ + Name: o.Name, + AssetCode: o.AssetCode, + IssuerName: o.IssuerName, + IssuerAccountID: o.IssuerAccountID, + IssuerVerifiedDomain: o.IssuerVerifiedDomain, + BalanceTotal: o.BalanceTotal, + BalanceAvailableToSend: o.BalanceAvailableToSend, + WorthCurrency: o.WorthCurrency, + Worth: o.Worth, + AvailableToSendWorth: o.AvailableToSendWorth, + Reserves: (func(x []AccountReserve) []AccountReserve { + if x == nil { + return nil + } + ret := make([]AccountReserve, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Reserves), + Desc: o.Desc, + InfoUrl: o.InfoUrl, + InfoUrlText: o.InfoUrlText, + ShowDepositButton: o.ShowDepositButton, + DepositButtonText: o.DepositButtonText, + ShowWithdrawButton: o.ShowWithdrawButton, + WithdrawButtonText: o.WithdrawButtonText, + } +} + +type BalanceDelta int + +const ( + BalanceDelta_NONE BalanceDelta = 0 + BalanceDelta_INCREASE BalanceDelta = 1 + BalanceDelta_DECREASE BalanceDelta = 2 +) + +func (o BalanceDelta) DeepCopy() BalanceDelta { return o } + +var BalanceDeltaMap = map[string]BalanceDelta{ + "NONE": 0, + "INCREASE": 1, + "DECREASE": 2, +} + +var BalanceDeltaRevMap = map[BalanceDelta]string{ + 0: "NONE", + 1: "INCREASE", + 2: "DECREASE", +} + +func (e BalanceDelta) String() string { + if v, ok := BalanceDeltaRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type PaymentStatus int + +const ( + PaymentStatus_NONE PaymentStatus = 0 + PaymentStatus_PENDING PaymentStatus = 1 + PaymentStatus_CLAIMABLE PaymentStatus = 2 + PaymentStatus_COMPLETED PaymentStatus = 3 + PaymentStatus_ERROR PaymentStatus = 4 + PaymentStatus_UNKNOWN PaymentStatus = 5 + PaymentStatus_CANCELED PaymentStatus = 6 +) + +func (o PaymentStatus) DeepCopy() PaymentStatus { return o } + +var PaymentStatusMap = map[string]PaymentStatus{ + "NONE": 0, + "PENDING": 1, + "CLAIMABLE": 2, + "COMPLETED": 3, + "ERROR": 4, + "UNKNOWN": 5, + "CANCELED": 6, +} + +var PaymentStatusRevMap = map[PaymentStatus]string{ + 0: "NONE", + 1: "PENDING", + 2: "CLAIMABLE", + 3: "COMPLETED", + 4: "ERROR", + 5: "UNKNOWN", + 6: "CANCELED", +} + +func (e PaymentStatus) String() string { + if v, ok := PaymentStatusRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type ParticipantType int + +const ( + ParticipantType_NONE ParticipantType = 0 + ParticipantType_KEYBASE ParticipantType = 1 + ParticipantType_STELLAR ParticipantType = 2 + ParticipantType_SBS ParticipantType = 3 + ParticipantType_OWNACCOUNT ParticipantType = 4 +) + +func (o ParticipantType) DeepCopy() ParticipantType { return o } + +var ParticipantTypeMap = map[string]ParticipantType{ + "NONE": 0, + "KEYBASE": 1, + "STELLAR": 2, + "SBS": 3, + "OWNACCOUNT": 4, +} + +var ParticipantTypeRevMap = map[ParticipantType]string{ + 0: "NONE", + 1: "KEYBASE", + 2: "STELLAR", + 3: "SBS", + 4: "OWNACCOUNT", +} + +func (e ParticipantType) String() string { + if v, ok := ParticipantTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type PaymentOrErrorLocal struct { + Payment *PaymentLocal `codec:"payment,omitempty" json:"payment,omitempty"` + Err *string `codec:"err,omitempty" json:"err,omitempty"` +} + +func (o PaymentOrErrorLocal) DeepCopy() PaymentOrErrorLocal { + return PaymentOrErrorLocal{ + Payment: (func(x *PaymentLocal) *PaymentLocal { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Payment), + Err: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Err), + } +} + +type PaymentsPageLocal struct { + Payments []PaymentOrErrorLocal `codec:"payments" json:"payments"` + Cursor *PageCursor `codec:"cursor,omitempty" json:"cursor,omitempty"` + OldestUnread *PaymentID `codec:"oldestUnread,omitempty" json:"oldestUnread,omitempty"` +} + +func (o PaymentsPageLocal) DeepCopy() PaymentsPageLocal { + return PaymentsPageLocal{ + Payments: (func(x []PaymentOrErrorLocal) []PaymentOrErrorLocal { + if x == nil { + return nil + } + ret := make([]PaymentOrErrorLocal, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Payments), + Cursor: (func(x *PageCursor) *PageCursor { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Cursor), + OldestUnread: (func(x *PaymentID) *PaymentID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.OldestUnread), + } +} + +type PaymentLocal struct { + Id PaymentID `codec:"id" json:"id"` + TxID TransactionID `codec:"txID" json:"txID"` + Time TimeMs `codec:"time" json:"time"` + StatusSimplified PaymentStatus `codec:"statusSimplified" json:"statusSimplified"` + StatusDescription string `codec:"statusDescription" json:"statusDescription"` + StatusDetail string `codec:"statusDetail" json:"statusDetail"` + ShowCancel bool `codec:"showCancel" json:"showCancel"` + AmountDescription string `codec:"amountDescription" json:"amountDescription"` + Delta BalanceDelta `codec:"delta" json:"delta"` + Worth string `codec:"worth" json:"worth"` + WorthAtSendTime string `codec:"worthAtSendTime" json:"worthAtSendTime"` + IssuerDescription string `codec:"issuerDescription" json:"issuerDescription"` + IssuerAccountID *AccountID `codec:"issuerAccountID,omitempty" json:"issuerAccountID,omitempty"` + FromType ParticipantType `codec:"fromType" json:"fromType"` + ToType ParticipantType `codec:"toType" json:"toType"` + AssetCode string `codec:"assetCode" json:"assetCode"` + FromAccountID AccountID `codec:"fromAccountID" json:"fromAccountID"` + FromAccountName string `codec:"fromAccountName" json:"fromAccountName"` + FromUsername string `codec:"fromUsername" json:"fromUsername"` + ToAccountID *AccountID `codec:"toAccountID,omitempty" json:"toAccountID,omitempty"` + ToAccountName string `codec:"toAccountName" json:"toAccountName"` + ToUsername string `codec:"toUsername" json:"toUsername"` + ToAssertion string `codec:"toAssertion" json:"toAssertion"` + OriginalToAssertion string `codec:"originalToAssertion" json:"originalToAssertion"` + Note string `codec:"note" json:"note"` + NoteErr string `codec:"noteErr" json:"noteErr"` + SourceAmountMax string `codec:"sourceAmountMax" json:"sourceAmountMax"` + SourceAmountActual string `codec:"sourceAmountActual" json:"sourceAmountActual"` + SourceAsset Asset `codec:"sourceAsset" json:"sourceAsset"` + SourceConvRate string `codec:"sourceConvRate" json:"sourceConvRate"` + IsAdvanced bool `codec:"isAdvanced" json:"isAdvanced"` + SummaryAdvanced string `codec:"summaryAdvanced" json:"summaryAdvanced"` + Operations []string `codec:"operations" json:"operations"` + Unread bool `codec:"unread" json:"unread"` + BatchID string `codec:"batchID" json:"batchID"` + FromAirdrop bool `codec:"fromAirdrop" json:"fromAirdrop"` + IsInflation bool `codec:"isInflation" json:"isInflation"` + InflationSource *string `codec:"inflationSource,omitempty" json:"inflationSource,omitempty"` + Trustline *PaymentTrustlineLocal `codec:"trustline,omitempty" json:"trustline,omitempty"` +} + +func (o PaymentLocal) DeepCopy() PaymentLocal { + return PaymentLocal{ + Id: o.Id.DeepCopy(), + TxID: o.TxID.DeepCopy(), + Time: o.Time.DeepCopy(), + StatusSimplified: o.StatusSimplified.DeepCopy(), + StatusDescription: o.StatusDescription, + StatusDetail: o.StatusDetail, + ShowCancel: o.ShowCancel, + AmountDescription: o.AmountDescription, + Delta: o.Delta.DeepCopy(), + Worth: o.Worth, + WorthAtSendTime: o.WorthAtSendTime, + IssuerDescription: o.IssuerDescription, + IssuerAccountID: (func(x *AccountID) *AccountID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.IssuerAccountID), + FromType: o.FromType.DeepCopy(), + ToType: o.ToType.DeepCopy(), + AssetCode: o.AssetCode, + FromAccountID: o.FromAccountID.DeepCopy(), + FromAccountName: o.FromAccountName, + FromUsername: o.FromUsername, + ToAccountID: (func(x *AccountID) *AccountID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ToAccountID), + ToAccountName: o.ToAccountName, + ToUsername: o.ToUsername, + ToAssertion: o.ToAssertion, + OriginalToAssertion: o.OriginalToAssertion, + Note: o.Note, + NoteErr: o.NoteErr, + SourceAmountMax: o.SourceAmountMax, + SourceAmountActual: o.SourceAmountActual, + SourceAsset: o.SourceAsset.DeepCopy(), + SourceConvRate: o.SourceConvRate, + IsAdvanced: o.IsAdvanced, + SummaryAdvanced: o.SummaryAdvanced, + Operations: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Operations), + Unread: o.Unread, + BatchID: o.BatchID, + FromAirdrop: o.FromAirdrop, + IsInflation: o.IsInflation, + InflationSource: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.InflationSource), + Trustline: (func(x *PaymentTrustlineLocal) *PaymentTrustlineLocal { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Trustline), + } +} + +type PaymentDetailsLocal struct { + Summary PaymentLocal `codec:"summary" json:"summary"` + Details PaymentDetailsOnlyLocal `codec:"details" json:"details"` +} + +func (o PaymentDetailsLocal) DeepCopy() PaymentDetailsLocal { + return PaymentDetailsLocal{ + Summary: o.Summary.DeepCopy(), + Details: o.Details.DeepCopy(), + } +} + +type PaymentDetailsOnlyLocal struct { + PublicNote string `codec:"publicNote" json:"publicNote"` + PublicNoteType string `codec:"publicNoteType" json:"publicNoteType"` + ExternalTxURL string `codec:"externalTxURL" json:"externalTxURL"` + FeeChargedDescription string `codec:"feeChargedDescription" json:"feeChargedDescription"` + PathIntermediate []Asset `codec:"pathIntermediate" json:"pathIntermediate"` +} + +func (o PaymentDetailsOnlyLocal) DeepCopy() PaymentDetailsOnlyLocal { + return PaymentDetailsOnlyLocal{ + PublicNote: o.PublicNote, + PublicNoteType: o.PublicNoteType, + ExternalTxURL: o.ExternalTxURL, + FeeChargedDescription: o.FeeChargedDescription, + PathIntermediate: (func(x []Asset) []Asset { + if x == nil { + return nil + } + ret := make([]Asset, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.PathIntermediate), + } +} + +type PaymentTrustlineLocal struct { + Asset Asset `codec:"asset" json:"asset"` + Remove bool `codec:"remove" json:"remove"` +} + +func (o PaymentTrustlineLocal) DeepCopy() PaymentTrustlineLocal { + return PaymentTrustlineLocal{ + Asset: o.Asset.DeepCopy(), + Remove: o.Remove, + } +} + +type CurrencyLocal struct { + Description string `codec:"description" json:"description"` + Code OutsideCurrencyCode `codec:"code" json:"code"` + Symbol string `codec:"symbol" json:"symbol"` + Name string `codec:"name" json:"name"` +} + +func (o CurrencyLocal) DeepCopy() CurrencyLocal { + return CurrencyLocal{ + Description: o.Description, + Code: o.Code.DeepCopy(), + Symbol: o.Symbol, + Name: o.Name, + } +} + +type SendAssetChoiceLocal struct { + Asset Asset `codec:"asset" json:"asset"` + Enabled bool `codec:"enabled" json:"enabled"` + Left string `codec:"left" json:"left"` + Right string `codec:"right" json:"right"` + Subtext string `codec:"subtext" json:"subtext"` +} + +func (o SendAssetChoiceLocal) DeepCopy() SendAssetChoiceLocal { + return SendAssetChoiceLocal{ + Asset: o.Asset.DeepCopy(), + Enabled: o.Enabled, + Left: o.Left, + Right: o.Right, + Subtext: o.Subtext, + } +} + +type BuildPaymentID string + +func (o BuildPaymentID) DeepCopy() BuildPaymentID { + return o +} + +type BuildPaymentResLocal struct { + ReadyToReview bool `codec:"readyToReview" json:"readyToReview"` + From AccountID `codec:"from" json:"from"` + ToErrMsg string `codec:"toErrMsg" json:"toErrMsg"` + AmountErrMsg string `codec:"amountErrMsg" json:"amountErrMsg"` + SecretNoteErrMsg string `codec:"secretNoteErrMsg" json:"secretNoteErrMsg"` + PublicMemoErrMsg string `codec:"publicMemoErrMsg" json:"publicMemoErrMsg"` + PublicMemoOverride string `codec:"publicMemoOverride" json:"publicMemoOverride"` + WorthDescription string `codec:"worthDescription" json:"worthDescription"` + WorthInfo string `codec:"worthInfo" json:"worthInfo"` + WorthAmount string `codec:"worthAmount" json:"worthAmount"` + WorthCurrency string `codec:"worthCurrency" json:"worthCurrency"` + DisplayAmountXLM string `codec:"displayAmountXLM" json:"displayAmountXLM"` + DisplayAmountFiat string `codec:"displayAmountFiat" json:"displayAmountFiat"` + SendingIntentionXLM bool `codec:"sendingIntentionXLM" json:"sendingIntentionXLM"` + AmountAvailable string `codec:"amountAvailable" json:"amountAvailable"` + Banners []SendBannerLocal `codec:"banners" json:"banners"` +} + +func (o BuildPaymentResLocal) DeepCopy() BuildPaymentResLocal { + return BuildPaymentResLocal{ + ReadyToReview: o.ReadyToReview, + From: o.From.DeepCopy(), + ToErrMsg: o.ToErrMsg, + AmountErrMsg: o.AmountErrMsg, + SecretNoteErrMsg: o.SecretNoteErrMsg, + PublicMemoErrMsg: o.PublicMemoErrMsg, + PublicMemoOverride: o.PublicMemoOverride, + WorthDescription: o.WorthDescription, + WorthInfo: o.WorthInfo, + WorthAmount: o.WorthAmount, + WorthCurrency: o.WorthCurrency, + DisplayAmountXLM: o.DisplayAmountXLM, + DisplayAmountFiat: o.DisplayAmountFiat, + SendingIntentionXLM: o.SendingIntentionXLM, + AmountAvailable: o.AmountAvailable, + Banners: (func(x []SendBannerLocal) []SendBannerLocal { + if x == nil { + return nil + } + ret := make([]SendBannerLocal, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Banners), + } +} + +type AdvancedBanner int + +const ( + AdvancedBanner_NO_BANNER AdvancedBanner = 0 + AdvancedBanner_SENDER_BANNER AdvancedBanner = 1 + AdvancedBanner_RECEIVER_BANNER AdvancedBanner = 2 +) + +func (o AdvancedBanner) DeepCopy() AdvancedBanner { return o } + +var AdvancedBannerMap = map[string]AdvancedBanner{ + "NO_BANNER": 0, + "SENDER_BANNER": 1, + "RECEIVER_BANNER": 2, +} + +var AdvancedBannerRevMap = map[AdvancedBanner]string{ + 0: "NO_BANNER", + 1: "SENDER_BANNER", + 2: "RECEIVER_BANNER", +} + +func (e AdvancedBanner) String() string { + if v, ok := AdvancedBannerRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type SendBannerLocal struct { + Level string `codec:"level" json:"level"` + Message string `codec:"message" json:"message"` + ProofsChanged bool `codec:"proofsChanged" json:"proofsChanged"` + OfferAdvancedSendForm AdvancedBanner `codec:"offerAdvancedSendForm" json:"offerAdvancedSendForm"` +} + +func (o SendBannerLocal) DeepCopy() SendBannerLocal { + return SendBannerLocal{ + Level: o.Level, + Message: o.Message, + ProofsChanged: o.ProofsChanged, + OfferAdvancedSendForm: o.OfferAdvancedSendForm.DeepCopy(), + } +} + +type SendPaymentResLocal struct { + KbTxID KeybaseTransactionID `codec:"kbTxID" json:"kbTxID"` + Pending bool `codec:"pending" json:"pending"` + JumpToChat string `codec:"jumpToChat" json:"jumpToChat"` +} + +func (o SendPaymentResLocal) DeepCopy() SendPaymentResLocal { + return SendPaymentResLocal{ + KbTxID: o.KbTxID.DeepCopy(), + Pending: o.Pending, + JumpToChat: o.JumpToChat, + } +} + +type BuildRequestResLocal struct { + ReadyToRequest bool `codec:"readyToRequest" json:"readyToRequest"` + ToErrMsg string `codec:"toErrMsg" json:"toErrMsg"` + AmountErrMsg string `codec:"amountErrMsg" json:"amountErrMsg"` + SecretNoteErrMsg string `codec:"secretNoteErrMsg" json:"secretNoteErrMsg"` + WorthDescription string `codec:"worthDescription" json:"worthDescription"` + WorthInfo string `codec:"worthInfo" json:"worthInfo"` + DisplayAmountXLM string `codec:"displayAmountXLM" json:"displayAmountXLM"` + DisplayAmountFiat string `codec:"displayAmountFiat" json:"displayAmountFiat"` + SendingIntentionXLM bool `codec:"sendingIntentionXLM" json:"sendingIntentionXLM"` + Banners []SendBannerLocal `codec:"banners" json:"banners"` +} + +func (o BuildRequestResLocal) DeepCopy() BuildRequestResLocal { + return BuildRequestResLocal{ + ReadyToRequest: o.ReadyToRequest, + ToErrMsg: o.ToErrMsg, + AmountErrMsg: o.AmountErrMsg, + SecretNoteErrMsg: o.SecretNoteErrMsg, + WorthDescription: o.WorthDescription, + WorthInfo: o.WorthInfo, + DisplayAmountXLM: o.DisplayAmountXLM, + DisplayAmountFiat: o.DisplayAmountFiat, + SendingIntentionXLM: o.SendingIntentionXLM, + Banners: (func(x []SendBannerLocal) []SendBannerLocal { + if x == nil { + return nil + } + ret := make([]SendBannerLocal, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Banners), + } +} + +type RequestDetailsLocal struct { + Id KeybaseRequestID `codec:"id" json:"id"` + FromAssertion string `codec:"fromAssertion" json:"fromAssertion"` + FromCurrentUser bool `codec:"fromCurrentUser" json:"fromCurrentUser"` + ToUserType ParticipantType `codec:"toUserType" json:"toUserType"` + ToAssertion string `codec:"toAssertion" json:"toAssertion"` + Amount string `codec:"amount" json:"amount"` + Asset *Asset `codec:"asset,omitempty" json:"asset,omitempty"` + Currency *OutsideCurrencyCode `codec:"currency,omitempty" json:"currency,omitempty"` + AmountDescription string `codec:"amountDescription" json:"amountDescription"` + WorthAtRequestTime string `codec:"worthAtRequestTime" json:"worthAtRequestTime"` + Status RequestStatus `codec:"status" json:"status"` +} + +func (o RequestDetailsLocal) DeepCopy() RequestDetailsLocal { + return RequestDetailsLocal{ + Id: o.Id.DeepCopy(), + FromAssertion: o.FromAssertion, + FromCurrentUser: o.FromCurrentUser, + ToUserType: o.ToUserType.DeepCopy(), + ToAssertion: o.ToAssertion, + Amount: o.Amount, + Asset: (func(x *Asset) *Asset { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Asset), + Currency: (func(x *OutsideCurrencyCode) *OutsideCurrencyCode { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Currency), + AmountDescription: o.AmountDescription, + WorthAtRequestTime: o.WorthAtRequestTime, + Status: o.Status.DeepCopy(), + } +} + +type InflationDestinationTag string + +func (o InflationDestinationTag) DeepCopy() InflationDestinationTag { + return o +} + +type PredefinedInflationDestination struct { + Tag InflationDestinationTag `codec:"tag" json:"tag"` + Name string `codec:"name" json:"name"` + Recommended bool `codec:"recommended" json:"recommended"` + AccountID AccountID `codec:"accountID" json:"accountID"` + Url string `codec:"url" json:"url"` +} + +func (o PredefinedInflationDestination) DeepCopy() PredefinedInflationDestination { + return PredefinedInflationDestination{ + Tag: o.Tag.DeepCopy(), + Name: o.Name, + Recommended: o.Recommended, + AccountID: o.AccountID.DeepCopy(), + Url: o.Url, + } +} + +type InflationDestinationResultLocal struct { + Destination *AccountID `codec:"destination,omitempty" json:"destination,omitempty"` + KnownDestination *PredefinedInflationDestination `codec:"knownDestination,omitempty" json:"knownDestination,omitempty"` + Self bool `codec:"self" json:"self"` +} + +func (o InflationDestinationResultLocal) DeepCopy() InflationDestinationResultLocal { + return InflationDestinationResultLocal{ + Destination: (func(x *AccountID) *AccountID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Destination), + KnownDestination: (func(x *PredefinedInflationDestination) *PredefinedInflationDestination { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.KnownDestination), + Self: o.Self, + } +} + +type AirdropDetails struct { + IsPromoted bool `codec:"isPromoted" json:"isPromoted"` + Details string `codec:"details" json:"details"` + Disclaimer string `codec:"disclaimer" json:"disclaimer"` +} + +func (o AirdropDetails) DeepCopy() AirdropDetails { + return AirdropDetails{ + IsPromoted: o.IsPromoted, + Details: o.Details, + Disclaimer: o.Disclaimer, + } +} + +type AirdropState string + +func (o AirdropState) DeepCopy() AirdropState { + return o +} + +type AirdropQualification struct { + Title string `codec:"title" json:"title"` + Subtitle string `codec:"subtitle" json:"subtitle"` + Valid bool `codec:"valid" json:"valid"` +} + +func (o AirdropQualification) DeepCopy() AirdropQualification { + return AirdropQualification{ + Title: o.Title, + Subtitle: o.Subtitle, + Valid: o.Valid, + } +} + +type AirdropStatus struct { + State AirdropState `codec:"state" json:"state"` + Rows []AirdropQualification `codec:"rows" json:"rows"` +} + +func (o AirdropStatus) DeepCopy() AirdropStatus { + return AirdropStatus{ + State: o.State.DeepCopy(), + Rows: (func(x []AirdropQualification) []AirdropQualification { + if x == nil { + return nil + } + ret := make([]AirdropQualification, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Rows), + } +} + +type RecipientTrustlinesLocal struct { + Trustlines []Balance `codec:"trustlines" json:"trustlines"` + RecipientType ParticipantType `codec:"recipientType" json:"recipientType"` +} + +func (o RecipientTrustlinesLocal) DeepCopy() RecipientTrustlinesLocal { + return RecipientTrustlinesLocal{ + Trustlines: (func(x []Balance) []Balance { + if x == nil { + return nil + } + ret := make([]Balance, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Trustlines), + RecipientType: o.RecipientType.DeepCopy(), + } +} + +type PaymentPathLocal struct { + SourceDisplay string `codec:"sourceDisplay" json:"sourceDisplay"` + SourceMaxDisplay string `codec:"sourceMaxDisplay" json:"sourceMaxDisplay"` + DestinationDisplay string `codec:"destinationDisplay" json:"destinationDisplay"` + ExchangeRate string `codec:"exchangeRate" json:"exchangeRate"` + AmountError string `codec:"amountError" json:"amountError"` + DestinationAccount AccountID `codec:"destinationAccount" json:"destinationAccount"` + FullPath PaymentPath `codec:"fullPath" json:"fullPath"` +} + +func (o PaymentPathLocal) DeepCopy() PaymentPathLocal { + return PaymentPathLocal{ + SourceDisplay: o.SourceDisplay, + SourceMaxDisplay: o.SourceMaxDisplay, + DestinationDisplay: o.DestinationDisplay, + ExchangeRate: o.ExchangeRate, + AmountError: o.AmountError, + DestinationAccount: o.DestinationAccount.DeepCopy(), + FullPath: o.FullPath.DeepCopy(), + } +} + +type AssetActionResultLocal struct { + ExternalUrl *string `codec:"externalUrl,omitempty" json:"externalUrl,omitempty"` + MessageFromAnchor *string `codec:"messageFromAnchor,omitempty" json:"messageFromAnchor,omitempty"` +} + +func (o AssetActionResultLocal) DeepCopy() AssetActionResultLocal { + return AssetActionResultLocal{ + ExternalUrl: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.ExternalUrl), + MessageFromAnchor: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.MessageFromAnchor), + } +} + +type SendResultCLILocal struct { + KbTxID KeybaseTransactionID `codec:"kbTxID" json:"kbTxID"` + TxID TransactionID `codec:"txID" json:"txID"` +} + +func (o SendResultCLILocal) DeepCopy() SendResultCLILocal { + return SendResultCLILocal{ + KbTxID: o.KbTxID.DeepCopy(), + TxID: o.TxID.DeepCopy(), + } +} + +type PublicNoteType int + +const ( + PublicNoteType_NONE PublicNoteType = 0 + PublicNoteType_TEXT PublicNoteType = 1 + PublicNoteType_ID PublicNoteType = 2 + PublicNoteType_HASH PublicNoteType = 3 + PublicNoteType_RETURN PublicNoteType = 4 +) + +func (o PublicNoteType) DeepCopy() PublicNoteType { return o } + +var PublicNoteTypeMap = map[string]PublicNoteType{ + "NONE": 0, + "TEXT": 1, + "ID": 2, + "HASH": 3, + "RETURN": 4, +} + +var PublicNoteTypeRevMap = map[PublicNoteType]string{ + 0: "NONE", + 1: "TEXT", + 2: "ID", + 3: "HASH", + 4: "RETURN", +} + +func (e PublicNoteType) String() string { + if v, ok := PublicNoteTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type PaymentOrErrorCLILocal struct { + Payment *PaymentCLILocal `codec:"payment,omitempty" json:"payment,omitempty"` + Err *string `codec:"err,omitempty" json:"err,omitempty"` +} + +func (o PaymentOrErrorCLILocal) DeepCopy() PaymentOrErrorCLILocal { + return PaymentOrErrorCLILocal{ + Payment: (func(x *PaymentCLILocal) *PaymentCLILocal { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Payment), + Err: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Err), + } +} + +type PaymentCLILocal struct { + TxID TransactionID `codec:"txID" json:"txID"` + Time TimeMs `codec:"time" json:"time"` + Status string `codec:"status" json:"status"` + StatusDetail string `codec:"statusDetail" json:"statusDetail"` + Amount string `codec:"amount" json:"amount"` + Asset Asset `codec:"asset" json:"asset"` + DisplayAmount *string `codec:"displayAmount,omitempty" json:"displayAmount,omitempty"` + DisplayCurrency *string `codec:"displayCurrency,omitempty" json:"displayCurrency,omitempty"` + SourceAmountMax string `codec:"sourceAmountMax" json:"sourceAmountMax"` + SourceAmountActual string `codec:"sourceAmountActual" json:"sourceAmountActual"` + SourceAsset Asset `codec:"sourceAsset" json:"sourceAsset"` + IsAdvanced bool `codec:"isAdvanced" json:"isAdvanced"` + SummaryAdvanced string `codec:"summaryAdvanced" json:"summaryAdvanced"` + Operations []string `codec:"operations" json:"operations"` + FromStellar AccountID `codec:"fromStellar" json:"fromStellar"` + ToStellar *AccountID `codec:"toStellar,omitempty" json:"toStellar,omitempty"` + FromUsername *string `codec:"fromUsername,omitempty" json:"fromUsername,omitempty"` + ToUsername *string `codec:"toUsername,omitempty" json:"toUsername,omitempty"` + ToAssertion *string `codec:"toAssertion,omitempty" json:"toAssertion,omitempty"` + Note string `codec:"note" json:"note"` + NoteErr string `codec:"noteErr" json:"noteErr"` + Unread bool `codec:"unread" json:"unread"` + PublicNote string `codec:"publicNote" json:"publicNote"` + PublicNoteType string `codec:"publicNoteType" json:"publicNoteType"` + FeeChargedDescription string `codec:"feeChargedDescription" json:"feeChargedDescription"` +} + +func (o PaymentCLILocal) DeepCopy() PaymentCLILocal { + return PaymentCLILocal{ + TxID: o.TxID.DeepCopy(), + Time: o.Time.DeepCopy(), + Status: o.Status, + StatusDetail: o.StatusDetail, + Amount: o.Amount, + Asset: o.Asset.DeepCopy(), + DisplayAmount: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.DisplayAmount), + DisplayCurrency: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.DisplayCurrency), + SourceAmountMax: o.SourceAmountMax, + SourceAmountActual: o.SourceAmountActual, + SourceAsset: o.SourceAsset.DeepCopy(), + IsAdvanced: o.IsAdvanced, + SummaryAdvanced: o.SummaryAdvanced, + Operations: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Operations), + FromStellar: o.FromStellar.DeepCopy(), + ToStellar: (func(x *AccountID) *AccountID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ToStellar), + FromUsername: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.FromUsername), + ToUsername: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.ToUsername), + ToAssertion: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.ToAssertion), + Note: o.Note, + NoteErr: o.NoteErr, + Unread: o.Unread, + PublicNote: o.PublicNote, + PublicNoteType: o.PublicNoteType, + FeeChargedDescription: o.FeeChargedDescription, + } +} + +type OwnAccountCLILocal struct { + AccountID AccountID `codec:"accountID" json:"accountID"` + IsPrimary bool `codec:"isPrimary" json:"isPrimary"` + Name string `codec:"name" json:"name"` + Balance []Balance `codec:"balance" json:"balance"` + ExchangeRate *OutsideExchangeRate `codec:"exchangeRate,omitempty" json:"exchangeRate,omitempty"` + AccountMode AccountMode `codec:"accountMode" json:"accountMode"` +} + +func (o OwnAccountCLILocal) DeepCopy() OwnAccountCLILocal { + return OwnAccountCLILocal{ + AccountID: o.AccountID.DeepCopy(), + IsPrimary: o.IsPrimary, + Name: o.Name, + Balance: (func(x []Balance) []Balance { + if x == nil { + return nil + } + ret := make([]Balance, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Balance), + ExchangeRate: (func(x *OutsideExchangeRate) *OutsideExchangeRate { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ExchangeRate), + AccountMode: o.AccountMode.DeepCopy(), + } +} + +type LookupResultCLILocal struct { + AccountID AccountID `codec:"accountID" json:"accountID"` + Username *string `codec:"username,omitempty" json:"username,omitempty"` +} + +func (o LookupResultCLILocal) DeepCopy() LookupResultCLILocal { + return LookupResultCLILocal{ + AccountID: o.AccountID.DeepCopy(), + Username: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.Username), + } +} + +type BatchPaymentError struct { + Message string `codec:"message" json:"message"` + Code int `codec:"code" json:"code"` +} + +func (o BatchPaymentError) DeepCopy() BatchPaymentError { + return BatchPaymentError{ + Message: o.Message, + Code: o.Code, + } +} + +type BatchPaymentResult struct { + Username string `codec:"username" json:"username"` + StartTime TimeMs `codec:"startTime" json:"startTime"` + SubmittedTime TimeMs `codec:"submittedTime" json:"submittedTime"` + EndTime TimeMs `codec:"endTime" json:"endTime"` + TxID TransactionID `codec:"txID" json:"txID"` + Status PaymentStatus `codec:"status" json:"status"` + StatusDescription string `codec:"statusDescription" json:"statusDescription"` + Error *BatchPaymentError `codec:"error,omitempty" json:"error,omitempty"` +} + +func (o BatchPaymentResult) DeepCopy() BatchPaymentResult { + return BatchPaymentResult{ + Username: o.Username, + StartTime: o.StartTime.DeepCopy(), + SubmittedTime: o.SubmittedTime.DeepCopy(), + EndTime: o.EndTime.DeepCopy(), + TxID: o.TxID.DeepCopy(), + Status: o.Status.DeepCopy(), + StatusDescription: o.StatusDescription, + Error: (func(x *BatchPaymentError) *BatchPaymentError { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Error), + } +} + +type BatchResultLocal struct { + StartTime TimeMs `codec:"startTime" json:"startTime"` + PreparedTime TimeMs `codec:"preparedTime" json:"preparedTime"` + AllSubmittedTime TimeMs `codec:"allSubmittedTime" json:"allSubmittedTime"` + AllCompleteTime TimeMs `codec:"allCompleteTime" json:"allCompleteTime"` + EndTime TimeMs `codec:"endTime" json:"endTime"` + Payments []BatchPaymentResult `codec:"payments" json:"payments"` + OverallDurationMs TimeMs `codec:"overallDurationMs" json:"overallDurationMs"` + PrepareDurationMs TimeMs `codec:"prepareDurationMs" json:"prepareDurationMs"` + SubmitDurationMs TimeMs `codec:"submitDurationMs" json:"submitDurationMs"` + WaitPaymentsDurationMs TimeMs `codec:"waitPaymentsDurationMs" json:"waitPaymentsDurationMs"` + WaitChatDurationMs TimeMs `codec:"waitChatDurationMs" json:"waitChatDurationMs"` + CountSuccess int `codec:"countSuccess" json:"countSuccess"` + CountDirect int `codec:"countDirect" json:"countDirect"` + CountRelay int `codec:"countRelay" json:"countRelay"` + CountError int `codec:"countError" json:"countError"` + CountPending int `codec:"countPending" json:"countPending"` + AvgDurationMs TimeMs `codec:"avgDurationMs" json:"avgDurationMs"` + AvgSuccessDurationMs TimeMs `codec:"avgSuccessDurationMs" json:"avgSuccessDurationMs"` + AvgDirectDurationMs TimeMs `codec:"avgDirectDurationMs" json:"avgDirectDurationMs"` + AvgRelayDurationMs TimeMs `codec:"avgRelayDurationMs" json:"avgRelayDurationMs"` + AvgErrorDurationMs TimeMs `codec:"avgErrorDurationMs" json:"avgErrorDurationMs"` +} + +func (o BatchResultLocal) DeepCopy() BatchResultLocal { + return BatchResultLocal{ + StartTime: o.StartTime.DeepCopy(), + PreparedTime: o.PreparedTime.DeepCopy(), + AllSubmittedTime: o.AllSubmittedTime.DeepCopy(), + AllCompleteTime: o.AllCompleteTime.DeepCopy(), + EndTime: o.EndTime.DeepCopy(), + Payments: (func(x []BatchPaymentResult) []BatchPaymentResult { + if x == nil { + return nil + } + ret := make([]BatchPaymentResult, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Payments), + OverallDurationMs: o.OverallDurationMs.DeepCopy(), + PrepareDurationMs: o.PrepareDurationMs.DeepCopy(), + SubmitDurationMs: o.SubmitDurationMs.DeepCopy(), + WaitPaymentsDurationMs: o.WaitPaymentsDurationMs.DeepCopy(), + WaitChatDurationMs: o.WaitChatDurationMs.DeepCopy(), + CountSuccess: o.CountSuccess, + CountDirect: o.CountDirect, + CountRelay: o.CountRelay, + CountError: o.CountError, + CountPending: o.CountPending, + AvgDurationMs: o.AvgDurationMs.DeepCopy(), + AvgSuccessDurationMs: o.AvgSuccessDurationMs.DeepCopy(), + AvgDirectDurationMs: o.AvgDirectDurationMs.DeepCopy(), + AvgRelayDurationMs: o.AvgRelayDurationMs.DeepCopy(), + AvgErrorDurationMs: o.AvgErrorDurationMs.DeepCopy(), + } +} + +type BatchPaymentArg struct { + Recipient string `codec:"recipient" json:"recipient"` + Amount string `codec:"amount" json:"amount"` + Message string `codec:"message" json:"message"` +} + +func (o BatchPaymentArg) DeepCopy() BatchPaymentArg { + return BatchPaymentArg{ + Recipient: o.Recipient, + Amount: o.Amount, + Message: o.Message, + } +} + +type TxDisplaySummary struct { + Source AccountID `codec:"source" json:"source"` + Fee int `codec:"fee" json:"fee"` + Memo string `codec:"memo" json:"memo"` + MemoType string `codec:"memoType" json:"memoType"` + Operations []string `codec:"operations" json:"operations"` +} + +func (o TxDisplaySummary) DeepCopy() TxDisplaySummary { + return TxDisplaySummary{ + Source: o.Source.DeepCopy(), + Fee: o.Fee, + Memo: o.Memo, + MemoType: o.MemoType, + Operations: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Operations), + } +} + +type ValidateStellarURIResultLocal struct { + Operation string `codec:"operation" json:"operation"` + OriginDomain string `codec:"originDomain" json:"originDomain"` + Message string `codec:"message" json:"message"` + CallbackURL string `codec:"callbackURL" json:"callbackURL"` + Xdr string `codec:"xdr" json:"xdr"` + Summary TxDisplaySummary `codec:"summary" json:"summary"` + Recipient string `codec:"recipient" json:"recipient"` + Amount string `codec:"amount" json:"amount"` + AssetCode string `codec:"assetCode" json:"assetCode"` + AssetIssuer string `codec:"assetIssuer" json:"assetIssuer"` + Memo string `codec:"memo" json:"memo"` + MemoType string `codec:"memoType" json:"memoType"` + DisplayAmountFiat string `codec:"displayAmountFiat" json:"displayAmountFiat"` + AvailableToSendNative string `codec:"availableToSendNative" json:"availableToSendNative"` + AvailableToSendFiat string `codec:"availableToSendFiat" json:"availableToSendFiat"` + Signed bool `codec:"signed" json:"signed"` +} + +func (o ValidateStellarURIResultLocal) DeepCopy() ValidateStellarURIResultLocal { + return ValidateStellarURIResultLocal{ + Operation: o.Operation, + OriginDomain: o.OriginDomain, + Message: o.Message, + CallbackURL: o.CallbackURL, + Xdr: o.Xdr, + Summary: o.Summary.DeepCopy(), + Recipient: o.Recipient, + Amount: o.Amount, + AssetCode: o.AssetCode, + AssetIssuer: o.AssetIssuer, + Memo: o.Memo, + MemoType: o.MemoType, + DisplayAmountFiat: o.DisplayAmountFiat, + AvailableToSendNative: o.AvailableToSendNative, + AvailableToSendFiat: o.AvailableToSendFiat, + Signed: o.Signed, + } +} + +type PartnerUrl struct { + Url string `codec:"url" json:"url"` + Title string `codec:"title" json:"title"` + Description string `codec:"description" json:"description"` + IconFilename string `codec:"iconFilename" json:"icon_filename"` + AdminOnly bool `codec:"adminOnly" json:"admin_only"` + CanPurchase bool `codec:"canPurchase" json:"can_purchase"` + Extra string `codec:"extra" json:"extra"` +} + +func (o PartnerUrl) DeepCopy() PartnerUrl { + return PartnerUrl{ + Url: o.Url, + Title: o.Title, + Description: o.Description, + IconFilename: o.IconFilename, + AdminOnly: o.AdminOnly, + CanPurchase: o.CanPurchase, + Extra: o.Extra, + } +} + +type SignXdrResult struct { + SingedTx string `codec:"singedTx" json:"singedTx"` + AccountID AccountID `codec:"accountID" json:"accountID"` + SubmitErr *string `codec:"submitErr,omitempty" json:"submitErr,omitempty"` + SubmitTxID *TransactionID `codec:"submitTxID,omitempty" json:"submitTxID,omitempty"` +} + +func (o SignXdrResult) DeepCopy() SignXdrResult { + return SignXdrResult{ + SingedTx: o.SingedTx, + AccountID: o.AccountID.DeepCopy(), + SubmitErr: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.SubmitErr), + SubmitTxID: (func(x *TransactionID) *TransactionID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.SubmitTxID), + } +} + +type StaticConfig struct { + PaymentNoteMaxLength int `codec:"paymentNoteMaxLength" json:"paymentNoteMaxLength"` + RequestNoteMaxLength int `codec:"requestNoteMaxLength" json:"requestNoteMaxLength"` + PublicMemoMaxLength int `codec:"publicMemoMaxLength" json:"publicMemoMaxLength"` +} + +func (o StaticConfig) DeepCopy() StaticConfig { + return StaticConfig{ + PaymentNoteMaxLength: o.PaymentNoteMaxLength, + RequestNoteMaxLength: o.RequestNoteMaxLength, + PublicMemoMaxLength: o.PublicMemoMaxLength, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/notify.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/notify.go new file mode 100644 index 00000000..f095bf00 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/notify.go @@ -0,0 +1,4 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/stellar1/notify.avdl + +package stellar1 diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/remote.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/remote.go new file mode 100644 index 00000000..798506a2 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/remote.go @@ -0,0 +1,913 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/stellar1/remote.avdl + +package stellar1 + +import ( + "errors" + "fmt" + + keybase1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1" +) + +type ChatConversationID string + +func (o ChatConversationID) DeepCopy() ChatConversationID { + return o +} + +type PaymentDirectPost struct { + FromDeviceID keybase1.DeviceID `codec:"fromDeviceID" json:"fromDeviceID"` + To *keybase1.UserVersion `codec:"to,omitempty" json:"to,omitempty"` + DisplayAmount string `codec:"displayAmount" json:"displayAmount"` + DisplayCurrency string `codec:"displayCurrency" json:"displayCurrency"` + NoteB64 string `codec:"noteB64" json:"noteB64"` + SignedTransaction string `codec:"signedTransaction" json:"signedTransaction"` + QuickReturn bool `codec:"quickReturn" json:"quickReturn"` + ChatConversationID *ChatConversationID `codec:"chatConversationID,omitempty" json:"chatConversationID,omitempty"` + BatchID string `codec:"batchID" json:"batchID"` +} + +func (o PaymentDirectPost) DeepCopy() PaymentDirectPost { + return PaymentDirectPost{ + FromDeviceID: o.FromDeviceID.DeepCopy(), + To: (func(x *keybase1.UserVersion) *keybase1.UserVersion { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.To), + DisplayAmount: o.DisplayAmount, + DisplayCurrency: o.DisplayCurrency, + NoteB64: o.NoteB64, + SignedTransaction: o.SignedTransaction, + QuickReturn: o.QuickReturn, + ChatConversationID: (func(x *ChatConversationID) *ChatConversationID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ChatConversationID), + BatchID: o.BatchID, + } +} + +type PaymentRelayPost struct { + FromDeviceID keybase1.DeviceID `codec:"fromDeviceID" json:"fromDeviceID"` + To *keybase1.UserVersion `codec:"to,omitempty" json:"to,omitempty"` + ToAssertion string `codec:"toAssertion" json:"toAssertion"` + RelayAccount AccountID `codec:"relayAccount" json:"relayAccount"` + TeamID keybase1.TeamID `codec:"teamID" json:"teamID"` + DisplayAmount string `codec:"displayAmount" json:"displayAmount"` + DisplayCurrency string `codec:"displayCurrency" json:"displayCurrency"` + BoxB64 string `codec:"boxB64" json:"boxB64"` + SignedTransaction string `codec:"signedTransaction" json:"signedTransaction"` + QuickReturn bool `codec:"quickReturn" json:"quickReturn"` + ChatConversationID *ChatConversationID `codec:"chatConversationID,omitempty" json:"chatConversationID,omitempty"` + BatchID string `codec:"batchID" json:"batchID"` +} + +func (o PaymentRelayPost) DeepCopy() PaymentRelayPost { + return PaymentRelayPost{ + FromDeviceID: o.FromDeviceID.DeepCopy(), + To: (func(x *keybase1.UserVersion) *keybase1.UserVersion { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.To), + ToAssertion: o.ToAssertion, + RelayAccount: o.RelayAccount.DeepCopy(), + TeamID: o.TeamID.DeepCopy(), + DisplayAmount: o.DisplayAmount, + DisplayCurrency: o.DisplayCurrency, + BoxB64: o.BoxB64, + SignedTransaction: o.SignedTransaction, + QuickReturn: o.QuickReturn, + ChatConversationID: (func(x *ChatConversationID) *ChatConversationID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ChatConversationID), + BatchID: o.BatchID, + } +} + +type RelayClaimPost struct { + KeybaseID KeybaseTransactionID `codec:"keybaseID" json:"keybaseID"` + Dir RelayDirection `codec:"dir" json:"dir"` + SignedTransaction string `codec:"signedTransaction" json:"signedTransaction"` + AutoClaimToken *string `codec:"autoClaimToken,omitempty" json:"autoClaimToken,omitempty"` +} + +func (o RelayClaimPost) DeepCopy() RelayClaimPost { + return RelayClaimPost{ + KeybaseID: o.KeybaseID.DeepCopy(), + Dir: o.Dir.DeepCopy(), + SignedTransaction: o.SignedTransaction, + AutoClaimToken: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.AutoClaimToken), + } +} + +type PathPaymentPost struct { + FromDeviceID keybase1.DeviceID `codec:"fromDeviceID" json:"fromDeviceID"` + To *keybase1.UserVersion `codec:"to,omitempty" json:"to,omitempty"` + NoteB64 string `codec:"noteB64" json:"noteB64"` + SignedTransaction string `codec:"signedTransaction" json:"signedTransaction"` + QuickReturn bool `codec:"quickReturn" json:"quickReturn"` + ChatConversationID *ChatConversationID `codec:"chatConversationID,omitempty" json:"chatConversationID,omitempty"` +} + +func (o PathPaymentPost) DeepCopy() PathPaymentPost { + return PathPaymentPost{ + FromDeviceID: o.FromDeviceID.DeepCopy(), + To: (func(x *keybase1.UserVersion) *keybase1.UserVersion { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.To), + NoteB64: o.NoteB64, + SignedTransaction: o.SignedTransaction, + QuickReturn: o.QuickReturn, + ChatConversationID: (func(x *ChatConversationID) *ChatConversationID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ChatConversationID), + } +} + +type DirectOp struct { + NoteB64 string `codec:"noteB64" json:"noteB64"` +} + +func (o DirectOp) DeepCopy() DirectOp { + return DirectOp{ + NoteB64: o.NoteB64, + } +} + +type RelayOp struct { + ToAssertion string `codec:"toAssertion" json:"toAssertion"` + RelayAccount AccountID `codec:"relayAccount" json:"relayAccount"` + TeamID keybase1.TeamID `codec:"teamID" json:"teamID"` + BoxB64 string `codec:"boxB64" json:"boxB64"` +} + +func (o RelayOp) DeepCopy() RelayOp { + return RelayOp{ + ToAssertion: o.ToAssertion, + RelayAccount: o.RelayAccount.DeepCopy(), + TeamID: o.TeamID.DeepCopy(), + BoxB64: o.BoxB64, + } +} + +type PaymentOp struct { + To *keybase1.UserVersion `codec:"to,omitempty" json:"to,omitempty"` + Direct *DirectOp `codec:"direct,omitempty" json:"direct,omitempty"` + Relay *RelayOp `codec:"relay,omitempty" json:"relay,omitempty"` +} + +func (o PaymentOp) DeepCopy() PaymentOp { + return PaymentOp{ + To: (func(x *keybase1.UserVersion) *keybase1.UserVersion { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.To), + Direct: (func(x *DirectOp) *DirectOp { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Direct), + Relay: (func(x *RelayOp) *RelayOp { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Relay), + } +} + +type PaymentMultiPost struct { + FromDeviceID keybase1.DeviceID `codec:"fromDeviceID" json:"fromDeviceID"` + SignedTransaction string `codec:"signedTransaction" json:"signedTransaction"` + Operations []PaymentOp `codec:"operations" json:"operations"` + BatchID string `codec:"batchID" json:"batchID"` +} + +func (o PaymentMultiPost) DeepCopy() PaymentMultiPost { + return PaymentMultiPost{ + FromDeviceID: o.FromDeviceID.DeepCopy(), + SignedTransaction: o.SignedTransaction, + Operations: (func(x []PaymentOp) []PaymentOp { + if x == nil { + return nil + } + ret := make([]PaymentOp, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Operations), + BatchID: o.BatchID, + } +} + +type PaymentSummaryType int + +const ( + PaymentSummaryType_NONE PaymentSummaryType = 0 + PaymentSummaryType_STELLAR PaymentSummaryType = 1 + PaymentSummaryType_DIRECT PaymentSummaryType = 2 + PaymentSummaryType_RELAY PaymentSummaryType = 3 +) + +func (o PaymentSummaryType) DeepCopy() PaymentSummaryType { return o } + +var PaymentSummaryTypeMap = map[string]PaymentSummaryType{ + "NONE": 0, + "STELLAR": 1, + "DIRECT": 2, + "RELAY": 3, +} + +var PaymentSummaryTypeRevMap = map[PaymentSummaryType]string{ + 0: "NONE", + 1: "STELLAR", + 2: "DIRECT", + 3: "RELAY", +} + +func (e PaymentSummaryType) String() string { + if v, ok := PaymentSummaryTypeRevMap[e]; ok { + return v + } + return fmt.Sprintf("%v", int(e)) +} + +type PaymentSummary struct { + Typ__ PaymentSummaryType `codec:"typ" json:"typ"` + Stellar__ *PaymentSummaryStellar `codec:"stellar,omitempty" json:"stellar,omitempty"` + Direct__ *PaymentSummaryDirect `codec:"direct,omitempty" json:"direct,omitempty"` + Relay__ *PaymentSummaryRelay `codec:"relay,omitempty" json:"relay,omitempty"` +} + +func (o *PaymentSummary) Typ() (ret PaymentSummaryType, err error) { + switch o.Typ__ { + case PaymentSummaryType_STELLAR: + if o.Stellar__ == nil { + err = errors.New("unexpected nil value for Stellar__") + return ret, err + } + case PaymentSummaryType_DIRECT: + if o.Direct__ == nil { + err = errors.New("unexpected nil value for Direct__") + return ret, err + } + case PaymentSummaryType_RELAY: + if o.Relay__ == nil { + err = errors.New("unexpected nil value for Relay__") + return ret, err + } + } + return o.Typ__, nil +} + +func (o PaymentSummary) Stellar() (res PaymentSummaryStellar) { + if o.Typ__ != PaymentSummaryType_STELLAR { + panic("wrong case accessed") + } + if o.Stellar__ == nil { + return + } + return *o.Stellar__ +} + +func (o PaymentSummary) Direct() (res PaymentSummaryDirect) { + if o.Typ__ != PaymentSummaryType_DIRECT { + panic("wrong case accessed") + } + if o.Direct__ == nil { + return + } + return *o.Direct__ +} + +func (o PaymentSummary) Relay() (res PaymentSummaryRelay) { + if o.Typ__ != PaymentSummaryType_RELAY { + panic("wrong case accessed") + } + if o.Relay__ == nil { + return + } + return *o.Relay__ +} + +func NewPaymentSummaryWithStellar(v PaymentSummaryStellar) PaymentSummary { + return PaymentSummary{ + Typ__: PaymentSummaryType_STELLAR, + Stellar__: &v, + } +} + +func NewPaymentSummaryWithDirect(v PaymentSummaryDirect) PaymentSummary { + return PaymentSummary{ + Typ__: PaymentSummaryType_DIRECT, + Direct__: &v, + } +} + +func NewPaymentSummaryWithRelay(v PaymentSummaryRelay) PaymentSummary { + return PaymentSummary{ + Typ__: PaymentSummaryType_RELAY, + Relay__: &v, + } +} + +func (o PaymentSummary) DeepCopy() PaymentSummary { + return PaymentSummary{ + Typ__: o.Typ__.DeepCopy(), + Stellar__: (func(x *PaymentSummaryStellar) *PaymentSummaryStellar { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Stellar__), + Direct__: (func(x *PaymentSummaryDirect) *PaymentSummaryDirect { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Direct__), + Relay__: (func(x *PaymentSummaryRelay) *PaymentSummaryRelay { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Relay__), + } +} + +type PaymentSummaryStellar struct { + TxID TransactionID `codec:"txID" json:"txID"` + From AccountID `codec:"from" json:"from"` + To AccountID `codec:"to" json:"to"` + Amount string `codec:"amount" json:"amount"` + Asset Asset `codec:"asset" json:"asset"` + Ctime TimeMs `codec:"ctime" json:"ctime"` + CursorToken string `codec:"cursorToken" json:"cursorToken"` + Unread bool `codec:"unread" json:"unread"` + IsInflation bool `codec:"isInflation" json:"isInflation"` + InflationSource *string `codec:"inflationSource,omitempty" json:"inflationSource,omitempty"` + SourceAmountMax string `codec:"sourceAmountMax" json:"sourceAmountMax"` + SourceAmountActual string `codec:"sourceAmountActual" json:"sourceAmountActual"` + SourceAsset Asset `codec:"sourceAsset" json:"sourceAsset"` + IsAdvanced bool `codec:"isAdvanced" json:"isAdvanced"` + SummaryAdvanced string `codec:"summaryAdvanced" json:"summaryAdvanced"` + Operations []string `codec:"operations" json:"operations"` + Trustline *PaymentTrustlineLocal `codec:"trustline,omitempty" json:"trustline,omitempty"` +} + +func (o PaymentSummaryStellar) DeepCopy() PaymentSummaryStellar { + return PaymentSummaryStellar{ + TxID: o.TxID.DeepCopy(), + From: o.From.DeepCopy(), + To: o.To.DeepCopy(), + Amount: o.Amount, + Asset: o.Asset.DeepCopy(), + Ctime: o.Ctime.DeepCopy(), + CursorToken: o.CursorToken, + Unread: o.Unread, + IsInflation: o.IsInflation, + InflationSource: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.InflationSource), + SourceAmountMax: o.SourceAmountMax, + SourceAmountActual: o.SourceAmountActual, + SourceAsset: o.SourceAsset.DeepCopy(), + IsAdvanced: o.IsAdvanced, + SummaryAdvanced: o.SummaryAdvanced, + Operations: (func(x []string) []string { + if x == nil { + return nil + } + ret := make([]string, len(x)) + for i, v := range x { + vCopy := v + ret[i] = vCopy + } + return ret + })(o.Operations), + Trustline: (func(x *PaymentTrustlineLocal) *PaymentTrustlineLocal { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Trustline), + } +} + +type PaymentSummaryDirect struct { + KbTxID KeybaseTransactionID `codec:"kbTxID" json:"kbTxID"` + TxID TransactionID `codec:"txID" json:"txID"` + TxStatus TransactionStatus `codec:"txStatus" json:"txStatus"` + TxErrMsg string `codec:"txErrMsg" json:"txErrMsg"` + FromStellar AccountID `codec:"fromStellar" json:"fromStellar"` + From keybase1.UserVersion `codec:"from" json:"from"` + FromDeviceID keybase1.DeviceID `codec:"fromDeviceID" json:"fromDeviceID"` + ToStellar AccountID `codec:"toStellar" json:"toStellar"` + To *keybase1.UserVersion `codec:"to,omitempty" json:"to,omitempty"` + Amount string `codec:"amount" json:"amount"` + Asset Asset `codec:"asset" json:"asset"` + DisplayAmount *string `codec:"displayAmount,omitempty" json:"displayAmount,omitempty"` + DisplayCurrency *string `codec:"displayCurrency,omitempty" json:"displayCurrency,omitempty"` + NoteB64 string `codec:"noteB64" json:"noteB64"` + FromDisplayAmount string `codec:"fromDisplayAmount" json:"fromDisplayAmount"` + FromDisplayCurrency string `codec:"fromDisplayCurrency" json:"fromDisplayCurrency"` + ToDisplayAmount string `codec:"toDisplayAmount" json:"toDisplayAmount"` + ToDisplayCurrency string `codec:"toDisplayCurrency" json:"toDisplayCurrency"` + Ctime TimeMs `codec:"ctime" json:"ctime"` + Rtime TimeMs `codec:"rtime" json:"rtime"` + CursorToken string `codec:"cursorToken" json:"cursorToken"` + Unread bool `codec:"unread" json:"unread"` + FromPrimary bool `codec:"fromPrimary" json:"fromPrimary"` + BatchID string `codec:"batchID" json:"batchID"` + FromAirdrop bool `codec:"fromAirdrop" json:"fromAirdrop"` + SourceAmountMax string `codec:"sourceAmountMax" json:"sourceAmountMax"` + SourceAmountActual string `codec:"sourceAmountActual" json:"sourceAmountActual"` + SourceAsset Asset `codec:"sourceAsset" json:"sourceAsset"` +} + +func (o PaymentSummaryDirect) DeepCopy() PaymentSummaryDirect { + return PaymentSummaryDirect{ + KbTxID: o.KbTxID.DeepCopy(), + TxID: o.TxID.DeepCopy(), + TxStatus: o.TxStatus.DeepCopy(), + TxErrMsg: o.TxErrMsg, + FromStellar: o.FromStellar.DeepCopy(), + From: o.From.DeepCopy(), + FromDeviceID: o.FromDeviceID.DeepCopy(), + ToStellar: o.ToStellar.DeepCopy(), + To: (func(x *keybase1.UserVersion) *keybase1.UserVersion { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.To), + Amount: o.Amount, + Asset: o.Asset.DeepCopy(), + DisplayAmount: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.DisplayAmount), + DisplayCurrency: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.DisplayCurrency), + NoteB64: o.NoteB64, + FromDisplayAmount: o.FromDisplayAmount, + FromDisplayCurrency: o.FromDisplayCurrency, + ToDisplayAmount: o.ToDisplayAmount, + ToDisplayCurrency: o.ToDisplayCurrency, + Ctime: o.Ctime.DeepCopy(), + Rtime: o.Rtime.DeepCopy(), + CursorToken: o.CursorToken, + Unread: o.Unread, + FromPrimary: o.FromPrimary, + BatchID: o.BatchID, + FromAirdrop: o.FromAirdrop, + SourceAmountMax: o.SourceAmountMax, + SourceAmountActual: o.SourceAmountActual, + SourceAsset: o.SourceAsset.DeepCopy(), + } +} + +type PaymentSummaryRelay struct { + KbTxID KeybaseTransactionID `codec:"kbTxID" json:"kbTxID"` + TxID TransactionID `codec:"txID" json:"txID"` + TxStatus TransactionStatus `codec:"txStatus" json:"txStatus"` + TxErrMsg string `codec:"txErrMsg" json:"txErrMsg"` + FromStellar AccountID `codec:"fromStellar" json:"fromStellar"` + From keybase1.UserVersion `codec:"from" json:"from"` + FromDeviceID keybase1.DeviceID `codec:"fromDeviceID" json:"fromDeviceID"` + To *keybase1.UserVersion `codec:"to,omitempty" json:"to,omitempty"` + ToAssertion string `codec:"toAssertion" json:"toAssertion"` + RelayAccount AccountID `codec:"relayAccount" json:"relayAccount"` + Amount string `codec:"amount" json:"amount"` + DisplayAmount *string `codec:"displayAmount,omitempty" json:"displayAmount,omitempty"` + DisplayCurrency *string `codec:"displayCurrency,omitempty" json:"displayCurrency,omitempty"` + Ctime TimeMs `codec:"ctime" json:"ctime"` + Rtime TimeMs `codec:"rtime" json:"rtime"` + BoxB64 string `codec:"boxB64" json:"boxB64"` + TeamID keybase1.TeamID `codec:"teamID" json:"teamID"` + Claim *ClaimSummary `codec:"claim,omitempty" json:"claim,omitempty"` + CursorToken string `codec:"cursorToken" json:"cursorToken"` + BatchID string `codec:"batchID" json:"batchID"` + FromAirdrop bool `codec:"fromAirdrop" json:"fromAirdrop"` +} + +func (o PaymentSummaryRelay) DeepCopy() PaymentSummaryRelay { + return PaymentSummaryRelay{ + KbTxID: o.KbTxID.DeepCopy(), + TxID: o.TxID.DeepCopy(), + TxStatus: o.TxStatus.DeepCopy(), + TxErrMsg: o.TxErrMsg, + FromStellar: o.FromStellar.DeepCopy(), + From: o.From.DeepCopy(), + FromDeviceID: o.FromDeviceID.DeepCopy(), + To: (func(x *keybase1.UserVersion) *keybase1.UserVersion { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.To), + ToAssertion: o.ToAssertion, + RelayAccount: o.RelayAccount.DeepCopy(), + Amount: o.Amount, + DisplayAmount: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.DisplayAmount), + DisplayCurrency: (func(x *string) *string { + if x == nil { + return nil + } + tmp := (*x) + return &tmp + })(o.DisplayCurrency), + Ctime: o.Ctime.DeepCopy(), + Rtime: o.Rtime.DeepCopy(), + BoxB64: o.BoxB64, + TeamID: o.TeamID.DeepCopy(), + Claim: (func(x *ClaimSummary) *ClaimSummary { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Claim), + CursorToken: o.CursorToken, + BatchID: o.BatchID, + FromAirdrop: o.FromAirdrop, + } +} + +type ClaimSummary struct { + TxID TransactionID `codec:"txID" json:"txID"` + TxStatus TransactionStatus `codec:"txStatus" json:"txStatus"` + TxErrMsg string `codec:"txErrMsg" json:"txErrMsg"` + Dir RelayDirection `codec:"dir" json:"dir"` + ToStellar AccountID `codec:"toStellar" json:"toStellar"` + To keybase1.UserVersion `codec:"to" json:"to"` +} + +func (o ClaimSummary) DeepCopy() ClaimSummary { + return ClaimSummary{ + TxID: o.TxID.DeepCopy(), + TxStatus: o.TxStatus.DeepCopy(), + TxErrMsg: o.TxErrMsg, + Dir: o.Dir.DeepCopy(), + ToStellar: o.ToStellar.DeepCopy(), + To: o.To.DeepCopy(), + } +} + +type PaymentDetails struct { + Summary PaymentSummary `codec:"summary" json:"summary"` + Memo string `codec:"memo" json:"memo"` + MemoType string `codec:"memoType" json:"memoType"` + ExternalTxURL string `codec:"externalTxURL" json:"externalTxURL"` + FeeCharged string `codec:"feeCharged" json:"feeCharged"` + PathIntermediate []Asset `codec:"pathIntermediate" json:"pathIntermediate"` +} + +func (o PaymentDetails) DeepCopy() PaymentDetails { + return PaymentDetails{ + Summary: o.Summary.DeepCopy(), + Memo: o.Memo, + MemoType: o.MemoType, + ExternalTxURL: o.ExternalTxURL, + FeeCharged: o.FeeCharged, + PathIntermediate: (func(x []Asset) []Asset { + if x == nil { + return nil + } + ret := make([]Asset, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.PathIntermediate), + } +} + +type AccountDetails struct { + AccountID AccountID `codec:"accountID" json:"accountID"` + Seqno string `codec:"seqno" json:"seqno"` + Balances []Balance `codec:"balances" json:"balances"` + SubentryCount int `codec:"subentryCount" json:"subentryCount"` + Available string `codec:"available" json:"available"` + Reserves []AccountReserve `codec:"reserves" json:"reserves"` + ReadTransactionID *TransactionID `codec:"readTransactionID,omitempty" json:"readTransactionID,omitempty"` + UnreadPayments int `codec:"unreadPayments" json:"unreadPayments"` + DisplayCurrency string `codec:"displayCurrency" json:"displayCurrency"` + InflationDestination *AccountID `codec:"inflationDestination,omitempty" json:"inflationDestination,omitempty"` +} + +func (o AccountDetails) DeepCopy() AccountDetails { + return AccountDetails{ + AccountID: o.AccountID.DeepCopy(), + Seqno: o.Seqno, + Balances: (func(x []Balance) []Balance { + if x == nil { + return nil + } + ret := make([]Balance, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Balances), + SubentryCount: o.SubentryCount, + Available: o.Available, + Reserves: (func(x []AccountReserve) []AccountReserve { + if x == nil { + return nil + } + ret := make([]AccountReserve, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Reserves), + ReadTransactionID: (func(x *TransactionID) *TransactionID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ReadTransactionID), + UnreadPayments: o.UnreadPayments, + DisplayCurrency: o.DisplayCurrency, + InflationDestination: (func(x *AccountID) *AccountID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.InflationDestination), + } +} + +type PaymentsPage struct { + Payments []PaymentSummary `codec:"payments" json:"payments"` + Cursor *PageCursor `codec:"cursor,omitempty" json:"cursor,omitempty"` + OldestUnread *TransactionID `codec:"oldestUnread,omitempty" json:"oldestUnread,omitempty"` +} + +func (o PaymentsPage) DeepCopy() PaymentsPage { + return PaymentsPage{ + Payments: (func(x []PaymentSummary) []PaymentSummary { + if x == nil { + return nil + } + ret := make([]PaymentSummary, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Payments), + Cursor: (func(x *PageCursor) *PageCursor { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Cursor), + OldestUnread: (func(x *TransactionID) *TransactionID { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.OldestUnread), + } +} + +type SubmitMultiRes struct { + TxID TransactionID `codec:"txID" json:"txID"` +} + +func (o SubmitMultiRes) DeepCopy() SubmitMultiRes { + return SubmitMultiRes{ + TxID: o.TxID.DeepCopy(), + } +} + +type AutoClaim struct { + KbTxID KeybaseTransactionID `codec:"kbTxID" json:"kbTxID"` +} + +func (o AutoClaim) DeepCopy() AutoClaim { + return AutoClaim{ + KbTxID: o.KbTxID.DeepCopy(), + } +} + +type RequestPost struct { + ToUser *keybase1.UserVersion `codec:"toUser,omitempty" json:"toUser,omitempty"` + ToAssertion string `codec:"toAssertion" json:"toAssertion"` + Amount string `codec:"amount" json:"amount"` + Asset *Asset `codec:"asset,omitempty" json:"asset,omitempty"` + Currency *OutsideCurrencyCode `codec:"currency,omitempty" json:"currency,omitempty"` +} + +func (o RequestPost) DeepCopy() RequestPost { + return RequestPost{ + ToUser: (func(x *keybase1.UserVersion) *keybase1.UserVersion { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ToUser), + ToAssertion: o.ToAssertion, + Amount: o.Amount, + Asset: (func(x *Asset) *Asset { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Asset), + Currency: (func(x *OutsideCurrencyCode) *OutsideCurrencyCode { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Currency), + } +} + +type RequestDetails struct { + Id KeybaseRequestID `codec:"id" json:"id"` + FromUser keybase1.UserVersion `codec:"fromUser" json:"fromUser"` + ToUser *keybase1.UserVersion `codec:"toUser,omitempty" json:"toUser,omitempty"` + ToAssertion string `codec:"toAssertion" json:"toAssertion"` + Amount string `codec:"amount" json:"amount"` + Asset *Asset `codec:"asset,omitempty" json:"asset,omitempty"` + Currency *OutsideCurrencyCode `codec:"currency,omitempty" json:"currency,omitempty"` + FromDisplayAmount string `codec:"fromDisplayAmount" json:"fromDisplayAmount"` + FromDisplayCurrency string `codec:"fromDisplayCurrency" json:"fromDisplayCurrency"` + ToDisplayAmount string `codec:"toDisplayAmount" json:"toDisplayAmount"` + ToDisplayCurrency string `codec:"toDisplayCurrency" json:"toDisplayCurrency"` + FundingKbTxID KeybaseTransactionID `codec:"fundingKbTxID" json:"fundingKbTxID"` + Status RequestStatus `codec:"status" json:"status"` +} + +func (o RequestDetails) DeepCopy() RequestDetails { + return RequestDetails{ + Id: o.Id.DeepCopy(), + FromUser: o.FromUser.DeepCopy(), + ToUser: (func(x *keybase1.UserVersion) *keybase1.UserVersion { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.ToUser), + ToAssertion: o.ToAssertion, + Amount: o.Amount, + Asset: (func(x *Asset) *Asset { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Asset), + Currency: (func(x *OutsideCurrencyCode) *OutsideCurrencyCode { + if x == nil { + return nil + } + tmp := (*x).DeepCopy() + return &tmp + })(o.Currency), + FromDisplayAmount: o.FromDisplayAmount, + FromDisplayCurrency: o.FromDisplayCurrency, + ToDisplayAmount: o.ToDisplayAmount, + ToDisplayCurrency: o.ToDisplayCurrency, + FundingKbTxID: o.FundingKbTxID.DeepCopy(), + Status: o.Status.DeepCopy(), + } +} + +type TimeboundsRecommendation struct { + TimeNow keybase1.UnixTime `codec:"timeNow" json:"time_now"` + Timeout int64 `codec:"timeout" json:"timeout"` +} + +func (o TimeboundsRecommendation) DeepCopy() TimeboundsRecommendation { + return TimeboundsRecommendation{ + TimeNow: o.TimeNow.DeepCopy(), + Timeout: o.Timeout, + } +} + +type NetworkOptions struct { + BaseFee uint64 `codec:"baseFee" json:"baseFee"` +} + +func (o NetworkOptions) DeepCopy() NetworkOptions { + return NetworkOptions{ + BaseFee: o.BaseFee, + } +} + +type DetailsPlusPayments struct { + Details AccountDetails `codec:"details" json:"details"` + RecentPayments PaymentsPage `codec:"recentPayments" json:"recentPayments"` + PendingPayments []PaymentSummary `codec:"pendingPayments" json:"pendingPayments"` +} + +func (o DetailsPlusPayments) DeepCopy() DetailsPlusPayments { + return DetailsPlusPayments{ + Details: o.Details.DeepCopy(), + RecentPayments: o.RecentPayments.DeepCopy(), + PendingPayments: (func(x []PaymentSummary) []PaymentSummary { + if x == nil { + return nil + } + ret := make([]PaymentSummary, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.PendingPayments), + } +} + +type PaymentPathQuery struct { + Source AccountID `codec:"source" json:"source"` + Destination AccountID `codec:"destination" json:"destination"` + SourceAsset Asset `codec:"sourceAsset" json:"sourceAsset"` + DestinationAsset Asset `codec:"destinationAsset" json:"destinationAsset"` + Amount string `codec:"amount" json:"amount"` +} + +func (o PaymentPathQuery) DeepCopy() PaymentPathQuery { + return PaymentPathQuery{ + Source: o.Source.DeepCopy(), + Destination: o.Destination.DeepCopy(), + SourceAsset: o.SourceAsset.DeepCopy(), + DestinationAsset: o.DestinationAsset.DeepCopy(), + Amount: o.Amount, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/ui.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/ui.go new file mode 100644 index 00000000..8decce76 --- /dev/null +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1/ui.go @@ -0,0 +1,32 @@ +// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler) +// Input file: ../client/protocol/avdl/stellar1/ui.avdl + +package stellar1 + +type UIPaymentReviewed struct { + Bid BuildPaymentID `codec:"bid" json:"bid"` + ReviewID int `codec:"reviewID" json:"reviewID"` + Seqno int `codec:"seqno" json:"seqno"` + Banners []SendBannerLocal `codec:"banners" json:"banners"` + NextButton string `codec:"nextButton" json:"nextButton"` +} + +func (o UIPaymentReviewed) DeepCopy() UIPaymentReviewed { + return UIPaymentReviewed{ + Bid: o.Bid.DeepCopy(), + ReviewID: o.ReviewID, + Seqno: o.Seqno, + Banners: (func(x []SendBannerLocal) []SendBannerLocal { + if x == nil { + return nil + } + ret := make([]SendBannerLocal, len(x)) + for i, v := range x { + vCopy := v.DeepCopy() + ret[i] = vCopy + } + return ret + })(o.Banners), + NextButton: o.NextButton, + } +} diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/wallet.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/wallet.go index 7dfdab68..fb9cfb31 100644 --- a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/wallet.go +++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/wallet.go @@ -5,25 +5,12 @@ import ( "encoding/json" "fmt" "strings" + + "github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1" ) type WalletOutput struct { - Result WalletResult `json:"result"` -} - -type WalletResult struct { - TxID string `json:"txID"` - Status string `json:"status"` - Amount string `json:"amount"` - Asset WalletAsset `json:"asset"` - FromUsername string `json:"fromUsername"` - ToUsername string `json:"toUsername"` -} - -type WalletAsset struct { - Type string `json:"type"` - Code string `json:"code"` - Issuer string `json:"issuer"` + Result stellar1.PaymentCLILocal `json:"result"` } func (a *API) GetWalletTxDetails(txID string) (wOut WalletOutput, err error) { diff --git a/vendor/modules.txt b/vendor/modules.txt index 0fba40d5..0e539c61 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -77,8 +77,12 @@ github.com/hashicorp/hcl/json/token github.com/jpillora/backoff # github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1 github.com/kardianos/osext -# github.com/keybase/go-keybase-chat-bot v0.0.0-20190816161829-561f10822eb2 +# github.com/keybase/go-keybase-chat-bot v0.0.0-20200207200343-9aca502dc88a github.com/keybase/go-keybase-chat-bot/kbchat +github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1 +github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1 +github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1 +github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1 # github.com/konsorten/go-windows-terminal-sequences v1.0.1 github.com/konsorten/go-windows-terminal-sequences # github.com/labstack/echo/v4 v4.1.13 -- cgit v1.2.3