github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/protocol/keybase1/identify3_ui.go (about)

     1  // Auto-generated to Go types and interfaces using avdl-compiler v1.4.10 (https://github.com/keybase/node-avdl-compiler)
     2  //   Input file: avdl/keybase1/identify3_ui.avdl
     3  
     4  package keybase1
     5  
     6  import (
     7  	"fmt"
     8  	"github.com/keybase/go-framed-msgpack-rpc/rpc"
     9  	context "golang.org/x/net/context"
    10  	"time"
    11  )
    12  
    13  type Identify3RowState int
    14  
    15  const (
    16  	Identify3RowState_CHECKING Identify3RowState = 1
    17  	Identify3RowState_VALID    Identify3RowState = 2
    18  	Identify3RowState_ERROR    Identify3RowState = 3
    19  	Identify3RowState_WARNING  Identify3RowState = 4
    20  	Identify3RowState_REVOKED  Identify3RowState = 5
    21  )
    22  
    23  func (o Identify3RowState) DeepCopy() Identify3RowState { return o }
    24  
    25  var Identify3RowStateMap = map[string]Identify3RowState{
    26  	"CHECKING": 1,
    27  	"VALID":    2,
    28  	"ERROR":    3,
    29  	"WARNING":  4,
    30  	"REVOKED":  5,
    31  }
    32  
    33  var Identify3RowStateRevMap = map[Identify3RowState]string{
    34  	1: "CHECKING",
    35  	2: "VALID",
    36  	3: "ERROR",
    37  	4: "WARNING",
    38  	5: "REVOKED",
    39  }
    40  
    41  func (e Identify3RowState) String() string {
    42  	if v, ok := Identify3RowStateRevMap[e]; ok {
    43  		return v
    44  	}
    45  	return fmt.Sprintf("%v", int(e))
    46  }
    47  
    48  type Identify3RowColor int
    49  
    50  const (
    51  	Identify3RowColor_BLUE   Identify3RowColor = 1
    52  	Identify3RowColor_RED    Identify3RowColor = 2
    53  	Identify3RowColor_BLACK  Identify3RowColor = 3
    54  	Identify3RowColor_GREEN  Identify3RowColor = 4
    55  	Identify3RowColor_GRAY   Identify3RowColor = 5
    56  	Identify3RowColor_YELLOW Identify3RowColor = 6
    57  	Identify3RowColor_ORANGE Identify3RowColor = 7
    58  )
    59  
    60  func (o Identify3RowColor) DeepCopy() Identify3RowColor { return o }
    61  
    62  var Identify3RowColorMap = map[string]Identify3RowColor{
    63  	"BLUE":   1,
    64  	"RED":    2,
    65  	"BLACK":  3,
    66  	"GREEN":  4,
    67  	"GRAY":   5,
    68  	"YELLOW": 6,
    69  	"ORANGE": 7,
    70  }
    71  
    72  var Identify3RowColorRevMap = map[Identify3RowColor]string{
    73  	1: "BLUE",
    74  	2: "RED",
    75  	3: "BLACK",
    76  	4: "GREEN",
    77  	5: "GRAY",
    78  	6: "YELLOW",
    79  	7: "ORANGE",
    80  }
    81  
    82  func (e Identify3RowColor) String() string {
    83  	if v, ok := Identify3RowColorRevMap[e]; ok {
    84  		return v
    85  	}
    86  	return fmt.Sprintf("%v", int(e))
    87  }
    88  
    89  type Identify3ResultType int
    90  
    91  const (
    92  	Identify3ResultType_OK            Identify3ResultType = 0
    93  	Identify3ResultType_BROKEN        Identify3ResultType = 1
    94  	Identify3ResultType_NEEDS_UPGRADE Identify3ResultType = 2
    95  	Identify3ResultType_CANCELED      Identify3ResultType = 3
    96  )
    97  
    98  func (o Identify3ResultType) DeepCopy() Identify3ResultType { return o }
    99  
   100  var Identify3ResultTypeMap = map[string]Identify3ResultType{
   101  	"OK":            0,
   102  	"BROKEN":        1,
   103  	"NEEDS_UPGRADE": 2,
   104  	"CANCELED":      3,
   105  }
   106  
   107  var Identify3ResultTypeRevMap = map[Identify3ResultType]string{
   108  	0: "OK",
   109  	1: "BROKEN",
   110  	2: "NEEDS_UPGRADE",
   111  	3: "CANCELED",
   112  }
   113  
   114  func (e Identify3ResultType) String() string {
   115  	if v, ok := Identify3ResultTypeRevMap[e]; ok {
   116  		return v
   117  	}
   118  	return fmt.Sprintf("%v", int(e))
   119  }
   120  
   121  type Identify3RowMeta struct {
   122  	Color Identify3RowColor `codec:"color" json:"color"`
   123  	Label string            `codec:"label" json:"label"`
   124  }
   125  
   126  func (o Identify3RowMeta) DeepCopy() Identify3RowMeta {
   127  	return Identify3RowMeta{
   128  		Color: o.Color.DeepCopy(),
   129  		Label: o.Label,
   130  	}
   131  }
   132  
   133  type Identify3Row struct {
   134  	GuiID                Identify3GUIID     `codec:"guiID" json:"guiID"`
   135  	Key                  string             `codec:"key" json:"key"`
   136  	Value                string             `codec:"value" json:"value"`
   137  	Priority             int                `codec:"priority" json:"priority"`
   138  	SiteURL              string             `codec:"siteURL" json:"siteURL"`
   139  	SiteIcon             []SizedImage       `codec:"siteIcon" json:"siteIcon"`
   140  	SiteIconDarkmode     []SizedImage       `codec:"siteIconDarkmode" json:"siteIconDarkmode"`
   141  	SiteIconFull         []SizedImage       `codec:"siteIconFull" json:"siteIconFull"`
   142  	SiteIconFullDarkmode []SizedImage       `codec:"siteIconFullDarkmode" json:"siteIconFullDarkmode"`
   143  	ProofURL             string             `codec:"proofURL" json:"proofURL"`
   144  	SigID                SigID              `codec:"sigID" json:"sigID"`
   145  	Ctime                Time               `codec:"ctime" json:"ctime"`
   146  	State                Identify3RowState  `codec:"state" json:"state"`
   147  	Metas                []Identify3RowMeta `codec:"metas" json:"metas"`
   148  	Color                Identify3RowColor  `codec:"color" json:"color"`
   149  	Kid                  *KID               `codec:"kid,omitempty" json:"kid,omitempty"`
   150  	WotProof             *WotProof          `codec:"wotProof,omitempty" json:"wotProof,omitempty"`
   151  }
   152  
   153  func (o Identify3Row) DeepCopy() Identify3Row {
   154  	return Identify3Row{
   155  		GuiID:    o.GuiID.DeepCopy(),
   156  		Key:      o.Key,
   157  		Value:    o.Value,
   158  		Priority: o.Priority,
   159  		SiteURL:  o.SiteURL,
   160  		SiteIcon: (func(x []SizedImage) []SizedImage {
   161  			if x == nil {
   162  				return nil
   163  			}
   164  			ret := make([]SizedImage, len(x))
   165  			for i, v := range x {
   166  				vCopy := v.DeepCopy()
   167  				ret[i] = vCopy
   168  			}
   169  			return ret
   170  		})(o.SiteIcon),
   171  		SiteIconDarkmode: (func(x []SizedImage) []SizedImage {
   172  			if x == nil {
   173  				return nil
   174  			}
   175  			ret := make([]SizedImage, len(x))
   176  			for i, v := range x {
   177  				vCopy := v.DeepCopy()
   178  				ret[i] = vCopy
   179  			}
   180  			return ret
   181  		})(o.SiteIconDarkmode),
   182  		SiteIconFull: (func(x []SizedImage) []SizedImage {
   183  			if x == nil {
   184  				return nil
   185  			}
   186  			ret := make([]SizedImage, len(x))
   187  			for i, v := range x {
   188  				vCopy := v.DeepCopy()
   189  				ret[i] = vCopy
   190  			}
   191  			return ret
   192  		})(o.SiteIconFull),
   193  		SiteIconFullDarkmode: (func(x []SizedImage) []SizedImage {
   194  			if x == nil {
   195  				return nil
   196  			}
   197  			ret := make([]SizedImage, len(x))
   198  			for i, v := range x {
   199  				vCopy := v.DeepCopy()
   200  				ret[i] = vCopy
   201  			}
   202  			return ret
   203  		})(o.SiteIconFullDarkmode),
   204  		ProofURL: o.ProofURL,
   205  		SigID:    o.SigID.DeepCopy(),
   206  		Ctime:    o.Ctime.DeepCopy(),
   207  		State:    o.State.DeepCopy(),
   208  		Metas: (func(x []Identify3RowMeta) []Identify3RowMeta {
   209  			if x == nil {
   210  				return nil
   211  			}
   212  			ret := make([]Identify3RowMeta, len(x))
   213  			for i, v := range x {
   214  				vCopy := v.DeepCopy()
   215  				ret[i] = vCopy
   216  			}
   217  			return ret
   218  		})(o.Metas),
   219  		Color: o.Color.DeepCopy(),
   220  		Kid: (func(x *KID) *KID {
   221  			if x == nil {
   222  				return nil
   223  			}
   224  			tmp := (*x).DeepCopy()
   225  			return &tmp
   226  		})(o.Kid),
   227  		WotProof: (func(x *WotProof) *WotProof {
   228  			if x == nil {
   229  				return nil
   230  			}
   231  			tmp := (*x).DeepCopy()
   232  			return &tmp
   233  		})(o.WotProof),
   234  	}
   235  }
   236  
   237  type Identify3Summary struct {
   238  	GuiID            Identify3GUIID `codec:"guiID" json:"guiID"`
   239  	NumProofsToCheck int            `codec:"numProofsToCheck" json:"numProofsToCheck"`
   240  }
   241  
   242  func (o Identify3Summary) DeepCopy() Identify3Summary {
   243  	return Identify3Summary{
   244  		GuiID:            o.GuiID.DeepCopy(),
   245  		NumProofsToCheck: o.NumProofsToCheck,
   246  	}
   247  }
   248  
   249  type Identify3ShowTrackerArg struct {
   250  	GuiID        Identify3GUIID     `codec:"guiID" json:"guiID"`
   251  	Assertion    Identify3Assertion `codec:"assertion" json:"assertion"`
   252  	Reason       IdentifyReason     `codec:"reason" json:"reason"`
   253  	ForceDisplay bool               `codec:"forceDisplay" json:"forceDisplay"`
   254  }
   255  
   256  type Identify3SummaryArg struct {
   257  	Summary Identify3Summary `codec:"summary" json:"summary"`
   258  }
   259  
   260  type Identify3UpdateRowArg struct {
   261  	Row Identify3Row `codec:"row" json:"row"`
   262  }
   263  
   264  type Identify3UserResetArg struct {
   265  	GuiID Identify3GUIID `codec:"guiID" json:"guiID"`
   266  }
   267  
   268  type Identify3UpdateUserCardArg struct {
   269  	GuiID Identify3GUIID `codec:"guiID" json:"guiID"`
   270  	Card  UserCard       `codec:"card" json:"card"`
   271  }
   272  
   273  type Identify3TrackerTimedOutArg struct {
   274  	GuiID Identify3GUIID `codec:"guiID" json:"guiID"`
   275  }
   276  
   277  type Identify3ResultArg struct {
   278  	GuiID  Identify3GUIID      `codec:"guiID" json:"guiID"`
   279  	Result Identify3ResultType `codec:"result" json:"result"`
   280  }
   281  
   282  type Identify3UiInterface interface {
   283  	Identify3ShowTracker(context.Context, Identify3ShowTrackerArg) error
   284  	Identify3Summary(context.Context, Identify3Summary) error
   285  	Identify3UpdateRow(context.Context, Identify3Row) error
   286  	Identify3UserReset(context.Context, Identify3GUIID) error
   287  	Identify3UpdateUserCard(context.Context, Identify3UpdateUserCardArg) error
   288  	Identify3TrackerTimedOut(context.Context, Identify3GUIID) error
   289  	Identify3Result(context.Context, Identify3ResultArg) error
   290  }
   291  
   292  func Identify3UiProtocol(i Identify3UiInterface) rpc.Protocol {
   293  	return rpc.Protocol{
   294  		Name: "keybase.1.identify3Ui",
   295  		Methods: map[string]rpc.ServeHandlerDescription{
   296  			"identify3ShowTracker": {
   297  				MakeArg: func() interface{} {
   298  					var ret [1]Identify3ShowTrackerArg
   299  					return &ret
   300  				},
   301  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
   302  					typedArgs, ok := args.(*[1]Identify3ShowTrackerArg)
   303  					if !ok {
   304  						err = rpc.NewTypeError((*[1]Identify3ShowTrackerArg)(nil), args)
   305  						return
   306  					}
   307  					err = i.Identify3ShowTracker(ctx, typedArgs[0])
   308  					return
   309  				},
   310  			},
   311  			"identify3Summary": {
   312  				MakeArg: func() interface{} {
   313  					var ret [1]Identify3SummaryArg
   314  					return &ret
   315  				},
   316  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
   317  					typedArgs, ok := args.(*[1]Identify3SummaryArg)
   318  					if !ok {
   319  						err = rpc.NewTypeError((*[1]Identify3SummaryArg)(nil), args)
   320  						return
   321  					}
   322  					err = i.Identify3Summary(ctx, typedArgs[0].Summary)
   323  					return
   324  				},
   325  			},
   326  			"identify3UpdateRow": {
   327  				MakeArg: func() interface{} {
   328  					var ret [1]Identify3UpdateRowArg
   329  					return &ret
   330  				},
   331  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
   332  					typedArgs, ok := args.(*[1]Identify3UpdateRowArg)
   333  					if !ok {
   334  						err = rpc.NewTypeError((*[1]Identify3UpdateRowArg)(nil), args)
   335  						return
   336  					}
   337  					err = i.Identify3UpdateRow(ctx, typedArgs[0].Row)
   338  					return
   339  				},
   340  			},
   341  			"identify3UserReset": {
   342  				MakeArg: func() interface{} {
   343  					var ret [1]Identify3UserResetArg
   344  					return &ret
   345  				},
   346  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
   347  					typedArgs, ok := args.(*[1]Identify3UserResetArg)
   348  					if !ok {
   349  						err = rpc.NewTypeError((*[1]Identify3UserResetArg)(nil), args)
   350  						return
   351  					}
   352  					err = i.Identify3UserReset(ctx, typedArgs[0].GuiID)
   353  					return
   354  				},
   355  			},
   356  			"identify3UpdateUserCard": {
   357  				MakeArg: func() interface{} {
   358  					var ret [1]Identify3UpdateUserCardArg
   359  					return &ret
   360  				},
   361  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
   362  					typedArgs, ok := args.(*[1]Identify3UpdateUserCardArg)
   363  					if !ok {
   364  						err = rpc.NewTypeError((*[1]Identify3UpdateUserCardArg)(nil), args)
   365  						return
   366  					}
   367  					err = i.Identify3UpdateUserCard(ctx, typedArgs[0])
   368  					return
   369  				},
   370  			},
   371  			"identify3TrackerTimedOut": {
   372  				MakeArg: func() interface{} {
   373  					var ret [1]Identify3TrackerTimedOutArg
   374  					return &ret
   375  				},
   376  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
   377  					typedArgs, ok := args.(*[1]Identify3TrackerTimedOutArg)
   378  					if !ok {
   379  						err = rpc.NewTypeError((*[1]Identify3TrackerTimedOutArg)(nil), args)
   380  						return
   381  					}
   382  					err = i.Identify3TrackerTimedOut(ctx, typedArgs[0].GuiID)
   383  					return
   384  				},
   385  			},
   386  			"identify3Result": {
   387  				MakeArg: func() interface{} {
   388  					var ret [1]Identify3ResultArg
   389  					return &ret
   390  				},
   391  				Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
   392  					typedArgs, ok := args.(*[1]Identify3ResultArg)
   393  					if !ok {
   394  						err = rpc.NewTypeError((*[1]Identify3ResultArg)(nil), args)
   395  						return
   396  					}
   397  					err = i.Identify3Result(ctx, typedArgs[0])
   398  					return
   399  				},
   400  			},
   401  		},
   402  	}
   403  }
   404  
   405  type Identify3UiClient struct {
   406  	Cli rpc.GenericClient
   407  }
   408  
   409  func (c Identify3UiClient) Identify3ShowTracker(ctx context.Context, __arg Identify3ShowTrackerArg) (err error) {
   410  	err = c.Cli.Call(ctx, "keybase.1.identify3Ui.identify3ShowTracker", []interface{}{__arg}, nil, 0*time.Millisecond)
   411  	return
   412  }
   413  
   414  func (c Identify3UiClient) Identify3Summary(ctx context.Context, summary Identify3Summary) (err error) {
   415  	__arg := Identify3SummaryArg{Summary: summary}
   416  	err = c.Cli.Notify(ctx, "keybase.1.identify3Ui.identify3Summary", []interface{}{__arg}, 0*time.Millisecond)
   417  	return
   418  }
   419  
   420  func (c Identify3UiClient) Identify3UpdateRow(ctx context.Context, row Identify3Row) (err error) {
   421  	__arg := Identify3UpdateRowArg{Row: row}
   422  	err = c.Cli.Notify(ctx, "keybase.1.identify3Ui.identify3UpdateRow", []interface{}{__arg}, 0*time.Millisecond)
   423  	return
   424  }
   425  
   426  func (c Identify3UiClient) Identify3UserReset(ctx context.Context, guiID Identify3GUIID) (err error) {
   427  	__arg := Identify3UserResetArg{GuiID: guiID}
   428  	err = c.Cli.Notify(ctx, "keybase.1.identify3Ui.identify3UserReset", []interface{}{__arg}, 0*time.Millisecond)
   429  	return
   430  }
   431  
   432  func (c Identify3UiClient) Identify3UpdateUserCard(ctx context.Context, __arg Identify3UpdateUserCardArg) (err error) {
   433  	err = c.Cli.Notify(ctx, "keybase.1.identify3Ui.identify3UpdateUserCard", []interface{}{__arg}, 0*time.Millisecond)
   434  	return
   435  }
   436  
   437  func (c Identify3UiClient) Identify3TrackerTimedOut(ctx context.Context, guiID Identify3GUIID) (err error) {
   438  	__arg := Identify3TrackerTimedOutArg{GuiID: guiID}
   439  	err = c.Cli.Notify(ctx, "keybase.1.identify3Ui.identify3TrackerTimedOut", []interface{}{__arg}, 0*time.Millisecond)
   440  	return
   441  }
   442  
   443  func (c Identify3UiClient) Identify3Result(ctx context.Context, __arg Identify3ResultArg) (err error) {
   444  	err = c.Cli.Notify(ctx, "keybase.1.identify3Ui.identify3Result", []interface{}{__arg}, 0*time.Millisecond)
   445  	return
   446  }