github.com/google/go-github/v53@v53.2.0/github/event_types_test.go (about)

     1  // Copyright 2020 The go-github AUTHORS. All rights reserved.
     2  //
     3  // Use of this source code is governed by a BSD-style
     4  // license that can be found in the LICENSE file.
     5  
     6  package github
     7  
     8  import (
     9  	"encoding/json"
    10  	"testing"
    11  )
    12  
    13  func TestEditChange_Marshal_TitleChange(t *testing.T) {
    14  	testJSONMarshal(t, &EditChange{}, "{}")
    15  
    16  	u := &EditChange{
    17  		Title: &EditTitle{
    18  			From: String("TitleFrom"),
    19  		},
    20  		Body: nil,
    21  		Base: nil,
    22  	}
    23  
    24  	want := `{
    25  		"title": {
    26  			"from": "TitleFrom"
    27  		  }
    28  	}`
    29  
    30  	testJSONMarshal(t, u, want)
    31  }
    32  
    33  func TestEditChange_Marshal_BodyChange(t *testing.T) {
    34  	testJSONMarshal(t, &EditChange{}, "{}")
    35  
    36  	u := &EditChange{
    37  		Title: nil,
    38  		Body: &EditBody{
    39  			From: String("BodyFrom"),
    40  		},
    41  		Base: nil,
    42  	}
    43  
    44  	want := `{
    45  		"body": {
    46  			"from": "BodyFrom"
    47  		  }
    48  	}`
    49  
    50  	testJSONMarshal(t, u, want)
    51  }
    52  
    53  func TestEditChange_Marshal_BaseChange(t *testing.T) {
    54  	testJSONMarshal(t, &EditChange{}, "{}")
    55  
    56  	Base := EditBase{
    57  		Ref: &EditRef{
    58  			From: String("BaseRefFrom"),
    59  		},
    60  		SHA: &EditSHA{
    61  			From: String("BaseSHAFrom"),
    62  		},
    63  	}
    64  
    65  	u := &EditChange{
    66  		Title: nil,
    67  		Body:  nil,
    68  		Base:  &Base,
    69  	}
    70  
    71  	want := `{
    72  		"base": {
    73  			"ref": {
    74  				"from": "BaseRefFrom"
    75  			},
    76  			"sha": {
    77  				"from": "BaseSHAFrom"
    78  			}
    79  		}
    80  	}`
    81  
    82  	testJSONMarshal(t, u, want)
    83  }
    84  
    85  func TestEditChange_Marshal_Repo(t *testing.T) {
    86  	testJSONMarshal(t, &EditChange{}, "{}")
    87  
    88  	u := &EditChange{
    89  		Repo: &EditRepo{
    90  			Name: &RepoName{
    91  				From: String("old-repo-name"),
    92  			},
    93  		},
    94  	}
    95  
    96  	want := `{
    97  		"repository": {
    98  			"name": {
    99  				"from": "old-repo-name"
   100  			}
   101  		}
   102  	}`
   103  
   104  	testJSONMarshal(t, u, want)
   105  }
   106  
   107  func TestEditChange_Marshal_TransferFromUser(t *testing.T) {
   108  	testJSONMarshal(t, &EditChange{}, "{}")
   109  
   110  	u := &EditChange{
   111  		Owner: &EditOwner{
   112  			OwnerInfo: &OwnerInfo{
   113  				User: &User{
   114  					Login:     String("l"),
   115  					ID:        Int64(1),
   116  					NodeID:    String("n"),
   117  					URL:       String("u"),
   118  					ReposURL:  String("r"),
   119  					EventsURL: String("e"),
   120  					AvatarURL: String("a"),
   121  				},
   122  			},
   123  		},
   124  	}
   125  
   126  	want := `{
   127  		"owner": {
   128  			"from": {
   129  				"user": {
   130  					"login": "l",
   131            			"id": 1,
   132           		 	"node_id": "n",
   133            			"avatar_url": "a",
   134            			"url": "u",
   135            			"repos_url": "r",
   136            			"events_url": "e"
   137  				}
   138  			}
   139  		}
   140  	}`
   141  
   142  	testJSONMarshal(t, u, want)
   143  }
   144  
   145  func TestEditChange_Marshal_TransferFromOrg(t *testing.T) {
   146  	testJSONMarshal(t, &EditChange{}, "{}")
   147  
   148  	u := &EditChange{
   149  		Owner: &EditOwner{
   150  			OwnerInfo: &OwnerInfo{
   151  				Org: &User{
   152  					Login:     String("l"),
   153  					ID:        Int64(1),
   154  					NodeID:    String("n"),
   155  					URL:       String("u"),
   156  					ReposURL:  String("r"),
   157  					EventsURL: String("e"),
   158  					AvatarURL: String("a"),
   159  				},
   160  			},
   161  		},
   162  	}
   163  
   164  	want := `{
   165  		"owner": {
   166  			"from": {
   167  				"organization": {
   168  					"login": "l",
   169            			"id": 1,
   170           		 	"node_id": "n",
   171            			"avatar_url": "a",
   172            			"url": "u",
   173            			"repos_url": "r",
   174            			"events_url": "e"
   175  				}
   176  			}
   177  		}
   178  	}`
   179  
   180  	testJSONMarshal(t, u, want)
   181  }
   182  
   183  func TestProjectChange_Marshal_NameChange(t *testing.T) {
   184  	testJSONMarshal(t, &ProjectChange{}, "{}")
   185  
   186  	u := &ProjectChange{
   187  		Name: &ProjectName{From: String("NameFrom")},
   188  		Body: nil,
   189  	}
   190  
   191  	want := `{
   192  		"name": {
   193  			"from": "NameFrom"
   194  		  }
   195  	}`
   196  
   197  	testJSONMarshal(t, u, want)
   198  }
   199  
   200  func TestProjectChange_Marshal_BodyChange(t *testing.T) {
   201  	testJSONMarshal(t, &ProjectChange{}, "{}")
   202  
   203  	u := &ProjectChange{
   204  		Name: nil,
   205  		Body: &ProjectBody{From: String("BodyFrom")},
   206  	}
   207  
   208  	want := `{
   209  		"body": {
   210  			"from": "BodyFrom"
   211  		  }
   212  	}`
   213  
   214  	testJSONMarshal(t, u, want)
   215  }
   216  
   217  func TestProjectCardChange_Marshal_NoteChange(t *testing.T) {
   218  	testJSONMarshal(t, &ProjectCardChange{}, "{}")
   219  
   220  	u := &ProjectCardChange{
   221  		Note: &ProjectCardNote{From: String("NoteFrom")},
   222  	}
   223  
   224  	want := `{
   225  		"note": {
   226  			"from": "NoteFrom"
   227  		  }
   228  	}`
   229  
   230  	testJSONMarshal(t, u, want)
   231  }
   232  
   233  func TestProjectColumnChange_Marshal_NameChange(t *testing.T) {
   234  	testJSONMarshal(t, &ProjectColumnChange{}, "{}")
   235  
   236  	u := &ProjectColumnChange{
   237  		Name: &ProjectColumnName{From: String("NameFrom")},
   238  	}
   239  
   240  	want := `{
   241  		"name": {
   242  			"from": "NameFrom"
   243  		  }
   244  	}`
   245  
   246  	testJSONMarshal(t, u, want)
   247  }
   248  
   249  func TestTeamAddEvent_Marshal(t *testing.T) {
   250  	testJSONMarshal(t, &TeamAddEvent{}, "{}")
   251  
   252  	u := &TeamAddEvent{
   253  		Team: &Team{
   254  			ID:              Int64(1),
   255  			NodeID:          String("n"),
   256  			Name:            String("n"),
   257  			Description:     String("d"),
   258  			URL:             String("u"),
   259  			Slug:            String("s"),
   260  			Permission:      String("p"),
   261  			Privacy:         String("p"),
   262  			MembersCount:    Int(1),
   263  			ReposCount:      Int(1),
   264  			MembersURL:      String("m"),
   265  			RepositoriesURL: String("r"),
   266  			Organization: &Organization{
   267  				Login:     String("l"),
   268  				ID:        Int64(1),
   269  				NodeID:    String("n"),
   270  				AvatarURL: String("a"),
   271  				HTMLURL:   String("h"),
   272  				Name:      String("n"),
   273  				Company:   String("c"),
   274  				Blog:      String("b"),
   275  				Location:  String("l"),
   276  				Email:     String("e"),
   277  			},
   278  			Parent: &Team{
   279  				ID:           Int64(1),
   280  				NodeID:       String("n"),
   281  				Name:         String("n"),
   282  				Description:  String("d"),
   283  				URL:          String("u"),
   284  				Slug:         String("s"),
   285  				Permission:   String("p"),
   286  				Privacy:      String("p"),
   287  				MembersCount: Int(1),
   288  				ReposCount:   Int(1),
   289  			},
   290  			LDAPDN: String("l"),
   291  		},
   292  		Repo: &Repository{
   293  			ID:   Int64(1),
   294  			URL:  String("s"),
   295  			Name: String("n"),
   296  		},
   297  		Org: &Organization{
   298  			BillingEmail:                         String("be"),
   299  			Blog:                                 String("b"),
   300  			Company:                              String("c"),
   301  			Email:                                String("e"),
   302  			TwitterUsername:                      String("tu"),
   303  			Location:                             String("loc"),
   304  			Name:                                 String("n"),
   305  			Description:                          String("d"),
   306  			IsVerified:                           Bool(true),
   307  			HasOrganizationProjects:              Bool(true),
   308  			HasRepositoryProjects:                Bool(true),
   309  			DefaultRepoPermission:                String("drp"),
   310  			MembersCanCreateRepos:                Bool(true),
   311  			MembersCanCreateInternalRepos:        Bool(true),
   312  			MembersCanCreatePrivateRepos:         Bool(true),
   313  			MembersCanCreatePublicRepos:          Bool(false),
   314  			MembersAllowedRepositoryCreationType: String("marct"),
   315  			MembersCanCreatePages:                Bool(true),
   316  			MembersCanCreatePublicPages:          Bool(false),
   317  			MembersCanCreatePrivatePages:         Bool(true),
   318  		},
   319  		Sender: &User{
   320  			Login:     String("l"),
   321  			ID:        Int64(1),
   322  			NodeID:    String("n"),
   323  			URL:       String("u"),
   324  			ReposURL:  String("r"),
   325  			EventsURL: String("e"),
   326  			AvatarURL: String("a"),
   327  		},
   328  		Installation: &Installation{
   329  			ID:       Int64(1),
   330  			NodeID:   String("nid"),
   331  			AppID:    Int64(1),
   332  			AppSlug:  String("as"),
   333  			TargetID: Int64(1),
   334  			Account: &User{
   335  				Login:           String("l"),
   336  				ID:              Int64(1),
   337  				URL:             String("u"),
   338  				AvatarURL:       String("a"),
   339  				GravatarID:      String("g"),
   340  				Name:            String("n"),
   341  				Company:         String("c"),
   342  				Blog:            String("b"),
   343  				Location:        String("l"),
   344  				Email:           String("e"),
   345  				Hireable:        Bool(true),
   346  				Bio:             String("b"),
   347  				TwitterUsername: String("t"),
   348  				PublicRepos:     Int(1),
   349  				Followers:       Int(1),
   350  				Following:       Int(1),
   351  				CreatedAt:       &Timestamp{referenceTime},
   352  				SuspendedAt:     &Timestamp{referenceTime},
   353  			},
   354  			AccessTokensURL:     String("atu"),
   355  			RepositoriesURL:     String("ru"),
   356  			HTMLURL:             String("hu"),
   357  			TargetType:          String("tt"),
   358  			SingleFileName:      String("sfn"),
   359  			RepositorySelection: String("rs"),
   360  			Events:              []string{"e"},
   361  			SingleFilePaths:     []string{"s"},
   362  			Permissions: &InstallationPermissions{
   363  				Actions:                       String("a"),
   364  				Administration:                String("ad"),
   365  				Checks:                        String("c"),
   366  				Contents:                      String("co"),
   367  				ContentReferences:             String("cr"),
   368  				Deployments:                   String("d"),
   369  				Environments:                  String("e"),
   370  				Issues:                        String("i"),
   371  				Metadata:                      String("md"),
   372  				Members:                       String("m"),
   373  				OrganizationAdministration:    String("oa"),
   374  				OrganizationHooks:             String("oh"),
   375  				OrganizationPlan:              String("op"),
   376  				OrganizationPreReceiveHooks:   String("opr"),
   377  				OrganizationProjects:          String("op"),
   378  				OrganizationSecrets:           String("os"),
   379  				OrganizationSelfHostedRunners: String("osh"),
   380  				OrganizationUserBlocking:      String("oub"),
   381  				Packages:                      String("pkg"),
   382  				Pages:                         String("pg"),
   383  				PullRequests:                  String("pr"),
   384  				RepositoryHooks:               String("rh"),
   385  				RepositoryProjects:            String("rp"),
   386  				RepositoryPreReceiveHooks:     String("rprh"),
   387  				Secrets:                       String("s"),
   388  				SecretScanningAlerts:          String("ssa"),
   389  				SecurityEvents:                String("se"),
   390  				SingleFile:                    String("sf"),
   391  				Statuses:                      String("s"),
   392  				TeamDiscussions:               String("td"),
   393  				VulnerabilityAlerts:           String("va"),
   394  				Workflows:                     String("w"),
   395  			},
   396  			CreatedAt:              &Timestamp{referenceTime},
   397  			UpdatedAt:              &Timestamp{referenceTime},
   398  			HasMultipleSingleFiles: Bool(false),
   399  			SuspendedBy: &User{
   400  				Login:           String("l"),
   401  				ID:              Int64(1),
   402  				URL:             String("u"),
   403  				AvatarURL:       String("a"),
   404  				GravatarID:      String("g"),
   405  				Name:            String("n"),
   406  				Company:         String("c"),
   407  				Blog:            String("b"),
   408  				Location:        String("l"),
   409  				Email:           String("e"),
   410  				Hireable:        Bool(true),
   411  				Bio:             String("b"),
   412  				TwitterUsername: String("t"),
   413  				PublicRepos:     Int(1),
   414  				Followers:       Int(1),
   415  				Following:       Int(1),
   416  				CreatedAt:       &Timestamp{referenceTime},
   417  				SuspendedAt:     &Timestamp{referenceTime},
   418  			},
   419  			SuspendedAt: &Timestamp{referenceTime},
   420  		},
   421  	}
   422  
   423  	want := `{
   424  		"team": {
   425  			"id": 1,
   426  			"node_id": "n",
   427  			"name": "n",
   428  			"description": "d",
   429  			"url": "u",
   430  			"slug": "s",
   431  			"permission": "p",
   432  			"privacy": "p",
   433  			"members_count": 1,
   434  			"repos_count": 1,
   435  			"organization": {
   436  				"login": "l",
   437  				"id": 1,
   438  				"node_id": "n",
   439  				"avatar_url": "a",
   440  				"html_url": "h",
   441  				"name": "n",
   442  				"company": "c",
   443  				"blog": "b",
   444  				"location": "l",
   445  				"email": "e"
   446  			},
   447  			"members_url": "m",
   448  			"repositories_url": "r",
   449  			"parent": {
   450  				"id": 1,
   451  				"node_id": "n",
   452  				"name": "n",
   453  				"description": "d",
   454  				"url": "u",
   455  				"slug": "s",
   456  				"permission": "p",
   457  				"privacy": "p",
   458  				"members_count": 1,
   459  				"repos_count": 1
   460  			},
   461  			"ldap_dn": "l"
   462  		},
   463  		"repository": {
   464  			"id": 1,
   465  			"name": "n",
   466  			"url": "s"
   467  		},
   468  		"organization": {
   469  			"name": "n",
   470  			"company": "c",
   471  			"blog": "b",
   472  			"location": "loc",
   473  			"email": "e",
   474  			"twitter_username": "tu",
   475  			"description": "d",
   476  			"billing_email": "be",
   477  			"is_verified": true,
   478  			"has_organization_projects": true,
   479  			"has_repository_projects": true,
   480  			"default_repository_permission": "drp",
   481  			"members_can_create_repositories": true,
   482  			"members_can_create_public_repositories": false,
   483  			"members_can_create_private_repositories": true,
   484  			"members_can_create_internal_repositories": true,
   485  			"members_allowed_repository_creation_type": "marct",
   486  			"members_can_create_pages": true,
   487  			"members_can_create_public_pages": false,
   488  			"members_can_create_private_pages": true
   489  		},
   490  		"sender": {
   491  			"login": "l",
   492  			"id": 1,
   493  			"node_id": "n",
   494  			"avatar_url": "a",
   495  			"url": "u",
   496  			"events_url": "e",
   497  			"repos_url": "r"
   498  		},
   499  		"installation": {
   500  			"id": 1,
   501  			"node_id": "nid",
   502  			"app_id": 1,
   503  			"app_slug": "as",
   504  			"target_id": 1,
   505  			"account": {
   506  				"login": "l",
   507  				"id": 1,
   508  				"avatar_url": "a",
   509  				"gravatar_id": "g",
   510  				"name": "n",
   511  				"company": "c",
   512  				"blog": "b",
   513  				"location": "l",
   514  				"email": "e",
   515  				"hireable": true,
   516  				"bio": "b",
   517  				"twitter_username": "t",
   518  				"public_repos": 1,
   519  				"followers": 1,
   520  				"following": 1,
   521  				"created_at": ` + referenceTimeStr + `,
   522  				"suspended_at": ` + referenceTimeStr + `,
   523  				"url": "u"
   524  			},
   525  			"access_tokens_url": "atu",
   526  			"repositories_url": "ru",
   527  			"html_url": "hu",
   528  			"target_type": "tt",
   529  			"single_file_name": "sfn",
   530  			"repository_selection": "rs",
   531  			"events": [
   532  				"e"
   533  			],
   534  			"single_file_paths": [
   535  				"s"
   536  			],
   537  			"permissions": {
   538  				"actions": "a",
   539  				"administration": "ad",
   540  				"checks": "c",
   541  				"contents": "co",
   542  				"content_references": "cr",
   543  				"deployments": "d",
   544  				"environments": "e",
   545  				"issues": "i",
   546  				"metadata": "md",
   547  				"members": "m",
   548  				"organization_administration": "oa",
   549  				"organization_hooks": "oh",
   550  				"organization_plan": "op",
   551  				"organization_pre_receive_hooks": "opr",
   552  				"organization_projects": "op",
   553  				"organization_secrets": "os",
   554  				"organization_self_hosted_runners": "osh",
   555  				"organization_user_blocking": "oub",
   556  				"packages": "pkg",
   557  				"pages": "pg",
   558  				"pull_requests": "pr",
   559  				"repository_hooks": "rh",
   560  				"repository_projects": "rp",
   561  				"repository_pre_receive_hooks": "rprh",
   562  				"secrets": "s",
   563  				"secret_scanning_alerts": "ssa",
   564  				"security_events": "se",
   565  				"single_file": "sf",
   566  				"statuses": "s",
   567  				"team_discussions": "td",
   568  				"vulnerability_alerts": "va",
   569  				"workflows": "w"
   570  			},
   571  			"created_at": ` + referenceTimeStr + `,
   572  			"updated_at": ` + referenceTimeStr + `,
   573  			"has_multiple_single_files": false,
   574  			"suspended_by": {
   575  				"login": "l",
   576  				"id": 1,
   577  				"avatar_url": "a",
   578  				"gravatar_id": "g",
   579  				"name": "n",
   580  				"company": "c",
   581  				"blog": "b",
   582  				"location": "l",
   583  				"email": "e",
   584  				"hireable": true,
   585  				"bio": "b",
   586  				"twitter_username": "t",
   587  				"public_repos": 1,
   588  				"followers": 1,
   589  				"following": 1,
   590  				"created_at": ` + referenceTimeStr + `,
   591  				"suspended_at": ` + referenceTimeStr + `,
   592  				"url": "u"
   593  			},
   594  			"suspended_at": ` + referenceTimeStr + `
   595  		}
   596  	}`
   597  
   598  	testJSONMarshal(t, u, want)
   599  }
   600  
   601  func TestStarEvent_Marshal(t *testing.T) {
   602  	testJSONMarshal(t, &StarEvent{}, "{}")
   603  
   604  	u := &StarEvent{
   605  		Action:    String("a"),
   606  		StarredAt: &Timestamp{referenceTime},
   607  		Org: &Organization{
   608  			BillingEmail:                         String("be"),
   609  			Blog:                                 String("b"),
   610  			Company:                              String("c"),
   611  			Email:                                String("e"),
   612  			TwitterUsername:                      String("tu"),
   613  			Location:                             String("loc"),
   614  			Name:                                 String("n"),
   615  			Description:                          String("d"),
   616  			IsVerified:                           Bool(true),
   617  			HasOrganizationProjects:              Bool(true),
   618  			HasRepositoryProjects:                Bool(true),
   619  			DefaultRepoPermission:                String("drp"),
   620  			MembersCanCreateRepos:                Bool(true),
   621  			MembersCanCreateInternalRepos:        Bool(true),
   622  			MembersCanCreatePrivateRepos:         Bool(true),
   623  			MembersCanCreatePublicRepos:          Bool(false),
   624  			MembersAllowedRepositoryCreationType: String("marct"),
   625  			MembersCanCreatePages:                Bool(true),
   626  			MembersCanCreatePublicPages:          Bool(false),
   627  			MembersCanCreatePrivatePages:         Bool(true),
   628  		},
   629  		Repo: &Repository{
   630  			ID:   Int64(1),
   631  			URL:  String("s"),
   632  			Name: String("n"),
   633  		},
   634  		Sender: &User{
   635  			Login:     String("l"),
   636  			ID:        Int64(1),
   637  			NodeID:    String("n"),
   638  			URL:       String("u"),
   639  			ReposURL:  String("r"),
   640  			EventsURL: String("e"),
   641  			AvatarURL: String("a"),
   642  		},
   643  	}
   644  
   645  	want := `{
   646  		"action": "a",
   647  		"starred_at": ` + referenceTimeStr + `,
   648  		"organization": {
   649  			"name": "n",
   650  			"company": "c",
   651  			"blog": "b",
   652  			"location": "loc",
   653  			"email": "e",
   654  			"twitter_username": "tu",
   655  			"description": "d",
   656  			"billing_email": "be",
   657  			"is_verified": true,
   658  			"has_organization_projects": true,
   659  			"has_repository_projects": true,
   660  			"default_repository_permission": "drp",
   661  			"members_can_create_repositories": true,
   662  			"members_can_create_public_repositories": false,
   663  			"members_can_create_private_repositories": true,
   664  			"members_can_create_internal_repositories": true,
   665  			"members_allowed_repository_creation_type": "marct",
   666  			"members_can_create_pages": true,
   667  			"members_can_create_public_pages": false,
   668  			"members_can_create_private_pages": true
   669  		},
   670  		"repository": {
   671  			"id": 1,
   672  			"name": "n",
   673  			"url": "s"
   674  		},
   675  		"sender": {
   676  			"login": "l",
   677  			"id": 1,
   678  			"node_id": "n",
   679  			"avatar_url": "a",
   680  			"url": "u",
   681  			"events_url": "e",
   682  			"repos_url": "r"
   683  		}
   684  	}`
   685  
   686  	testJSONMarshal(t, u, want)
   687  }
   688  
   689  func TestTeamEvent_Marshal(t *testing.T) {
   690  	testJSONMarshal(t, &TeamEvent{}, "{}")
   691  
   692  	u := &TeamEvent{
   693  		Action: String("a"),
   694  		Team: &Team{
   695  			ID:              Int64(1),
   696  			NodeID:          String("n"),
   697  			Name:            String("n"),
   698  			Description:     String("d"),
   699  			URL:             String("u"),
   700  			Slug:            String("s"),
   701  			Permission:      String("p"),
   702  			Privacy:         String("p"),
   703  			MembersCount:    Int(1),
   704  			ReposCount:      Int(1),
   705  			MembersURL:      String("m"),
   706  			RepositoriesURL: String("r"),
   707  			Organization: &Organization{
   708  				Login:     String("l"),
   709  				ID:        Int64(1),
   710  				NodeID:    String("n"),
   711  				AvatarURL: String("a"),
   712  				HTMLURL:   String("h"),
   713  				Name:      String("n"),
   714  				Company:   String("c"),
   715  				Blog:      String("b"),
   716  				Location:  String("l"),
   717  				Email:     String("e"),
   718  			},
   719  			Parent: &Team{
   720  				ID:           Int64(1),
   721  				NodeID:       String("n"),
   722  				Name:         String("n"),
   723  				Description:  String("d"),
   724  				URL:          String("u"),
   725  				Slug:         String("s"),
   726  				Permission:   String("p"),
   727  				Privacy:      String("p"),
   728  				MembersCount: Int(1),
   729  				ReposCount:   Int(1),
   730  			},
   731  			LDAPDN: String("l"),
   732  		},
   733  		Changes: &TeamChange{
   734  			Description: &TeamDescription{
   735  				From: String("from"),
   736  			},
   737  			Name: &TeamName{
   738  				From: String("from"),
   739  			},
   740  			Privacy: &TeamPrivacy{
   741  				From: String("from"),
   742  			},
   743  			Repository: &TeamRepository{
   744  				Permissions: &TeamPermissions{
   745  					From: &TeamPermissionsFrom{
   746  						Admin: Bool(true),
   747  						Pull:  Bool(true),
   748  						Push:  Bool(true),
   749  					},
   750  				},
   751  			},
   752  		},
   753  		Repo: &Repository{
   754  			ID:   Int64(1),
   755  			URL:  String("s"),
   756  			Name: String("n"),
   757  		},
   758  		Org: &Organization{
   759  			BillingEmail:                         String("be"),
   760  			Blog:                                 String("b"),
   761  			Company:                              String("c"),
   762  			Email:                                String("e"),
   763  			TwitterUsername:                      String("tu"),
   764  			Location:                             String("loc"),
   765  			Name:                                 String("n"),
   766  			Description:                          String("d"),
   767  			IsVerified:                           Bool(true),
   768  			HasOrganizationProjects:              Bool(true),
   769  			HasRepositoryProjects:                Bool(true),
   770  			DefaultRepoPermission:                String("drp"),
   771  			MembersCanCreateRepos:                Bool(true),
   772  			MembersCanCreateInternalRepos:        Bool(true),
   773  			MembersCanCreatePrivateRepos:         Bool(true),
   774  			MembersCanCreatePublicRepos:          Bool(false),
   775  			MembersAllowedRepositoryCreationType: String("marct"),
   776  			MembersCanCreatePages:                Bool(true),
   777  			MembersCanCreatePublicPages:          Bool(false),
   778  			MembersCanCreatePrivatePages:         Bool(true),
   779  		},
   780  		Sender: &User{
   781  			Login:     String("l"),
   782  			ID:        Int64(1),
   783  			NodeID:    String("n"),
   784  			URL:       String("u"),
   785  			ReposURL:  String("r"),
   786  			EventsURL: String("e"),
   787  			AvatarURL: String("a"),
   788  		},
   789  		Installation: &Installation{
   790  			ID:       Int64(1),
   791  			NodeID:   String("nid"),
   792  			AppID:    Int64(1),
   793  			AppSlug:  String("as"),
   794  			TargetID: Int64(1),
   795  			Account: &User{
   796  				Login:           String("l"),
   797  				ID:              Int64(1),
   798  				URL:             String("u"),
   799  				AvatarURL:       String("a"),
   800  				GravatarID:      String("g"),
   801  				Name:            String("n"),
   802  				Company:         String("c"),
   803  				Blog:            String("b"),
   804  				Location:        String("l"),
   805  				Email:           String("e"),
   806  				Hireable:        Bool(true),
   807  				Bio:             String("b"),
   808  				TwitterUsername: String("t"),
   809  				PublicRepos:     Int(1),
   810  				Followers:       Int(1),
   811  				Following:       Int(1),
   812  				CreatedAt:       &Timestamp{referenceTime},
   813  				SuspendedAt:     &Timestamp{referenceTime},
   814  			},
   815  			AccessTokensURL:     String("atu"),
   816  			RepositoriesURL:     String("ru"),
   817  			HTMLURL:             String("hu"),
   818  			TargetType:          String("tt"),
   819  			SingleFileName:      String("sfn"),
   820  			RepositorySelection: String("rs"),
   821  			Events:              []string{"e"},
   822  			SingleFilePaths:     []string{"s"},
   823  			Permissions: &InstallationPermissions{
   824  				Actions:                       String("a"),
   825  				Administration:                String("ad"),
   826  				Checks:                        String("c"),
   827  				Contents:                      String("co"),
   828  				ContentReferences:             String("cr"),
   829  				Deployments:                   String("d"),
   830  				Environments:                  String("e"),
   831  				Issues:                        String("i"),
   832  				Metadata:                      String("md"),
   833  				Members:                       String("m"),
   834  				OrganizationAdministration:    String("oa"),
   835  				OrganizationHooks:             String("oh"),
   836  				OrganizationPlan:              String("op"),
   837  				OrganizationPreReceiveHooks:   String("opr"),
   838  				OrganizationProjects:          String("op"),
   839  				OrganizationSecrets:           String("os"),
   840  				OrganizationSelfHostedRunners: String("osh"),
   841  				OrganizationUserBlocking:      String("oub"),
   842  				Packages:                      String("pkg"),
   843  				Pages:                         String("pg"),
   844  				PullRequests:                  String("pr"),
   845  				RepositoryHooks:               String("rh"),
   846  				RepositoryProjects:            String("rp"),
   847  				RepositoryPreReceiveHooks:     String("rprh"),
   848  				Secrets:                       String("s"),
   849  				SecretScanningAlerts:          String("ssa"),
   850  				SecurityEvents:                String("se"),
   851  				SingleFile:                    String("sf"),
   852  				Statuses:                      String("s"),
   853  				TeamDiscussions:               String("td"),
   854  				VulnerabilityAlerts:           String("va"),
   855  				Workflows:                     String("w"),
   856  			},
   857  			CreatedAt:              &Timestamp{referenceTime},
   858  			UpdatedAt:              &Timestamp{referenceTime},
   859  			HasMultipleSingleFiles: Bool(false),
   860  			SuspendedBy: &User{
   861  				Login:           String("l"),
   862  				ID:              Int64(1),
   863  				URL:             String("u"),
   864  				AvatarURL:       String("a"),
   865  				GravatarID:      String("g"),
   866  				Name:            String("n"),
   867  				Company:         String("c"),
   868  				Blog:            String("b"),
   869  				Location:        String("l"),
   870  				Email:           String("e"),
   871  				Hireable:        Bool(true),
   872  				Bio:             String("b"),
   873  				TwitterUsername: String("t"),
   874  				PublicRepos:     Int(1),
   875  				Followers:       Int(1),
   876  				Following:       Int(1),
   877  				CreatedAt:       &Timestamp{referenceTime},
   878  				SuspendedAt:     &Timestamp{referenceTime},
   879  			},
   880  			SuspendedAt: &Timestamp{referenceTime},
   881  		},
   882  	}
   883  
   884  	want := `{
   885  		"action": "a",
   886  		"team": {
   887  			"id": 1,
   888  			"node_id": "n",
   889  			"name": "n",
   890  			"description": "d",
   891  			"url": "u",
   892  			"slug": "s",
   893  			"permission": "p",
   894  			"privacy": "p",
   895  			"members_count": 1,
   896  			"repos_count": 1,
   897  			"organization": {
   898  				"login": "l",
   899  				"id": 1,
   900  				"node_id": "n",
   901  				"avatar_url": "a",
   902  				"html_url": "h",
   903  				"name": "n",
   904  				"company": "c",
   905  				"blog": "b",
   906  				"location": "l",
   907  				"email": "e"
   908  			},
   909  			"members_url": "m",
   910  			"repositories_url": "r",
   911  			"parent": {
   912  				"id": 1,
   913  				"node_id": "n",
   914  				"name": "n",
   915  				"description": "d",
   916  				"url": "u",
   917  				"slug": "s",
   918  				"permission": "p",
   919  				"privacy": "p",
   920  				"members_count": 1,
   921  				"repos_count": 1
   922  			},
   923  			"ldap_dn": "l"
   924  		},
   925  		"changes": {
   926  			"description": {
   927  				"from": "from"
   928  			},
   929  			"name": {
   930  				"from": "from"
   931  			},
   932  			"privacy": {
   933  				"from": "from"
   934  			},
   935  			"repository": {
   936  				"permissions": {
   937  					"from": {
   938  						"admin": true,
   939  						"pull": true,
   940  						"push": true
   941  					}
   942  				}
   943  			}
   944  		},
   945  		"repository": {
   946  			"id": 1,
   947  			"name": "n",
   948  			"url": "s"
   949  		},
   950  		"organization": {
   951  			"name": "n",
   952  			"company": "c",
   953  			"blog": "b",
   954  			"location": "loc",
   955  			"email": "e",
   956  			"twitter_username": "tu",
   957  			"description": "d",
   958  			"billing_email": "be",
   959  			"is_verified": true,
   960  			"has_organization_projects": true,
   961  			"has_repository_projects": true,
   962  			"default_repository_permission": "drp",
   963  			"members_can_create_repositories": true,
   964  			"members_can_create_public_repositories": false,
   965  			"members_can_create_private_repositories": true,
   966  			"members_can_create_internal_repositories": true,
   967  			"members_allowed_repository_creation_type": "marct",
   968  			"members_can_create_pages": true,
   969  			"members_can_create_public_pages": false,
   970  			"members_can_create_private_pages": true
   971  		},
   972  		"sender": {
   973  			"login": "l",
   974  			"id": 1,
   975  			"node_id": "n",
   976  			"avatar_url": "a",
   977  			"url": "u",
   978  			"events_url": "e",
   979  			"repos_url": "r"
   980  		},
   981  		"installation": {
   982  			"id": 1,
   983  			"node_id": "nid",
   984  			"app_id": 1,
   985  			"app_slug": "as",
   986  			"target_id": 1,
   987  			"account": {
   988  				"login": "l",
   989  				"id": 1,
   990  				"avatar_url": "a",
   991  				"gravatar_id": "g",
   992  				"name": "n",
   993  				"company": "c",
   994  				"blog": "b",
   995  				"location": "l",
   996  				"email": "e",
   997  				"hireable": true,
   998  				"bio": "b",
   999  				"twitter_username": "t",
  1000  				"public_repos": 1,
  1001  				"followers": 1,
  1002  				"following": 1,
  1003  				"created_at": ` + referenceTimeStr + `,
  1004  				"suspended_at": ` + referenceTimeStr + `,
  1005  				"url": "u"
  1006  			},
  1007  			"access_tokens_url": "atu",
  1008  			"repositories_url": "ru",
  1009  			"html_url": "hu",
  1010  			"target_type": "tt",
  1011  			"single_file_name": "sfn",
  1012  			"repository_selection": "rs",
  1013  			"events": [
  1014  				"e"
  1015  			],
  1016  			"single_file_paths": [
  1017  				"s"
  1018  			],
  1019  			"permissions": {
  1020  				"actions": "a",
  1021  				"administration": "ad",
  1022  				"checks": "c",
  1023  				"contents": "co",
  1024  				"content_references": "cr",
  1025  				"deployments": "d",
  1026  				"environments": "e",
  1027  				"issues": "i",
  1028  				"metadata": "md",
  1029  				"members": "m",
  1030  				"organization_administration": "oa",
  1031  				"organization_hooks": "oh",
  1032  				"organization_plan": "op",
  1033  				"organization_pre_receive_hooks": "opr",
  1034  				"organization_projects": "op",
  1035  				"organization_secrets": "os",
  1036  				"organization_self_hosted_runners": "osh",
  1037  				"organization_user_blocking": "oub",
  1038  				"packages": "pkg",
  1039  				"pages": "pg",
  1040  				"pull_requests": "pr",
  1041  				"repository_hooks": "rh",
  1042  				"repository_projects": "rp",
  1043  				"repository_pre_receive_hooks": "rprh",
  1044  				"secrets": "s",
  1045  				"secret_scanning_alerts": "ssa",
  1046  				"security_events": "se",
  1047  				"single_file": "sf",
  1048  				"statuses": "s",
  1049  				"team_discussions": "td",
  1050  				"vulnerability_alerts": "va",
  1051  				"workflows": "w"
  1052  			},
  1053  			"created_at": ` + referenceTimeStr + `,
  1054  			"updated_at": ` + referenceTimeStr + `,
  1055  			"has_multiple_single_files": false,
  1056  			"suspended_by": {
  1057  				"login": "l",
  1058  				"id": 1,
  1059  				"avatar_url": "a",
  1060  				"gravatar_id": "g",
  1061  				"name": "n",
  1062  				"company": "c",
  1063  				"blog": "b",
  1064  				"location": "l",
  1065  				"email": "e",
  1066  				"hireable": true,
  1067  				"bio": "b",
  1068  				"twitter_username": "t",
  1069  				"public_repos": 1,
  1070  				"followers": 1,
  1071  				"following": 1,
  1072  				"created_at": ` + referenceTimeStr + `,
  1073  				"suspended_at": ` + referenceTimeStr + `,
  1074  				"url": "u"
  1075  			},
  1076  			"suspended_at": ` + referenceTimeStr + `
  1077  		}
  1078  	}`
  1079  
  1080  	testJSONMarshal(t, u, want)
  1081  }
  1082  
  1083  func TestInstallationRepositoriesEvent_Marshal(t *testing.T) {
  1084  	testJSONMarshal(t, &InstallationRepositoriesEvent{}, "{}")
  1085  
  1086  	u := &InstallationRepositoriesEvent{
  1087  		Action: String("a"),
  1088  		RepositoriesAdded: []*Repository{
  1089  			{
  1090  				ID:   Int64(1),
  1091  				URL:  String("s"),
  1092  				Name: String("n"),
  1093  			},
  1094  		},
  1095  		RepositoriesRemoved: []*Repository{
  1096  			{
  1097  				ID:   Int64(1),
  1098  				URL:  String("s"),
  1099  				Name: String("n"),
  1100  			},
  1101  		},
  1102  		RepositorySelection: String("rs"),
  1103  		Sender: &User{
  1104  			Login:     String("l"),
  1105  			ID:        Int64(1),
  1106  			NodeID:    String("n"),
  1107  			URL:       String("u"),
  1108  			ReposURL:  String("r"),
  1109  			EventsURL: String("e"),
  1110  			AvatarURL: String("a"),
  1111  		},
  1112  		Installation: &Installation{
  1113  			ID:       Int64(1),
  1114  			NodeID:   String("nid"),
  1115  			AppID:    Int64(1),
  1116  			AppSlug:  String("as"),
  1117  			TargetID: Int64(1),
  1118  			Account: &User{
  1119  				Login:           String("l"),
  1120  				ID:              Int64(1),
  1121  				URL:             String("u"),
  1122  				AvatarURL:       String("a"),
  1123  				GravatarID:      String("g"),
  1124  				Name:            String("n"),
  1125  				Company:         String("c"),
  1126  				Blog:            String("b"),
  1127  				Location:        String("l"),
  1128  				Email:           String("e"),
  1129  				Hireable:        Bool(true),
  1130  				Bio:             String("b"),
  1131  				TwitterUsername: String("t"),
  1132  				PublicRepos:     Int(1),
  1133  				Followers:       Int(1),
  1134  				Following:       Int(1),
  1135  				CreatedAt:       &Timestamp{referenceTime},
  1136  				SuspendedAt:     &Timestamp{referenceTime},
  1137  			},
  1138  			AccessTokensURL:     String("atu"),
  1139  			RepositoriesURL:     String("ru"),
  1140  			HTMLURL:             String("hu"),
  1141  			TargetType:          String("tt"),
  1142  			SingleFileName:      String("sfn"),
  1143  			RepositorySelection: String("rs"),
  1144  			Events:              []string{"e"},
  1145  			SingleFilePaths:     []string{"s"},
  1146  			Permissions: &InstallationPermissions{
  1147  				Actions:                       String("a"),
  1148  				Administration:                String("ad"),
  1149  				Checks:                        String("c"),
  1150  				Contents:                      String("co"),
  1151  				ContentReferences:             String("cr"),
  1152  				Deployments:                   String("d"),
  1153  				Environments:                  String("e"),
  1154  				Issues:                        String("i"),
  1155  				Metadata:                      String("md"),
  1156  				Members:                       String("m"),
  1157  				OrganizationAdministration:    String("oa"),
  1158  				OrganizationHooks:             String("oh"),
  1159  				OrganizationPlan:              String("op"),
  1160  				OrganizationPreReceiveHooks:   String("opr"),
  1161  				OrganizationProjects:          String("op"),
  1162  				OrganizationSecrets:           String("os"),
  1163  				OrganizationSelfHostedRunners: String("osh"),
  1164  				OrganizationUserBlocking:      String("oub"),
  1165  				Packages:                      String("pkg"),
  1166  				Pages:                         String("pg"),
  1167  				PullRequests:                  String("pr"),
  1168  				RepositoryHooks:               String("rh"),
  1169  				RepositoryProjects:            String("rp"),
  1170  				RepositoryPreReceiveHooks:     String("rprh"),
  1171  				Secrets:                       String("s"),
  1172  				SecretScanningAlerts:          String("ssa"),
  1173  				SecurityEvents:                String("se"),
  1174  				SingleFile:                    String("sf"),
  1175  				Statuses:                      String("s"),
  1176  				TeamDiscussions:               String("td"),
  1177  				VulnerabilityAlerts:           String("va"),
  1178  				Workflows:                     String("w"),
  1179  			},
  1180  			CreatedAt:              &Timestamp{referenceTime},
  1181  			UpdatedAt:              &Timestamp{referenceTime},
  1182  			HasMultipleSingleFiles: Bool(false),
  1183  			SuspendedBy: &User{
  1184  				Login:           String("l"),
  1185  				ID:              Int64(1),
  1186  				URL:             String("u"),
  1187  				AvatarURL:       String("a"),
  1188  				GravatarID:      String("g"),
  1189  				Name:            String("n"),
  1190  				Company:         String("c"),
  1191  				Blog:            String("b"),
  1192  				Location:        String("l"),
  1193  				Email:           String("e"),
  1194  				Hireable:        Bool(true),
  1195  				Bio:             String("b"),
  1196  				TwitterUsername: String("t"),
  1197  				PublicRepos:     Int(1),
  1198  				Followers:       Int(1),
  1199  				Following:       Int(1),
  1200  				CreatedAt:       &Timestamp{referenceTime},
  1201  				SuspendedAt:     &Timestamp{referenceTime},
  1202  			},
  1203  			SuspendedAt: &Timestamp{referenceTime},
  1204  		},
  1205  	}
  1206  
  1207  	want := `{
  1208  		"action": "a",
  1209  		"repositories_added": [
  1210  			{
  1211  				"id": 1,
  1212  				"name": "n",
  1213  				"url": "s"
  1214  			}
  1215  		],
  1216  		"repositories_removed": [
  1217  			{
  1218  				"id": 1,
  1219  				"name": "n",
  1220  				"url": "s"
  1221  			}
  1222  		],
  1223  		"repository_selection": "rs",
  1224  		"sender": {
  1225  			"login": "l",
  1226  			"id": 1,
  1227  			"node_id": "n",
  1228  			"avatar_url": "a",
  1229  			"url": "u",
  1230  			"events_url": "e",
  1231  			"repos_url": "r"
  1232  		},
  1233  		"installation": {
  1234  			"id": 1,
  1235  			"node_id": "nid",
  1236  			"app_id": 1,
  1237  			"app_slug": "as",
  1238  			"target_id": 1,
  1239  			"account": {
  1240  				"login": "l",
  1241  				"id": 1,
  1242  				"avatar_url": "a",
  1243  				"gravatar_id": "g",
  1244  				"name": "n",
  1245  				"company": "c",
  1246  				"blog": "b",
  1247  				"location": "l",
  1248  				"email": "e",
  1249  				"hireable": true,
  1250  				"bio": "b",
  1251  				"twitter_username": "t",
  1252  				"public_repos": 1,
  1253  				"followers": 1,
  1254  				"following": 1,
  1255  				"created_at": ` + referenceTimeStr + `,
  1256  				"suspended_at": ` + referenceTimeStr + `,
  1257  				"url": "u"
  1258  			},
  1259  			"access_tokens_url": "atu",
  1260  			"repositories_url": "ru",
  1261  			"html_url": "hu",
  1262  			"target_type": "tt",
  1263  			"single_file_name": "sfn",
  1264  			"repository_selection": "rs",
  1265  			"events": [
  1266  				"e"
  1267  			],
  1268  			"single_file_paths": [
  1269  				"s"
  1270  			],
  1271  			"permissions": {
  1272  				"actions": "a",
  1273  				"administration": "ad",
  1274  				"checks": "c",
  1275  				"contents": "co",
  1276  				"content_references": "cr",
  1277  				"deployments": "d",
  1278  				"environments": "e",
  1279  				"issues": "i",
  1280  				"metadata": "md",
  1281  				"members": "m",
  1282  				"organization_administration": "oa",
  1283  				"organization_hooks": "oh",
  1284  				"organization_plan": "op",
  1285  				"organization_pre_receive_hooks": "opr",
  1286  				"organization_projects": "op",
  1287  				"organization_secrets": "os",
  1288  				"organization_self_hosted_runners": "osh",
  1289  				"organization_user_blocking": "oub",
  1290  				"packages": "pkg",
  1291  				"pages": "pg",
  1292  				"pull_requests": "pr",
  1293  				"repository_hooks": "rh",
  1294  				"repository_projects": "rp",
  1295  				"repository_pre_receive_hooks": "rprh",
  1296  				"secrets": "s",
  1297  				"secret_scanning_alerts": "ssa",
  1298  				"security_events": "se",
  1299  				"single_file": "sf",
  1300  				"statuses": "s",
  1301  				"team_discussions": "td",
  1302  				"vulnerability_alerts": "va",
  1303  				"workflows": "w"
  1304  			},
  1305  			"created_at": ` + referenceTimeStr + `,
  1306  			"updated_at": ` + referenceTimeStr + `,
  1307  			"has_multiple_single_files": false,
  1308  			"suspended_by": {
  1309  				"login": "l",
  1310  				"id": 1,
  1311  				"avatar_url": "a",
  1312  				"gravatar_id": "g",
  1313  				"name": "n",
  1314  				"company": "c",
  1315  				"blog": "b",
  1316  				"location": "l",
  1317  				"email": "e",
  1318  				"hireable": true,
  1319  				"bio": "b",
  1320  				"twitter_username": "t",
  1321  				"public_repos": 1,
  1322  				"followers": 1,
  1323  				"following": 1,
  1324  				"created_at": ` + referenceTimeStr + `,
  1325  				"suspended_at": ` + referenceTimeStr + `,
  1326  				"url": "u"
  1327  			},
  1328  			"suspended_at": ` + referenceTimeStr + `
  1329  		}
  1330  	}`
  1331  
  1332  	testJSONMarshal(t, u, want)
  1333  }
  1334  
  1335  func TestEditTitle_Marshal(t *testing.T) {
  1336  	testJSONMarshal(t, &EditTitle{}, "{}")
  1337  
  1338  	u := &EditTitle{
  1339  		From: String("EditTitleFrom"),
  1340  	}
  1341  
  1342  	want := `{
  1343  		"from": "EditTitleFrom"
  1344  	}`
  1345  
  1346  	testJSONMarshal(t, u, want)
  1347  }
  1348  
  1349  func TestEditBody_Marshal(t *testing.T) {
  1350  	testJSONMarshal(t, &EditBody{}, "{}")
  1351  
  1352  	u := &EditBody{
  1353  		From: String("EditBodyFrom"),
  1354  	}
  1355  
  1356  	want := `{
  1357  		"from": "EditBodyFrom"
  1358  	}`
  1359  
  1360  	testJSONMarshal(t, u, want)
  1361  }
  1362  
  1363  func TestEditBase_Marshal(t *testing.T) {
  1364  	testJSONMarshal(t, &EditBase{}, "{}")
  1365  
  1366  	u := &EditBase{
  1367  		Ref: &EditRef{
  1368  			From: String("EditRefFrom"),
  1369  		},
  1370  		SHA: &EditSHA{
  1371  			From: String("EditSHAFrom"),
  1372  		},
  1373  	}
  1374  
  1375  	want := `{
  1376  		"ref": {
  1377  			"from": "EditRefFrom"
  1378  		},
  1379  		"sha": {
  1380  			"from": "EditSHAFrom"
  1381  		}
  1382  	}`
  1383  
  1384  	testJSONMarshal(t, u, want)
  1385  }
  1386  
  1387  func TestEditRef_Marshal(t *testing.T) {
  1388  	testJSONMarshal(t, &EditRef{}, "{}")
  1389  
  1390  	u := &EditRef{
  1391  		From: String("EditRefFrom"),
  1392  	}
  1393  
  1394  	want := `{
  1395  		"from": "EditRefFrom"
  1396  	}`
  1397  
  1398  	testJSONMarshal(t, u, want)
  1399  }
  1400  
  1401  func TestEditSHA_Marshal(t *testing.T) {
  1402  	testJSONMarshal(t, &EditSHA{}, "{}")
  1403  
  1404  	u := &EditSHA{
  1405  		From: String("EditSHAFrom"),
  1406  	}
  1407  
  1408  	want := `{
  1409  		"from": "EditSHAFrom"
  1410  	}`
  1411  
  1412  	testJSONMarshal(t, u, want)
  1413  }
  1414  
  1415  func TestProjectName_Marshal(t *testing.T) {
  1416  	testJSONMarshal(t, &ProjectName{}, "{}")
  1417  
  1418  	u := &ProjectName{
  1419  		From: String("ProjectNameFrom"),
  1420  	}
  1421  
  1422  	want := `{
  1423  		"from": "ProjectNameFrom"
  1424  	}`
  1425  
  1426  	testJSONMarshal(t, u, want)
  1427  }
  1428  
  1429  func TestProjectBody_Marshal(t *testing.T) {
  1430  	testJSONMarshal(t, &ProjectBody{}, "{}")
  1431  
  1432  	u := &ProjectBody{
  1433  		From: String("ProjectBodyFrom"),
  1434  	}
  1435  
  1436  	want := `{
  1437  		"from": "ProjectBodyFrom"
  1438  	}`
  1439  
  1440  	testJSONMarshal(t, u, want)
  1441  }
  1442  
  1443  func TestProjectCardNote_Marshal(t *testing.T) {
  1444  	testJSONMarshal(t, &ProjectCardNote{}, "{}")
  1445  
  1446  	u := &ProjectCardNote{
  1447  		From: String("ProjectCardNoteFrom"),
  1448  	}
  1449  
  1450  	want := `{
  1451  		"from": "ProjectCardNoteFrom"
  1452  	}`
  1453  
  1454  	testJSONMarshal(t, u, want)
  1455  }
  1456  
  1457  func TestProjectColumnName_Marshal(t *testing.T) {
  1458  	testJSONMarshal(t, &ProjectColumnName{}, "{}")
  1459  
  1460  	u := &ProjectColumnName{
  1461  		From: String("ProjectColumnNameFrom"),
  1462  	}
  1463  
  1464  	want := `{
  1465  		"from": "ProjectColumnNameFrom"
  1466  	}`
  1467  
  1468  	testJSONMarshal(t, u, want)
  1469  }
  1470  
  1471  func TestTeamDescription_Marshal(t *testing.T) {
  1472  	testJSONMarshal(t, &TeamDescription{}, "{}")
  1473  
  1474  	u := &TeamDescription{
  1475  		From: String("TeamDescriptionFrom"),
  1476  	}
  1477  
  1478  	want := `{
  1479  		"from": "TeamDescriptionFrom"
  1480  	}`
  1481  
  1482  	testJSONMarshal(t, u, want)
  1483  }
  1484  
  1485  func TestTeamName_Marshal(t *testing.T) {
  1486  	testJSONMarshal(t, &TeamName{}, "{}")
  1487  
  1488  	u := &TeamName{
  1489  		From: String("TeamNameFrom"),
  1490  	}
  1491  
  1492  	want := `{
  1493  		"from": "TeamNameFrom"
  1494  	}`
  1495  
  1496  	testJSONMarshal(t, u, want)
  1497  }
  1498  
  1499  func TestTeamPrivacy_Marshal(t *testing.T) {
  1500  	testJSONMarshal(t, &TeamPrivacy{}, "{}")
  1501  
  1502  	u := &TeamPrivacy{
  1503  		From: String("TeamPrivacyFrom"),
  1504  	}
  1505  
  1506  	want := `{
  1507  		"from": "TeamPrivacyFrom"
  1508  	}`
  1509  
  1510  	testJSONMarshal(t, u, want)
  1511  }
  1512  
  1513  func TestTeamRepository_Marshal(t *testing.T) {
  1514  	testJSONMarshal(t, &TeamRepository{}, "{}")
  1515  
  1516  	u := &TeamRepository{
  1517  		Permissions: &TeamPermissions{
  1518  			From: &TeamPermissionsFrom{
  1519  				Admin: Bool(true),
  1520  				Pull:  Bool(true),
  1521  				Push:  Bool(true),
  1522  			},
  1523  		},
  1524  	}
  1525  
  1526  	want := `{
  1527  		"permissions": {
  1528  			"from": {
  1529  				"admin": true,
  1530  				"pull": true,
  1531  				"push": true
  1532  			}
  1533  		}
  1534  	}`
  1535  
  1536  	testJSONMarshal(t, u, want)
  1537  }
  1538  
  1539  func TestTeamPermissions_Marshal(t *testing.T) {
  1540  	testJSONMarshal(t, &TeamPermissions{}, "{}")
  1541  
  1542  	u := &TeamPermissions{
  1543  		From: &TeamPermissionsFrom{
  1544  			Admin: Bool(true),
  1545  			Pull:  Bool(true),
  1546  			Push:  Bool(true),
  1547  		},
  1548  	}
  1549  
  1550  	want := `{
  1551  		"from": {
  1552  			"admin": true,
  1553  			"pull": true,
  1554  			"push": true
  1555  		}
  1556  	}`
  1557  
  1558  	testJSONMarshal(t, u, want)
  1559  }
  1560  
  1561  func TestTeamPermissionsFrom_Marshal(t *testing.T) {
  1562  	testJSONMarshal(t, &TeamPermissionsFrom{}, "{}")
  1563  
  1564  	u := &TeamPermissionsFrom{
  1565  		Admin: Bool(true),
  1566  		Pull:  Bool(true),
  1567  		Push:  Bool(true),
  1568  	}
  1569  
  1570  	want := `{
  1571  		"admin": true,
  1572  		"pull": true,
  1573  		"push": true
  1574  	}`
  1575  
  1576  	testJSONMarshal(t, u, want)
  1577  }
  1578  
  1579  func TestRepositoryVulnerabilityAlert_Marshal(t *testing.T) {
  1580  	testJSONMarshal(t, &RepositoryVulnerabilityAlert{}, "{}")
  1581  
  1582  	u := &RepositoryVulnerabilityAlert{
  1583  		ID:                  Int64(1),
  1584  		AffectedRange:       String("ar"),
  1585  		AffectedPackageName: String("apn"),
  1586  		ExternalReference:   String("er"),
  1587  		ExternalIdentifier:  String("ei"),
  1588  		FixedIn:             String("fi"),
  1589  		Dismisser: &User{
  1590  			Login:     String("l"),
  1591  			ID:        Int64(1),
  1592  			NodeID:    String("n"),
  1593  			URL:       String("u"),
  1594  			ReposURL:  String("r"),
  1595  			EventsURL: String("e"),
  1596  			AvatarURL: String("a"),
  1597  		},
  1598  		DismissReason: String("dr"),
  1599  		DismissedAt:   &Timestamp{referenceTime},
  1600  	}
  1601  
  1602  	want := `{
  1603  		"id": 1,
  1604  		"affected_range": "ar",
  1605  		"affected_package_name": "apn",
  1606  		"external_reference": "er",
  1607  		"external_identifier": "ei",
  1608  		"fixed_in": "fi",
  1609  		"dismisser": {
  1610  			"login": "l",
  1611  			"id": 1,
  1612  			"node_id": "n",
  1613  			"avatar_url": "a",
  1614  			"url": "u",
  1615  			"events_url": "e",
  1616  			"repos_url": "r"
  1617  		},
  1618  		"dismiss_reason": "dr",
  1619  		"dismissed_at": ` + referenceTimeStr + `
  1620  	}`
  1621  
  1622  	testJSONMarshal(t, u, want)
  1623  }
  1624  
  1625  func TestPage_Marshal(t *testing.T) {
  1626  	testJSONMarshal(t, &Page{}, "{}")
  1627  
  1628  	u := &Page{
  1629  		PageName: String("p"),
  1630  		Title:    String("t"),
  1631  		Summary:  String("s"),
  1632  		Action:   String("a"),
  1633  		SHA:      String("s"),
  1634  		HTMLURL:  String("h"),
  1635  	}
  1636  
  1637  	want := `{
  1638  		"page_name": "p",
  1639  		"title": "t",
  1640  		"summary": "s",
  1641  		"action": "a",
  1642  		"sha": "s",
  1643  		"html_url": "h"
  1644  	}`
  1645  
  1646  	testJSONMarshal(t, u, want)
  1647  }
  1648  
  1649  func TestTeamChange_Marshal(t *testing.T) {
  1650  	testJSONMarshal(t, &TeamChange{}, "{}")
  1651  
  1652  	u := &TeamChange{
  1653  		Description: &TeamDescription{
  1654  			From: String("DescriptionFrom"),
  1655  		},
  1656  		Name: &TeamName{
  1657  			From: String("NameFrom"),
  1658  		},
  1659  		Privacy: &TeamPrivacy{
  1660  			From: String("PrivacyFrom"),
  1661  		},
  1662  		Repository: &TeamRepository{
  1663  			Permissions: &TeamPermissions{
  1664  				From: &TeamPermissionsFrom{
  1665  					Admin: Bool(false),
  1666  					Pull:  Bool(false),
  1667  					Push:  Bool(false),
  1668  				},
  1669  			},
  1670  		},
  1671  	}
  1672  
  1673  	want := `{
  1674  		"description": {
  1675  			"from": "DescriptionFrom"
  1676  		},
  1677  		"name": {
  1678  			"from": "NameFrom"
  1679  		},
  1680  		"privacy": {
  1681  			"from": "PrivacyFrom"
  1682  		},
  1683  		"repository": {
  1684  			"permissions": {
  1685  				"from": {
  1686  					"admin": false,
  1687  					"pull": false,
  1688  					"push": false
  1689  				}
  1690  			}
  1691  		}
  1692  	}`
  1693  
  1694  	testJSONMarshal(t, u, want)
  1695  }
  1696  
  1697  func TestIssueCommentEvent_Marshal(t *testing.T) {
  1698  	testJSONMarshal(t, &IssueCommentEvent{}, "{}")
  1699  
  1700  	u := &IssueCommentEvent{
  1701  		Action:  String("a"),
  1702  		Issue:   &Issue{ID: Int64(1)},
  1703  		Comment: &IssueComment{ID: Int64(1)},
  1704  		Changes: &EditChange{
  1705  			Title: &EditTitle{
  1706  				From: String("TitleFrom"),
  1707  			},
  1708  			Body: &EditBody{
  1709  				From: String("BodyFrom"),
  1710  			},
  1711  			Base: &EditBase{
  1712  				Ref: &EditRef{
  1713  					From: String("BaseRefFrom"),
  1714  				},
  1715  				SHA: &EditSHA{
  1716  					From: String("BaseSHAFrom"),
  1717  				},
  1718  			},
  1719  		},
  1720  		Repo: &Repository{
  1721  			ID:   Int64(1),
  1722  			URL:  String("s"),
  1723  			Name: String("n"),
  1724  		},
  1725  		Sender: &User{
  1726  			Login:     String("l"),
  1727  			ID:        Int64(1),
  1728  			NodeID:    String("n"),
  1729  			URL:       String("u"),
  1730  			ReposURL:  String("r"),
  1731  			EventsURL: String("e"),
  1732  			AvatarURL: String("a"),
  1733  		},
  1734  		Installation: &Installation{
  1735  			ID:       Int64(1),
  1736  			NodeID:   String("nid"),
  1737  			AppID:    Int64(1),
  1738  			AppSlug:  String("as"),
  1739  			TargetID: Int64(1),
  1740  			Account: &User{
  1741  				Login:           String("l"),
  1742  				ID:              Int64(1),
  1743  				URL:             String("u"),
  1744  				AvatarURL:       String("a"),
  1745  				GravatarID:      String("g"),
  1746  				Name:            String("n"),
  1747  				Company:         String("c"),
  1748  				Blog:            String("b"),
  1749  				Location:        String("l"),
  1750  				Email:           String("e"),
  1751  				Hireable:        Bool(true),
  1752  				Bio:             String("b"),
  1753  				TwitterUsername: String("t"),
  1754  				PublicRepos:     Int(1),
  1755  				Followers:       Int(1),
  1756  				Following:       Int(1),
  1757  				CreatedAt:       &Timestamp{referenceTime},
  1758  				SuspendedAt:     &Timestamp{referenceTime},
  1759  			},
  1760  			AccessTokensURL:     String("atu"),
  1761  			RepositoriesURL:     String("ru"),
  1762  			HTMLURL:             String("hu"),
  1763  			TargetType:          String("tt"),
  1764  			SingleFileName:      String("sfn"),
  1765  			RepositorySelection: String("rs"),
  1766  			Events:              []string{"e"},
  1767  			SingleFilePaths:     []string{"s"},
  1768  			Permissions: &InstallationPermissions{
  1769  				Actions:                       String("a"),
  1770  				Administration:                String("ad"),
  1771  				Checks:                        String("c"),
  1772  				Contents:                      String("co"),
  1773  				ContentReferences:             String("cr"),
  1774  				Deployments:                   String("d"),
  1775  				Environments:                  String("e"),
  1776  				Issues:                        String("i"),
  1777  				Metadata:                      String("md"),
  1778  				Members:                       String("m"),
  1779  				OrganizationAdministration:    String("oa"),
  1780  				OrganizationHooks:             String("oh"),
  1781  				OrganizationPlan:              String("op"),
  1782  				OrganizationPreReceiveHooks:   String("opr"),
  1783  				OrganizationProjects:          String("op"),
  1784  				OrganizationSecrets:           String("os"),
  1785  				OrganizationSelfHostedRunners: String("osh"),
  1786  				OrganizationUserBlocking:      String("oub"),
  1787  				Packages:                      String("pkg"),
  1788  				Pages:                         String("pg"),
  1789  				PullRequests:                  String("pr"),
  1790  				RepositoryHooks:               String("rh"),
  1791  				RepositoryProjects:            String("rp"),
  1792  				RepositoryPreReceiveHooks:     String("rprh"),
  1793  				Secrets:                       String("s"),
  1794  				SecretScanningAlerts:          String("ssa"),
  1795  				SecurityEvents:                String("se"),
  1796  				SingleFile:                    String("sf"),
  1797  				Statuses:                      String("s"),
  1798  				TeamDiscussions:               String("td"),
  1799  				VulnerabilityAlerts:           String("va"),
  1800  				Workflows:                     String("w"),
  1801  			},
  1802  			CreatedAt:              &Timestamp{referenceTime},
  1803  			UpdatedAt:              &Timestamp{referenceTime},
  1804  			HasMultipleSingleFiles: Bool(false),
  1805  			SuspendedBy: &User{
  1806  				Login:           String("l"),
  1807  				ID:              Int64(1),
  1808  				URL:             String("u"),
  1809  				AvatarURL:       String("a"),
  1810  				GravatarID:      String("g"),
  1811  				Name:            String("n"),
  1812  				Company:         String("c"),
  1813  				Blog:            String("b"),
  1814  				Location:        String("l"),
  1815  				Email:           String("e"),
  1816  				Hireable:        Bool(true),
  1817  				Bio:             String("b"),
  1818  				TwitterUsername: String("t"),
  1819  				PublicRepos:     Int(1),
  1820  				Followers:       Int(1),
  1821  				Following:       Int(1),
  1822  				CreatedAt:       &Timestamp{referenceTime},
  1823  				SuspendedAt:     &Timestamp{referenceTime},
  1824  			},
  1825  			SuspendedAt: &Timestamp{referenceTime},
  1826  		},
  1827  		Organization: &Organization{
  1828  			BillingEmail:                         String("be"),
  1829  			Blog:                                 String("b"),
  1830  			Company:                              String("c"),
  1831  			Email:                                String("e"),
  1832  			TwitterUsername:                      String("tu"),
  1833  			Location:                             String("loc"),
  1834  			Name:                                 String("n"),
  1835  			Description:                          String("d"),
  1836  			IsVerified:                           Bool(true),
  1837  			HasOrganizationProjects:              Bool(true),
  1838  			HasRepositoryProjects:                Bool(true),
  1839  			DefaultRepoPermission:                String("drp"),
  1840  			MembersCanCreateRepos:                Bool(true),
  1841  			MembersCanCreateInternalRepos:        Bool(true),
  1842  			MembersCanCreatePrivateRepos:         Bool(true),
  1843  			MembersCanCreatePublicRepos:          Bool(false),
  1844  			MembersAllowedRepositoryCreationType: String("marct"),
  1845  			MembersCanCreatePages:                Bool(true),
  1846  			MembersCanCreatePublicPages:          Bool(false),
  1847  			MembersCanCreatePrivatePages:         Bool(true),
  1848  		},
  1849  	}
  1850  
  1851  	want := `{
  1852  		"action": "a",
  1853  		"issue": {
  1854  			"id": 1
  1855  		},
  1856  		"comment": {
  1857  			"id": 1
  1858  		},
  1859  		"changes": {
  1860  			"title": {
  1861  				"from": "TitleFrom"
  1862  			},
  1863  			"body": {
  1864  				"from": "BodyFrom"
  1865  			},
  1866  			"base": {
  1867  				"ref": {
  1868  					"from": "BaseRefFrom"
  1869  				},
  1870  				"sha": {
  1871  					"from": "BaseSHAFrom"
  1872  				}
  1873  			}
  1874  		},
  1875  		"repository": {
  1876  			"id": 1,
  1877  			"name": "n",
  1878  			"url": "s"
  1879  		},
  1880  		"sender": {
  1881  			"login": "l",
  1882  			"id": 1,
  1883  			"node_id": "n",
  1884  			"avatar_url": "a",
  1885  			"url": "u",
  1886  			"events_url": "e",
  1887  			"repos_url": "r"
  1888  		},
  1889  		"installation": {
  1890  			"id": 1,
  1891  			"node_id": "nid",
  1892  			"app_id": 1,
  1893  			"app_slug": "as",
  1894  			"target_id": 1,
  1895  			"account": {
  1896  				"login": "l",
  1897  				"id": 1,
  1898  				"avatar_url": "a",
  1899  				"gravatar_id": "g",
  1900  				"name": "n",
  1901  				"company": "c",
  1902  				"blog": "b",
  1903  				"location": "l",
  1904  				"email": "e",
  1905  				"hireable": true,
  1906  				"bio": "b",
  1907  				"twitter_username": "t",
  1908  				"public_repos": 1,
  1909  				"followers": 1,
  1910  				"following": 1,
  1911  				"created_at": ` + referenceTimeStr + `,
  1912  				"suspended_at": ` + referenceTimeStr + `,
  1913  				"url": "u"
  1914  			},
  1915  			"access_tokens_url": "atu",
  1916  			"repositories_url": "ru",
  1917  			"html_url": "hu",
  1918  			"target_type": "tt",
  1919  			"single_file_name": "sfn",
  1920  			"repository_selection": "rs",
  1921  			"events": [
  1922  				"e"
  1923  			],
  1924  			"single_file_paths": [
  1925  				"s"
  1926  			],
  1927  			"permissions": {
  1928  				"actions": "a",
  1929  				"administration": "ad",
  1930  				"checks": "c",
  1931  				"contents": "co",
  1932  				"content_references": "cr",
  1933  				"deployments": "d",
  1934  				"environments": "e",
  1935  				"issues": "i",
  1936  				"metadata": "md",
  1937  				"members": "m",
  1938  				"organization_administration": "oa",
  1939  				"organization_hooks": "oh",
  1940  				"organization_plan": "op",
  1941  				"organization_pre_receive_hooks": "opr",
  1942  				"organization_projects": "op",
  1943  				"organization_secrets": "os",
  1944  				"organization_self_hosted_runners": "osh",
  1945  				"organization_user_blocking": "oub",
  1946  				"packages": "pkg",
  1947  				"pages": "pg",
  1948  				"pull_requests": "pr",
  1949  				"repository_hooks": "rh",
  1950  				"repository_projects": "rp",
  1951  				"repository_pre_receive_hooks": "rprh",
  1952  				"secrets": "s",
  1953  				"secret_scanning_alerts": "ssa",
  1954  				"security_events": "se",
  1955  				"single_file": "sf",
  1956  				"statuses": "s",
  1957  				"team_discussions": "td",
  1958  				"vulnerability_alerts": "va",
  1959  				"workflows": "w"
  1960  			},
  1961  			"created_at": ` + referenceTimeStr + `,
  1962  			"updated_at": ` + referenceTimeStr + `,
  1963  			"has_multiple_single_files": false,
  1964  			"suspended_by": {
  1965  				"login": "l",
  1966  				"id": 1,
  1967  				"avatar_url": "a",
  1968  				"gravatar_id": "g",
  1969  				"name": "n",
  1970  				"company": "c",
  1971  				"blog": "b",
  1972  				"location": "l",
  1973  				"email": "e",
  1974  				"hireable": true,
  1975  				"bio": "b",
  1976  				"twitter_username": "t",
  1977  				"public_repos": 1,
  1978  				"followers": 1,
  1979  				"following": 1,
  1980  				"created_at": ` + referenceTimeStr + `,
  1981  				"suspended_at": ` + referenceTimeStr + `,
  1982  				"url": "u"
  1983  			},
  1984  			"suspended_at": ` + referenceTimeStr + `
  1985  		},
  1986  		"organization": {
  1987  			"name": "n",
  1988  			"company": "c",
  1989  			"blog": "b",
  1990  			"location": "loc",
  1991  			"email": "e",
  1992  			"twitter_username": "tu",
  1993  			"description": "d",
  1994  			"billing_email": "be",
  1995  			"is_verified": true,
  1996  			"has_organization_projects": true,
  1997  			"has_repository_projects": true,
  1998  			"default_repository_permission": "drp",
  1999  			"members_can_create_repositories": true,
  2000  			"members_can_create_public_repositories": false,
  2001  			"members_can_create_private_repositories": true,
  2002  			"members_can_create_internal_repositories": true,
  2003  			"members_allowed_repository_creation_type": "marct",
  2004  			"members_can_create_pages": true,
  2005  			"members_can_create_public_pages": false,
  2006  			"members_can_create_private_pages": true
  2007  		}
  2008  	}`
  2009  
  2010  	testJSONMarshal(t, u, want)
  2011  }
  2012  
  2013  func TestIssuesEvent_Marshal(t *testing.T) {
  2014  	testJSONMarshal(t, &IssuesEvent{}, "{}")
  2015  
  2016  	u := &IssuesEvent{
  2017  		Action: String("a"),
  2018  		Issue:  &Issue{ID: Int64(1)},
  2019  		Assignee: &User{
  2020  			Login:     String("l"),
  2021  			ID:        Int64(1),
  2022  			NodeID:    String("n"),
  2023  			URL:       String("u"),
  2024  			ReposURL:  String("r"),
  2025  			EventsURL: String("e"),
  2026  			AvatarURL: String("a"),
  2027  		},
  2028  		Label: &Label{ID: Int64(1)},
  2029  		Changes: &EditChange{
  2030  			Title: &EditTitle{
  2031  				From: String("TitleFrom"),
  2032  			},
  2033  			Body: &EditBody{
  2034  				From: String("BodyFrom"),
  2035  			},
  2036  			Base: &EditBase{
  2037  				Ref: &EditRef{
  2038  					From: String("BaseRefFrom"),
  2039  				},
  2040  				SHA: &EditSHA{
  2041  					From: String("BaseSHAFrom"),
  2042  				},
  2043  			},
  2044  		},
  2045  		Repo: &Repository{
  2046  			ID:   Int64(1),
  2047  			URL:  String("s"),
  2048  			Name: String("n"),
  2049  		},
  2050  		Sender: &User{
  2051  			Login:     String("l"),
  2052  			ID:        Int64(1),
  2053  			NodeID:    String("n"),
  2054  			URL:       String("u"),
  2055  			ReposURL:  String("r"),
  2056  			EventsURL: String("e"),
  2057  			AvatarURL: String("a"),
  2058  		},
  2059  		Installation: &Installation{
  2060  			ID:       Int64(1),
  2061  			NodeID:   String("nid"),
  2062  			AppID:    Int64(1),
  2063  			AppSlug:  String("as"),
  2064  			TargetID: Int64(1),
  2065  			Account: &User{
  2066  				Login:           String("l"),
  2067  				ID:              Int64(1),
  2068  				URL:             String("u"),
  2069  				AvatarURL:       String("a"),
  2070  				GravatarID:      String("g"),
  2071  				Name:            String("n"),
  2072  				Company:         String("c"),
  2073  				Blog:            String("b"),
  2074  				Location:        String("l"),
  2075  				Email:           String("e"),
  2076  				Hireable:        Bool(true),
  2077  				Bio:             String("b"),
  2078  				TwitterUsername: String("t"),
  2079  				PublicRepos:     Int(1),
  2080  				Followers:       Int(1),
  2081  				Following:       Int(1),
  2082  				CreatedAt:       &Timestamp{referenceTime},
  2083  				SuspendedAt:     &Timestamp{referenceTime},
  2084  			},
  2085  			AccessTokensURL:     String("atu"),
  2086  			RepositoriesURL:     String("ru"),
  2087  			HTMLURL:             String("hu"),
  2088  			TargetType:          String("tt"),
  2089  			SingleFileName:      String("sfn"),
  2090  			RepositorySelection: String("rs"),
  2091  			Events:              []string{"e"},
  2092  			SingleFilePaths:     []string{"s"},
  2093  			Permissions: &InstallationPermissions{
  2094  				Actions:                       String("a"),
  2095  				Administration:                String("ad"),
  2096  				Checks:                        String("c"),
  2097  				Contents:                      String("co"),
  2098  				ContentReferences:             String("cr"),
  2099  				Deployments:                   String("d"),
  2100  				Environments:                  String("e"),
  2101  				Issues:                        String("i"),
  2102  				Metadata:                      String("md"),
  2103  				Members:                       String("m"),
  2104  				OrganizationAdministration:    String("oa"),
  2105  				OrganizationHooks:             String("oh"),
  2106  				OrganizationPlan:              String("op"),
  2107  				OrganizationPreReceiveHooks:   String("opr"),
  2108  				OrganizationProjects:          String("op"),
  2109  				OrganizationSecrets:           String("os"),
  2110  				OrganizationSelfHostedRunners: String("osh"),
  2111  				OrganizationUserBlocking:      String("oub"),
  2112  				Packages:                      String("pkg"),
  2113  				Pages:                         String("pg"),
  2114  				PullRequests:                  String("pr"),
  2115  				RepositoryHooks:               String("rh"),
  2116  				RepositoryProjects:            String("rp"),
  2117  				RepositoryPreReceiveHooks:     String("rprh"),
  2118  				Secrets:                       String("s"),
  2119  				SecretScanningAlerts:          String("ssa"),
  2120  				SecurityEvents:                String("se"),
  2121  				SingleFile:                    String("sf"),
  2122  				Statuses:                      String("s"),
  2123  				TeamDiscussions:               String("td"),
  2124  				VulnerabilityAlerts:           String("va"),
  2125  				Workflows:                     String("w"),
  2126  			},
  2127  			CreatedAt:              &Timestamp{referenceTime},
  2128  			UpdatedAt:              &Timestamp{referenceTime},
  2129  			HasMultipleSingleFiles: Bool(false),
  2130  			SuspendedBy: &User{
  2131  				Login:           String("l"),
  2132  				ID:              Int64(1),
  2133  				URL:             String("u"),
  2134  				AvatarURL:       String("a"),
  2135  				GravatarID:      String("g"),
  2136  				Name:            String("n"),
  2137  				Company:         String("c"),
  2138  				Blog:            String("b"),
  2139  				Location:        String("l"),
  2140  				Email:           String("e"),
  2141  				Hireable:        Bool(true),
  2142  				Bio:             String("b"),
  2143  				TwitterUsername: String("t"),
  2144  				PublicRepos:     Int(1),
  2145  				Followers:       Int(1),
  2146  				Following:       Int(1),
  2147  				CreatedAt:       &Timestamp{referenceTime},
  2148  				SuspendedAt:     &Timestamp{referenceTime},
  2149  			},
  2150  			SuspendedAt: &Timestamp{referenceTime},
  2151  		},
  2152  	}
  2153  
  2154  	want := `{
  2155  		"action": "a",
  2156  		"issue": {
  2157  			"id": 1
  2158  		},
  2159  		"assignee": {
  2160  			"login": "l",
  2161  			"id": 1,
  2162  			"node_id": "n",
  2163  			"avatar_url": "a",
  2164  			"url": "u",
  2165  			"events_url": "e",
  2166  			"repos_url": "r"
  2167  		},
  2168  		"label": {
  2169  			"id": 1
  2170  		},
  2171  		"changes": {
  2172  			"title": {
  2173  				"from": "TitleFrom"
  2174  			},
  2175  			"body": {
  2176  				"from": "BodyFrom"
  2177  			},
  2178  			"base": {
  2179  				"ref": {
  2180  					"from": "BaseRefFrom"
  2181  				},
  2182  				"sha": {
  2183  					"from": "BaseSHAFrom"
  2184  				}
  2185  			}
  2186  		},
  2187  		"repository": {
  2188  			"id": 1,
  2189  			"name": "n",
  2190  			"url": "s"
  2191  		},
  2192  		"sender": {
  2193  			"login": "l",
  2194  			"id": 1,
  2195  			"node_id": "n",
  2196  			"avatar_url": "a",
  2197  			"url": "u",
  2198  			"events_url": "e",
  2199  			"repos_url": "r"
  2200  		},
  2201  		"installation": {
  2202  			"id": 1,
  2203  			"node_id": "nid",
  2204  			"app_id": 1,
  2205  			"app_slug": "as",
  2206  			"target_id": 1,
  2207  			"account": {
  2208  				"login": "l",
  2209  				"id": 1,
  2210  				"avatar_url": "a",
  2211  				"gravatar_id": "g",
  2212  				"name": "n",
  2213  				"company": "c",
  2214  				"blog": "b",
  2215  				"location": "l",
  2216  				"email": "e",
  2217  				"hireable": true,
  2218  				"bio": "b",
  2219  				"twitter_username": "t",
  2220  				"public_repos": 1,
  2221  				"followers": 1,
  2222  				"following": 1,
  2223  				"created_at": ` + referenceTimeStr + `,
  2224  				"suspended_at": ` + referenceTimeStr + `,
  2225  				"url": "u"
  2226  			},
  2227  			"access_tokens_url": "atu",
  2228  			"repositories_url": "ru",
  2229  			"html_url": "hu",
  2230  			"target_type": "tt",
  2231  			"single_file_name": "sfn",
  2232  			"repository_selection": "rs",
  2233  			"events": [
  2234  				"e"
  2235  			],
  2236  			"single_file_paths": [
  2237  				"s"
  2238  			],
  2239  			"permissions": {
  2240  				"actions": "a",
  2241  				"administration": "ad",
  2242  				"checks": "c",
  2243  				"contents": "co",
  2244  				"content_references": "cr",
  2245  				"deployments": "d",
  2246  				"environments": "e",
  2247  				"issues": "i",
  2248  				"metadata": "md",
  2249  				"members": "m",
  2250  				"organization_administration": "oa",
  2251  				"organization_hooks": "oh",
  2252  				"organization_plan": "op",
  2253  				"organization_pre_receive_hooks": "opr",
  2254  				"organization_projects": "op",
  2255  				"organization_secrets": "os",
  2256  				"organization_self_hosted_runners": "osh",
  2257  				"organization_user_blocking": "oub",
  2258  				"packages": "pkg",
  2259  				"pages": "pg",
  2260  				"pull_requests": "pr",
  2261  				"repository_hooks": "rh",
  2262  				"repository_projects": "rp",
  2263  				"repository_pre_receive_hooks": "rprh",
  2264  				"secrets": "s",
  2265  				"secret_scanning_alerts": "ssa",
  2266  				"security_events": "se",
  2267  				"single_file": "sf",
  2268  				"statuses": "s",
  2269  				"team_discussions": "td",
  2270  				"vulnerability_alerts": "va",
  2271  				"workflows": "w"
  2272  			},
  2273  			"created_at": ` + referenceTimeStr + `,
  2274  			"updated_at": ` + referenceTimeStr + `,
  2275  			"has_multiple_single_files": false,
  2276  			"suspended_by": {
  2277  				"login": "l",
  2278  				"id": 1,
  2279  				"avatar_url": "a",
  2280  				"gravatar_id": "g",
  2281  				"name": "n",
  2282  				"company": "c",
  2283  				"blog": "b",
  2284  				"location": "l",
  2285  				"email": "e",
  2286  				"hireable": true,
  2287  				"bio": "b",
  2288  				"twitter_username": "t",
  2289  				"public_repos": 1,
  2290  				"followers": 1,
  2291  				"following": 1,
  2292  				"created_at": ` + referenceTimeStr + `,
  2293  				"suspended_at": ` + referenceTimeStr + `,
  2294  				"url": "u"
  2295  			},
  2296  			"suspended_at": ` + referenceTimeStr + `
  2297  		}
  2298  	}`
  2299  
  2300  	testJSONMarshal(t, u, want)
  2301  }
  2302  
  2303  func TestLabelEvent_Marshal(t *testing.T) {
  2304  	testJSONMarshal(t, &LabelEvent{}, "{}")
  2305  
  2306  	u := &LabelEvent{
  2307  		Action: String("a"),
  2308  		Label:  &Label{ID: Int64(1)},
  2309  		Changes: &EditChange{
  2310  			Title: &EditTitle{
  2311  				From: String("TitleFrom"),
  2312  			},
  2313  			Body: &EditBody{
  2314  				From: String("BodyFrom"),
  2315  			},
  2316  			Base: &EditBase{
  2317  				Ref: &EditRef{
  2318  					From: String("BaseRefFrom"),
  2319  				},
  2320  				SHA: &EditSHA{
  2321  					From: String("BaseSHAFrom"),
  2322  				},
  2323  			},
  2324  		},
  2325  		Repo: &Repository{
  2326  			ID:   Int64(1),
  2327  			URL:  String("s"),
  2328  			Name: String("n"),
  2329  		},
  2330  		Org: &Organization{
  2331  			BillingEmail:                         String("be"),
  2332  			Blog:                                 String("b"),
  2333  			Company:                              String("c"),
  2334  			Email:                                String("e"),
  2335  			TwitterUsername:                      String("tu"),
  2336  			Location:                             String("loc"),
  2337  			Name:                                 String("n"),
  2338  			Description:                          String("d"),
  2339  			IsVerified:                           Bool(true),
  2340  			HasOrganizationProjects:              Bool(true),
  2341  			HasRepositoryProjects:                Bool(true),
  2342  			DefaultRepoPermission:                String("drp"),
  2343  			MembersCanCreateRepos:                Bool(true),
  2344  			MembersCanCreateInternalRepos:        Bool(true),
  2345  			MembersCanCreatePrivateRepos:         Bool(true),
  2346  			MembersCanCreatePublicRepos:          Bool(false),
  2347  			MembersAllowedRepositoryCreationType: String("marct"),
  2348  			MembersCanCreatePages:                Bool(true),
  2349  			MembersCanCreatePublicPages:          Bool(false),
  2350  			MembersCanCreatePrivatePages:         Bool(true),
  2351  		},
  2352  		Installation: &Installation{
  2353  			ID:       Int64(1),
  2354  			NodeID:   String("nid"),
  2355  			AppID:    Int64(1),
  2356  			AppSlug:  String("as"),
  2357  			TargetID: Int64(1),
  2358  			Account: &User{
  2359  				Login:           String("l"),
  2360  				ID:              Int64(1),
  2361  				URL:             String("u"),
  2362  				AvatarURL:       String("a"),
  2363  				GravatarID:      String("g"),
  2364  				Name:            String("n"),
  2365  				Company:         String("c"),
  2366  				Blog:            String("b"),
  2367  				Location:        String("l"),
  2368  				Email:           String("e"),
  2369  				Hireable:        Bool(true),
  2370  				Bio:             String("b"),
  2371  				TwitterUsername: String("t"),
  2372  				PublicRepos:     Int(1),
  2373  				Followers:       Int(1),
  2374  				Following:       Int(1),
  2375  				CreatedAt:       &Timestamp{referenceTime},
  2376  				SuspendedAt:     &Timestamp{referenceTime},
  2377  			},
  2378  			AccessTokensURL:     String("atu"),
  2379  			RepositoriesURL:     String("ru"),
  2380  			HTMLURL:             String("hu"),
  2381  			TargetType:          String("tt"),
  2382  			SingleFileName:      String("sfn"),
  2383  			RepositorySelection: String("rs"),
  2384  			Events:              []string{"e"},
  2385  			SingleFilePaths:     []string{"s"},
  2386  			Permissions: &InstallationPermissions{
  2387  				Actions:                       String("a"),
  2388  				Administration:                String("ad"),
  2389  				Checks:                        String("c"),
  2390  				Contents:                      String("co"),
  2391  				ContentReferences:             String("cr"),
  2392  				Deployments:                   String("d"),
  2393  				Environments:                  String("e"),
  2394  				Issues:                        String("i"),
  2395  				Metadata:                      String("md"),
  2396  				Members:                       String("m"),
  2397  				OrganizationAdministration:    String("oa"),
  2398  				OrganizationHooks:             String("oh"),
  2399  				OrganizationPlan:              String("op"),
  2400  				OrganizationPreReceiveHooks:   String("opr"),
  2401  				OrganizationProjects:          String("op"),
  2402  				OrganizationSecrets:           String("os"),
  2403  				OrganizationSelfHostedRunners: String("osh"),
  2404  				OrganizationUserBlocking:      String("oub"),
  2405  				Packages:                      String("pkg"),
  2406  				Pages:                         String("pg"),
  2407  				PullRequests:                  String("pr"),
  2408  				RepositoryHooks:               String("rh"),
  2409  				RepositoryProjects:            String("rp"),
  2410  				RepositoryPreReceiveHooks:     String("rprh"),
  2411  				Secrets:                       String("s"),
  2412  				SecretScanningAlerts:          String("ssa"),
  2413  				SecurityEvents:                String("se"),
  2414  				SingleFile:                    String("sf"),
  2415  				Statuses:                      String("s"),
  2416  				TeamDiscussions:               String("td"),
  2417  				VulnerabilityAlerts:           String("va"),
  2418  				Workflows:                     String("w"),
  2419  			},
  2420  			CreatedAt:              &Timestamp{referenceTime},
  2421  			UpdatedAt:              &Timestamp{referenceTime},
  2422  			HasMultipleSingleFiles: Bool(false),
  2423  			SuspendedBy: &User{
  2424  				Login:           String("l"),
  2425  				ID:              Int64(1),
  2426  				URL:             String("u"),
  2427  				AvatarURL:       String("a"),
  2428  				GravatarID:      String("g"),
  2429  				Name:            String("n"),
  2430  				Company:         String("c"),
  2431  				Blog:            String("b"),
  2432  				Location:        String("l"),
  2433  				Email:           String("e"),
  2434  				Hireable:        Bool(true),
  2435  				Bio:             String("b"),
  2436  				TwitterUsername: String("t"),
  2437  				PublicRepos:     Int(1),
  2438  				Followers:       Int(1),
  2439  				Following:       Int(1),
  2440  				CreatedAt:       &Timestamp{referenceTime},
  2441  				SuspendedAt:     &Timestamp{referenceTime},
  2442  			},
  2443  			SuspendedAt: &Timestamp{referenceTime},
  2444  		},
  2445  	}
  2446  
  2447  	want := `{
  2448  		"action": "a",
  2449  		"label": {
  2450  			"id": 1
  2451  		},
  2452  		"changes": {
  2453  			"title": {
  2454  				"from": "TitleFrom"
  2455  			},
  2456  			"body": {
  2457  				"from": "BodyFrom"
  2458  			},
  2459  			"base": {
  2460  				"ref": {
  2461  					"from": "BaseRefFrom"
  2462  				},
  2463  				"sha": {
  2464  					"from": "BaseSHAFrom"
  2465  				}
  2466  			}
  2467  		},
  2468  		"repository": {
  2469  			"id": 1,
  2470  			"name": "n",
  2471  			"url": "s"
  2472  		},
  2473  		"organization": {
  2474  			"name": "n",
  2475  			"company": "c",
  2476  			"blog": "b",
  2477  			"location": "loc",
  2478  			"email": "e",
  2479  			"twitter_username": "tu",
  2480  			"description": "d",
  2481  			"billing_email": "be",
  2482  			"is_verified": true,
  2483  			"has_organization_projects": true,
  2484  			"has_repository_projects": true,
  2485  			"default_repository_permission": "drp",
  2486  			"members_can_create_repositories": true,
  2487  			"members_can_create_public_repositories": false,
  2488  			"members_can_create_private_repositories": true,
  2489  			"members_can_create_internal_repositories": true,
  2490  			"members_allowed_repository_creation_type": "marct",
  2491  			"members_can_create_pages": true,
  2492  			"members_can_create_public_pages": false,
  2493  			"members_can_create_private_pages": true
  2494  		},
  2495  		"installation": {
  2496  			"id": 1,
  2497  			"node_id": "nid",
  2498  			"app_id": 1,
  2499  			"app_slug": "as",
  2500  			"target_id": 1,
  2501  			"account": {
  2502  				"login": "l",
  2503  				"id": 1,
  2504  				"avatar_url": "a",
  2505  				"gravatar_id": "g",
  2506  				"name": "n",
  2507  				"company": "c",
  2508  				"blog": "b",
  2509  				"location": "l",
  2510  				"email": "e",
  2511  				"hireable": true,
  2512  				"bio": "b",
  2513  				"twitter_username": "t",
  2514  				"public_repos": 1,
  2515  				"followers": 1,
  2516  				"following": 1,
  2517  				"created_at": ` + referenceTimeStr + `,
  2518  				"suspended_at": ` + referenceTimeStr + `,
  2519  				"url": "u"
  2520  			},
  2521  			"access_tokens_url": "atu",
  2522  			"repositories_url": "ru",
  2523  			"html_url": "hu",
  2524  			"target_type": "tt",
  2525  			"single_file_name": "sfn",
  2526  			"repository_selection": "rs",
  2527  			"events": [
  2528  				"e"
  2529  			],
  2530  			"single_file_paths": [
  2531  				"s"
  2532  			],
  2533  			"permissions": {
  2534  				"actions": "a",
  2535  				"administration": "ad",
  2536  				"checks": "c",
  2537  				"contents": "co",
  2538  				"content_references": "cr",
  2539  				"deployments": "d",
  2540  				"environments": "e",
  2541  				"issues": "i",
  2542  				"metadata": "md",
  2543  				"members": "m",
  2544  				"organization_administration": "oa",
  2545  				"organization_hooks": "oh",
  2546  				"organization_plan": "op",
  2547  				"organization_pre_receive_hooks": "opr",
  2548  				"organization_projects": "op",
  2549  				"organization_secrets": "os",
  2550  				"organization_self_hosted_runners": "osh",
  2551  				"organization_user_blocking": "oub",
  2552  				"packages": "pkg",
  2553  				"pages": "pg",
  2554  				"pull_requests": "pr",
  2555  				"repository_hooks": "rh",
  2556  				"repository_projects": "rp",
  2557  				"repository_pre_receive_hooks": "rprh",
  2558  				"secrets": "s",
  2559  				"secret_scanning_alerts": "ssa",
  2560  				"security_events": "se",
  2561  				"single_file": "sf",
  2562  				"statuses": "s",
  2563  				"team_discussions": "td",
  2564  				"vulnerability_alerts": "va",
  2565  				"workflows": "w"
  2566  			},
  2567  			"created_at": ` + referenceTimeStr + `,
  2568  			"updated_at": ` + referenceTimeStr + `,
  2569  			"has_multiple_single_files": false,
  2570  			"suspended_by": {
  2571  				"login": "l",
  2572  				"id": 1,
  2573  				"avatar_url": "a",
  2574  				"gravatar_id": "g",
  2575  				"name": "n",
  2576  				"company": "c",
  2577  				"blog": "b",
  2578  				"location": "l",
  2579  				"email": "e",
  2580  				"hireable": true,
  2581  				"bio": "b",
  2582  				"twitter_username": "t",
  2583  				"public_repos": 1,
  2584  				"followers": 1,
  2585  				"following": 1,
  2586  				"created_at": ` + referenceTimeStr + `,
  2587  				"suspended_at": ` + referenceTimeStr + `,
  2588  				"url": "u"
  2589  			},
  2590  			"suspended_at": ` + referenceTimeStr + `
  2591  		}
  2592  	}`
  2593  
  2594  	testJSONMarshal(t, u, want)
  2595  }
  2596  
  2597  func TestMilestoneEvent_Marshal(t *testing.T) {
  2598  	testJSONMarshal(t, &MilestoneEvent{}, "{}")
  2599  
  2600  	u := &MilestoneEvent{
  2601  		Action:    String("a"),
  2602  		Milestone: &Milestone{ID: Int64(1)},
  2603  		Changes: &EditChange{
  2604  			Title: &EditTitle{
  2605  				From: String("TitleFrom"),
  2606  			},
  2607  			Body: &EditBody{
  2608  				From: String("BodyFrom"),
  2609  			},
  2610  			Base: &EditBase{
  2611  				Ref: &EditRef{
  2612  					From: String("BaseRefFrom"),
  2613  				},
  2614  				SHA: &EditSHA{
  2615  					From: String("BaseSHAFrom"),
  2616  				},
  2617  			},
  2618  		},
  2619  		Repo: &Repository{
  2620  			ID:   Int64(1),
  2621  			URL:  String("s"),
  2622  			Name: String("n"),
  2623  		},
  2624  		Sender: &User{
  2625  			Login:     String("l"),
  2626  			ID:        Int64(1),
  2627  			NodeID:    String("n"),
  2628  			URL:       String("u"),
  2629  			ReposURL:  String("r"),
  2630  			EventsURL: String("e"),
  2631  			AvatarURL: String("a"),
  2632  		},
  2633  		Org: &Organization{
  2634  			BillingEmail:                         String("be"),
  2635  			Blog:                                 String("b"),
  2636  			Company:                              String("c"),
  2637  			Email:                                String("e"),
  2638  			TwitterUsername:                      String("tu"),
  2639  			Location:                             String("loc"),
  2640  			Name:                                 String("n"),
  2641  			Description:                          String("d"),
  2642  			IsVerified:                           Bool(true),
  2643  			HasOrganizationProjects:              Bool(true),
  2644  			HasRepositoryProjects:                Bool(true),
  2645  			DefaultRepoPermission:                String("drp"),
  2646  			MembersCanCreateRepos:                Bool(true),
  2647  			MembersCanCreateInternalRepos:        Bool(true),
  2648  			MembersCanCreatePrivateRepos:         Bool(true),
  2649  			MembersCanCreatePublicRepos:          Bool(false),
  2650  			MembersAllowedRepositoryCreationType: String("marct"),
  2651  			MembersCanCreatePages:                Bool(true),
  2652  			MembersCanCreatePublicPages:          Bool(false),
  2653  			MembersCanCreatePrivatePages:         Bool(true),
  2654  		},
  2655  		Installation: &Installation{
  2656  			ID:       Int64(1),
  2657  			NodeID:   String("nid"),
  2658  			AppID:    Int64(1),
  2659  			AppSlug:  String("as"),
  2660  			TargetID: Int64(1),
  2661  			Account: &User{
  2662  				Login:           String("l"),
  2663  				ID:              Int64(1),
  2664  				URL:             String("u"),
  2665  				AvatarURL:       String("a"),
  2666  				GravatarID:      String("g"),
  2667  				Name:            String("n"),
  2668  				Company:         String("c"),
  2669  				Blog:            String("b"),
  2670  				Location:        String("l"),
  2671  				Email:           String("e"),
  2672  				Hireable:        Bool(true),
  2673  				Bio:             String("b"),
  2674  				TwitterUsername: String("t"),
  2675  				PublicRepos:     Int(1),
  2676  				Followers:       Int(1),
  2677  				Following:       Int(1),
  2678  				CreatedAt:       &Timestamp{referenceTime},
  2679  				SuspendedAt:     &Timestamp{referenceTime},
  2680  			},
  2681  			AccessTokensURL:     String("atu"),
  2682  			RepositoriesURL:     String("ru"),
  2683  			HTMLURL:             String("hu"),
  2684  			TargetType:          String("tt"),
  2685  			SingleFileName:      String("sfn"),
  2686  			RepositorySelection: String("rs"),
  2687  			Events:              []string{"e"},
  2688  			SingleFilePaths:     []string{"s"},
  2689  			Permissions: &InstallationPermissions{
  2690  				Actions:                       String("a"),
  2691  				Administration:                String("ad"),
  2692  				Checks:                        String("c"),
  2693  				Contents:                      String("co"),
  2694  				ContentReferences:             String("cr"),
  2695  				Deployments:                   String("d"),
  2696  				Environments:                  String("e"),
  2697  				Issues:                        String("i"),
  2698  				Metadata:                      String("md"),
  2699  				Members:                       String("m"),
  2700  				OrganizationAdministration:    String("oa"),
  2701  				OrganizationHooks:             String("oh"),
  2702  				OrganizationPlan:              String("op"),
  2703  				OrganizationPreReceiveHooks:   String("opr"),
  2704  				OrganizationProjects:          String("op"),
  2705  				OrganizationSecrets:           String("os"),
  2706  				OrganizationSelfHostedRunners: String("osh"),
  2707  				OrganizationUserBlocking:      String("oub"),
  2708  				Packages:                      String("pkg"),
  2709  				Pages:                         String("pg"),
  2710  				PullRequests:                  String("pr"),
  2711  				RepositoryHooks:               String("rh"),
  2712  				RepositoryProjects:            String("rp"),
  2713  				RepositoryPreReceiveHooks:     String("rprh"),
  2714  				Secrets:                       String("s"),
  2715  				SecretScanningAlerts:          String("ssa"),
  2716  				SecurityEvents:                String("se"),
  2717  				SingleFile:                    String("sf"),
  2718  				Statuses:                      String("s"),
  2719  				TeamDiscussions:               String("td"),
  2720  				VulnerabilityAlerts:           String("va"),
  2721  				Workflows:                     String("w"),
  2722  			},
  2723  			CreatedAt:              &Timestamp{referenceTime},
  2724  			UpdatedAt:              &Timestamp{referenceTime},
  2725  			HasMultipleSingleFiles: Bool(false),
  2726  			SuspendedBy: &User{
  2727  				Login:           String("l"),
  2728  				ID:              Int64(1),
  2729  				URL:             String("u"),
  2730  				AvatarURL:       String("a"),
  2731  				GravatarID:      String("g"),
  2732  				Name:            String("n"),
  2733  				Company:         String("c"),
  2734  				Blog:            String("b"),
  2735  				Location:        String("l"),
  2736  				Email:           String("e"),
  2737  				Hireable:        Bool(true),
  2738  				Bio:             String("b"),
  2739  				TwitterUsername: String("t"),
  2740  				PublicRepos:     Int(1),
  2741  				Followers:       Int(1),
  2742  				Following:       Int(1),
  2743  				CreatedAt:       &Timestamp{referenceTime},
  2744  				SuspendedAt:     &Timestamp{referenceTime},
  2745  			},
  2746  			SuspendedAt: &Timestamp{referenceTime},
  2747  		},
  2748  	}
  2749  
  2750  	want := `{
  2751  		"action": "a",
  2752  		"milestone": {
  2753  			"id": 1
  2754  		},
  2755  		"changes": {
  2756  			"title": {
  2757  				"from": "TitleFrom"
  2758  			},
  2759  			"body": {
  2760  				"from": "BodyFrom"
  2761  			},
  2762  			"base": {
  2763  				"ref": {
  2764  					"from": "BaseRefFrom"
  2765  				},
  2766  				"sha": {
  2767  					"from": "BaseSHAFrom"
  2768  				}
  2769  			}
  2770  		},
  2771  		"repository": {
  2772  			"id": 1,
  2773  			"name": "n",
  2774  			"url": "s"
  2775  		},
  2776  		"sender": {
  2777  			"login": "l",
  2778  			"id": 1,
  2779  			"node_id": "n",
  2780  			"avatar_url": "a",
  2781  			"url": "u",
  2782  			"events_url": "e",
  2783  			"repos_url": "r"
  2784  		},
  2785  		"organization": {
  2786  			"name": "n",
  2787  			"company": "c",
  2788  			"blog": "b",
  2789  			"location": "loc",
  2790  			"email": "e",
  2791  			"twitter_username": "tu",
  2792  			"description": "d",
  2793  			"billing_email": "be",
  2794  			"is_verified": true,
  2795  			"has_organization_projects": true,
  2796  			"has_repository_projects": true,
  2797  			"default_repository_permission": "drp",
  2798  			"members_can_create_repositories": true,
  2799  			"members_can_create_public_repositories": false,
  2800  			"members_can_create_private_repositories": true,
  2801  			"members_can_create_internal_repositories": true,
  2802  			"members_allowed_repository_creation_type": "marct",
  2803  			"members_can_create_pages": true,
  2804  			"members_can_create_public_pages": false,
  2805  			"members_can_create_private_pages": true
  2806  		},
  2807  		"installation": {
  2808  			"id": 1,
  2809  			"node_id": "nid",
  2810  			"app_id": 1,
  2811  			"app_slug": "as",
  2812  			"target_id": 1,
  2813  			"account": {
  2814  				"login": "l",
  2815  				"id": 1,
  2816  				"avatar_url": "a",
  2817  				"gravatar_id": "g",
  2818  				"name": "n",
  2819  				"company": "c",
  2820  				"blog": "b",
  2821  				"location": "l",
  2822  				"email": "e",
  2823  				"hireable": true,
  2824  				"bio": "b",
  2825  				"twitter_username": "t",
  2826  				"public_repos": 1,
  2827  				"followers": 1,
  2828  				"following": 1,
  2829  				"created_at": ` + referenceTimeStr + `,
  2830  				"suspended_at": ` + referenceTimeStr + `,
  2831  				"url": "u"
  2832  			},
  2833  			"access_tokens_url": "atu",
  2834  			"repositories_url": "ru",
  2835  			"html_url": "hu",
  2836  			"target_type": "tt",
  2837  			"single_file_name": "sfn",
  2838  			"repository_selection": "rs",
  2839  			"events": [
  2840  				"e"
  2841  			],
  2842  			"single_file_paths": [
  2843  				"s"
  2844  			],
  2845  			"permissions": {
  2846  				"actions": "a",
  2847  				"administration": "ad",
  2848  				"checks": "c",
  2849  				"contents": "co",
  2850  				"content_references": "cr",
  2851  				"deployments": "d",
  2852  				"environments": "e",
  2853  				"issues": "i",
  2854  				"metadata": "md",
  2855  				"members": "m",
  2856  				"organization_administration": "oa",
  2857  				"organization_hooks": "oh",
  2858  				"organization_plan": "op",
  2859  				"organization_pre_receive_hooks": "opr",
  2860  				"organization_projects": "op",
  2861  				"organization_secrets": "os",
  2862  				"organization_self_hosted_runners": "osh",
  2863  				"organization_user_blocking": "oub",
  2864  				"packages": "pkg",
  2865  				"pages": "pg",
  2866  				"pull_requests": "pr",
  2867  				"repository_hooks": "rh",
  2868  				"repository_projects": "rp",
  2869  				"repository_pre_receive_hooks": "rprh",
  2870  				"secrets": "s",
  2871  				"secret_scanning_alerts": "ssa",
  2872  				"security_events": "se",
  2873  				"single_file": "sf",
  2874  				"statuses": "s",
  2875  				"team_discussions": "td",
  2876  				"vulnerability_alerts": "va",
  2877  				"workflows": "w"
  2878  			},
  2879  			"created_at": ` + referenceTimeStr + `,
  2880  			"updated_at": ` + referenceTimeStr + `,
  2881  			"has_multiple_single_files": false,
  2882  			"suspended_by": {
  2883  				"login": "l",
  2884  				"id": 1,
  2885  				"avatar_url": "a",
  2886  				"gravatar_id": "g",
  2887  				"name": "n",
  2888  				"company": "c",
  2889  				"blog": "b",
  2890  				"location": "l",
  2891  				"email": "e",
  2892  				"hireable": true,
  2893  				"bio": "b",
  2894  				"twitter_username": "t",
  2895  				"public_repos": 1,
  2896  				"followers": 1,
  2897  				"following": 1,
  2898  				"created_at": ` + referenceTimeStr + `,
  2899  				"suspended_at": ` + referenceTimeStr + `,
  2900  				"url": "u"
  2901  			},
  2902  			"suspended_at": ` + referenceTimeStr + `
  2903  		}
  2904  	}`
  2905  
  2906  	testJSONMarshal(t, u, want)
  2907  }
  2908  
  2909  func TestPublicEvent_Marshal(t *testing.T) {
  2910  	testJSONMarshal(t, &PublicEvent{}, "{}")
  2911  
  2912  	u := &PublicEvent{
  2913  		Repo: &Repository{
  2914  			ID:   Int64(1),
  2915  			URL:  String("s"),
  2916  			Name: String("n"),
  2917  		},
  2918  		Sender: &User{
  2919  			Login:     String("l"),
  2920  			ID:        Int64(1),
  2921  			NodeID:    String("n"),
  2922  			URL:       String("u"),
  2923  			ReposURL:  String("r"),
  2924  			EventsURL: String("e"),
  2925  			AvatarURL: String("a"),
  2926  		},
  2927  		Installation: &Installation{
  2928  			ID:       Int64(1),
  2929  			NodeID:   String("nid"),
  2930  			AppID:    Int64(1),
  2931  			AppSlug:  String("as"),
  2932  			TargetID: Int64(1),
  2933  			Account: &User{
  2934  				Login:           String("l"),
  2935  				ID:              Int64(1),
  2936  				URL:             String("u"),
  2937  				AvatarURL:       String("a"),
  2938  				GravatarID:      String("g"),
  2939  				Name:            String("n"),
  2940  				Company:         String("c"),
  2941  				Blog:            String("b"),
  2942  				Location:        String("l"),
  2943  				Email:           String("e"),
  2944  				Hireable:        Bool(true),
  2945  				Bio:             String("b"),
  2946  				TwitterUsername: String("t"),
  2947  				PublicRepos:     Int(1),
  2948  				Followers:       Int(1),
  2949  				Following:       Int(1),
  2950  				CreatedAt:       &Timestamp{referenceTime},
  2951  				SuspendedAt:     &Timestamp{referenceTime},
  2952  			},
  2953  			AccessTokensURL:     String("atu"),
  2954  			RepositoriesURL:     String("ru"),
  2955  			HTMLURL:             String("hu"),
  2956  			TargetType:          String("tt"),
  2957  			SingleFileName:      String("sfn"),
  2958  			RepositorySelection: String("rs"),
  2959  			Events:              []string{"e"},
  2960  			SingleFilePaths:     []string{"s"},
  2961  			Permissions: &InstallationPermissions{
  2962  				Actions:                       String("a"),
  2963  				Administration:                String("ad"),
  2964  				Checks:                        String("c"),
  2965  				Contents:                      String("co"),
  2966  				ContentReferences:             String("cr"),
  2967  				Deployments:                   String("d"),
  2968  				Environments:                  String("e"),
  2969  				Issues:                        String("i"),
  2970  				Metadata:                      String("md"),
  2971  				Members:                       String("m"),
  2972  				OrganizationAdministration:    String("oa"),
  2973  				OrganizationHooks:             String("oh"),
  2974  				OrganizationPlan:              String("op"),
  2975  				OrganizationPreReceiveHooks:   String("opr"),
  2976  				OrganizationProjects:          String("op"),
  2977  				OrganizationSecrets:           String("os"),
  2978  				OrganizationSelfHostedRunners: String("osh"),
  2979  				OrganizationUserBlocking:      String("oub"),
  2980  				Packages:                      String("pkg"),
  2981  				Pages:                         String("pg"),
  2982  				PullRequests:                  String("pr"),
  2983  				RepositoryHooks:               String("rh"),
  2984  				RepositoryProjects:            String("rp"),
  2985  				RepositoryPreReceiveHooks:     String("rprh"),
  2986  				Secrets:                       String("s"),
  2987  				SecretScanningAlerts:          String("ssa"),
  2988  				SecurityEvents:                String("se"),
  2989  				SingleFile:                    String("sf"),
  2990  				Statuses:                      String("s"),
  2991  				TeamDiscussions:               String("td"),
  2992  				VulnerabilityAlerts:           String("va"),
  2993  				Workflows:                     String("w"),
  2994  			},
  2995  			CreatedAt:              &Timestamp{referenceTime},
  2996  			UpdatedAt:              &Timestamp{referenceTime},
  2997  			HasMultipleSingleFiles: Bool(false),
  2998  			SuspendedBy: &User{
  2999  				Login:           String("l"),
  3000  				ID:              Int64(1),
  3001  				URL:             String("u"),
  3002  				AvatarURL:       String("a"),
  3003  				GravatarID:      String("g"),
  3004  				Name:            String("n"),
  3005  				Company:         String("c"),
  3006  				Blog:            String("b"),
  3007  				Location:        String("l"),
  3008  				Email:           String("e"),
  3009  				Hireable:        Bool(true),
  3010  				Bio:             String("b"),
  3011  				TwitterUsername: String("t"),
  3012  				PublicRepos:     Int(1),
  3013  				Followers:       Int(1),
  3014  				Following:       Int(1),
  3015  				CreatedAt:       &Timestamp{referenceTime},
  3016  				SuspendedAt:     &Timestamp{referenceTime},
  3017  			},
  3018  			SuspendedAt: &Timestamp{referenceTime},
  3019  		},
  3020  	}
  3021  
  3022  	want := `{
  3023  		"repository": {
  3024  			"id": 1,
  3025  			"name": "n",
  3026  			"url": "s"
  3027  		},
  3028  		"sender": {
  3029  			"login": "l",
  3030  			"id": 1,
  3031  			"node_id": "n",
  3032  			"avatar_url": "a",
  3033  			"url": "u",
  3034  			"events_url": "e",
  3035  			"repos_url": "r"
  3036  		},
  3037  		"installation": {
  3038  			"id": 1,
  3039  			"node_id": "nid",
  3040  			"app_id": 1,
  3041  			"app_slug": "as",
  3042  			"target_id": 1,
  3043  			"account": {
  3044  				"login": "l",
  3045  				"id": 1,
  3046  				"avatar_url": "a",
  3047  				"gravatar_id": "g",
  3048  				"name": "n",
  3049  				"company": "c",
  3050  				"blog": "b",
  3051  				"location": "l",
  3052  				"email": "e",
  3053  				"hireable": true,
  3054  				"bio": "b",
  3055  				"twitter_username": "t",
  3056  				"public_repos": 1,
  3057  				"followers": 1,
  3058  				"following": 1,
  3059  				"created_at": ` + referenceTimeStr + `,
  3060  				"suspended_at": ` + referenceTimeStr + `,
  3061  				"url": "u"
  3062  			},
  3063  			"access_tokens_url": "atu",
  3064  			"repositories_url": "ru",
  3065  			"html_url": "hu",
  3066  			"target_type": "tt",
  3067  			"single_file_name": "sfn",
  3068  			"repository_selection": "rs",
  3069  			"events": [
  3070  				"e"
  3071  			],
  3072  			"single_file_paths": [
  3073  				"s"
  3074  			],
  3075  			"permissions": {
  3076  				"actions": "a",
  3077  				"administration": "ad",
  3078  				"checks": "c",
  3079  				"contents": "co",
  3080  				"content_references": "cr",
  3081  				"deployments": "d",
  3082  				"environments": "e",
  3083  				"issues": "i",
  3084  				"metadata": "md",
  3085  				"members": "m",
  3086  				"organization_administration": "oa",
  3087  				"organization_hooks": "oh",
  3088  				"organization_plan": "op",
  3089  				"organization_pre_receive_hooks": "opr",
  3090  				"organization_projects": "op",
  3091  				"organization_secrets": "os",
  3092  				"organization_self_hosted_runners": "osh",
  3093  				"organization_user_blocking": "oub",
  3094  				"packages": "pkg",
  3095  				"pages": "pg",
  3096  				"pull_requests": "pr",
  3097  				"repository_hooks": "rh",
  3098  				"repository_projects": "rp",
  3099  				"repository_pre_receive_hooks": "rprh",
  3100  				"secrets": "s",
  3101  				"secret_scanning_alerts": "ssa",
  3102  				"security_events": "se",
  3103  				"single_file": "sf",
  3104  				"statuses": "s",
  3105  				"team_discussions": "td",
  3106  				"vulnerability_alerts": "va",
  3107  				"workflows": "w"
  3108  			},
  3109  			"created_at": ` + referenceTimeStr + `,
  3110  			"updated_at": ` + referenceTimeStr + `,
  3111  			"has_multiple_single_files": false,
  3112  			"suspended_by": {
  3113  				"login": "l",
  3114  				"id": 1,
  3115  				"avatar_url": "a",
  3116  				"gravatar_id": "g",
  3117  				"name": "n",
  3118  				"company": "c",
  3119  				"blog": "b",
  3120  				"location": "l",
  3121  				"email": "e",
  3122  				"hireable": true,
  3123  				"bio": "b",
  3124  				"twitter_username": "t",
  3125  				"public_repos": 1,
  3126  				"followers": 1,
  3127  				"following": 1,
  3128  				"created_at": ` + referenceTimeStr + `,
  3129  				"suspended_at": ` + referenceTimeStr + `,
  3130  				"url": "u"
  3131  			},
  3132  			"suspended_at": ` + referenceTimeStr + `
  3133  		}
  3134  	}`
  3135  
  3136  	testJSONMarshal(t, u, want)
  3137  }
  3138  
  3139  func TestPullRequestReviewEvent_Marshal(t *testing.T) {
  3140  	testJSONMarshal(t, &PullRequestReviewEvent{}, "{}")
  3141  
  3142  	u := &PullRequestReviewEvent{
  3143  		Action:      String("a"),
  3144  		Review:      &PullRequestReview{ID: Int64(1)},
  3145  		PullRequest: &PullRequest{ID: Int64(1)},
  3146  		Repo: &Repository{
  3147  			ID:   Int64(1),
  3148  			URL:  String("s"),
  3149  			Name: String("n"),
  3150  		},
  3151  		Sender: &User{
  3152  			Login:     String("l"),
  3153  			ID:        Int64(1),
  3154  			NodeID:    String("n"),
  3155  			URL:       String("u"),
  3156  			ReposURL:  String("r"),
  3157  			EventsURL: String("e"),
  3158  			AvatarURL: String("a"),
  3159  		},
  3160  		Installation: &Installation{
  3161  			ID:       Int64(1),
  3162  			NodeID:   String("nid"),
  3163  			AppID:    Int64(1),
  3164  			AppSlug:  String("as"),
  3165  			TargetID: Int64(1),
  3166  			Account: &User{
  3167  				Login:           String("l"),
  3168  				ID:              Int64(1),
  3169  				URL:             String("u"),
  3170  				AvatarURL:       String("a"),
  3171  				GravatarID:      String("g"),
  3172  				Name:            String("n"),
  3173  				Company:         String("c"),
  3174  				Blog:            String("b"),
  3175  				Location:        String("l"),
  3176  				Email:           String("e"),
  3177  				Hireable:        Bool(true),
  3178  				Bio:             String("b"),
  3179  				TwitterUsername: String("t"),
  3180  				PublicRepos:     Int(1),
  3181  				Followers:       Int(1),
  3182  				Following:       Int(1),
  3183  				CreatedAt:       &Timestamp{referenceTime},
  3184  				SuspendedAt:     &Timestamp{referenceTime},
  3185  			},
  3186  			AccessTokensURL:     String("atu"),
  3187  			RepositoriesURL:     String("ru"),
  3188  			HTMLURL:             String("hu"),
  3189  			TargetType:          String("tt"),
  3190  			SingleFileName:      String("sfn"),
  3191  			RepositorySelection: String("rs"),
  3192  			Events:              []string{"e"},
  3193  			SingleFilePaths:     []string{"s"},
  3194  			Permissions: &InstallationPermissions{
  3195  				Actions:                       String("a"),
  3196  				Administration:                String("ad"),
  3197  				Checks:                        String("c"),
  3198  				Contents:                      String("co"),
  3199  				ContentReferences:             String("cr"),
  3200  				Deployments:                   String("d"),
  3201  				Environments:                  String("e"),
  3202  				Issues:                        String("i"),
  3203  				Metadata:                      String("md"),
  3204  				Members:                       String("m"),
  3205  				OrganizationAdministration:    String("oa"),
  3206  				OrganizationHooks:             String("oh"),
  3207  				OrganizationPlan:              String("op"),
  3208  				OrganizationPreReceiveHooks:   String("opr"),
  3209  				OrganizationProjects:          String("op"),
  3210  				OrganizationSecrets:           String("os"),
  3211  				OrganizationSelfHostedRunners: String("osh"),
  3212  				OrganizationUserBlocking:      String("oub"),
  3213  				Packages:                      String("pkg"),
  3214  				Pages:                         String("pg"),
  3215  				PullRequests:                  String("pr"),
  3216  				RepositoryHooks:               String("rh"),
  3217  				RepositoryProjects:            String("rp"),
  3218  				RepositoryPreReceiveHooks:     String("rprh"),
  3219  				Secrets:                       String("s"),
  3220  				SecretScanningAlerts:          String("ssa"),
  3221  				SecurityEvents:                String("se"),
  3222  				SingleFile:                    String("sf"),
  3223  				Statuses:                      String("s"),
  3224  				TeamDiscussions:               String("td"),
  3225  				VulnerabilityAlerts:           String("va"),
  3226  				Workflows:                     String("w"),
  3227  			},
  3228  			CreatedAt:              &Timestamp{referenceTime},
  3229  			UpdatedAt:              &Timestamp{referenceTime},
  3230  			HasMultipleSingleFiles: Bool(false),
  3231  			SuspendedBy: &User{
  3232  				Login:           String("l"),
  3233  				ID:              Int64(1),
  3234  				URL:             String("u"),
  3235  				AvatarURL:       String("a"),
  3236  				GravatarID:      String("g"),
  3237  				Name:            String("n"),
  3238  				Company:         String("c"),
  3239  				Blog:            String("b"),
  3240  				Location:        String("l"),
  3241  				Email:           String("e"),
  3242  				Hireable:        Bool(true),
  3243  				Bio:             String("b"),
  3244  				TwitterUsername: String("t"),
  3245  				PublicRepos:     Int(1),
  3246  				Followers:       Int(1),
  3247  				Following:       Int(1),
  3248  				CreatedAt:       &Timestamp{referenceTime},
  3249  				SuspendedAt:     &Timestamp{referenceTime},
  3250  			},
  3251  			SuspendedAt: &Timestamp{referenceTime},
  3252  		},
  3253  		Organization: &Organization{
  3254  			BillingEmail:                         String("be"),
  3255  			Blog:                                 String("b"),
  3256  			Company:                              String("c"),
  3257  			Email:                                String("e"),
  3258  			TwitterUsername:                      String("tu"),
  3259  			Location:                             String("loc"),
  3260  			Name:                                 String("n"),
  3261  			Description:                          String("d"),
  3262  			IsVerified:                           Bool(true),
  3263  			HasOrganizationProjects:              Bool(true),
  3264  			HasRepositoryProjects:                Bool(true),
  3265  			DefaultRepoPermission:                String("drp"),
  3266  			MembersCanCreateRepos:                Bool(true),
  3267  			MembersCanCreateInternalRepos:        Bool(true),
  3268  			MembersCanCreatePrivateRepos:         Bool(true),
  3269  			MembersCanCreatePublicRepos:          Bool(false),
  3270  			MembersAllowedRepositoryCreationType: String("marct"),
  3271  			MembersCanCreatePages:                Bool(true),
  3272  			MembersCanCreatePublicPages:          Bool(false),
  3273  			MembersCanCreatePrivatePages:         Bool(true),
  3274  		},
  3275  	}
  3276  
  3277  	want := `{
  3278  		"action": "a",
  3279  		"review": {
  3280  			"id": 1
  3281  		},
  3282  		"pull_request": {
  3283  			"id": 1
  3284  		},
  3285  		"repository": {
  3286  			"id": 1,
  3287  			"name": "n",
  3288  			"url": "s"
  3289  		},
  3290  		"sender": {
  3291  			"login": "l",
  3292  			"id": 1,
  3293  			"node_id": "n",
  3294  			"avatar_url": "a",
  3295  			"url": "u",
  3296  			"events_url": "e",
  3297  			"repos_url": "r"
  3298  		},
  3299  		"installation": {
  3300  			"id": 1,
  3301  			"node_id": "nid",
  3302  			"app_id": 1,
  3303  			"app_slug": "as",
  3304  			"target_id": 1,
  3305  			"account": {
  3306  				"login": "l",
  3307  				"id": 1,
  3308  				"avatar_url": "a",
  3309  				"gravatar_id": "g",
  3310  				"name": "n",
  3311  				"company": "c",
  3312  				"blog": "b",
  3313  				"location": "l",
  3314  				"email": "e",
  3315  				"hireable": true,
  3316  				"bio": "b",
  3317  				"twitter_username": "t",
  3318  				"public_repos": 1,
  3319  				"followers": 1,
  3320  				"following": 1,
  3321  				"created_at": ` + referenceTimeStr + `,
  3322  				"suspended_at": ` + referenceTimeStr + `,
  3323  				"url": "u"
  3324  			},
  3325  			"access_tokens_url": "atu",
  3326  			"repositories_url": "ru",
  3327  			"html_url": "hu",
  3328  			"target_type": "tt",
  3329  			"single_file_name": "sfn",
  3330  			"repository_selection": "rs",
  3331  			"events": [
  3332  				"e"
  3333  			],
  3334  			"single_file_paths": [
  3335  				"s"
  3336  			],
  3337  			"permissions": {
  3338  				"actions": "a",
  3339  				"administration": "ad",
  3340  				"checks": "c",
  3341  				"contents": "co",
  3342  				"content_references": "cr",
  3343  				"deployments": "d",
  3344  				"environments": "e",
  3345  				"issues": "i",
  3346  				"metadata": "md",
  3347  				"members": "m",
  3348  				"organization_administration": "oa",
  3349  				"organization_hooks": "oh",
  3350  				"organization_plan": "op",
  3351  				"organization_pre_receive_hooks": "opr",
  3352  				"organization_projects": "op",
  3353  				"organization_secrets": "os",
  3354  				"organization_self_hosted_runners": "osh",
  3355  				"organization_user_blocking": "oub",
  3356  				"packages": "pkg",
  3357  				"pages": "pg",
  3358  				"pull_requests": "pr",
  3359  				"repository_hooks": "rh",
  3360  				"repository_projects": "rp",
  3361  				"repository_pre_receive_hooks": "rprh",
  3362  				"secrets": "s",
  3363  				"secret_scanning_alerts": "ssa",
  3364  				"security_events": "se",
  3365  				"single_file": "sf",
  3366  				"statuses": "s",
  3367  				"team_discussions": "td",
  3368  				"vulnerability_alerts": "va",
  3369  				"workflows": "w"
  3370  			},
  3371  			"created_at": ` + referenceTimeStr + `,
  3372  			"updated_at": ` + referenceTimeStr + `,
  3373  			"has_multiple_single_files": false,
  3374  			"suspended_by": {
  3375  				"login": "l",
  3376  				"id": 1,
  3377  				"avatar_url": "a",
  3378  				"gravatar_id": "g",
  3379  				"name": "n",
  3380  				"company": "c",
  3381  				"blog": "b",
  3382  				"location": "l",
  3383  				"email": "e",
  3384  				"hireable": true,
  3385  				"bio": "b",
  3386  				"twitter_username": "t",
  3387  				"public_repos": 1,
  3388  				"followers": 1,
  3389  				"following": 1,
  3390  				"created_at": ` + referenceTimeStr + `,
  3391  				"suspended_at": ` + referenceTimeStr + `,
  3392  				"url": "u"
  3393  			},
  3394  			"suspended_at": ` + referenceTimeStr + `
  3395  		},
  3396  		"organization": {
  3397  			"name": "n",
  3398  			"company": "c",
  3399  			"blog": "b",
  3400  			"location": "loc",
  3401  			"email": "e",
  3402  			"twitter_username": "tu",
  3403  			"description": "d",
  3404  			"billing_email": "be",
  3405  			"is_verified": true,
  3406  			"has_organization_projects": true,
  3407  			"has_repository_projects": true,
  3408  			"default_repository_permission": "drp",
  3409  			"members_can_create_repositories": true,
  3410  			"members_can_create_public_repositories": false,
  3411  			"members_can_create_private_repositories": true,
  3412  			"members_can_create_internal_repositories": true,
  3413  			"members_allowed_repository_creation_type": "marct",
  3414  			"members_can_create_pages": true,
  3415  			"members_can_create_public_pages": false,
  3416  			"members_can_create_private_pages": true
  3417  		}
  3418  	}`
  3419  
  3420  	testJSONMarshal(t, u, want)
  3421  }
  3422  
  3423  func TestPushEvent_Marshal(t *testing.T) {
  3424  	testJSONMarshal(t, &PushEvent{}, "{}")
  3425  
  3426  	u := &PushEvent{
  3427  		PushID: Int64(1),
  3428  		Head:   String("h"),
  3429  		Ref:    String("ref"),
  3430  		Size:   Int(1),
  3431  		Commits: []*HeadCommit{
  3432  			{ID: String("id")},
  3433  		},
  3434  		Before:       String("b"),
  3435  		DistinctSize: Int(1),
  3436  		After:        String("a"),
  3437  		Created:      Bool(true),
  3438  		Deleted:      Bool(true),
  3439  		Forced:       Bool(true),
  3440  		BaseRef:      String("a"),
  3441  		Compare:      String("a"),
  3442  		Repo:         &PushEventRepository{ID: Int64(1)},
  3443  		HeadCommit:   &HeadCommit{ID: String("id")},
  3444  		Pusher: &User{
  3445  			Login:     String("l"),
  3446  			ID:        Int64(1),
  3447  			NodeID:    String("n"),
  3448  			URL:       String("u"),
  3449  			ReposURL:  String("r"),
  3450  			EventsURL: String("e"),
  3451  			AvatarURL: String("a"),
  3452  		},
  3453  		Sender: &User{
  3454  			Login:     String("l"),
  3455  			ID:        Int64(1),
  3456  			NodeID:    String("n"),
  3457  			URL:       String("u"),
  3458  			ReposURL:  String("r"),
  3459  			EventsURL: String("e"),
  3460  			AvatarURL: String("a"),
  3461  		},
  3462  		Installation: &Installation{
  3463  			ID:       Int64(1),
  3464  			NodeID:   String("nid"),
  3465  			AppID:    Int64(1),
  3466  			AppSlug:  String("as"),
  3467  			TargetID: Int64(1),
  3468  			Account: &User{
  3469  				Login:           String("l"),
  3470  				ID:              Int64(1),
  3471  				URL:             String("u"),
  3472  				AvatarURL:       String("a"),
  3473  				GravatarID:      String("g"),
  3474  				Name:            String("n"),
  3475  				Company:         String("c"),
  3476  				Blog:            String("b"),
  3477  				Location:        String("l"),
  3478  				Email:           String("e"),
  3479  				Hireable:        Bool(true),
  3480  				Bio:             String("b"),
  3481  				TwitterUsername: String("t"),
  3482  				PublicRepos:     Int(1),
  3483  				Followers:       Int(1),
  3484  				Following:       Int(1),
  3485  				CreatedAt:       &Timestamp{referenceTime},
  3486  				SuspendedAt:     &Timestamp{referenceTime},
  3487  			},
  3488  			AccessTokensURL:     String("atu"),
  3489  			RepositoriesURL:     String("ru"),
  3490  			HTMLURL:             String("hu"),
  3491  			TargetType:          String("tt"),
  3492  			SingleFileName:      String("sfn"),
  3493  			RepositorySelection: String("rs"),
  3494  			Events:              []string{"e"},
  3495  			SingleFilePaths:     []string{"s"},
  3496  			Permissions: &InstallationPermissions{
  3497  				Actions:                       String("a"),
  3498  				Administration:                String("ad"),
  3499  				Checks:                        String("c"),
  3500  				Contents:                      String("co"),
  3501  				ContentReferences:             String("cr"),
  3502  				Deployments:                   String("d"),
  3503  				Environments:                  String("e"),
  3504  				Issues:                        String("i"),
  3505  				Metadata:                      String("md"),
  3506  				Members:                       String("m"),
  3507  				OrganizationAdministration:    String("oa"),
  3508  				OrganizationHooks:             String("oh"),
  3509  				OrganizationPlan:              String("op"),
  3510  				OrganizationPreReceiveHooks:   String("opr"),
  3511  				OrganizationProjects:          String("op"),
  3512  				OrganizationSecrets:           String("os"),
  3513  				OrganizationSelfHostedRunners: String("osh"),
  3514  				OrganizationUserBlocking:      String("oub"),
  3515  				Packages:                      String("pkg"),
  3516  				Pages:                         String("pg"),
  3517  				PullRequests:                  String("pr"),
  3518  				RepositoryHooks:               String("rh"),
  3519  				RepositoryProjects:            String("rp"),
  3520  				RepositoryPreReceiveHooks:     String("rprh"),
  3521  				Secrets:                       String("s"),
  3522  				SecretScanningAlerts:          String("ssa"),
  3523  				SecurityEvents:                String("se"),
  3524  				SingleFile:                    String("sf"),
  3525  				Statuses:                      String("s"),
  3526  				TeamDiscussions:               String("td"),
  3527  				VulnerabilityAlerts:           String("va"),
  3528  				Workflows:                     String("w"),
  3529  			},
  3530  			CreatedAt:              &Timestamp{referenceTime},
  3531  			UpdatedAt:              &Timestamp{referenceTime},
  3532  			HasMultipleSingleFiles: Bool(false),
  3533  			SuspendedBy: &User{
  3534  				Login:           String("l"),
  3535  				ID:              Int64(1),
  3536  				URL:             String("u"),
  3537  				AvatarURL:       String("a"),
  3538  				GravatarID:      String("g"),
  3539  				Name:            String("n"),
  3540  				Company:         String("c"),
  3541  				Blog:            String("b"),
  3542  				Location:        String("l"),
  3543  				Email:           String("e"),
  3544  				Hireable:        Bool(true),
  3545  				Bio:             String("b"),
  3546  				TwitterUsername: String("t"),
  3547  				PublicRepos:     Int(1),
  3548  				Followers:       Int(1),
  3549  				Following:       Int(1),
  3550  				CreatedAt:       &Timestamp{referenceTime},
  3551  				SuspendedAt:     &Timestamp{referenceTime},
  3552  			},
  3553  			SuspendedAt: &Timestamp{referenceTime},
  3554  		},
  3555  		Organization: &Organization{
  3556  			BillingEmail:                         String("be"),
  3557  			Blog:                                 String("b"),
  3558  			Company:                              String("c"),
  3559  			Email:                                String("e"),
  3560  			TwitterUsername:                      String("tu"),
  3561  			Location:                             String("loc"),
  3562  			Name:                                 String("n"),
  3563  			Description:                          String("d"),
  3564  			IsVerified:                           Bool(true),
  3565  			HasOrganizationProjects:              Bool(true),
  3566  			HasRepositoryProjects:                Bool(true),
  3567  			DefaultRepoPermission:                String("drp"),
  3568  			MembersCanCreateRepos:                Bool(true),
  3569  			MembersCanCreateInternalRepos:        Bool(true),
  3570  			MembersCanCreatePrivateRepos:         Bool(true),
  3571  			MembersCanCreatePublicRepos:          Bool(false),
  3572  			MembersAllowedRepositoryCreationType: String("marct"),
  3573  			MembersCanCreatePages:                Bool(true),
  3574  			MembersCanCreatePublicPages:          Bool(false),
  3575  			MembersCanCreatePrivatePages:         Bool(true),
  3576  		},
  3577  	}
  3578  
  3579  	want := `{
  3580  		"push_id": 1,
  3581  		"head": "h",
  3582  		"ref": "ref",
  3583  		"size": 1,
  3584  		"commits": [
  3585  			{
  3586  				"id": "id"
  3587  			}
  3588  		],
  3589  		"before": "b",
  3590  		"distinct_size": 1,
  3591  		"after": "a",
  3592  		"created": true,
  3593  		"deleted": true,
  3594  		"forced": true,
  3595  		"base_ref": "a",
  3596  		"compare": "a",
  3597  		"repository": {
  3598  			"id": 1
  3599  		},
  3600  		"head_commit": {
  3601  			"id": "id"
  3602  		},
  3603  		"pusher": {
  3604  			"login": "l",
  3605  			"id": 1,
  3606  			"node_id": "n",
  3607  			"avatar_url": "a",
  3608  			"url": "u",
  3609  			"events_url": "e",
  3610  			"repos_url": "r"
  3611  		},
  3612  		"sender": {
  3613  			"login": "l",
  3614  			"id": 1,
  3615  			"node_id": "n",
  3616  			"avatar_url": "a",
  3617  			"url": "u",
  3618  			"events_url": "e",
  3619  			"repos_url": "r"
  3620  		},
  3621  		"installation": {
  3622  			"id": 1,
  3623  			"node_id": "nid",
  3624  			"app_id": 1,
  3625  			"app_slug": "as",
  3626  			"target_id": 1,
  3627  			"account": {
  3628  				"login": "l",
  3629  				"id": 1,
  3630  				"avatar_url": "a",
  3631  				"gravatar_id": "g",
  3632  				"name": "n",
  3633  				"company": "c",
  3634  				"blog": "b",
  3635  				"location": "l",
  3636  				"email": "e",
  3637  				"hireable": true,
  3638  				"bio": "b",
  3639  				"twitter_username": "t",
  3640  				"public_repos": 1,
  3641  				"followers": 1,
  3642  				"following": 1,
  3643  				"created_at": ` + referenceTimeStr + `,
  3644  				"suspended_at": ` + referenceTimeStr + `,
  3645  				"url": "u"
  3646  			},
  3647  			"access_tokens_url": "atu",
  3648  			"repositories_url": "ru",
  3649  			"html_url": "hu",
  3650  			"target_type": "tt",
  3651  			"single_file_name": "sfn",
  3652  			"repository_selection": "rs",
  3653  			"events": [
  3654  				"e"
  3655  			],
  3656  			"single_file_paths": [
  3657  				"s"
  3658  			],
  3659  			"permissions": {
  3660  				"actions": "a",
  3661  				"administration": "ad",
  3662  				"checks": "c",
  3663  				"contents": "co",
  3664  				"content_references": "cr",
  3665  				"deployments": "d",
  3666  				"environments": "e",
  3667  				"issues": "i",
  3668  				"metadata": "md",
  3669  				"members": "m",
  3670  				"organization_administration": "oa",
  3671  				"organization_hooks": "oh",
  3672  				"organization_plan": "op",
  3673  				"organization_pre_receive_hooks": "opr",
  3674  				"organization_projects": "op",
  3675  				"organization_secrets": "os",
  3676  				"organization_self_hosted_runners": "osh",
  3677  				"organization_user_blocking": "oub",
  3678  				"packages": "pkg",
  3679  				"pages": "pg",
  3680  				"pull_requests": "pr",
  3681  				"repository_hooks": "rh",
  3682  				"repository_projects": "rp",
  3683  				"repository_pre_receive_hooks": "rprh",
  3684  				"secrets": "s",
  3685  				"secret_scanning_alerts": "ssa",
  3686  				"security_events": "se",
  3687  				"single_file": "sf",
  3688  				"statuses": "s",
  3689  				"team_discussions": "td",
  3690  				"vulnerability_alerts": "va",
  3691  				"workflows": "w"
  3692  			},
  3693  			"created_at": ` + referenceTimeStr + `,
  3694  			"updated_at": ` + referenceTimeStr + `,
  3695  			"has_multiple_single_files": false,
  3696  			"suspended_by": {
  3697  				"login": "l",
  3698  				"id": 1,
  3699  				"avatar_url": "a",
  3700  				"gravatar_id": "g",
  3701  				"name": "n",
  3702  				"company": "c",
  3703  				"blog": "b",
  3704  				"location": "l",
  3705  				"email": "e",
  3706  				"hireable": true,
  3707  				"bio": "b",
  3708  				"twitter_username": "t",
  3709  				"public_repos": 1,
  3710  				"followers": 1,
  3711  				"following": 1,
  3712  				"created_at": ` + referenceTimeStr + `,
  3713  				"suspended_at": ` + referenceTimeStr + `,
  3714  				"url": "u"
  3715  			},
  3716  			"suspended_at": ` + referenceTimeStr + `
  3717  		},
  3718  		"organization": {
  3719  			"name": "n",
  3720  			"company": "c",
  3721  			"blog": "b",
  3722  			"location": "loc",
  3723  			"email": "e",
  3724  			"twitter_username": "tu",
  3725  			"description": "d",
  3726  			"billing_email": "be",
  3727  			"is_verified": true,
  3728  			"has_organization_projects": true,
  3729  			"has_repository_projects": true,
  3730  			"default_repository_permission": "drp",
  3731  			"members_can_create_repositories": true,
  3732  			"members_can_create_public_repositories": false,
  3733  			"members_can_create_private_repositories": true,
  3734  			"members_can_create_internal_repositories": true,
  3735  			"members_allowed_repository_creation_type": "marct",
  3736  			"members_can_create_pages": true,
  3737  			"members_can_create_public_pages": false,
  3738  			"members_can_create_private_pages": true
  3739  		}
  3740  	}`
  3741  
  3742  	testJSONMarshal(t, u, want)
  3743  }
  3744  
  3745  func TestStatusEvent_Marshal(t *testing.T) {
  3746  	testJSONMarshal(t, &StatusEvent{}, "{}")
  3747  
  3748  	u := &StatusEvent{
  3749  		SHA:         String("sha"),
  3750  		State:       String("s"),
  3751  		Description: String("d"),
  3752  		TargetURL:   String("turl"),
  3753  		Branches: []*Branch{
  3754  			{
  3755  				Name:      String("n"),
  3756  				Commit:    &RepositoryCommit{NodeID: String("nid")},
  3757  				Protected: Bool(false),
  3758  			},
  3759  		},
  3760  		ID:        Int64(1),
  3761  		Name:      String("n"),
  3762  		Context:   String("c"),
  3763  		Commit:    &RepositoryCommit{NodeID: String("nid")},
  3764  		CreatedAt: &Timestamp{referenceTime},
  3765  		UpdatedAt: &Timestamp{referenceTime},
  3766  		Sender: &User{
  3767  			Login:     String("l"),
  3768  			ID:        Int64(1),
  3769  			NodeID:    String("n"),
  3770  			URL:       String("u"),
  3771  			ReposURL:  String("r"),
  3772  			EventsURL: String("e"),
  3773  			AvatarURL: String("a"),
  3774  		},
  3775  		Installation: &Installation{
  3776  			ID:       Int64(1),
  3777  			NodeID:   String("nid"),
  3778  			AppID:    Int64(1),
  3779  			AppSlug:  String("as"),
  3780  			TargetID: Int64(1),
  3781  			Account: &User{
  3782  				Login:           String("l"),
  3783  				ID:              Int64(1),
  3784  				URL:             String("u"),
  3785  				AvatarURL:       String("a"),
  3786  				GravatarID:      String("g"),
  3787  				Name:            String("n"),
  3788  				Company:         String("c"),
  3789  				Blog:            String("b"),
  3790  				Location:        String("l"),
  3791  				Email:           String("e"),
  3792  				Hireable:        Bool(true),
  3793  				Bio:             String("b"),
  3794  				TwitterUsername: String("t"),
  3795  				PublicRepos:     Int(1),
  3796  				Followers:       Int(1),
  3797  				Following:       Int(1),
  3798  				CreatedAt:       &Timestamp{referenceTime},
  3799  				SuspendedAt:     &Timestamp{referenceTime},
  3800  			},
  3801  			AccessTokensURL:     String("atu"),
  3802  			RepositoriesURL:     String("ru"),
  3803  			HTMLURL:             String("hu"),
  3804  			TargetType:          String("tt"),
  3805  			SingleFileName:      String("sfn"),
  3806  			RepositorySelection: String("rs"),
  3807  			Events:              []string{"e"},
  3808  			SingleFilePaths:     []string{"s"},
  3809  			Permissions: &InstallationPermissions{
  3810  				Actions:                       String("a"),
  3811  				Administration:                String("ad"),
  3812  				Checks:                        String("c"),
  3813  				Contents:                      String("co"),
  3814  				ContentReferences:             String("cr"),
  3815  				Deployments:                   String("d"),
  3816  				Environments:                  String("e"),
  3817  				Issues:                        String("i"),
  3818  				Metadata:                      String("md"),
  3819  				Members:                       String("m"),
  3820  				OrganizationAdministration:    String("oa"),
  3821  				OrganizationHooks:             String("oh"),
  3822  				OrganizationPlan:              String("op"),
  3823  				OrganizationPreReceiveHooks:   String("opr"),
  3824  				OrganizationProjects:          String("op"),
  3825  				OrganizationSecrets:           String("os"),
  3826  				OrganizationSelfHostedRunners: String("osh"),
  3827  				OrganizationUserBlocking:      String("oub"),
  3828  				Packages:                      String("pkg"),
  3829  				Pages:                         String("pg"),
  3830  				PullRequests:                  String("pr"),
  3831  				RepositoryHooks:               String("rh"),
  3832  				RepositoryProjects:            String("rp"),
  3833  				RepositoryPreReceiveHooks:     String("rprh"),
  3834  				Secrets:                       String("s"),
  3835  				SecretScanningAlerts:          String("ssa"),
  3836  				SecurityEvents:                String("se"),
  3837  				SingleFile:                    String("sf"),
  3838  				Statuses:                      String("s"),
  3839  				TeamDiscussions:               String("td"),
  3840  				VulnerabilityAlerts:           String("va"),
  3841  				Workflows:                     String("w"),
  3842  			},
  3843  			CreatedAt:              &Timestamp{referenceTime},
  3844  			UpdatedAt:              &Timestamp{referenceTime},
  3845  			HasMultipleSingleFiles: Bool(false),
  3846  			SuspendedBy: &User{
  3847  				Login:           String("l"),
  3848  				ID:              Int64(1),
  3849  				URL:             String("u"),
  3850  				AvatarURL:       String("a"),
  3851  				GravatarID:      String("g"),
  3852  				Name:            String("n"),
  3853  				Company:         String("c"),
  3854  				Blog:            String("b"),
  3855  				Location:        String("l"),
  3856  				Email:           String("e"),
  3857  				Hireable:        Bool(true),
  3858  				Bio:             String("b"),
  3859  				TwitterUsername: String("t"),
  3860  				PublicRepos:     Int(1),
  3861  				Followers:       Int(1),
  3862  				Following:       Int(1),
  3863  				CreatedAt:       &Timestamp{referenceTime},
  3864  				SuspendedAt:     &Timestamp{referenceTime},
  3865  			},
  3866  			SuspendedAt: &Timestamp{referenceTime},
  3867  		},
  3868  	}
  3869  
  3870  	want := `{
  3871  		"sha": "sha",
  3872  		"state": "s",
  3873  		"description": "d",
  3874  		"target_url": "turl",
  3875  		"branches": [
  3876  			{
  3877  				"name": "n",
  3878  				"commit": {
  3879  					"node_id": "nid"
  3880  				},
  3881  				"protected": false
  3882  			}
  3883  		],
  3884  		"id": 1,
  3885  		"name": "n",
  3886  		"context": "c",
  3887  		"commit": {
  3888  			"node_id": "nid"
  3889  		},
  3890  		"created_at": ` + referenceTimeStr + `,
  3891  		"updated_at": ` + referenceTimeStr + `,
  3892  		"sender": {
  3893  			"login": "l",
  3894  			"id": 1,
  3895  			"node_id": "n",
  3896  			"avatar_url": "a",
  3897  			"url": "u",
  3898  			"events_url": "e",
  3899  			"repos_url": "r"
  3900  		},
  3901  		"installation": {
  3902  			"id": 1,
  3903  			"node_id": "nid",
  3904  			"app_id": 1,
  3905  			"app_slug": "as",
  3906  			"target_id": 1,
  3907  			"account": {
  3908  				"login": "l",
  3909  				"id": 1,
  3910  				"avatar_url": "a",
  3911  				"gravatar_id": "g",
  3912  				"name": "n",
  3913  				"company": "c",
  3914  				"blog": "b",
  3915  				"location": "l",
  3916  				"email": "e",
  3917  				"hireable": true,
  3918  				"bio": "b",
  3919  				"twitter_username": "t",
  3920  				"public_repos": 1,
  3921  				"followers": 1,
  3922  				"following": 1,
  3923  				"created_at": ` + referenceTimeStr + `,
  3924  				"suspended_at": ` + referenceTimeStr + `,
  3925  				"url": "u"
  3926  			},
  3927  			"access_tokens_url": "atu",
  3928  			"repositories_url": "ru",
  3929  			"html_url": "hu",
  3930  			"target_type": "tt",
  3931  			"single_file_name": "sfn",
  3932  			"repository_selection": "rs",
  3933  			"events": [
  3934  				"e"
  3935  			],
  3936  			"single_file_paths": [
  3937  				"s"
  3938  			],
  3939  			"permissions": {
  3940  				"actions": "a",
  3941  				"administration": "ad",
  3942  				"checks": "c",
  3943  				"contents": "co",
  3944  				"content_references": "cr",
  3945  				"deployments": "d",
  3946  				"environments": "e",
  3947  				"issues": "i",
  3948  				"metadata": "md",
  3949  				"members": "m",
  3950  				"organization_administration": "oa",
  3951  				"organization_hooks": "oh",
  3952  				"organization_plan": "op",
  3953  				"organization_pre_receive_hooks": "opr",
  3954  				"organization_projects": "op",
  3955  				"organization_secrets": "os",
  3956  				"organization_self_hosted_runners": "osh",
  3957  				"organization_user_blocking": "oub",
  3958  				"packages": "pkg",
  3959  				"pages": "pg",
  3960  				"pull_requests": "pr",
  3961  				"repository_hooks": "rh",
  3962  				"repository_projects": "rp",
  3963  				"repository_pre_receive_hooks": "rprh",
  3964  				"secrets": "s",
  3965  				"secret_scanning_alerts": "ssa",
  3966  				"security_events": "se",
  3967  				"single_file": "sf",
  3968  				"statuses": "s",
  3969  				"team_discussions": "td",
  3970  				"vulnerability_alerts": "va",
  3971  				"workflows": "w"
  3972  			},
  3973  			"created_at": ` + referenceTimeStr + `,
  3974  			"updated_at": ` + referenceTimeStr + `,
  3975  			"has_multiple_single_files": false,
  3976  			"suspended_by": {
  3977  				"login": "l",
  3978  				"id": 1,
  3979  				"avatar_url": "a",
  3980  				"gravatar_id": "g",
  3981  				"name": "n",
  3982  				"company": "c",
  3983  				"blog": "b",
  3984  				"location": "l",
  3985  				"email": "e",
  3986  				"hireable": true,
  3987  				"bio": "b",
  3988  				"twitter_username": "t",
  3989  				"public_repos": 1,
  3990  				"followers": 1,
  3991  				"following": 1,
  3992  				"created_at": ` + referenceTimeStr + `,
  3993  				"suspended_at": ` + referenceTimeStr + `,
  3994  				"url": "u"
  3995  			},
  3996  			"suspended_at": ` + referenceTimeStr + `
  3997  		}
  3998  	}`
  3999  
  4000  	testJSONMarshal(t, u, want)
  4001  }
  4002  
  4003  func TestMarketplacePurchaseEvent_Marshal(t *testing.T) {
  4004  	testJSONMarshal(t, &MarketplacePurchaseEvent{}, "{}")
  4005  
  4006  	u := &MarketplacePurchaseEvent{
  4007  		Action:        String("a"),
  4008  		EffectiveDate: &Timestamp{referenceTime},
  4009  		MarketplacePurchase: &MarketplacePurchase{
  4010  			BillingCycle:    String("bc"),
  4011  			NextBillingDate: &Timestamp{referenceTime},
  4012  			UnitCount:       Int(1),
  4013  			Plan: &MarketplacePlan{
  4014  				URL:                 String("u"),
  4015  				AccountsURL:         String("au"),
  4016  				ID:                  Int64(1),
  4017  				Number:              Int(1),
  4018  				Name:                String("n"),
  4019  				Description:         String("d"),
  4020  				MonthlyPriceInCents: Int(1),
  4021  				YearlyPriceInCents:  Int(1),
  4022  				PriceModel:          String("pm"),
  4023  				UnitName:            String("un"),
  4024  				Bullets:             &[]string{"b"},
  4025  				State:               String("s"),
  4026  				HasFreeTrial:        Bool(false),
  4027  			},
  4028  			OnFreeTrial:     Bool(false),
  4029  			FreeTrialEndsOn: &Timestamp{referenceTime},
  4030  			UpdatedAt:       &Timestamp{referenceTime},
  4031  		},
  4032  		PreviousMarketplacePurchase: &MarketplacePurchase{
  4033  			BillingCycle:    String("bc"),
  4034  			NextBillingDate: &Timestamp{referenceTime},
  4035  			UnitCount:       Int(1),
  4036  			Plan: &MarketplacePlan{
  4037  				URL:                 String("u"),
  4038  				AccountsURL:         String("au"),
  4039  				ID:                  Int64(1),
  4040  				Number:              Int(1),
  4041  				Name:                String("n"),
  4042  				Description:         String("d"),
  4043  				MonthlyPriceInCents: Int(1),
  4044  				YearlyPriceInCents:  Int(1),
  4045  				PriceModel:          String("pm"),
  4046  				UnitName:            String("un"),
  4047  				Bullets:             &[]string{"b"},
  4048  				State:               String("s"),
  4049  				HasFreeTrial:        Bool(false),
  4050  			},
  4051  			OnFreeTrial:     Bool(false),
  4052  			FreeTrialEndsOn: &Timestamp{referenceTime},
  4053  			UpdatedAt:       &Timestamp{referenceTime},
  4054  		},
  4055  		Sender: &User{
  4056  			Login:     String("l"),
  4057  			ID:        Int64(1),
  4058  			NodeID:    String("n"),
  4059  			URL:       String("u"),
  4060  			ReposURL:  String("r"),
  4061  			EventsURL: String("e"),
  4062  			AvatarURL: String("a"),
  4063  		},
  4064  		Installation: &Installation{
  4065  			ID:       Int64(1),
  4066  			NodeID:   String("nid"),
  4067  			AppID:    Int64(1),
  4068  			AppSlug:  String("as"),
  4069  			TargetID: Int64(1),
  4070  			Account: &User{
  4071  				Login:           String("l"),
  4072  				ID:              Int64(1),
  4073  				URL:             String("u"),
  4074  				AvatarURL:       String("a"),
  4075  				GravatarID:      String("g"),
  4076  				Name:            String("n"),
  4077  				Company:         String("c"),
  4078  				Blog:            String("b"),
  4079  				Location:        String("l"),
  4080  				Email:           String("e"),
  4081  				Hireable:        Bool(true),
  4082  				Bio:             String("b"),
  4083  				TwitterUsername: String("t"),
  4084  				PublicRepos:     Int(1),
  4085  				Followers:       Int(1),
  4086  				Following:       Int(1),
  4087  				CreatedAt:       &Timestamp{referenceTime},
  4088  				SuspendedAt:     &Timestamp{referenceTime},
  4089  			},
  4090  			AccessTokensURL:     String("atu"),
  4091  			RepositoriesURL:     String("ru"),
  4092  			HTMLURL:             String("hu"),
  4093  			TargetType:          String("tt"),
  4094  			SingleFileName:      String("sfn"),
  4095  			RepositorySelection: String("rs"),
  4096  			Events:              []string{"e"},
  4097  			SingleFilePaths:     []string{"s"},
  4098  			Permissions: &InstallationPermissions{
  4099  				Actions:                       String("a"),
  4100  				Administration:                String("ad"),
  4101  				Checks:                        String("c"),
  4102  				Contents:                      String("co"),
  4103  				ContentReferences:             String("cr"),
  4104  				Deployments:                   String("d"),
  4105  				Environments:                  String("e"),
  4106  				Issues:                        String("i"),
  4107  				Metadata:                      String("md"),
  4108  				Members:                       String("m"),
  4109  				OrganizationAdministration:    String("oa"),
  4110  				OrganizationHooks:             String("oh"),
  4111  				OrganizationPlan:              String("op"),
  4112  				OrganizationPreReceiveHooks:   String("opr"),
  4113  				OrganizationProjects:          String("op"),
  4114  				OrganizationSecrets:           String("os"),
  4115  				OrganizationSelfHostedRunners: String("osh"),
  4116  				OrganizationUserBlocking:      String("oub"),
  4117  				Packages:                      String("pkg"),
  4118  				Pages:                         String("pg"),
  4119  				PullRequests:                  String("pr"),
  4120  				RepositoryHooks:               String("rh"),
  4121  				RepositoryProjects:            String("rp"),
  4122  				RepositoryPreReceiveHooks:     String("rprh"),
  4123  				Secrets:                       String("s"),
  4124  				SecretScanningAlerts:          String("ssa"),
  4125  				SecurityEvents:                String("se"),
  4126  				SingleFile:                    String("sf"),
  4127  				Statuses:                      String("s"),
  4128  				TeamDiscussions:               String("td"),
  4129  				VulnerabilityAlerts:           String("va"),
  4130  				Workflows:                     String("w"),
  4131  			},
  4132  			CreatedAt:              &Timestamp{referenceTime},
  4133  			UpdatedAt:              &Timestamp{referenceTime},
  4134  			HasMultipleSingleFiles: Bool(false),
  4135  			SuspendedBy: &User{
  4136  				Login:           String("l"),
  4137  				ID:              Int64(1),
  4138  				URL:             String("u"),
  4139  				AvatarURL:       String("a"),
  4140  				GravatarID:      String("g"),
  4141  				Name:            String("n"),
  4142  				Company:         String("c"),
  4143  				Blog:            String("b"),
  4144  				Location:        String("l"),
  4145  				Email:           String("e"),
  4146  				Hireable:        Bool(true),
  4147  				Bio:             String("b"),
  4148  				TwitterUsername: String("t"),
  4149  				PublicRepos:     Int(1),
  4150  				Followers:       Int(1),
  4151  				Following:       Int(1),
  4152  				CreatedAt:       &Timestamp{referenceTime},
  4153  				SuspendedAt:     &Timestamp{referenceTime},
  4154  			},
  4155  			SuspendedAt: &Timestamp{referenceTime},
  4156  		},
  4157  	}
  4158  
  4159  	want := `{
  4160  		"action": "a",
  4161  		"effective_date": ` + referenceTimeStr + `,
  4162  		"marketplace_purchase": {
  4163  			"billing_cycle": "bc",
  4164  			"next_billing_date": ` + referenceTimeStr + `,
  4165  			"unit_count": 1,
  4166  			"plan": {
  4167  				"url": "u",
  4168  				"accounts_url": "au",
  4169  				"id": 1,
  4170  				"number": 1,
  4171  				"name": "n",
  4172  				"description": "d",
  4173  				"monthly_price_in_cents": 1,
  4174  				"yearly_price_in_cents": 1,
  4175  				"price_model": "pm",
  4176  				"unit_name": "un",
  4177  				"bullets": [
  4178  					"b"
  4179  				],
  4180  				"state": "s",
  4181  				"has_free_trial": false
  4182  			},
  4183  			"on_free_trial": false,
  4184  			"free_trial_ends_on": ` + referenceTimeStr + `,
  4185  			"updated_at": ` + referenceTimeStr + `
  4186  		},
  4187  		"previous_marketplace_purchase": {
  4188  			"billing_cycle": "bc",
  4189  			"next_billing_date": ` + referenceTimeStr + `,
  4190  			"unit_count": 1,
  4191  			"plan": {
  4192  				"url": "u",
  4193  				"accounts_url": "au",
  4194  				"id": 1,
  4195  				"number": 1,
  4196  				"name": "n",
  4197  				"description": "d",
  4198  				"monthly_price_in_cents": 1,
  4199  				"yearly_price_in_cents": 1,
  4200  				"price_model": "pm",
  4201  				"unit_name": "un",
  4202  				"bullets": [
  4203  					"b"
  4204  				],
  4205  				"state": "s",
  4206  				"has_free_trial": false
  4207  			},
  4208  			"on_free_trial": false,
  4209  			"free_trial_ends_on": ` + referenceTimeStr + `,
  4210  			"updated_at": ` + referenceTimeStr + `
  4211  		},
  4212  		"sender": {
  4213  			"login": "l",
  4214  			"id": 1,
  4215  			"node_id": "n",
  4216  			"avatar_url": "a",
  4217  			"url": "u",
  4218  			"events_url": "e",
  4219  			"repos_url": "r"
  4220  		},
  4221  		"installation": {
  4222  			"id": 1,
  4223  			"node_id": "nid",
  4224  			"app_id": 1,
  4225  			"app_slug": "as",
  4226  			"target_id": 1,
  4227  			"account": {
  4228  				"login": "l",
  4229  				"id": 1,
  4230  				"avatar_url": "a",
  4231  				"gravatar_id": "g",
  4232  				"name": "n",
  4233  				"company": "c",
  4234  				"blog": "b",
  4235  				"location": "l",
  4236  				"email": "e",
  4237  				"hireable": true,
  4238  				"bio": "b",
  4239  				"twitter_username": "t",
  4240  				"public_repos": 1,
  4241  				"followers": 1,
  4242  				"following": 1,
  4243  				"created_at": ` + referenceTimeStr + `,
  4244  				"suspended_at": ` + referenceTimeStr + `,
  4245  				"url": "u"
  4246  			},
  4247  			"access_tokens_url": "atu",
  4248  			"repositories_url": "ru",
  4249  			"html_url": "hu",
  4250  			"target_type": "tt",
  4251  			"single_file_name": "sfn",
  4252  			"repository_selection": "rs",
  4253  			"events": [
  4254  				"e"
  4255  			],
  4256  			"single_file_paths": [
  4257  				"s"
  4258  			],
  4259  			"permissions": {
  4260  				"actions": "a",
  4261  				"administration": "ad",
  4262  				"checks": "c",
  4263  				"contents": "co",
  4264  				"content_references": "cr",
  4265  				"deployments": "d",
  4266  				"environments": "e",
  4267  				"issues": "i",
  4268  				"metadata": "md",
  4269  				"members": "m",
  4270  				"organization_administration": "oa",
  4271  				"organization_hooks": "oh",
  4272  				"organization_plan": "op",
  4273  				"organization_pre_receive_hooks": "opr",
  4274  				"organization_projects": "op",
  4275  				"organization_secrets": "os",
  4276  				"organization_self_hosted_runners": "osh",
  4277  				"organization_user_blocking": "oub",
  4278  				"packages": "pkg",
  4279  				"pages": "pg",
  4280  				"pull_requests": "pr",
  4281  				"repository_hooks": "rh",
  4282  				"repository_projects": "rp",
  4283  				"repository_pre_receive_hooks": "rprh",
  4284  				"secrets": "s",
  4285  				"secret_scanning_alerts": "ssa",
  4286  				"security_events": "se",
  4287  				"single_file": "sf",
  4288  				"statuses": "s",
  4289  				"team_discussions": "td",
  4290  				"vulnerability_alerts": "va",
  4291  				"workflows": "w"
  4292  			},
  4293  			"created_at": ` + referenceTimeStr + `,
  4294  			"updated_at": ` + referenceTimeStr + `,
  4295  			"has_multiple_single_files": false,
  4296  			"suspended_by": {
  4297  				"login": "l",
  4298  				"id": 1,
  4299  				"avatar_url": "a",
  4300  				"gravatar_id": "g",
  4301  				"name": "n",
  4302  				"company": "c",
  4303  				"blog": "b",
  4304  				"location": "l",
  4305  				"email": "e",
  4306  				"hireable": true,
  4307  				"bio": "b",
  4308  				"twitter_username": "t",
  4309  				"public_repos": 1,
  4310  				"followers": 1,
  4311  				"following": 1,
  4312  				"created_at": ` + referenceTimeStr + `,
  4313  				"suspended_at": ` + referenceTimeStr + `,
  4314  				"url": "u"
  4315  			},
  4316  			"suspended_at": ` + referenceTimeStr + `
  4317  		}
  4318  	}`
  4319  
  4320  	testJSONMarshal(t, u, want)
  4321  }
  4322  
  4323  func TestOrganizationEvent_Marshal(t *testing.T) {
  4324  	testJSONMarshal(t, &OrganizationEvent{}, "{}")
  4325  
  4326  	u := &OrganizationEvent{
  4327  		Action:     String("a"),
  4328  		Invitation: &Invitation{ID: Int64(1)},
  4329  		Membership: &Membership{
  4330  			URL:             String("url"),
  4331  			State:           String("s"),
  4332  			Role:            String("r"),
  4333  			OrganizationURL: String("ou"),
  4334  			Organization: &Organization{
  4335  				BillingEmail:                         String("be"),
  4336  				Blog:                                 String("b"),
  4337  				Company:                              String("c"),
  4338  				Email:                                String("e"),
  4339  				TwitterUsername:                      String("tu"),
  4340  				Location:                             String("loc"),
  4341  				Name:                                 String("n"),
  4342  				Description:                          String("d"),
  4343  				IsVerified:                           Bool(true),
  4344  				HasOrganizationProjects:              Bool(true),
  4345  				HasRepositoryProjects:                Bool(true),
  4346  				DefaultRepoPermission:                String("drp"),
  4347  				MembersCanCreateRepos:                Bool(true),
  4348  				MembersCanCreateInternalRepos:        Bool(true),
  4349  				MembersCanCreatePrivateRepos:         Bool(true),
  4350  				MembersCanCreatePublicRepos:          Bool(false),
  4351  				MembersAllowedRepositoryCreationType: String("marct"),
  4352  				MembersCanCreatePages:                Bool(true),
  4353  				MembersCanCreatePublicPages:          Bool(false),
  4354  				MembersCanCreatePrivatePages:         Bool(true),
  4355  			},
  4356  			User: &User{
  4357  				Login:     String("l"),
  4358  				ID:        Int64(1),
  4359  				NodeID:    String("n"),
  4360  				URL:       String("u"),
  4361  				ReposURL:  String("r"),
  4362  				EventsURL: String("e"),
  4363  				AvatarURL: String("a"),
  4364  			},
  4365  		},
  4366  		Organization: &Organization{
  4367  			BillingEmail:                         String("be"),
  4368  			Blog:                                 String("b"),
  4369  			Company:                              String("c"),
  4370  			Email:                                String("e"),
  4371  			TwitterUsername:                      String("tu"),
  4372  			Location:                             String("loc"),
  4373  			Name:                                 String("n"),
  4374  			Description:                          String("d"),
  4375  			IsVerified:                           Bool(true),
  4376  			HasOrganizationProjects:              Bool(true),
  4377  			HasRepositoryProjects:                Bool(true),
  4378  			DefaultRepoPermission:                String("drp"),
  4379  			MembersCanCreateRepos:                Bool(true),
  4380  			MembersCanCreateInternalRepos:        Bool(true),
  4381  			MembersCanCreatePrivateRepos:         Bool(true),
  4382  			MembersCanCreatePublicRepos:          Bool(false),
  4383  			MembersAllowedRepositoryCreationType: String("marct"),
  4384  			MembersCanCreatePages:                Bool(true),
  4385  			MembersCanCreatePublicPages:          Bool(false),
  4386  			MembersCanCreatePrivatePages:         Bool(true),
  4387  		},
  4388  		Sender: &User{
  4389  			Login:     String("l"),
  4390  			ID:        Int64(1),
  4391  			NodeID:    String("n"),
  4392  			URL:       String("u"),
  4393  			ReposURL:  String("r"),
  4394  			EventsURL: String("e"),
  4395  			AvatarURL: String("a"),
  4396  		},
  4397  		Installation: &Installation{
  4398  			ID:       Int64(1),
  4399  			NodeID:   String("nid"),
  4400  			AppID:    Int64(1),
  4401  			AppSlug:  String("as"),
  4402  			TargetID: Int64(1),
  4403  			Account: &User{
  4404  				Login:           String("l"),
  4405  				ID:              Int64(1),
  4406  				URL:             String("u"),
  4407  				AvatarURL:       String("a"),
  4408  				GravatarID:      String("g"),
  4409  				Name:            String("n"),
  4410  				Company:         String("c"),
  4411  				Blog:            String("b"),
  4412  				Location:        String("l"),
  4413  				Email:           String("e"),
  4414  				Hireable:        Bool(true),
  4415  				Bio:             String("b"),
  4416  				TwitterUsername: String("t"),
  4417  				PublicRepos:     Int(1),
  4418  				Followers:       Int(1),
  4419  				Following:       Int(1),
  4420  				CreatedAt:       &Timestamp{referenceTime},
  4421  				SuspendedAt:     &Timestamp{referenceTime},
  4422  			},
  4423  			AccessTokensURL:     String("atu"),
  4424  			RepositoriesURL:     String("ru"),
  4425  			HTMLURL:             String("hu"),
  4426  			TargetType:          String("tt"),
  4427  			SingleFileName:      String("sfn"),
  4428  			RepositorySelection: String("rs"),
  4429  			Events:              []string{"e"},
  4430  			SingleFilePaths:     []string{"s"},
  4431  			Permissions: &InstallationPermissions{
  4432  				Actions:                       String("a"),
  4433  				Administration:                String("ad"),
  4434  				Checks:                        String("c"),
  4435  				Contents:                      String("co"),
  4436  				ContentReferences:             String("cr"),
  4437  				Deployments:                   String("d"),
  4438  				Environments:                  String("e"),
  4439  				Issues:                        String("i"),
  4440  				Metadata:                      String("md"),
  4441  				Members:                       String("m"),
  4442  				OrganizationAdministration:    String("oa"),
  4443  				OrganizationHooks:             String("oh"),
  4444  				OrganizationPlan:              String("op"),
  4445  				OrganizationPreReceiveHooks:   String("opr"),
  4446  				OrganizationProjects:          String("op"),
  4447  				OrganizationSecrets:           String("os"),
  4448  				OrganizationSelfHostedRunners: String("osh"),
  4449  				OrganizationUserBlocking:      String("oub"),
  4450  				Packages:                      String("pkg"),
  4451  				Pages:                         String("pg"),
  4452  				PullRequests:                  String("pr"),
  4453  				RepositoryHooks:               String("rh"),
  4454  				RepositoryProjects:            String("rp"),
  4455  				RepositoryPreReceiveHooks:     String("rprh"),
  4456  				Secrets:                       String("s"),
  4457  				SecretScanningAlerts:          String("ssa"),
  4458  				SecurityEvents:                String("se"),
  4459  				SingleFile:                    String("sf"),
  4460  				Statuses:                      String("s"),
  4461  				TeamDiscussions:               String("td"),
  4462  				VulnerabilityAlerts:           String("va"),
  4463  				Workflows:                     String("w"),
  4464  			},
  4465  			CreatedAt:              &Timestamp{referenceTime},
  4466  			UpdatedAt:              &Timestamp{referenceTime},
  4467  			HasMultipleSingleFiles: Bool(false),
  4468  			SuspendedBy: &User{
  4469  				Login:           String("l"),
  4470  				ID:              Int64(1),
  4471  				URL:             String("u"),
  4472  				AvatarURL:       String("a"),
  4473  				GravatarID:      String("g"),
  4474  				Name:            String("n"),
  4475  				Company:         String("c"),
  4476  				Blog:            String("b"),
  4477  				Location:        String("l"),
  4478  				Email:           String("e"),
  4479  				Hireable:        Bool(true),
  4480  				Bio:             String("b"),
  4481  				TwitterUsername: String("t"),
  4482  				PublicRepos:     Int(1),
  4483  				Followers:       Int(1),
  4484  				Following:       Int(1),
  4485  				CreatedAt:       &Timestamp{referenceTime},
  4486  				SuspendedAt:     &Timestamp{referenceTime},
  4487  			},
  4488  			SuspendedAt: &Timestamp{referenceTime},
  4489  		},
  4490  	}
  4491  
  4492  	want := `{
  4493  		"action": "a",
  4494  		"invitation": {
  4495  			"id": 1
  4496  		},
  4497  		"membership": {
  4498  			"url": "url",
  4499  			"state": "s",
  4500  			"role": "r",
  4501  			"organization_url": "ou",
  4502  			"organization": {
  4503  				"name": "n",
  4504  				"company": "c",
  4505  				"blog": "b",
  4506  				"location": "loc",
  4507  				"email": "e",
  4508  				"twitter_username": "tu",
  4509  				"description": "d",
  4510  				"billing_email": "be",
  4511  				"is_verified": true,
  4512  				"has_organization_projects": true,
  4513  				"has_repository_projects": true,
  4514  				"default_repository_permission": "drp",
  4515  				"members_can_create_repositories": true,
  4516  				"members_can_create_public_repositories": false,
  4517  				"members_can_create_private_repositories": true,
  4518  				"members_can_create_internal_repositories": true,
  4519  				"members_allowed_repository_creation_type": "marct",
  4520  				"members_can_create_pages": true,
  4521  				"members_can_create_public_pages": false,
  4522  				"members_can_create_private_pages": true
  4523  			},
  4524  			"user": {
  4525  				"login": "l",
  4526  				"id": 1,
  4527  				"node_id": "n",
  4528  				"avatar_url": "a",
  4529  				"url": "u",
  4530  				"events_url": "e",
  4531  				"repos_url": "r"
  4532  			}
  4533  		},
  4534  		"organization": {
  4535  			"name": "n",
  4536  			"company": "c",
  4537  			"blog": "b",
  4538  			"location": "loc",
  4539  			"email": "e",
  4540  			"twitter_username": "tu",
  4541  			"description": "d",
  4542  			"billing_email": "be",
  4543  			"is_verified": true,
  4544  			"has_organization_projects": true,
  4545  			"has_repository_projects": true,
  4546  			"default_repository_permission": "drp",
  4547  			"members_can_create_repositories": true,
  4548  			"members_can_create_public_repositories": false,
  4549  			"members_can_create_private_repositories": true,
  4550  			"members_can_create_internal_repositories": true,
  4551  			"members_allowed_repository_creation_type": "marct",
  4552  			"members_can_create_pages": true,
  4553  			"members_can_create_public_pages": false,
  4554  			"members_can_create_private_pages": true
  4555  		},
  4556  		"sender": {
  4557  			"login": "l",
  4558  			"id": 1,
  4559  			"node_id": "n",
  4560  			"avatar_url": "a",
  4561  			"url": "u",
  4562  			"events_url": "e",
  4563  			"repos_url": "r"
  4564  		},
  4565  		"installation": {
  4566  			"id": 1,
  4567  			"node_id": "nid",
  4568  			"app_id": 1,
  4569  			"app_slug": "as",
  4570  			"target_id": 1,
  4571  			"account": {
  4572  				"login": "l",
  4573  				"id": 1,
  4574  				"avatar_url": "a",
  4575  				"gravatar_id": "g",
  4576  				"name": "n",
  4577  				"company": "c",
  4578  				"blog": "b",
  4579  				"location": "l",
  4580  				"email": "e",
  4581  				"hireable": true,
  4582  				"bio": "b",
  4583  				"twitter_username": "t",
  4584  				"public_repos": 1,
  4585  				"followers": 1,
  4586  				"following": 1,
  4587  				"created_at": ` + referenceTimeStr + `,
  4588  				"suspended_at": ` + referenceTimeStr + `,
  4589  				"url": "u"
  4590  			},
  4591  			"access_tokens_url": "atu",
  4592  			"repositories_url": "ru",
  4593  			"html_url": "hu",
  4594  			"target_type": "tt",
  4595  			"single_file_name": "sfn",
  4596  			"repository_selection": "rs",
  4597  			"events": [
  4598  				"e"
  4599  			],
  4600  			"single_file_paths": [
  4601  				"s"
  4602  			],
  4603  			"permissions": {
  4604  				"actions": "a",
  4605  				"administration": "ad",
  4606  				"checks": "c",
  4607  				"contents": "co",
  4608  				"content_references": "cr",
  4609  				"deployments": "d",
  4610  				"environments": "e",
  4611  				"issues": "i",
  4612  				"metadata": "md",
  4613  				"members": "m",
  4614  				"organization_administration": "oa",
  4615  				"organization_hooks": "oh",
  4616  				"organization_plan": "op",
  4617  				"organization_pre_receive_hooks": "opr",
  4618  				"organization_projects": "op",
  4619  				"organization_secrets": "os",
  4620  				"organization_self_hosted_runners": "osh",
  4621  				"organization_user_blocking": "oub",
  4622  				"packages": "pkg",
  4623  				"pages": "pg",
  4624  				"pull_requests": "pr",
  4625  				"repository_hooks": "rh",
  4626  				"repository_projects": "rp",
  4627  				"repository_pre_receive_hooks": "rprh",
  4628  				"secrets": "s",
  4629  				"secret_scanning_alerts": "ssa",
  4630  				"security_events": "se",
  4631  				"single_file": "sf",
  4632  				"statuses": "s",
  4633  				"team_discussions": "td",
  4634  				"vulnerability_alerts": "va",
  4635  				"workflows": "w"
  4636  			},
  4637  			"created_at": ` + referenceTimeStr + `,
  4638  			"updated_at": ` + referenceTimeStr + `,
  4639  			"has_multiple_single_files": false,
  4640  			"suspended_by": {
  4641  				"login": "l",
  4642  				"id": 1,
  4643  				"avatar_url": "a",
  4644  				"gravatar_id": "g",
  4645  				"name": "n",
  4646  				"company": "c",
  4647  				"blog": "b",
  4648  				"location": "l",
  4649  				"email": "e",
  4650  				"hireable": true,
  4651  				"bio": "b",
  4652  				"twitter_username": "t",
  4653  				"public_repos": 1,
  4654  				"followers": 1,
  4655  				"following": 1,
  4656  				"created_at": ` + referenceTimeStr + `,
  4657  				"suspended_at": ` + referenceTimeStr + `,
  4658  				"url": "u"
  4659  			},
  4660  			"suspended_at": ` + referenceTimeStr + `
  4661  		}
  4662  	}`
  4663  
  4664  	testJSONMarshal(t, u, want)
  4665  }
  4666  
  4667  func TestPageBuildEvent_Marshal(t *testing.T) {
  4668  	testJSONMarshal(t, &PageBuildEvent{}, "{}")
  4669  
  4670  	u := &PageBuildEvent{
  4671  		Build: &PagesBuild{URL: String("url")},
  4672  		ID:    Int64(1),
  4673  		Repo: &Repository{
  4674  			ID:   Int64(1),
  4675  			URL:  String("s"),
  4676  			Name: String("n"),
  4677  		},
  4678  		Sender: &User{
  4679  			Login:     String("l"),
  4680  			ID:        Int64(1),
  4681  			NodeID:    String("n"),
  4682  			URL:       String("u"),
  4683  			ReposURL:  String("r"),
  4684  			EventsURL: String("e"),
  4685  			AvatarURL: String("a"),
  4686  		},
  4687  		Installation: &Installation{
  4688  			ID:       Int64(1),
  4689  			NodeID:   String("nid"),
  4690  			AppID:    Int64(1),
  4691  			AppSlug:  String("as"),
  4692  			TargetID: Int64(1),
  4693  			Account: &User{
  4694  				Login:           String("l"),
  4695  				ID:              Int64(1),
  4696  				URL:             String("u"),
  4697  				AvatarURL:       String("a"),
  4698  				GravatarID:      String("g"),
  4699  				Name:            String("n"),
  4700  				Company:         String("c"),
  4701  				Blog:            String("b"),
  4702  				Location:        String("l"),
  4703  				Email:           String("e"),
  4704  				Hireable:        Bool(true),
  4705  				Bio:             String("b"),
  4706  				TwitterUsername: String("t"),
  4707  				PublicRepos:     Int(1),
  4708  				Followers:       Int(1),
  4709  				Following:       Int(1),
  4710  				CreatedAt:       &Timestamp{referenceTime},
  4711  				SuspendedAt:     &Timestamp{referenceTime},
  4712  			},
  4713  			AccessTokensURL:     String("atu"),
  4714  			RepositoriesURL:     String("ru"),
  4715  			HTMLURL:             String("hu"),
  4716  			TargetType:          String("tt"),
  4717  			SingleFileName:      String("sfn"),
  4718  			RepositorySelection: String("rs"),
  4719  			Events:              []string{"e"},
  4720  			SingleFilePaths:     []string{"s"},
  4721  			Permissions: &InstallationPermissions{
  4722  				Actions:                       String("a"),
  4723  				Administration:                String("ad"),
  4724  				Checks:                        String("c"),
  4725  				Contents:                      String("co"),
  4726  				ContentReferences:             String("cr"),
  4727  				Deployments:                   String("d"),
  4728  				Environments:                  String("e"),
  4729  				Issues:                        String("i"),
  4730  				Metadata:                      String("md"),
  4731  				Members:                       String("m"),
  4732  				OrganizationAdministration:    String("oa"),
  4733  				OrganizationHooks:             String("oh"),
  4734  				OrganizationPlan:              String("op"),
  4735  				OrganizationPreReceiveHooks:   String("opr"),
  4736  				OrganizationProjects:          String("op"),
  4737  				OrganizationSecrets:           String("os"),
  4738  				OrganizationSelfHostedRunners: String("osh"),
  4739  				OrganizationUserBlocking:      String("oub"),
  4740  				Packages:                      String("pkg"),
  4741  				Pages:                         String("pg"),
  4742  				PullRequests:                  String("pr"),
  4743  				RepositoryHooks:               String("rh"),
  4744  				RepositoryProjects:            String("rp"),
  4745  				RepositoryPreReceiveHooks:     String("rprh"),
  4746  				Secrets:                       String("s"),
  4747  				SecretScanningAlerts:          String("ssa"),
  4748  				SecurityEvents:                String("se"),
  4749  				SingleFile:                    String("sf"),
  4750  				Statuses:                      String("s"),
  4751  				TeamDiscussions:               String("td"),
  4752  				VulnerabilityAlerts:           String("va"),
  4753  				Workflows:                     String("w"),
  4754  			},
  4755  			CreatedAt:              &Timestamp{referenceTime},
  4756  			UpdatedAt:              &Timestamp{referenceTime},
  4757  			HasMultipleSingleFiles: Bool(false),
  4758  			SuspendedBy: &User{
  4759  				Login:           String("l"),
  4760  				ID:              Int64(1),
  4761  				URL:             String("u"),
  4762  				AvatarURL:       String("a"),
  4763  				GravatarID:      String("g"),
  4764  				Name:            String("n"),
  4765  				Company:         String("c"),
  4766  				Blog:            String("b"),
  4767  				Location:        String("l"),
  4768  				Email:           String("e"),
  4769  				Hireable:        Bool(true),
  4770  				Bio:             String("b"),
  4771  				TwitterUsername: String("t"),
  4772  				PublicRepos:     Int(1),
  4773  				Followers:       Int(1),
  4774  				Following:       Int(1),
  4775  				CreatedAt:       &Timestamp{referenceTime},
  4776  				SuspendedAt:     &Timestamp{referenceTime},
  4777  			},
  4778  			SuspendedAt: &Timestamp{referenceTime},
  4779  		},
  4780  	}
  4781  
  4782  	want := `{
  4783  		"build": {
  4784  			"url": "url"
  4785  		},
  4786  		"id": 1,
  4787  		"repository": {
  4788  			"id": 1,
  4789  			"name": "n",
  4790  			"url": "s"
  4791  		},
  4792  		"sender": {
  4793  			"login": "l",
  4794  			"id": 1,
  4795  			"node_id": "n",
  4796  			"avatar_url": "a",
  4797  			"url": "u",
  4798  			"events_url": "e",
  4799  			"repos_url": "r"
  4800  		},
  4801  		"installation": {
  4802  			"id": 1,
  4803  			"node_id": "nid",
  4804  			"app_id": 1,
  4805  			"app_slug": "as",
  4806  			"target_id": 1,
  4807  			"account": {
  4808  				"login": "l",
  4809  				"id": 1,
  4810  				"avatar_url": "a",
  4811  				"gravatar_id": "g",
  4812  				"name": "n",
  4813  				"company": "c",
  4814  				"blog": "b",
  4815  				"location": "l",
  4816  				"email": "e",
  4817  				"hireable": true,
  4818  				"bio": "b",
  4819  				"twitter_username": "t",
  4820  				"public_repos": 1,
  4821  				"followers": 1,
  4822  				"following": 1,
  4823  				"created_at": ` + referenceTimeStr + `,
  4824  				"suspended_at": ` + referenceTimeStr + `,
  4825  				"url": "u"
  4826  			},
  4827  			"access_tokens_url": "atu",
  4828  			"repositories_url": "ru",
  4829  			"html_url": "hu",
  4830  			"target_type": "tt",
  4831  			"single_file_name": "sfn",
  4832  			"repository_selection": "rs",
  4833  			"events": [
  4834  				"e"
  4835  			],
  4836  			"single_file_paths": [
  4837  				"s"
  4838  			],
  4839  			"permissions": {
  4840  				"actions": "a",
  4841  				"administration": "ad",
  4842  				"checks": "c",
  4843  				"contents": "co",
  4844  				"content_references": "cr",
  4845  				"deployments": "d",
  4846  				"environments": "e",
  4847  				"issues": "i",
  4848  				"metadata": "md",
  4849  				"members": "m",
  4850  				"organization_administration": "oa",
  4851  				"organization_hooks": "oh",
  4852  				"organization_plan": "op",
  4853  				"organization_pre_receive_hooks": "opr",
  4854  				"organization_projects": "op",
  4855  				"organization_secrets": "os",
  4856  				"organization_self_hosted_runners": "osh",
  4857  				"organization_user_blocking": "oub",
  4858  				"packages": "pkg",
  4859  				"pages": "pg",
  4860  				"pull_requests": "pr",
  4861  				"repository_hooks": "rh",
  4862  				"repository_projects": "rp",
  4863  				"repository_pre_receive_hooks": "rprh",
  4864  				"secrets": "s",
  4865  				"secret_scanning_alerts": "ssa",
  4866  				"security_events": "se",
  4867  				"single_file": "sf",
  4868  				"statuses": "s",
  4869  				"team_discussions": "td",
  4870  				"vulnerability_alerts": "va",
  4871  				"workflows": "w"
  4872  			},
  4873  			"created_at": ` + referenceTimeStr + `,
  4874  			"updated_at": ` + referenceTimeStr + `,
  4875  			"has_multiple_single_files": false,
  4876  			"suspended_by": {
  4877  				"login": "l",
  4878  				"id": 1,
  4879  				"avatar_url": "a",
  4880  				"gravatar_id": "g",
  4881  				"name": "n",
  4882  				"company": "c",
  4883  				"blog": "b",
  4884  				"location": "l",
  4885  				"email": "e",
  4886  				"hireable": true,
  4887  				"bio": "b",
  4888  				"twitter_username": "t",
  4889  				"public_repos": 1,
  4890  				"followers": 1,
  4891  				"following": 1,
  4892  				"created_at": ` + referenceTimeStr + `,
  4893  				"suspended_at": ` + referenceTimeStr + `,
  4894  				"url": "u"
  4895  			},
  4896  			"suspended_at": ` + referenceTimeStr + `
  4897  		}
  4898  	}`
  4899  
  4900  	testJSONMarshal(t, u, want)
  4901  }
  4902  
  4903  func TestCommitCommentEvent_Marshal(t *testing.T) {
  4904  	testJSONMarshal(t, &CommitCommentEvent{}, "{}")
  4905  
  4906  	u := &CommitCommentEvent{
  4907  		Comment: &RepositoryComment{
  4908  			HTMLURL:  String("hurl"),
  4909  			URL:      String("url"),
  4910  			ID:       Int64(1),
  4911  			NodeID:   String("nid"),
  4912  			CommitID: String("cid"),
  4913  			User: &User{
  4914  				Login:     String("l"),
  4915  				ID:        Int64(1),
  4916  				NodeID:    String("n"),
  4917  				URL:       String("u"),
  4918  				ReposURL:  String("r"),
  4919  				EventsURL: String("e"),
  4920  				AvatarURL: String("a"),
  4921  			},
  4922  			Reactions: &Reactions{
  4923  				TotalCount: Int(1),
  4924  				PlusOne:    Int(1),
  4925  				MinusOne:   Int(1),
  4926  				Laugh:      Int(1),
  4927  				Confused:   Int(1),
  4928  				Heart:      Int(1),
  4929  				Hooray:     Int(1),
  4930  				Rocket:     Int(1),
  4931  				Eyes:       Int(1),
  4932  				URL:        String("url"),
  4933  			},
  4934  			CreatedAt: &Timestamp{referenceTime},
  4935  			UpdatedAt: &Timestamp{referenceTime},
  4936  			Body:      String("b"),
  4937  			Path:      String("path"),
  4938  			Position:  Int(1),
  4939  		},
  4940  		Action: String("a"),
  4941  		Repo: &Repository{
  4942  			ID:   Int64(1),
  4943  			URL:  String("s"),
  4944  			Name: String("n"),
  4945  		},
  4946  		Sender: &User{
  4947  			Login:     String("l"),
  4948  			ID:        Int64(1),
  4949  			NodeID:    String("n"),
  4950  			URL:       String("u"),
  4951  			ReposURL:  String("r"),
  4952  			EventsURL: String("e"),
  4953  			AvatarURL: String("a"),
  4954  		},
  4955  		Installation: &Installation{
  4956  			ID:       Int64(1),
  4957  			NodeID:   String("nid"),
  4958  			AppID:    Int64(1),
  4959  			AppSlug:  String("as"),
  4960  			TargetID: Int64(1),
  4961  			Account: &User{
  4962  				Login:           String("l"),
  4963  				ID:              Int64(1),
  4964  				URL:             String("u"),
  4965  				AvatarURL:       String("a"),
  4966  				GravatarID:      String("g"),
  4967  				Name:            String("n"),
  4968  				Company:         String("c"),
  4969  				Blog:            String("b"),
  4970  				Location:        String("l"),
  4971  				Email:           String("e"),
  4972  				Hireable:        Bool(true),
  4973  				Bio:             String("b"),
  4974  				TwitterUsername: String("t"),
  4975  				PublicRepos:     Int(1),
  4976  				Followers:       Int(1),
  4977  				Following:       Int(1),
  4978  				CreatedAt:       &Timestamp{referenceTime},
  4979  				SuspendedAt:     &Timestamp{referenceTime},
  4980  			},
  4981  			AccessTokensURL:     String("atu"),
  4982  			RepositoriesURL:     String("ru"),
  4983  			HTMLURL:             String("hu"),
  4984  			TargetType:          String("tt"),
  4985  			SingleFileName:      String("sfn"),
  4986  			RepositorySelection: String("rs"),
  4987  			Events:              []string{"e"},
  4988  			SingleFilePaths:     []string{"s"},
  4989  			Permissions: &InstallationPermissions{
  4990  				Actions:                       String("a"),
  4991  				Administration:                String("ad"),
  4992  				Checks:                        String("c"),
  4993  				Contents:                      String("co"),
  4994  				ContentReferences:             String("cr"),
  4995  				Deployments:                   String("d"),
  4996  				Environments:                  String("e"),
  4997  				Issues:                        String("i"),
  4998  				Metadata:                      String("md"),
  4999  				Members:                       String("m"),
  5000  				OrganizationAdministration:    String("oa"),
  5001  				OrganizationHooks:             String("oh"),
  5002  				OrganizationPlan:              String("op"),
  5003  				OrganizationPreReceiveHooks:   String("opr"),
  5004  				OrganizationProjects:          String("op"),
  5005  				OrganizationSecrets:           String("os"),
  5006  				OrganizationSelfHostedRunners: String("osh"),
  5007  				OrganizationUserBlocking:      String("oub"),
  5008  				Packages:                      String("pkg"),
  5009  				Pages:                         String("pg"),
  5010  				PullRequests:                  String("pr"),
  5011  				RepositoryHooks:               String("rh"),
  5012  				RepositoryProjects:            String("rp"),
  5013  				RepositoryPreReceiveHooks:     String("rprh"),
  5014  				Secrets:                       String("s"),
  5015  				SecretScanningAlerts:          String("ssa"),
  5016  				SecurityEvents:                String("se"),
  5017  				SingleFile:                    String("sf"),
  5018  				Statuses:                      String("s"),
  5019  				TeamDiscussions:               String("td"),
  5020  				VulnerabilityAlerts:           String("va"),
  5021  				Workflows:                     String("w"),
  5022  			},
  5023  			CreatedAt:              &Timestamp{referenceTime},
  5024  			UpdatedAt:              &Timestamp{referenceTime},
  5025  			HasMultipleSingleFiles: Bool(false),
  5026  			SuspendedBy: &User{
  5027  				Login:           String("l"),
  5028  				ID:              Int64(1),
  5029  				URL:             String("u"),
  5030  				AvatarURL:       String("a"),
  5031  				GravatarID:      String("g"),
  5032  				Name:            String("n"),
  5033  				Company:         String("c"),
  5034  				Blog:            String("b"),
  5035  				Location:        String("l"),
  5036  				Email:           String("e"),
  5037  				Hireable:        Bool(true),
  5038  				Bio:             String("b"),
  5039  				TwitterUsername: String("t"),
  5040  				PublicRepos:     Int(1),
  5041  				Followers:       Int(1),
  5042  				Following:       Int(1),
  5043  				CreatedAt:       &Timestamp{referenceTime},
  5044  				SuspendedAt:     &Timestamp{referenceTime},
  5045  			},
  5046  			SuspendedAt: &Timestamp{referenceTime},
  5047  		},
  5048  	}
  5049  
  5050  	want := `{
  5051  		"comment": {
  5052  			"html_url": "hurl",
  5053  			"url": "url",
  5054  			"id": 1,
  5055  			"node_id": "nid",
  5056  			"commit_id": "cid",
  5057  			"user": {
  5058  				"login": "l",
  5059  				"id": 1,
  5060  				"node_id": "n",
  5061  				"avatar_url": "a",
  5062  				"url": "u",
  5063  				"events_url": "e",
  5064  				"repos_url": "r"
  5065  			},
  5066  			"reactions": {
  5067  				"total_count": 1,
  5068  				"+1": 1,
  5069  				"-1": 1,
  5070  				"laugh": 1,
  5071  				"confused": 1,
  5072  				"heart": 1,
  5073  				"hooray": 1,
  5074  				"rocket": 1,
  5075  				"eyes": 1,
  5076  				"url": "url"
  5077  			},
  5078  			"created_at": ` + referenceTimeStr + `,
  5079  			"updated_at": ` + referenceTimeStr + `,
  5080  			"body": "b",
  5081  			"path": "path",
  5082  			"position": 1
  5083  		},
  5084  		"action": "a",
  5085  		"repository": {
  5086  			"id": 1,
  5087  			"name": "n",
  5088  			"url": "s"
  5089  		},
  5090  		"sender": {
  5091  			"login": "l",
  5092  			"id": 1,
  5093  			"node_id": "n",
  5094  			"avatar_url": "a",
  5095  			"url": "u",
  5096  			"events_url": "e",
  5097  			"repos_url": "r"
  5098  		},
  5099  		"installation": {
  5100  			"id": 1,
  5101  			"node_id": "nid",
  5102  			"app_id": 1,
  5103  			"app_slug": "as",
  5104  			"target_id": 1,
  5105  			"account": {
  5106  				"login": "l",
  5107  				"id": 1,
  5108  				"avatar_url": "a",
  5109  				"gravatar_id": "g",
  5110  				"name": "n",
  5111  				"company": "c",
  5112  				"blog": "b",
  5113  				"location": "l",
  5114  				"email": "e",
  5115  				"hireable": true,
  5116  				"bio": "b",
  5117  				"twitter_username": "t",
  5118  				"public_repos": 1,
  5119  				"followers": 1,
  5120  				"following": 1,
  5121  				"created_at": ` + referenceTimeStr + `,
  5122  				"suspended_at": ` + referenceTimeStr + `,
  5123  				"url": "u"
  5124  			},
  5125  			"access_tokens_url": "atu",
  5126  			"repositories_url": "ru",
  5127  			"html_url": "hu",
  5128  			"target_type": "tt",
  5129  			"single_file_name": "sfn",
  5130  			"repository_selection": "rs",
  5131  			"events": [
  5132  				"e"
  5133  			],
  5134  			"single_file_paths": [
  5135  				"s"
  5136  			],
  5137  			"permissions": {
  5138  				"actions": "a",
  5139  				"administration": "ad",
  5140  				"checks": "c",
  5141  				"contents": "co",
  5142  				"content_references": "cr",
  5143  				"deployments": "d",
  5144  				"environments": "e",
  5145  				"issues": "i",
  5146  				"metadata": "md",
  5147  				"members": "m",
  5148  				"organization_administration": "oa",
  5149  				"organization_hooks": "oh",
  5150  				"organization_plan": "op",
  5151  				"organization_pre_receive_hooks": "opr",
  5152  				"organization_projects": "op",
  5153  				"organization_secrets": "os",
  5154  				"organization_self_hosted_runners": "osh",
  5155  				"organization_user_blocking": "oub",
  5156  				"packages": "pkg",
  5157  				"pages": "pg",
  5158  				"pull_requests": "pr",
  5159  				"repository_hooks": "rh",
  5160  				"repository_projects": "rp",
  5161  				"repository_pre_receive_hooks": "rprh",
  5162  				"secrets": "s",
  5163  				"secret_scanning_alerts": "ssa",
  5164  				"security_events": "se",
  5165  				"single_file": "sf",
  5166  				"statuses": "s",
  5167  				"team_discussions": "td",
  5168  				"vulnerability_alerts": "va",
  5169  				"workflows": "w"
  5170  			},
  5171  			"created_at": ` + referenceTimeStr + `,
  5172  			"updated_at": ` + referenceTimeStr + `,
  5173  			"has_multiple_single_files": false,
  5174  			"suspended_by": {
  5175  				"login": "l",
  5176  				"id": 1,
  5177  				"avatar_url": "a",
  5178  				"gravatar_id": "g",
  5179  				"name": "n",
  5180  				"company": "c",
  5181  				"blog": "b",
  5182  				"location": "l",
  5183  				"email": "e",
  5184  				"hireable": true,
  5185  				"bio": "b",
  5186  				"twitter_username": "t",
  5187  				"public_repos": 1,
  5188  				"followers": 1,
  5189  				"following": 1,
  5190  				"created_at": ` + referenceTimeStr + `,
  5191  				"suspended_at": ` + referenceTimeStr + `,
  5192  				"url": "u"
  5193  			},
  5194  			"suspended_at": ` + referenceTimeStr + `
  5195  		}
  5196  	}`
  5197  
  5198  	testJSONMarshal(t, u, want)
  5199  }
  5200  
  5201  func TestDeploymentEvent_Marshal(t *testing.T) {
  5202  	testJSONMarshal(t, &DeploymentEvent{}, "{}")
  5203  
  5204  	l := make(map[string]interface{})
  5205  	l["key"] = "value"
  5206  
  5207  	jsonMsg, _ := json.Marshal(&l)
  5208  
  5209  	u := &DeploymentEvent{
  5210  		Deployment: &Deployment{
  5211  			URL:         String("url"),
  5212  			ID:          Int64(1),
  5213  			SHA:         String("sha"),
  5214  			Ref:         String("ref"),
  5215  			Task:        String("t"),
  5216  			Payload:     jsonMsg,
  5217  			Environment: String("e"),
  5218  			Description: String("d"),
  5219  			Creator: &User{
  5220  				Login:     String("l"),
  5221  				ID:        Int64(1),
  5222  				NodeID:    String("n"),
  5223  				URL:       String("u"),
  5224  				ReposURL:  String("r"),
  5225  				EventsURL: String("e"),
  5226  				AvatarURL: String("a"),
  5227  			},
  5228  			CreatedAt:     &Timestamp{referenceTime},
  5229  			UpdatedAt:     &Timestamp{referenceTime},
  5230  			StatusesURL:   String("surl"),
  5231  			RepositoryURL: String("rurl"),
  5232  			NodeID:        String("nid"),
  5233  		},
  5234  		Repo: &Repository{
  5235  			ID:   Int64(1),
  5236  			URL:  String("s"),
  5237  			Name: String("n"),
  5238  		},
  5239  		Sender: &User{
  5240  			Login:     String("l"),
  5241  			ID:        Int64(1),
  5242  			NodeID:    String("n"),
  5243  			URL:       String("u"),
  5244  			ReposURL:  String("r"),
  5245  			EventsURL: String("e"),
  5246  			AvatarURL: String("a"),
  5247  		},
  5248  		Installation: &Installation{
  5249  			ID:       Int64(1),
  5250  			NodeID:   String("nid"),
  5251  			AppID:    Int64(1),
  5252  			AppSlug:  String("as"),
  5253  			TargetID: Int64(1),
  5254  			Account: &User{
  5255  				Login:           String("l"),
  5256  				ID:              Int64(1),
  5257  				URL:             String("u"),
  5258  				AvatarURL:       String("a"),
  5259  				GravatarID:      String("g"),
  5260  				Name:            String("n"),
  5261  				Company:         String("c"),
  5262  				Blog:            String("b"),
  5263  				Location:        String("l"),
  5264  				Email:           String("e"),
  5265  				Hireable:        Bool(true),
  5266  				Bio:             String("b"),
  5267  				TwitterUsername: String("t"),
  5268  				PublicRepos:     Int(1),
  5269  				Followers:       Int(1),
  5270  				Following:       Int(1),
  5271  				CreatedAt:       &Timestamp{referenceTime},
  5272  				SuspendedAt:     &Timestamp{referenceTime},
  5273  			},
  5274  			AccessTokensURL:     String("atu"),
  5275  			RepositoriesURL:     String("ru"),
  5276  			HTMLURL:             String("hu"),
  5277  			TargetType:          String("tt"),
  5278  			SingleFileName:      String("sfn"),
  5279  			RepositorySelection: String("rs"),
  5280  			Events:              []string{"e"},
  5281  			SingleFilePaths:     []string{"s"},
  5282  			Permissions: &InstallationPermissions{
  5283  				Actions:                       String("a"),
  5284  				Administration:                String("ad"),
  5285  				Checks:                        String("c"),
  5286  				Contents:                      String("co"),
  5287  				ContentReferences:             String("cr"),
  5288  				Deployments:                   String("d"),
  5289  				Environments:                  String("e"),
  5290  				Issues:                        String("i"),
  5291  				Metadata:                      String("md"),
  5292  				Members:                       String("m"),
  5293  				OrganizationAdministration:    String("oa"),
  5294  				OrganizationHooks:             String("oh"),
  5295  				OrganizationPlan:              String("op"),
  5296  				OrganizationPreReceiveHooks:   String("opr"),
  5297  				OrganizationProjects:          String("op"),
  5298  				OrganizationSecrets:           String("os"),
  5299  				OrganizationSelfHostedRunners: String("osh"),
  5300  				OrganizationUserBlocking:      String("oub"),
  5301  				Packages:                      String("pkg"),
  5302  				Pages:                         String("pg"),
  5303  				PullRequests:                  String("pr"),
  5304  				RepositoryHooks:               String("rh"),
  5305  				RepositoryProjects:            String("rp"),
  5306  				RepositoryPreReceiveHooks:     String("rprh"),
  5307  				Secrets:                       String("s"),
  5308  				SecretScanningAlerts:          String("ssa"),
  5309  				SecurityEvents:                String("se"),
  5310  				SingleFile:                    String("sf"),
  5311  				Statuses:                      String("s"),
  5312  				TeamDiscussions:               String("td"),
  5313  				VulnerabilityAlerts:           String("va"),
  5314  				Workflows:                     String("w"),
  5315  			},
  5316  			CreatedAt:              &Timestamp{referenceTime},
  5317  			UpdatedAt:              &Timestamp{referenceTime},
  5318  			HasMultipleSingleFiles: Bool(false),
  5319  			SuspendedBy: &User{
  5320  				Login:           String("l"),
  5321  				ID:              Int64(1),
  5322  				URL:             String("u"),
  5323  				AvatarURL:       String("a"),
  5324  				GravatarID:      String("g"),
  5325  				Name:            String("n"),
  5326  				Company:         String("c"),
  5327  				Blog:            String("b"),
  5328  				Location:        String("l"),
  5329  				Email:           String("e"),
  5330  				Hireable:        Bool(true),
  5331  				Bio:             String("b"),
  5332  				TwitterUsername: String("t"),
  5333  				PublicRepos:     Int(1),
  5334  				Followers:       Int(1),
  5335  				Following:       Int(1),
  5336  				CreatedAt:       &Timestamp{referenceTime},
  5337  				SuspendedAt:     &Timestamp{referenceTime},
  5338  			},
  5339  			SuspendedAt: &Timestamp{referenceTime},
  5340  		},
  5341  	}
  5342  
  5343  	want := `{
  5344  		"deployment": {
  5345  			"url": "url",
  5346  			"id": 1,
  5347  			"sha": "sha",
  5348  			"ref": "ref",
  5349  			"task": "t",
  5350  			"payload": {
  5351  				"key": "value"
  5352  			},
  5353  			"environment": "e",
  5354  			"description": "d",
  5355  			"creator": {
  5356  				"login": "l",
  5357  				"id": 1,
  5358  				"node_id": "n",
  5359  				"avatar_url": "a",
  5360  				"url": "u",
  5361  				"events_url": "e",
  5362  				"repos_url": "r"
  5363  			},
  5364  			"created_at": ` + referenceTimeStr + `,
  5365  			"updated_at": ` + referenceTimeStr + `,
  5366  			"statuses_url": "surl",
  5367  			"repository_url": "rurl",
  5368  			"node_id": "nid"
  5369  		},
  5370  		"repository": {
  5371  			"id": 1,
  5372  			"name": "n",
  5373  			"url": "s"
  5374  		},
  5375  		"sender": {
  5376  			"login": "l",
  5377  			"id": 1,
  5378  			"node_id": "n",
  5379  			"avatar_url": "a",
  5380  			"url": "u",
  5381  			"events_url": "e",
  5382  			"repos_url": "r"
  5383  		},
  5384  		"installation": {
  5385  			"id": 1,
  5386  			"node_id": "nid",
  5387  			"app_id": 1,
  5388  			"app_slug": "as",
  5389  			"target_id": 1,
  5390  			"account": {
  5391  				"login": "l",
  5392  				"id": 1,
  5393  				"avatar_url": "a",
  5394  				"gravatar_id": "g",
  5395  				"name": "n",
  5396  				"company": "c",
  5397  				"blog": "b",
  5398  				"location": "l",
  5399  				"email": "e",
  5400  				"hireable": true,
  5401  				"bio": "b",
  5402  				"twitter_username": "t",
  5403  				"public_repos": 1,
  5404  				"followers": 1,
  5405  				"following": 1,
  5406  				"created_at": ` + referenceTimeStr + `,
  5407  				"suspended_at": ` + referenceTimeStr + `,
  5408  				"url": "u"
  5409  			},
  5410  			"access_tokens_url": "atu",
  5411  			"repositories_url": "ru",
  5412  			"html_url": "hu",
  5413  			"target_type": "tt",
  5414  			"single_file_name": "sfn",
  5415  			"repository_selection": "rs",
  5416  			"events": [
  5417  				"e"
  5418  			],
  5419  			"single_file_paths": [
  5420  				"s"
  5421  			],
  5422  			"permissions": {
  5423  				"actions": "a",
  5424  				"administration": "ad",
  5425  				"checks": "c",
  5426  				"contents": "co",
  5427  				"content_references": "cr",
  5428  				"deployments": "d",
  5429  				"environments": "e",
  5430  				"issues": "i",
  5431  				"metadata": "md",
  5432  				"members": "m",
  5433  				"organization_administration": "oa",
  5434  				"organization_hooks": "oh",
  5435  				"organization_plan": "op",
  5436  				"organization_pre_receive_hooks": "opr",
  5437  				"organization_projects": "op",
  5438  				"organization_secrets": "os",
  5439  				"organization_self_hosted_runners": "osh",
  5440  				"organization_user_blocking": "oub",
  5441  				"packages": "pkg",
  5442  				"pages": "pg",
  5443  				"pull_requests": "pr",
  5444  				"repository_hooks": "rh",
  5445  				"repository_projects": "rp",
  5446  				"repository_pre_receive_hooks": "rprh",
  5447  				"secrets": "s",
  5448  				"secret_scanning_alerts": "ssa",
  5449  				"security_events": "se",
  5450  				"single_file": "sf",
  5451  				"statuses": "s",
  5452  				"team_discussions": "td",
  5453  				"vulnerability_alerts": "va",
  5454  				"workflows": "w"
  5455  			},
  5456  			"created_at": ` + referenceTimeStr + `,
  5457  			"updated_at": ` + referenceTimeStr + `,
  5458  			"has_multiple_single_files": false,
  5459  			"suspended_by": {
  5460  				"login": "l",
  5461  				"id": 1,
  5462  				"avatar_url": "a",
  5463  				"gravatar_id": "g",
  5464  				"name": "n",
  5465  				"company": "c",
  5466  				"blog": "b",
  5467  				"location": "l",
  5468  				"email": "e",
  5469  				"hireable": true,
  5470  				"bio": "b",
  5471  				"twitter_username": "t",
  5472  				"public_repos": 1,
  5473  				"followers": 1,
  5474  				"following": 1,
  5475  				"created_at": ` + referenceTimeStr + `,
  5476  				"suspended_at": ` + referenceTimeStr + `,
  5477  				"url": "u"
  5478  			},
  5479  			"suspended_at": ` + referenceTimeStr + `
  5480  		}
  5481  	}`
  5482  
  5483  	testJSONMarshal(t, u, want)
  5484  }
  5485  
  5486  func TestDeploymentProtectionRuleEvent_Marshal(t *testing.T) {
  5487  	testJSONMarshal(t, &DeploymentProtectionRuleEvent{}, "{}")
  5488  
  5489  	l := make(map[string]interface{})
  5490  	l["key"] = "value"
  5491  
  5492  	jsonMsg, _ := json.Marshal(&l)
  5493  
  5494  	u := &DeploymentProtectionRuleEvent{
  5495  		Action:                String("a"),
  5496  		Environment:           String("e"),
  5497  		DeploymentCallbackURL: String("b"),
  5498  		Deployment: &Deployment{
  5499  			URL:         String("url"),
  5500  			ID:          Int64(1),
  5501  			SHA:         String("sha"),
  5502  			Ref:         String("ref"),
  5503  			Task:        String("t"),
  5504  			Payload:     jsonMsg,
  5505  			Environment: String("e"),
  5506  			Description: String("d"),
  5507  			Creator: &User{
  5508  				Login:     String("l"),
  5509  				ID:        Int64(1),
  5510  				NodeID:    String("n"),
  5511  				URL:       String("u"),
  5512  				ReposURL:  String("r"),
  5513  				EventsURL: String("e"),
  5514  				AvatarURL: String("a"),
  5515  			},
  5516  			CreatedAt:     &Timestamp{referenceTime},
  5517  			UpdatedAt:     &Timestamp{referenceTime},
  5518  			StatusesURL:   String("surl"),
  5519  			RepositoryURL: String("rurl"),
  5520  			NodeID:        String("nid"),
  5521  		},
  5522  		Repo: &Repository{
  5523  			ID:   Int64(1),
  5524  			URL:  String("s"),
  5525  			Name: String("n"),
  5526  		},
  5527  		Organization: &Organization{
  5528  			BillingEmail:                         String("be"),
  5529  			Blog:                                 String("b"),
  5530  			Company:                              String("c"),
  5531  			Email:                                String("e"),
  5532  			TwitterUsername:                      String("tu"),
  5533  			Location:                             String("loc"),
  5534  			Name:                                 String("n"),
  5535  			Description:                          String("d"),
  5536  			IsVerified:                           Bool(true),
  5537  			HasOrganizationProjects:              Bool(true),
  5538  			HasRepositoryProjects:                Bool(true),
  5539  			DefaultRepoPermission:                String("drp"),
  5540  			MembersCanCreateRepos:                Bool(true),
  5541  			MembersCanCreateInternalRepos:        Bool(true),
  5542  			MembersCanCreatePrivateRepos:         Bool(true),
  5543  			MembersCanCreatePublicRepos:          Bool(false),
  5544  			MembersAllowedRepositoryCreationType: String("marct"),
  5545  			MembersCanCreatePages:                Bool(true),
  5546  			MembersCanCreatePublicPages:          Bool(false),
  5547  			MembersCanCreatePrivatePages:         Bool(true),
  5548  		},
  5549  		PullRequests: []*PullRequest{
  5550  			{
  5551  				URL:    String("u"),
  5552  				ID:     Int64(1),
  5553  				Number: Int(1),
  5554  				Head: &PullRequestBranch{
  5555  					Ref: String("r"),
  5556  					SHA: String("s"),
  5557  					Repo: &Repository{
  5558  						ID:   Int64(1),
  5559  						URL:  String("s"),
  5560  						Name: String("n"),
  5561  					},
  5562  				},
  5563  				Base: &PullRequestBranch{
  5564  					Ref: String("r"),
  5565  					SHA: String("s"),
  5566  					Repo: &Repository{
  5567  						ID:   Int64(1),
  5568  						URL:  String("u"),
  5569  						Name: String("n"),
  5570  					},
  5571  				},
  5572  			},
  5573  		},
  5574  		Sender: &User{
  5575  			Login:     String("l"),
  5576  			ID:        Int64(1),
  5577  			NodeID:    String("n"),
  5578  			URL:       String("u"),
  5579  			ReposURL:  String("r"),
  5580  			EventsURL: String("e"),
  5581  			AvatarURL: String("a"),
  5582  		},
  5583  		Installation: &Installation{
  5584  			ID:       Int64(1),
  5585  			NodeID:   String("nid"),
  5586  			AppID:    Int64(1),
  5587  			AppSlug:  String("as"),
  5588  			TargetID: Int64(1),
  5589  			Account: &User{
  5590  				Login:           String("l"),
  5591  				ID:              Int64(1),
  5592  				URL:             String("u"),
  5593  				AvatarURL:       String("a"),
  5594  				GravatarID:      String("g"),
  5595  				Name:            String("n"),
  5596  				Company:         String("c"),
  5597  				Blog:            String("b"),
  5598  				Location:        String("l"),
  5599  				Email:           String("e"),
  5600  				Hireable:        Bool(true),
  5601  				Bio:             String("b"),
  5602  				TwitterUsername: String("t"),
  5603  				PublicRepos:     Int(1),
  5604  				Followers:       Int(1),
  5605  				Following:       Int(1),
  5606  				CreatedAt:       &Timestamp{referenceTime},
  5607  				SuspendedAt:     &Timestamp{referenceTime},
  5608  			},
  5609  			AccessTokensURL:     String("atu"),
  5610  			RepositoriesURL:     String("ru"),
  5611  			HTMLURL:             String("hu"),
  5612  			TargetType:          String("tt"),
  5613  			SingleFileName:      String("sfn"),
  5614  			RepositorySelection: String("rs"),
  5615  			Events:              []string{"e"},
  5616  			SingleFilePaths:     []string{"s"},
  5617  			Permissions: &InstallationPermissions{
  5618  				Actions:                       String("a"),
  5619  				Administration:                String("ad"),
  5620  				Checks:                        String("c"),
  5621  				Contents:                      String("co"),
  5622  				ContentReferences:             String("cr"),
  5623  				Deployments:                   String("d"),
  5624  				Environments:                  String("e"),
  5625  				Issues:                        String("i"),
  5626  				Metadata:                      String("md"),
  5627  				Members:                       String("m"),
  5628  				OrganizationAdministration:    String("oa"),
  5629  				OrganizationHooks:             String("oh"),
  5630  				OrganizationPlan:              String("op"),
  5631  				OrganizationPreReceiveHooks:   String("opr"),
  5632  				OrganizationProjects:          String("op"),
  5633  				OrganizationSecrets:           String("os"),
  5634  				OrganizationSelfHostedRunners: String("osh"),
  5635  				OrganizationUserBlocking:      String("oub"),
  5636  				Packages:                      String("pkg"),
  5637  				Pages:                         String("pg"),
  5638  				PullRequests:                  String("pr"),
  5639  				RepositoryHooks:               String("rh"),
  5640  				RepositoryProjects:            String("rp"),
  5641  				RepositoryPreReceiveHooks:     String("rprh"),
  5642  				Secrets:                       String("s"),
  5643  				SecretScanningAlerts:          String("ssa"),
  5644  				SecurityEvents:                String("se"),
  5645  				SingleFile:                    String("sf"),
  5646  				Statuses:                      String("s"),
  5647  				TeamDiscussions:               String("td"),
  5648  				VulnerabilityAlerts:           String("va"),
  5649  				Workflows:                     String("w"),
  5650  			},
  5651  			CreatedAt:              &Timestamp{referenceTime},
  5652  			UpdatedAt:              &Timestamp{referenceTime},
  5653  			HasMultipleSingleFiles: Bool(false),
  5654  			SuspendedBy: &User{
  5655  				Login:           String("l"),
  5656  				ID:              Int64(1),
  5657  				URL:             String("u"),
  5658  				AvatarURL:       String("a"),
  5659  				GravatarID:      String("g"),
  5660  				Name:            String("n"),
  5661  				Company:         String("c"),
  5662  				Blog:            String("b"),
  5663  				Location:        String("l"),
  5664  				Email:           String("e"),
  5665  				Hireable:        Bool(true),
  5666  				Bio:             String("b"),
  5667  				TwitterUsername: String("t"),
  5668  				PublicRepos:     Int(1),
  5669  				Followers:       Int(1),
  5670  				Following:       Int(1),
  5671  				CreatedAt:       &Timestamp{referenceTime},
  5672  				SuspendedAt:     &Timestamp{referenceTime},
  5673  			},
  5674  			SuspendedAt: &Timestamp{referenceTime},
  5675  		},
  5676  	}
  5677  
  5678  	want := `{
  5679  		"action": "a",
  5680  		"environment": "e",
  5681  		"deployment_callback_url": "b",
  5682  		"deployment": {
  5683  			"url": "url",
  5684  			"id": 1,
  5685  			"sha": "sha",
  5686  			"ref": "ref",
  5687  			"task": "t",
  5688  			"payload": {
  5689  				"key": "value"
  5690  			},
  5691  			"environment": "e",
  5692  			"description": "d",
  5693  			"creator": {
  5694  				"login": "l",
  5695  				"id": 1,
  5696  				"node_id": "n",
  5697  				"avatar_url": "a",
  5698  				"url": "u",
  5699  				"events_url": "e",
  5700  				"repos_url": "r"
  5701  			},
  5702  			"created_at": ` + referenceTimeStr + `,
  5703  			"updated_at": ` + referenceTimeStr + `,
  5704  			"statuses_url": "surl",
  5705  			"repository_url": "rurl",
  5706  			"node_id": "nid"
  5707  		},
  5708  		"repository": {
  5709  			"id": 1,
  5710  			"name": "n",
  5711  			"url": "s"
  5712  		},
  5713  		"organization": {
  5714  			"name": "n",
  5715  			"company": "c",
  5716  			"blog": "b",
  5717  			"location": "loc",
  5718  			"email": "e",
  5719  			"twitter_username": "tu",
  5720  			"description": "d",
  5721  			"billing_email": "be",
  5722  			"is_verified": true,
  5723  			"has_organization_projects": true,
  5724  			"has_repository_projects": true,
  5725  			"default_repository_permission": "drp",
  5726  			"members_can_create_repositories": true,
  5727  			"members_can_create_public_repositories": false,
  5728  			"members_can_create_private_repositories": true,
  5729  			"members_can_create_internal_repositories": true,
  5730  			"members_allowed_repository_creation_type": "marct",
  5731  			"members_can_create_pages": true,
  5732  			"members_can_create_public_pages": false,
  5733  			"members_can_create_private_pages": true
  5734  		},
  5735  		"pull_requests": [
  5736  			{
  5737  				"id": 1,
  5738  				"number": 1,
  5739  				"url": "u",
  5740  				"head": {
  5741  					"ref": "r",
  5742  					"sha": "s",
  5743  					"repo": {
  5744  						"id": 1,
  5745  						"name": "n",
  5746  						"url": "s"
  5747  					}
  5748  				},
  5749  				"base": {
  5750  					"ref": "r",
  5751  					"sha": "s",
  5752  					"repo": {
  5753  						"id": 1,
  5754  						"name": "n",
  5755  						"url": "u"
  5756  					}
  5757  				}
  5758  			}
  5759  		],
  5760  		"sender": {
  5761  			"login": "l",
  5762  			"id": 1,
  5763  			"node_id": "n",
  5764  			"avatar_url": "a",
  5765  			"url": "u",
  5766  			"events_url": "e",
  5767  			"repos_url": "r"
  5768  		},
  5769  		"installation": {
  5770  			"id": 1,
  5771  			"node_id": "nid",
  5772  			"app_id": 1,
  5773  			"app_slug": "as",
  5774  			"target_id": 1,
  5775  			"account": {
  5776  				"login": "l",
  5777  				"id": 1,
  5778  				"avatar_url": "a",
  5779  				"gravatar_id": "g",
  5780  				"name": "n",
  5781  				"company": "c",
  5782  				"blog": "b",
  5783  				"location": "l",
  5784  				"email": "e",
  5785  				"hireable": true,
  5786  				"bio": "b",
  5787  				"twitter_username": "t",
  5788  				"public_repos": 1,
  5789  				"followers": 1,
  5790  				"following": 1,
  5791  				"created_at": ` + referenceTimeStr + `,
  5792  				"suspended_at": ` + referenceTimeStr + `,
  5793  				"url": "u"
  5794  			},
  5795  			"access_tokens_url": "atu",
  5796  			"repositories_url": "ru",
  5797  			"html_url": "hu",
  5798  			"target_type": "tt",
  5799  			"single_file_name": "sfn",
  5800  			"repository_selection": "rs",
  5801  			"events": [
  5802  				"e"
  5803  			],
  5804  			"single_file_paths": [
  5805  				"s"
  5806  			],
  5807  			"permissions": {
  5808  				"actions": "a",
  5809  				"administration": "ad",
  5810  				"checks": "c",
  5811  				"contents": "co",
  5812  				"content_references": "cr",
  5813  				"deployments": "d",
  5814  				"environments": "e",
  5815  				"issues": "i",
  5816  				"metadata": "md",
  5817  				"members": "m",
  5818  				"organization_administration": "oa",
  5819  				"organization_hooks": "oh",
  5820  				"organization_plan": "op",
  5821  				"organization_pre_receive_hooks": "opr",
  5822  				"organization_projects": "op",
  5823  				"organization_secrets": "os",
  5824  				"organization_self_hosted_runners": "osh",
  5825  				"organization_user_blocking": "oub",
  5826  				"packages": "pkg",
  5827  				"pages": "pg",
  5828  				"pull_requests": "pr",
  5829  				"repository_hooks": "rh",
  5830  				"repository_projects": "rp",
  5831  				"repository_pre_receive_hooks": "rprh",
  5832  				"secrets": "s",
  5833  				"secret_scanning_alerts": "ssa",
  5834  				"security_events": "se",
  5835  				"single_file": "sf",
  5836  				"statuses": "s",
  5837  				"team_discussions": "td",
  5838  				"vulnerability_alerts": "va",
  5839  				"workflows": "w"
  5840  			},
  5841  			"created_at": ` + referenceTimeStr + `,
  5842  			"updated_at": ` + referenceTimeStr + `,
  5843  			"has_multiple_single_files": false,
  5844  			"suspended_by": {
  5845  				"login": "l",
  5846  				"id": 1,
  5847  				"avatar_url": "a",
  5848  				"gravatar_id": "g",
  5849  				"name": "n",
  5850  				"company": "c",
  5851  				"blog": "b",
  5852  				"location": "l",
  5853  				"email": "e",
  5854  				"hireable": true,
  5855  				"bio": "b",
  5856  				"twitter_username": "t",
  5857  				"public_repos": 1,
  5858  				"followers": 1,
  5859  				"following": 1,
  5860  				"created_at": ` + referenceTimeStr + `,
  5861  				"suspended_at": ` + referenceTimeStr + `,
  5862  				"url": "u"
  5863  			},
  5864  			"suspended_at": ` + referenceTimeStr + `
  5865  		}
  5866  	}`
  5867  
  5868  	testJSONMarshal(t, u, want)
  5869  }
  5870  
  5871  func TestDeploymentStatusEvent_Marshal(t *testing.T) {
  5872  	testJSONMarshal(t, &DeploymentStatusEvent{}, "{}")
  5873  
  5874  	l := make(map[string]interface{})
  5875  	l["key"] = "value"
  5876  
  5877  	jsonMsg, _ := json.Marshal(&l)
  5878  
  5879  	u := &DeploymentStatusEvent{
  5880  		Deployment: &Deployment{
  5881  			URL:         String("url"),
  5882  			ID:          Int64(1),
  5883  			SHA:         String("sha"),
  5884  			Ref:         String("ref"),
  5885  			Task:        String("t"),
  5886  			Payload:     jsonMsg,
  5887  			Environment: String("e"),
  5888  			Description: String("d"),
  5889  			Creator: &User{
  5890  				Login:     String("l"),
  5891  				ID:        Int64(1),
  5892  				NodeID:    String("n"),
  5893  				URL:       String("u"),
  5894  				ReposURL:  String("r"),
  5895  				EventsURL: String("e"),
  5896  				AvatarURL: String("a"),
  5897  			},
  5898  			CreatedAt:     &Timestamp{referenceTime},
  5899  			UpdatedAt:     &Timestamp{referenceTime},
  5900  			StatusesURL:   String("surl"),
  5901  			RepositoryURL: String("rurl"),
  5902  			NodeID:        String("nid"),
  5903  		},
  5904  		DeploymentStatus: &DeploymentStatus{
  5905  			ID:    Int64(1),
  5906  			State: String("s"),
  5907  			Creator: &User{
  5908  				Login:     String("l"),
  5909  				ID:        Int64(1),
  5910  				NodeID:    String("n"),
  5911  				URL:       String("u"),
  5912  				ReposURL:  String("r"),
  5913  				EventsURL: String("e"),
  5914  				AvatarURL: String("a"),
  5915  			},
  5916  			Description:    String("s"),
  5917  			Environment:    String("s"),
  5918  			NodeID:         String("s"),
  5919  			CreatedAt:      &Timestamp{referenceTime},
  5920  			UpdatedAt:      &Timestamp{referenceTime},
  5921  			TargetURL:      String("s"),
  5922  			DeploymentURL:  String("s"),
  5923  			RepositoryURL:  String("s"),
  5924  			EnvironmentURL: String("s"),
  5925  			LogURL:         String("s"),
  5926  			URL:            String("s"),
  5927  		},
  5928  		Repo: &Repository{
  5929  			ID:   Int64(1),
  5930  			URL:  String("s"),
  5931  			Name: String("n"),
  5932  		},
  5933  		Sender: &User{
  5934  			Login:     String("l"),
  5935  			ID:        Int64(1),
  5936  			NodeID:    String("n"),
  5937  			URL:       String("u"),
  5938  			ReposURL:  String("r"),
  5939  			EventsURL: String("e"),
  5940  			AvatarURL: String("a"),
  5941  		},
  5942  		Installation: &Installation{
  5943  			ID:       Int64(1),
  5944  			NodeID:   String("nid"),
  5945  			AppID:    Int64(1),
  5946  			AppSlug:  String("as"),
  5947  			TargetID: Int64(1),
  5948  			Account: &User{
  5949  				Login:           String("l"),
  5950  				ID:              Int64(1),
  5951  				URL:             String("u"),
  5952  				AvatarURL:       String("a"),
  5953  				GravatarID:      String("g"),
  5954  				Name:            String("n"),
  5955  				Company:         String("c"),
  5956  				Blog:            String("b"),
  5957  				Location:        String("l"),
  5958  				Email:           String("e"),
  5959  				Hireable:        Bool(true),
  5960  				Bio:             String("b"),
  5961  				TwitterUsername: String("t"),
  5962  				PublicRepos:     Int(1),
  5963  				Followers:       Int(1),
  5964  				Following:       Int(1),
  5965  				CreatedAt:       &Timestamp{referenceTime},
  5966  				SuspendedAt:     &Timestamp{referenceTime},
  5967  			},
  5968  			AccessTokensURL:     String("atu"),
  5969  			RepositoriesURL:     String("ru"),
  5970  			HTMLURL:             String("hu"),
  5971  			TargetType:          String("tt"),
  5972  			SingleFileName:      String("sfn"),
  5973  			RepositorySelection: String("rs"),
  5974  			Events:              []string{"e"},
  5975  			SingleFilePaths:     []string{"s"},
  5976  			Permissions: &InstallationPermissions{
  5977  				Actions:                       String("a"),
  5978  				Administration:                String("ad"),
  5979  				Checks:                        String("c"),
  5980  				Contents:                      String("co"),
  5981  				ContentReferences:             String("cr"),
  5982  				Deployments:                   String("d"),
  5983  				Environments:                  String("e"),
  5984  				Issues:                        String("i"),
  5985  				Metadata:                      String("md"),
  5986  				Members:                       String("m"),
  5987  				OrganizationAdministration:    String("oa"),
  5988  				OrganizationHooks:             String("oh"),
  5989  				OrganizationPlan:              String("op"),
  5990  				OrganizationPreReceiveHooks:   String("opr"),
  5991  				OrganizationProjects:          String("op"),
  5992  				OrganizationSecrets:           String("os"),
  5993  				OrganizationSelfHostedRunners: String("osh"),
  5994  				OrganizationUserBlocking:      String("oub"),
  5995  				Packages:                      String("pkg"),
  5996  				Pages:                         String("pg"),
  5997  				PullRequests:                  String("pr"),
  5998  				RepositoryHooks:               String("rh"),
  5999  				RepositoryProjects:            String("rp"),
  6000  				RepositoryPreReceiveHooks:     String("rprh"),
  6001  				Secrets:                       String("s"),
  6002  				SecretScanningAlerts:          String("ssa"),
  6003  				SecurityEvents:                String("se"),
  6004  				SingleFile:                    String("sf"),
  6005  				Statuses:                      String("s"),
  6006  				TeamDiscussions:               String("td"),
  6007  				VulnerabilityAlerts:           String("va"),
  6008  				Workflows:                     String("w"),
  6009  			},
  6010  			CreatedAt:              &Timestamp{referenceTime},
  6011  			UpdatedAt:              &Timestamp{referenceTime},
  6012  			HasMultipleSingleFiles: Bool(false),
  6013  			SuspendedBy: &User{
  6014  				Login:           String("l"),
  6015  				ID:              Int64(1),
  6016  				URL:             String("u"),
  6017  				AvatarURL:       String("a"),
  6018  				GravatarID:      String("g"),
  6019  				Name:            String("n"),
  6020  				Company:         String("c"),
  6021  				Blog:            String("b"),
  6022  				Location:        String("l"),
  6023  				Email:           String("e"),
  6024  				Hireable:        Bool(true),
  6025  				Bio:             String("b"),
  6026  				TwitterUsername: String("t"),
  6027  				PublicRepos:     Int(1),
  6028  				Followers:       Int(1),
  6029  				Following:       Int(1),
  6030  				CreatedAt:       &Timestamp{referenceTime},
  6031  				SuspendedAt:     &Timestamp{referenceTime},
  6032  			},
  6033  			SuspendedAt: &Timestamp{referenceTime},
  6034  		},
  6035  	}
  6036  
  6037  	want := `{
  6038  		"deployment": {
  6039  			"url": "url",
  6040  			"id": 1,
  6041  			"sha": "sha",
  6042  			"ref": "ref",
  6043  			"task": "t",
  6044  			"payload": {
  6045  				"key": "value"
  6046  			},
  6047  			"environment": "e",
  6048  			"description": "d",
  6049  			"creator": {
  6050  				"login": "l",
  6051  				"id": 1,
  6052  				"node_id": "n",
  6053  				"avatar_url": "a",
  6054  				"url": "u",
  6055  				"events_url": "e",
  6056  				"repos_url": "r"
  6057  			},
  6058  			"created_at": ` + referenceTimeStr + `,
  6059  			"updated_at": ` + referenceTimeStr + `,
  6060  			"statuses_url": "surl",
  6061  			"repository_url": "rurl",
  6062  			"node_id": "nid"
  6063  		},
  6064  		"deployment_status": {
  6065  			"id": 1,
  6066  			"state": "s",
  6067  			"creator": {
  6068  				"login": "l",
  6069  				"id": 1,
  6070  				"node_id": "n",
  6071  				"avatar_url": "a",
  6072  				"url": "u",
  6073  				"events_url": "e",
  6074  				"repos_url": "r"
  6075  			},
  6076  			"description": "s",
  6077  			"environment": "s",
  6078  			"node_id": "s",
  6079  			"created_at": ` + referenceTimeStr + `,
  6080  			"updated_at": ` + referenceTimeStr + `,
  6081  			"target_url": "s",
  6082  			"deployment_url": "s",
  6083  			"repository_url": "s",
  6084  			"environment_url": "s",
  6085  			"log_url": "s",
  6086  			"url": "s"
  6087  		},
  6088  		"repository": {
  6089  			"id": 1,
  6090  			"name": "n",
  6091  			"url": "s"
  6092  		},
  6093  		"sender": {
  6094  			"login": "l",
  6095  			"id": 1,
  6096  			"node_id": "n",
  6097  			"avatar_url": "a",
  6098  			"url": "u",
  6099  			"events_url": "e",
  6100  			"repos_url": "r"
  6101  		},
  6102  		"installation": {
  6103  			"id": 1,
  6104  			"node_id": "nid",
  6105  			"app_id": 1,
  6106  			"app_slug": "as",
  6107  			"target_id": 1,
  6108  			"account": {
  6109  				"login": "l",
  6110  				"id": 1,
  6111  				"avatar_url": "a",
  6112  				"gravatar_id": "g",
  6113  				"name": "n",
  6114  				"company": "c",
  6115  				"blog": "b",
  6116  				"location": "l",
  6117  				"email": "e",
  6118  				"hireable": true,
  6119  				"bio": "b",
  6120  				"twitter_username": "t",
  6121  				"public_repos": 1,
  6122  				"followers": 1,
  6123  				"following": 1,
  6124  				"created_at": ` + referenceTimeStr + `,
  6125  				"suspended_at": ` + referenceTimeStr + `,
  6126  				"url": "u"
  6127  			},
  6128  			"access_tokens_url": "atu",
  6129  			"repositories_url": "ru",
  6130  			"html_url": "hu",
  6131  			"target_type": "tt",
  6132  			"single_file_name": "sfn",
  6133  			"repository_selection": "rs",
  6134  			"events": [
  6135  				"e"
  6136  			],
  6137  			"single_file_paths": [
  6138  				"s"
  6139  			],
  6140  			"permissions": {
  6141  				"actions": "a",
  6142  				"administration": "ad",
  6143  				"checks": "c",
  6144  				"contents": "co",
  6145  				"content_references": "cr",
  6146  				"deployments": "d",
  6147  				"environments": "e",
  6148  				"issues": "i",
  6149  				"metadata": "md",
  6150  				"members": "m",
  6151  				"organization_administration": "oa",
  6152  				"organization_hooks": "oh",
  6153  				"organization_plan": "op",
  6154  				"organization_pre_receive_hooks": "opr",
  6155  				"organization_projects": "op",
  6156  				"organization_secrets": "os",
  6157  				"organization_self_hosted_runners": "osh",
  6158  				"organization_user_blocking": "oub",
  6159  				"packages": "pkg",
  6160  				"pages": "pg",
  6161  				"pull_requests": "pr",
  6162  				"repository_hooks": "rh",
  6163  				"repository_projects": "rp",
  6164  				"repository_pre_receive_hooks": "rprh",
  6165  				"secrets": "s",
  6166  				"secret_scanning_alerts": "ssa",
  6167  				"security_events": "se",
  6168  				"single_file": "sf",
  6169  				"statuses": "s",
  6170  				"team_discussions": "td",
  6171  				"vulnerability_alerts": "va",
  6172  				"workflows": "w"
  6173  			},
  6174  			"created_at": ` + referenceTimeStr + `,
  6175  			"updated_at": ` + referenceTimeStr + `,
  6176  			"has_multiple_single_files": false,
  6177  			"suspended_by": {
  6178  				"login": "l",
  6179  				"id": 1,
  6180  				"avatar_url": "a",
  6181  				"gravatar_id": "g",
  6182  				"name": "n",
  6183  				"company": "c",
  6184  				"blog": "b",
  6185  				"location": "l",
  6186  				"email": "e",
  6187  				"hireable": true,
  6188  				"bio": "b",
  6189  				"twitter_username": "t",
  6190  				"public_repos": 1,
  6191  				"followers": 1,
  6192  				"following": 1,
  6193  				"created_at": ` + referenceTimeStr + `,
  6194  				"suspended_at": ` + referenceTimeStr + `,
  6195  				"url": "u"
  6196  			},
  6197  			"suspended_at": ` + referenceTimeStr + `
  6198  		}
  6199  	}`
  6200  
  6201  	testJSONMarshal(t, u, want)
  6202  }
  6203  
  6204  func TestDiscussionCommentEvent_Marshal(t *testing.T) {
  6205  	testJSONMarshal(t, &DiscussionCommentEvent{}, "{}")
  6206  
  6207  	u := &DiscussionCommentEvent{
  6208  		Comment: &CommentDiscussion{
  6209  			AuthorAssociation: String("aa"),
  6210  			Body:              String("bo"),
  6211  			ChildCommentCount: Int(1),
  6212  			CreatedAt:         &Timestamp{referenceTime},
  6213  			DiscussionID:      Int64(1),
  6214  			HTMLURL:           String("hurl"),
  6215  			ID:                Int64(1),
  6216  			NodeID:            String("nid"),
  6217  			ParentID:          Int64(1),
  6218  			Reactions: &Reactions{
  6219  				TotalCount: Int(1),
  6220  				PlusOne:    Int(1),
  6221  				MinusOne:   Int(1),
  6222  				Laugh:      Int(1),
  6223  				Confused:   Int(1),
  6224  				Heart:      Int(1),
  6225  				Hooray:     Int(1),
  6226  				Rocket:     Int(1),
  6227  				Eyes:       Int(1),
  6228  				URL:        String("url"),
  6229  			},
  6230  			RepositoryURL: String("rurl"),
  6231  			UpdatedAt:     &Timestamp{referenceTime},
  6232  			User: &User{
  6233  				Login:     String("l"),
  6234  				ID:        Int64(1),
  6235  				NodeID:    String("n"),
  6236  				URL:       String("u"),
  6237  				ReposURL:  String("r"),
  6238  				EventsURL: String("e"),
  6239  				AvatarURL: String("a"),
  6240  			},
  6241  		},
  6242  		Discussion: &Discussion{
  6243  			RepositoryURL: String("rurl"),
  6244  			DiscussionCategory: &DiscussionCategory{
  6245  				ID:           Int64(1),
  6246  				NodeID:       String("nid"),
  6247  				RepositoryID: Int64(1),
  6248  				Emoji:        String("emoji"),
  6249  				Name:         String("name"),
  6250  				Description:  String("description"),
  6251  				CreatedAt:    &Timestamp{referenceTime},
  6252  				UpdatedAt:    &Timestamp{referenceTime},
  6253  				Slug:         String("slug"),
  6254  				IsAnswerable: Bool(false),
  6255  			},
  6256  			HTMLURL: String("hurl"),
  6257  			ID:      Int64(1),
  6258  			NodeID:  String("nurl"),
  6259  			Number:  Int(1),
  6260  			Title:   String("title"),
  6261  			User: &User{
  6262  				Login:     String("l"),
  6263  				ID:        Int64(1),
  6264  				NodeID:    String("n"),
  6265  				URL:       String("u"),
  6266  				ReposURL:  String("r"),
  6267  				EventsURL: String("e"),
  6268  				AvatarURL: String("a"),
  6269  			},
  6270  			State:             String("st"),
  6271  			Locked:            Bool(false),
  6272  			Comments:          Int(1),
  6273  			CreatedAt:         &Timestamp{referenceTime},
  6274  			UpdatedAt:         &Timestamp{referenceTime},
  6275  			AuthorAssociation: String("aa"),
  6276  			Body:              String("bo"),
  6277  		},
  6278  		Repo: &Repository{
  6279  			ID:   Int64(1),
  6280  			URL:  String("s"),
  6281  			Name: String("n"),
  6282  		},
  6283  		Org: &Organization{
  6284  			BillingEmail:                         String("be"),
  6285  			Blog:                                 String("b"),
  6286  			Company:                              String("c"),
  6287  			Email:                                String("e"),
  6288  			TwitterUsername:                      String("tu"),
  6289  			Location:                             String("loc"),
  6290  			Name:                                 String("n"),
  6291  			Description:                          String("d"),
  6292  			IsVerified:                           Bool(true),
  6293  			HasOrganizationProjects:              Bool(true),
  6294  			HasRepositoryProjects:                Bool(true),
  6295  			DefaultRepoPermission:                String("drp"),
  6296  			MembersCanCreateRepos:                Bool(true),
  6297  			MembersCanCreateInternalRepos:        Bool(true),
  6298  			MembersCanCreatePrivateRepos:         Bool(true),
  6299  			MembersCanCreatePublicRepos:          Bool(false),
  6300  			MembersAllowedRepositoryCreationType: String("marct"),
  6301  			MembersCanCreatePages:                Bool(true),
  6302  			MembersCanCreatePublicPages:          Bool(false),
  6303  			MembersCanCreatePrivatePages:         Bool(true),
  6304  		},
  6305  		Sender: &User{
  6306  			Login:     String("l"),
  6307  			ID:        Int64(1),
  6308  			NodeID:    String("n"),
  6309  			URL:       String("u"),
  6310  			ReposURL:  String("r"),
  6311  			EventsURL: String("e"),
  6312  			AvatarURL: String("a"),
  6313  		},
  6314  		Installation: &Installation{
  6315  			ID:       Int64(1),
  6316  			NodeID:   String("nid"),
  6317  			AppID:    Int64(1),
  6318  			AppSlug:  String("as"),
  6319  			TargetID: Int64(1),
  6320  			Account: &User{
  6321  				Login:           String("l"),
  6322  				ID:              Int64(1),
  6323  				URL:             String("u"),
  6324  				AvatarURL:       String("a"),
  6325  				GravatarID:      String("g"),
  6326  				Name:            String("n"),
  6327  				Company:         String("c"),
  6328  				Blog:            String("b"),
  6329  				Location:        String("l"),
  6330  				Email:           String("e"),
  6331  				Hireable:        Bool(true),
  6332  				Bio:             String("b"),
  6333  				TwitterUsername: String("t"),
  6334  				PublicRepos:     Int(1),
  6335  				Followers:       Int(1),
  6336  				Following:       Int(1),
  6337  				CreatedAt:       &Timestamp{referenceTime},
  6338  				SuspendedAt:     &Timestamp{referenceTime},
  6339  			},
  6340  			AccessTokensURL:     String("atu"),
  6341  			RepositoriesURL:     String("ru"),
  6342  			HTMLURL:             String("hu"),
  6343  			TargetType:          String("tt"),
  6344  			SingleFileName:      String("sfn"),
  6345  			RepositorySelection: String("rs"),
  6346  			Events:              []string{"e"},
  6347  			SingleFilePaths:     []string{"s"},
  6348  			Permissions: &InstallationPermissions{
  6349  				Actions:                       String("a"),
  6350  				Administration:                String("ad"),
  6351  				Checks:                        String("c"),
  6352  				Contents:                      String("co"),
  6353  				ContentReferences:             String("cr"),
  6354  				Deployments:                   String("d"),
  6355  				Environments:                  String("e"),
  6356  				Issues:                        String("i"),
  6357  				Metadata:                      String("md"),
  6358  				Members:                       String("m"),
  6359  				OrganizationAdministration:    String("oa"),
  6360  				OrganizationHooks:             String("oh"),
  6361  				OrganizationPlan:              String("op"),
  6362  				OrganizationPreReceiveHooks:   String("opr"),
  6363  				OrganizationProjects:          String("op"),
  6364  				OrganizationSecrets:           String("os"),
  6365  				OrganizationSelfHostedRunners: String("osh"),
  6366  				OrganizationUserBlocking:      String("oub"),
  6367  				Packages:                      String("pkg"),
  6368  				Pages:                         String("pg"),
  6369  				PullRequests:                  String("pr"),
  6370  				RepositoryHooks:               String("rh"),
  6371  				RepositoryProjects:            String("rp"),
  6372  				RepositoryPreReceiveHooks:     String("rprh"),
  6373  				Secrets:                       String("s"),
  6374  				SecretScanningAlerts:          String("ssa"),
  6375  				SecurityEvents:                String("se"),
  6376  				SingleFile:                    String("sf"),
  6377  				Statuses:                      String("s"),
  6378  				TeamDiscussions:               String("td"),
  6379  				VulnerabilityAlerts:           String("va"),
  6380  				Workflows:                     String("w"),
  6381  			},
  6382  			CreatedAt:              &Timestamp{referenceTime},
  6383  			UpdatedAt:              &Timestamp{referenceTime},
  6384  			HasMultipleSingleFiles: Bool(false),
  6385  			SuspendedBy: &User{
  6386  				Login:           String("l"),
  6387  				ID:              Int64(1),
  6388  				URL:             String("u"),
  6389  				AvatarURL:       String("a"),
  6390  				GravatarID:      String("g"),
  6391  				Name:            String("n"),
  6392  				Company:         String("c"),
  6393  				Blog:            String("b"),
  6394  				Location:        String("l"),
  6395  				Email:           String("e"),
  6396  				Hireable:        Bool(true),
  6397  				Bio:             String("b"),
  6398  				TwitterUsername: String("t"),
  6399  				PublicRepos:     Int(1),
  6400  				Followers:       Int(1),
  6401  				Following:       Int(1),
  6402  				CreatedAt:       &Timestamp{referenceTime},
  6403  				SuspendedAt:     &Timestamp{referenceTime},
  6404  			},
  6405  			SuspendedAt: &Timestamp{referenceTime},
  6406  		},
  6407  	}
  6408  
  6409  	want := `{
  6410  		"comment": {
  6411  			"author_association": "aa",
  6412  			"body": "bo",
  6413  			"child_comment_count": 1,
  6414  			"created_at": ` + referenceTimeStr + `,
  6415  			"discussion_id": 1,
  6416  			"html_url": "hurl",
  6417  			"id": 1,
  6418  			"node_id": "nid",
  6419  			"parent_id": 1,
  6420  			"reactions": {
  6421  				"total_count": 1,
  6422  				"+1": 1,
  6423  				"-1": 1,
  6424  				"laugh": 1,
  6425  				"confused": 1,
  6426  				"heart": 1,
  6427  				"hooray": 1,
  6428  				"rocket": 1,
  6429  				"eyes": 1,
  6430  				"url": "url"
  6431  			},
  6432  			"repository_url": "rurl",
  6433  			"updated_at": ` + referenceTimeStr + `,
  6434  			"user": {
  6435  				"login": "l",
  6436  				"id": 1,
  6437  				"node_id": "n",
  6438  				"avatar_url": "a",
  6439  				"url": "u",
  6440  				"events_url": "e",
  6441  				"repos_url": "r"
  6442  			}
  6443  		},
  6444  		"discussion": {
  6445  			"repository_url": "rurl",
  6446  			"category": {
  6447  				"id": 1,
  6448  				"node_id": "nid",
  6449  				"repository_id": 1,
  6450  				"emoji": "emoji",
  6451  				"name": "name",
  6452  				"description": "description",
  6453  				"created_at": ` + referenceTimeStr + `,
  6454  				"updated_at": ` + referenceTimeStr + `,
  6455  				"slug": "slug",
  6456  				"is_answerable": false
  6457  			},
  6458  			"html_url": "hurl",
  6459  			"id": 1,
  6460  			"node_id": "nurl",
  6461  			"number": 1,
  6462  			"title": "title",
  6463  			"user": {
  6464  				"login": "l",
  6465  				"id": 1,
  6466  				"node_id": "n",
  6467  				"avatar_url": "a",
  6468  				"url": "u",
  6469  				"events_url": "e",
  6470  				"repos_url": "r"
  6471  			},
  6472  			"state": "st",
  6473  			"locked": false,
  6474  			"comments": 1,
  6475  			"created_at": ` + referenceTimeStr + `,
  6476  			"updated_at": ` + referenceTimeStr + `,
  6477  			"author_association": "aa",
  6478  			"body": "bo"
  6479  		},
  6480  		"repository": {
  6481  			"id": 1,
  6482  			"name": "n",
  6483  			"url": "s"
  6484  		},
  6485  		"organization": {
  6486  			"name": "n",
  6487  			"company": "c",
  6488  			"blog": "b",
  6489  			"location": "loc",
  6490  			"email": "e",
  6491  			"twitter_username": "tu",
  6492  			"description": "d",
  6493  			"billing_email": "be",
  6494  			"is_verified": true,
  6495  			"has_organization_projects": true,
  6496  			"has_repository_projects": true,
  6497  			"default_repository_permission": "drp",
  6498  			"members_can_create_repositories": true,
  6499  			"members_can_create_public_repositories": false,
  6500  			"members_can_create_private_repositories": true,
  6501  			"members_can_create_internal_repositories": true,
  6502  			"members_allowed_repository_creation_type": "marct",
  6503  			"members_can_create_pages": true,
  6504  			"members_can_create_public_pages": false,
  6505  			"members_can_create_private_pages": true
  6506  		},
  6507  		"sender": {
  6508  			"login": "l",
  6509  			"id": 1,
  6510  			"node_id": "n",
  6511  			"avatar_url": "a",
  6512  			"url": "u",
  6513  			"events_url": "e",
  6514  			"repos_url": "r"
  6515  		},
  6516  		"installation": {
  6517  			"id": 1,
  6518  			"node_id": "nid",
  6519  			"app_id": 1,
  6520  			"app_slug": "as",
  6521  			"target_id": 1,
  6522  			"account": {
  6523  				"login": "l",
  6524  				"id": 1,
  6525  				"avatar_url": "a",
  6526  				"gravatar_id": "g",
  6527  				"name": "n",
  6528  				"company": "c",
  6529  				"blog": "b",
  6530  				"location": "l",
  6531  				"email": "e",
  6532  				"hireable": true,
  6533  				"bio": "b",
  6534  				"twitter_username": "t",
  6535  				"public_repos": 1,
  6536  				"followers": 1,
  6537  				"following": 1,
  6538  				"created_at": ` + referenceTimeStr + `,
  6539  				"suspended_at": ` + referenceTimeStr + `,
  6540  				"url": "u"
  6541  			},
  6542  			"access_tokens_url": "atu",
  6543  			"repositories_url": "ru",
  6544  			"html_url": "hu",
  6545  			"target_type": "tt",
  6546  			"single_file_name": "sfn",
  6547  			"repository_selection": "rs",
  6548  			"events": [
  6549  				"e"
  6550  			],
  6551  			"single_file_paths": [
  6552  				"s"
  6553  			],
  6554  			"permissions": {
  6555  				"actions": "a",
  6556  				"administration": "ad",
  6557  				"checks": "c",
  6558  				"contents": "co",
  6559  				"content_references": "cr",
  6560  				"deployments": "d",
  6561  				"environments": "e",
  6562  				"issues": "i",
  6563  				"metadata": "md",
  6564  				"members": "m",
  6565  				"organization_administration": "oa",
  6566  				"organization_hooks": "oh",
  6567  				"organization_plan": "op",
  6568  				"organization_pre_receive_hooks": "opr",
  6569  				"organization_projects": "op",
  6570  				"organization_secrets": "os",
  6571  				"organization_self_hosted_runners": "osh",
  6572  				"organization_user_blocking": "oub",
  6573  				"packages": "pkg",
  6574  				"pages": "pg",
  6575  				"pull_requests": "pr",
  6576  				"repository_hooks": "rh",
  6577  				"repository_projects": "rp",
  6578  				"repository_pre_receive_hooks": "rprh",
  6579  				"secrets": "s",
  6580  				"secret_scanning_alerts": "ssa",
  6581  				"security_events": "se",
  6582  				"single_file": "sf",
  6583  				"statuses": "s",
  6584  				"team_discussions": "td",
  6585  				"vulnerability_alerts": "va",
  6586  				"workflows": "w"
  6587  			},
  6588  			"created_at": ` + referenceTimeStr + `,
  6589  			"updated_at": ` + referenceTimeStr + `,
  6590  			"has_multiple_single_files": false,
  6591  			"suspended_by": {
  6592  				"login": "l",
  6593  				"id": 1,
  6594  				"avatar_url": "a",
  6595  				"gravatar_id": "g",
  6596  				"name": "n",
  6597  				"company": "c",
  6598  				"blog": "b",
  6599  				"location": "l",
  6600  				"email": "e",
  6601  				"hireable": true,
  6602  				"bio": "b",
  6603  				"twitter_username": "t",
  6604  				"public_repos": 1,
  6605  				"followers": 1,
  6606  				"following": 1,
  6607  				"created_at": ` + referenceTimeStr + `,
  6608  				"suspended_at": ` + referenceTimeStr + `,
  6609  				"url": "u"
  6610  			},
  6611  			"suspended_at": ` + referenceTimeStr + `
  6612  		}
  6613  	}`
  6614  
  6615  	testJSONMarshal(t, u, want)
  6616  }
  6617  
  6618  func TestDiscussionEvent_Marshal(t *testing.T) {
  6619  	testJSONMarshal(t, &DiscussionEvent{}, "{}")
  6620  
  6621  	u := &DiscussionEvent{
  6622  		Discussion: &Discussion{
  6623  			RepositoryURL: String("rurl"),
  6624  			DiscussionCategory: &DiscussionCategory{
  6625  				ID:           Int64(1),
  6626  				NodeID:       String("nid"),
  6627  				RepositoryID: Int64(1),
  6628  				Emoji:        String("emoji"),
  6629  				Name:         String("name"),
  6630  				Description:  String("description"),
  6631  				CreatedAt:    &Timestamp{referenceTime},
  6632  				UpdatedAt:    &Timestamp{referenceTime},
  6633  				Slug:         String("slug"),
  6634  				IsAnswerable: Bool(false),
  6635  			},
  6636  			HTMLURL: String("hurl"),
  6637  			ID:      Int64(1),
  6638  			NodeID:  String("nurl"),
  6639  			Number:  Int(1),
  6640  			Title:   String("title"),
  6641  			User: &User{
  6642  				Login:     String("l"),
  6643  				ID:        Int64(1),
  6644  				NodeID:    String("n"),
  6645  				URL:       String("u"),
  6646  				ReposURL:  String("r"),
  6647  				EventsURL: String("e"),
  6648  				AvatarURL: String("a"),
  6649  			},
  6650  			State:             String("st"),
  6651  			Locked:            Bool(false),
  6652  			Comments:          Int(1),
  6653  			CreatedAt:         &Timestamp{referenceTime},
  6654  			UpdatedAt:         &Timestamp{referenceTime},
  6655  			AuthorAssociation: String("aa"),
  6656  			Body:              String("bo"),
  6657  		},
  6658  		Repo: &Repository{
  6659  			ID:   Int64(1),
  6660  			URL:  String("s"),
  6661  			Name: String("n"),
  6662  		},
  6663  		Org: &Organization{
  6664  			BillingEmail:                         String("be"),
  6665  			Blog:                                 String("b"),
  6666  			Company:                              String("c"),
  6667  			Email:                                String("e"),
  6668  			TwitterUsername:                      String("tu"),
  6669  			Location:                             String("loc"),
  6670  			Name:                                 String("n"),
  6671  			Description:                          String("d"),
  6672  			IsVerified:                           Bool(true),
  6673  			HasOrganizationProjects:              Bool(true),
  6674  			HasRepositoryProjects:                Bool(true),
  6675  			DefaultRepoPermission:                String("drp"),
  6676  			MembersCanCreateRepos:                Bool(true),
  6677  			MembersCanCreateInternalRepos:        Bool(true),
  6678  			MembersCanCreatePrivateRepos:         Bool(true),
  6679  			MembersCanCreatePublicRepos:          Bool(false),
  6680  			MembersAllowedRepositoryCreationType: String("marct"),
  6681  			MembersCanCreatePages:                Bool(true),
  6682  			MembersCanCreatePublicPages:          Bool(false),
  6683  			MembersCanCreatePrivatePages:         Bool(true),
  6684  		},
  6685  		Sender: &User{
  6686  			Login:     String("l"),
  6687  			ID:        Int64(1),
  6688  			NodeID:    String("n"),
  6689  			URL:       String("u"),
  6690  			ReposURL:  String("r"),
  6691  			EventsURL: String("e"),
  6692  			AvatarURL: String("a"),
  6693  		},
  6694  		Installation: &Installation{
  6695  			ID:       Int64(1),
  6696  			NodeID:   String("nid"),
  6697  			AppID:    Int64(1),
  6698  			AppSlug:  String("as"),
  6699  			TargetID: Int64(1),
  6700  			Account: &User{
  6701  				Login:           String("l"),
  6702  				ID:              Int64(1),
  6703  				URL:             String("u"),
  6704  				AvatarURL:       String("a"),
  6705  				GravatarID:      String("g"),
  6706  				Name:            String("n"),
  6707  				Company:         String("c"),
  6708  				Blog:            String("b"),
  6709  				Location:        String("l"),
  6710  				Email:           String("e"),
  6711  				Hireable:        Bool(true),
  6712  				Bio:             String("b"),
  6713  				TwitterUsername: String("t"),
  6714  				PublicRepos:     Int(1),
  6715  				Followers:       Int(1),
  6716  				Following:       Int(1),
  6717  				CreatedAt:       &Timestamp{referenceTime},
  6718  				SuspendedAt:     &Timestamp{referenceTime},
  6719  			},
  6720  			AccessTokensURL:     String("atu"),
  6721  			RepositoriesURL:     String("ru"),
  6722  			HTMLURL:             String("hu"),
  6723  			TargetType:          String("tt"),
  6724  			SingleFileName:      String("sfn"),
  6725  			RepositorySelection: String("rs"),
  6726  			Events:              []string{"e"},
  6727  			SingleFilePaths:     []string{"s"},
  6728  			Permissions: &InstallationPermissions{
  6729  				Actions:                       String("a"),
  6730  				Administration:                String("ad"),
  6731  				Checks:                        String("c"),
  6732  				Contents:                      String("co"),
  6733  				ContentReferences:             String("cr"),
  6734  				Deployments:                   String("d"),
  6735  				Environments:                  String("e"),
  6736  				Issues:                        String("i"),
  6737  				Metadata:                      String("md"),
  6738  				Members:                       String("m"),
  6739  				OrganizationAdministration:    String("oa"),
  6740  				OrganizationHooks:             String("oh"),
  6741  				OrganizationPlan:              String("op"),
  6742  				OrganizationPreReceiveHooks:   String("opr"),
  6743  				OrganizationProjects:          String("op"),
  6744  				OrganizationSecrets:           String("os"),
  6745  				OrganizationSelfHostedRunners: String("osh"),
  6746  				OrganizationUserBlocking:      String("oub"),
  6747  				Packages:                      String("pkg"),
  6748  				Pages:                         String("pg"),
  6749  				PullRequests:                  String("pr"),
  6750  				RepositoryHooks:               String("rh"),
  6751  				RepositoryProjects:            String("rp"),
  6752  				RepositoryPreReceiveHooks:     String("rprh"),
  6753  				Secrets:                       String("s"),
  6754  				SecretScanningAlerts:          String("ssa"),
  6755  				SecurityEvents:                String("se"),
  6756  				SingleFile:                    String("sf"),
  6757  				Statuses:                      String("s"),
  6758  				TeamDiscussions:               String("td"),
  6759  				VulnerabilityAlerts:           String("va"),
  6760  				Workflows:                     String("w"),
  6761  			},
  6762  			CreatedAt:              &Timestamp{referenceTime},
  6763  			UpdatedAt:              &Timestamp{referenceTime},
  6764  			HasMultipleSingleFiles: Bool(false),
  6765  			SuspendedBy: &User{
  6766  				Login:           String("l"),
  6767  				ID:              Int64(1),
  6768  				URL:             String("u"),
  6769  				AvatarURL:       String("a"),
  6770  				GravatarID:      String("g"),
  6771  				Name:            String("n"),
  6772  				Company:         String("c"),
  6773  				Blog:            String("b"),
  6774  				Location:        String("l"),
  6775  				Email:           String("e"),
  6776  				Hireable:        Bool(true),
  6777  				Bio:             String("b"),
  6778  				TwitterUsername: String("t"),
  6779  				PublicRepos:     Int(1),
  6780  				Followers:       Int(1),
  6781  				Following:       Int(1),
  6782  				CreatedAt:       &Timestamp{referenceTime},
  6783  				SuspendedAt:     &Timestamp{referenceTime},
  6784  			},
  6785  			SuspendedAt: &Timestamp{referenceTime},
  6786  		},
  6787  	}
  6788  
  6789  	want := `{
  6790  		"discussion": {
  6791  			"repository_url": "rurl",
  6792  			"category": {
  6793  				"id": 1,
  6794  				"node_id": "nid",
  6795  				"repository_id": 1,
  6796  				"emoji": "emoji",
  6797  				"name": "name",
  6798  				"description": "description",
  6799  				"created_at": ` + referenceTimeStr + `,
  6800  				"updated_at": ` + referenceTimeStr + `,
  6801  				"slug": "slug",
  6802  				"is_answerable": false
  6803  			},
  6804  			"html_url": "hurl",
  6805  			"id": 1,
  6806  			"node_id": "nurl",
  6807  			"number": 1,
  6808  			"title": "title",
  6809  			"user": {
  6810  				"login": "l",
  6811  				"id": 1,
  6812  				"node_id": "n",
  6813  				"avatar_url": "a",
  6814  				"url": "u",
  6815  				"events_url": "e",
  6816  				"repos_url": "r"
  6817  			},
  6818  			"state": "st",
  6819  			"locked": false,
  6820  			"comments": 1,
  6821  			"created_at": ` + referenceTimeStr + `,
  6822  			"updated_at": ` + referenceTimeStr + `,
  6823  			"author_association": "aa",
  6824  			"body": "bo"
  6825  		},
  6826  		"repository": {
  6827  			"id": 1,
  6828  			"name": "n",
  6829  			"url": "s"
  6830  		},
  6831  		"organization": {
  6832  			"name": "n",
  6833  			"company": "c",
  6834  			"blog": "b",
  6835  			"location": "loc",
  6836  			"email": "e",
  6837  			"twitter_username": "tu",
  6838  			"description": "d",
  6839  			"billing_email": "be",
  6840  			"is_verified": true,
  6841  			"has_organization_projects": true,
  6842  			"has_repository_projects": true,
  6843  			"default_repository_permission": "drp",
  6844  			"members_can_create_repositories": true,
  6845  			"members_can_create_public_repositories": false,
  6846  			"members_can_create_private_repositories": true,
  6847  			"members_can_create_internal_repositories": true,
  6848  			"members_allowed_repository_creation_type": "marct",
  6849  			"members_can_create_pages": true,
  6850  			"members_can_create_public_pages": false,
  6851  			"members_can_create_private_pages": true
  6852  		},
  6853  		"sender": {
  6854  			"login": "l",
  6855  			"id": 1,
  6856  			"node_id": "n",
  6857  			"avatar_url": "a",
  6858  			"url": "u",
  6859  			"events_url": "e",
  6860  			"repos_url": "r"
  6861  		},
  6862  		"installation": {
  6863  			"id": 1,
  6864  			"node_id": "nid",
  6865  			"app_id": 1,
  6866  			"app_slug": "as",
  6867  			"target_id": 1,
  6868  			"account": {
  6869  				"login": "l",
  6870  				"id": 1,
  6871  				"avatar_url": "a",
  6872  				"gravatar_id": "g",
  6873  				"name": "n",
  6874  				"company": "c",
  6875  				"blog": "b",
  6876  				"location": "l",
  6877  				"email": "e",
  6878  				"hireable": true,
  6879  				"bio": "b",
  6880  				"twitter_username": "t",
  6881  				"public_repos": 1,
  6882  				"followers": 1,
  6883  				"following": 1,
  6884  				"created_at": ` + referenceTimeStr + `,
  6885  				"suspended_at": ` + referenceTimeStr + `,
  6886  				"url": "u"
  6887  			},
  6888  			"access_tokens_url": "atu",
  6889  			"repositories_url": "ru",
  6890  			"html_url": "hu",
  6891  			"target_type": "tt",
  6892  			"single_file_name": "sfn",
  6893  			"repository_selection": "rs",
  6894  			"events": [
  6895  				"e"
  6896  			],
  6897  			"single_file_paths": [
  6898  				"s"
  6899  			],
  6900  			"permissions": {
  6901  				"actions": "a",
  6902  				"administration": "ad",
  6903  				"checks": "c",
  6904  				"contents": "co",
  6905  				"content_references": "cr",
  6906  				"deployments": "d",
  6907  				"environments": "e",
  6908  				"issues": "i",
  6909  				"metadata": "md",
  6910  				"members": "m",
  6911  				"organization_administration": "oa",
  6912  				"organization_hooks": "oh",
  6913  				"organization_plan": "op",
  6914  				"organization_pre_receive_hooks": "opr",
  6915  				"organization_projects": "op",
  6916  				"organization_secrets": "os",
  6917  				"organization_self_hosted_runners": "osh",
  6918  				"organization_user_blocking": "oub",
  6919  				"packages": "pkg",
  6920  				"pages": "pg",
  6921  				"pull_requests": "pr",
  6922  				"repository_hooks": "rh",
  6923  				"repository_projects": "rp",
  6924  				"repository_pre_receive_hooks": "rprh",
  6925  				"secrets": "s",
  6926  				"secret_scanning_alerts": "ssa",
  6927  				"security_events": "se",
  6928  				"single_file": "sf",
  6929  				"statuses": "s",
  6930  				"team_discussions": "td",
  6931  				"vulnerability_alerts": "va",
  6932  				"workflows": "w"
  6933  			},
  6934  			"created_at": ` + referenceTimeStr + `,
  6935  			"updated_at": ` + referenceTimeStr + `,
  6936  			"has_multiple_single_files": false,
  6937  			"suspended_by": {
  6938  				"login": "l",
  6939  				"id": 1,
  6940  				"avatar_url": "a",
  6941  				"gravatar_id": "g",
  6942  				"name": "n",
  6943  				"company": "c",
  6944  				"blog": "b",
  6945  				"location": "l",
  6946  				"email": "e",
  6947  				"hireable": true,
  6948  				"bio": "b",
  6949  				"twitter_username": "t",
  6950  				"public_repos": 1,
  6951  				"followers": 1,
  6952  				"following": 1,
  6953  				"created_at": ` + referenceTimeStr + `,
  6954  				"suspended_at": ` + referenceTimeStr + `,
  6955  				"url": "u"
  6956  			},
  6957  			"suspended_at": ` + referenceTimeStr + `
  6958  		}
  6959  	}`
  6960  
  6961  	testJSONMarshal(t, u, want)
  6962  }
  6963  
  6964  func TestPackageEvent_Marshal(t *testing.T) {
  6965  	testJSONMarshal(t, &PackageEvent{}, "{}")
  6966  
  6967  	u := &PackageEvent{
  6968  		Action: String("a"),
  6969  		Package: &Package{
  6970  			ID:          Int64(1),
  6971  			Name:        String("n"),
  6972  			PackageType: String("pt"),
  6973  			HTMLURL:     String("hurl"),
  6974  			CreatedAt:   &Timestamp{referenceTime},
  6975  			UpdatedAt:   &Timestamp{referenceTime},
  6976  			Owner: &User{
  6977  				Login:     String("l"),
  6978  				ID:        Int64(1),
  6979  				NodeID:    String("n"),
  6980  				URL:       String("u"),
  6981  				ReposURL:  String("r"),
  6982  				EventsURL: String("e"),
  6983  				AvatarURL: String("a"),
  6984  			},
  6985  			PackageVersion: &PackageVersion{ID: Int64(1)},
  6986  			Registry:       &PackageRegistry{Name: String("n")},
  6987  		},
  6988  		Repo: &Repository{
  6989  			ID:   Int64(1),
  6990  			URL:  String("s"),
  6991  			Name: String("n"),
  6992  		},
  6993  		Org: &Organization{
  6994  			BillingEmail:                         String("be"),
  6995  			Blog:                                 String("b"),
  6996  			Company:                              String("c"),
  6997  			Email:                                String("e"),
  6998  			TwitterUsername:                      String("tu"),
  6999  			Location:                             String("loc"),
  7000  			Name:                                 String("n"),
  7001  			Description:                          String("d"),
  7002  			IsVerified:                           Bool(true),
  7003  			HasOrganizationProjects:              Bool(true),
  7004  			HasRepositoryProjects:                Bool(true),
  7005  			DefaultRepoPermission:                String("drp"),
  7006  			MembersCanCreateRepos:                Bool(true),
  7007  			MembersCanCreateInternalRepos:        Bool(true),
  7008  			MembersCanCreatePrivateRepos:         Bool(true),
  7009  			MembersCanCreatePublicRepos:          Bool(false),
  7010  			MembersAllowedRepositoryCreationType: String("marct"),
  7011  			MembersCanCreatePages:                Bool(true),
  7012  			MembersCanCreatePublicPages:          Bool(false),
  7013  			MembersCanCreatePrivatePages:         Bool(true),
  7014  		},
  7015  		Sender: &User{
  7016  			Login:     String("l"),
  7017  			ID:        Int64(1),
  7018  			NodeID:    String("n"),
  7019  			URL:       String("u"),
  7020  			ReposURL:  String("r"),
  7021  			EventsURL: String("e"),
  7022  			AvatarURL: String("a"),
  7023  		},
  7024  	}
  7025  
  7026  	want := `{
  7027  		"action": "a",
  7028  		"package": {
  7029  			"id": 1,
  7030  			"name": "n",
  7031  			"package_type": "pt",
  7032  			"html_url": "hurl",
  7033  			"created_at": ` + referenceTimeStr + `,
  7034  			"updated_at": ` + referenceTimeStr + `,
  7035  			"owner": {
  7036  				"login": "l",
  7037  				"id": 1,
  7038  				"node_id": "n",
  7039  				"avatar_url": "a",
  7040  				"url": "u",
  7041  				"events_url": "e",
  7042  				"repos_url": "r"
  7043  			},
  7044  			"package_version": {
  7045  				"id": 1
  7046  			},
  7047  			"registry": {
  7048  				"name": "n"
  7049  			}
  7050  		},
  7051  		"repository": {
  7052  			"id": 1,
  7053  			"name": "n",
  7054  			"url": "s"
  7055  		},
  7056  		"organization": {
  7057  			"name": "n",
  7058  			"company": "c",
  7059  			"blog": "b",
  7060  			"location": "loc",
  7061  			"email": "e",
  7062  			"twitter_username": "tu",
  7063  			"description": "d",
  7064  			"billing_email": "be",
  7065  			"is_verified": true,
  7066  			"has_organization_projects": true,
  7067  			"has_repository_projects": true,
  7068  			"default_repository_permission": "drp",
  7069  			"members_can_create_repositories": true,
  7070  			"members_can_create_public_repositories": false,
  7071  			"members_can_create_private_repositories": true,
  7072  			"members_can_create_internal_repositories": true,
  7073  			"members_allowed_repository_creation_type": "marct",
  7074  			"members_can_create_pages": true,
  7075  			"members_can_create_public_pages": false,
  7076  			"members_can_create_private_pages": true
  7077  		},
  7078  		"sender": {
  7079  			"login": "l",
  7080  			"id": 1,
  7081  			"node_id": "n",
  7082  			"avatar_url": "a",
  7083  			"url": "u",
  7084  			"events_url": "e",
  7085  			"repos_url": "r"
  7086  		}
  7087  	}`
  7088  
  7089  	testJSONMarshal(t, u, want)
  7090  }
  7091  
  7092  func TestPingEvent_Marshal(t *testing.T) {
  7093  	testJSONMarshal(t, &PingEvent{}, "{}")
  7094  
  7095  	l := make(map[string]interface{})
  7096  	l["key"] = "value"
  7097  
  7098  	u := &PingEvent{
  7099  		Zen:    String("z"),
  7100  		HookID: Int64(1),
  7101  		Hook: &Hook{
  7102  			CreatedAt:    &Timestamp{referenceTime},
  7103  			UpdatedAt:    &Timestamp{referenceTime},
  7104  			URL:          String("url"),
  7105  			ID:           Int64(1),
  7106  			Type:         String("t"),
  7107  			Name:         String("n"),
  7108  			TestURL:      String("tu"),
  7109  			PingURL:      String("pu"),
  7110  			LastResponse: l,
  7111  			Config:       l,
  7112  			Events:       []string{"a"},
  7113  			Active:       Bool(true),
  7114  		},
  7115  		Installation: &Installation{
  7116  			ID:       Int64(1),
  7117  			NodeID:   String("nid"),
  7118  			AppID:    Int64(1),
  7119  			AppSlug:  String("as"),
  7120  			TargetID: Int64(1),
  7121  			Account: &User{
  7122  				Login:           String("l"),
  7123  				ID:              Int64(1),
  7124  				URL:             String("u"),
  7125  				AvatarURL:       String("a"),
  7126  				GravatarID:      String("g"),
  7127  				Name:            String("n"),
  7128  				Company:         String("c"),
  7129  				Blog:            String("b"),
  7130  				Location:        String("l"),
  7131  				Email:           String("e"),
  7132  				Hireable:        Bool(true),
  7133  				Bio:             String("b"),
  7134  				TwitterUsername: String("t"),
  7135  				PublicRepos:     Int(1),
  7136  				Followers:       Int(1),
  7137  				Following:       Int(1),
  7138  				CreatedAt:       &Timestamp{referenceTime},
  7139  				SuspendedAt:     &Timestamp{referenceTime},
  7140  			},
  7141  			AccessTokensURL:     String("atu"),
  7142  			RepositoriesURL:     String("ru"),
  7143  			HTMLURL:             String("hu"),
  7144  			TargetType:          String("tt"),
  7145  			SingleFileName:      String("sfn"),
  7146  			RepositorySelection: String("rs"),
  7147  			Events:              []string{"e"},
  7148  			SingleFilePaths:     []string{"s"},
  7149  			Permissions: &InstallationPermissions{
  7150  				Actions:                       String("a"),
  7151  				Administration:                String("ad"),
  7152  				Checks:                        String("c"),
  7153  				Contents:                      String("co"),
  7154  				ContentReferences:             String("cr"),
  7155  				Deployments:                   String("d"),
  7156  				Environments:                  String("e"),
  7157  				Issues:                        String("i"),
  7158  				Metadata:                      String("md"),
  7159  				Members:                       String("m"),
  7160  				OrganizationAdministration:    String("oa"),
  7161  				OrganizationHooks:             String("oh"),
  7162  				OrganizationPlan:              String("op"),
  7163  				OrganizationPreReceiveHooks:   String("opr"),
  7164  				OrganizationProjects:          String("op"),
  7165  				OrganizationSecrets:           String("os"),
  7166  				OrganizationSelfHostedRunners: String("osh"),
  7167  				OrganizationUserBlocking:      String("oub"),
  7168  				Packages:                      String("pkg"),
  7169  				Pages:                         String("pg"),
  7170  				PullRequests:                  String("pr"),
  7171  				RepositoryHooks:               String("rh"),
  7172  				RepositoryProjects:            String("rp"),
  7173  				RepositoryPreReceiveHooks:     String("rprh"),
  7174  				Secrets:                       String("s"),
  7175  				SecretScanningAlerts:          String("ssa"),
  7176  				SecurityEvents:                String("se"),
  7177  				SingleFile:                    String("sf"),
  7178  				Statuses:                      String("s"),
  7179  				TeamDiscussions:               String("td"),
  7180  				VulnerabilityAlerts:           String("va"),
  7181  				Workflows:                     String("w"),
  7182  			},
  7183  			CreatedAt:              &Timestamp{referenceTime},
  7184  			UpdatedAt:              &Timestamp{referenceTime},
  7185  			HasMultipleSingleFiles: Bool(false),
  7186  			SuspendedBy: &User{
  7187  				Login:           String("l"),
  7188  				ID:              Int64(1),
  7189  				URL:             String("u"),
  7190  				AvatarURL:       String("a"),
  7191  				GravatarID:      String("g"),
  7192  				Name:            String("n"),
  7193  				Company:         String("c"),
  7194  				Blog:            String("b"),
  7195  				Location:        String("l"),
  7196  				Email:           String("e"),
  7197  				Hireable:        Bool(true),
  7198  				Bio:             String("b"),
  7199  				TwitterUsername: String("t"),
  7200  				PublicRepos:     Int(1),
  7201  				Followers:       Int(1),
  7202  				Following:       Int(1),
  7203  				CreatedAt:       &Timestamp{referenceTime},
  7204  				SuspendedAt:     &Timestamp{referenceTime},
  7205  			},
  7206  			SuspendedAt: &Timestamp{referenceTime},
  7207  		},
  7208  	}
  7209  
  7210  	want := `{
  7211  		"zen": "z",
  7212  		"hook_id": 1,
  7213  		"hook": {
  7214  			"created_at": ` + referenceTimeStr + `,
  7215  			"updated_at": ` + referenceTimeStr + `,
  7216  			"url": "url",
  7217  			"id": 1,
  7218  			"type": "t",
  7219  			"name": "n",
  7220  			"test_url": "tu",
  7221  			"ping_url": "pu",
  7222  			"last_response": {
  7223  				"key": "value"
  7224  			},
  7225  			"config": {
  7226  				"key": "value"
  7227  			},
  7228  			"events": [
  7229  				"a"
  7230  			],
  7231  			"active": true
  7232  		},
  7233  		"installation": {
  7234  			"id": 1,
  7235  			"node_id": "nid",
  7236  			"app_id": 1,
  7237  			"app_slug": "as",
  7238  			"target_id": 1,
  7239  			"account": {
  7240  				"login": "l",
  7241  				"id": 1,
  7242  				"avatar_url": "a",
  7243  				"gravatar_id": "g",
  7244  				"name": "n",
  7245  				"company": "c",
  7246  				"blog": "b",
  7247  				"location": "l",
  7248  				"email": "e",
  7249  				"hireable": true,
  7250  				"bio": "b",
  7251  				"twitter_username": "t",
  7252  				"public_repos": 1,
  7253  				"followers": 1,
  7254  				"following": 1,
  7255  				"created_at": ` + referenceTimeStr + `,
  7256  				"suspended_at": ` + referenceTimeStr + `,
  7257  				"url": "u"
  7258  			},
  7259  			"access_tokens_url": "atu",
  7260  			"repositories_url": "ru",
  7261  			"html_url": "hu",
  7262  			"target_type": "tt",
  7263  			"single_file_name": "sfn",
  7264  			"repository_selection": "rs",
  7265  			"events": [
  7266  				"e"
  7267  			],
  7268  			"single_file_paths": [
  7269  				"s"
  7270  			],
  7271  			"permissions": {
  7272  				"actions": "a",
  7273  				"administration": "ad",
  7274  				"checks": "c",
  7275  				"contents": "co",
  7276  				"content_references": "cr",
  7277  				"deployments": "d",
  7278  				"environments": "e",
  7279  				"issues": "i",
  7280  				"metadata": "md",
  7281  				"members": "m",
  7282  				"organization_administration": "oa",
  7283  				"organization_hooks": "oh",
  7284  				"organization_plan": "op",
  7285  				"organization_pre_receive_hooks": "opr",
  7286  				"organization_projects": "op",
  7287  				"organization_secrets": "os",
  7288  				"organization_self_hosted_runners": "osh",
  7289  				"organization_user_blocking": "oub",
  7290  				"packages": "pkg",
  7291  				"pages": "pg",
  7292  				"pull_requests": "pr",
  7293  				"repository_hooks": "rh",
  7294  				"repository_projects": "rp",
  7295  				"repository_pre_receive_hooks": "rprh",
  7296  				"secrets": "s",
  7297  				"secret_scanning_alerts": "ssa",
  7298  				"security_events": "se",
  7299  				"single_file": "sf",
  7300  				"statuses": "s",
  7301  				"team_discussions": "td",
  7302  				"vulnerability_alerts": "va",
  7303  				"workflows": "w"
  7304  			},
  7305  			"created_at": ` + referenceTimeStr + `,
  7306  			"updated_at": ` + referenceTimeStr + `,
  7307  			"has_multiple_single_files": false,
  7308  			"suspended_by": {
  7309  				"login": "l",
  7310  				"id": 1,
  7311  				"avatar_url": "a",
  7312  				"gravatar_id": "g",
  7313  				"name": "n",
  7314  				"company": "c",
  7315  				"blog": "b",
  7316  				"location": "l",
  7317  				"email": "e",
  7318  				"hireable": true,
  7319  				"bio": "b",
  7320  				"twitter_username": "t",
  7321  				"public_repos": 1,
  7322  				"followers": 1,
  7323  				"following": 1,
  7324  				"created_at": ` + referenceTimeStr + `,
  7325  				"suspended_at": ` + referenceTimeStr + `,
  7326  				"url": "u"
  7327  			},
  7328  			"suspended_at": ` + referenceTimeStr + `
  7329  		}
  7330  	}`
  7331  
  7332  	testJSONMarshal(t, u, want)
  7333  }
  7334  
  7335  func TestRepositoryDispatchEvent_Marshal(t *testing.T) {
  7336  	testJSONMarshal(t, &RepositoryDispatchEvent{}, "{}")
  7337  
  7338  	l := make(map[string]interface{})
  7339  	l["key"] = "value"
  7340  
  7341  	jsonMsg, _ := json.Marshal(&l)
  7342  
  7343  	u := &RepositoryDispatchEvent{
  7344  		Action:        String("a"),
  7345  		Branch:        String("b"),
  7346  		ClientPayload: jsonMsg,
  7347  		Repo: &Repository{
  7348  
  7349  			ID:   Int64(1),
  7350  			URL:  String("s"),
  7351  			Name: String("n"),
  7352  		},
  7353  		Org: &Organization{
  7354  			BillingEmail:                         String("be"),
  7355  			Blog:                                 String("b"),
  7356  			Company:                              String("c"),
  7357  			Email:                                String("e"),
  7358  			TwitterUsername:                      String("tu"),
  7359  			Location:                             String("loc"),
  7360  			Name:                                 String("n"),
  7361  			Description:                          String("d"),
  7362  			IsVerified:                           Bool(true),
  7363  			HasOrganizationProjects:              Bool(true),
  7364  			HasRepositoryProjects:                Bool(true),
  7365  			DefaultRepoPermission:                String("drp"),
  7366  			MembersCanCreateRepos:                Bool(true),
  7367  			MembersCanCreateInternalRepos:        Bool(true),
  7368  			MembersCanCreatePrivateRepos:         Bool(true),
  7369  			MembersCanCreatePublicRepos:          Bool(false),
  7370  			MembersAllowedRepositoryCreationType: String("marct"),
  7371  			MembersCanCreatePages:                Bool(true),
  7372  			MembersCanCreatePublicPages:          Bool(false),
  7373  			MembersCanCreatePrivatePages:         Bool(true),
  7374  		},
  7375  		Sender: &User{
  7376  			Login:     String("l"),
  7377  			ID:        Int64(1),
  7378  			NodeID:    String("n"),
  7379  			URL:       String("u"),
  7380  			ReposURL:  String("r"),
  7381  			EventsURL: String("e"),
  7382  			AvatarURL: String("a"),
  7383  		},
  7384  		Installation: &Installation{
  7385  			ID:       Int64(1),
  7386  			NodeID:   String("nid"),
  7387  			AppID:    Int64(1),
  7388  			AppSlug:  String("as"),
  7389  			TargetID: Int64(1),
  7390  			Account: &User{
  7391  				Login:           String("l"),
  7392  				ID:              Int64(1),
  7393  				URL:             String("u"),
  7394  				AvatarURL:       String("a"),
  7395  				GravatarID:      String("g"),
  7396  				Name:            String("n"),
  7397  				Company:         String("c"),
  7398  				Blog:            String("b"),
  7399  				Location:        String("l"),
  7400  				Email:           String("e"),
  7401  				Hireable:        Bool(true),
  7402  				Bio:             String("b"),
  7403  				TwitterUsername: String("t"),
  7404  				PublicRepos:     Int(1),
  7405  				Followers:       Int(1),
  7406  				Following:       Int(1),
  7407  				CreatedAt:       &Timestamp{referenceTime},
  7408  				SuspendedAt:     &Timestamp{referenceTime},
  7409  			},
  7410  			AccessTokensURL:     String("atu"),
  7411  			RepositoriesURL:     String("ru"),
  7412  			HTMLURL:             String("hu"),
  7413  			TargetType:          String("tt"),
  7414  			SingleFileName:      String("sfn"),
  7415  			RepositorySelection: String("rs"),
  7416  			Events:              []string{"e"},
  7417  			SingleFilePaths:     []string{"s"},
  7418  			Permissions: &InstallationPermissions{
  7419  				Actions:                       String("a"),
  7420  				Administration:                String("ad"),
  7421  				Checks:                        String("c"),
  7422  				Contents:                      String("co"),
  7423  				ContentReferences:             String("cr"),
  7424  				Deployments:                   String("d"),
  7425  				Environments:                  String("e"),
  7426  				Issues:                        String("i"),
  7427  				Metadata:                      String("md"),
  7428  				Members:                       String("m"),
  7429  				OrganizationAdministration:    String("oa"),
  7430  				OrganizationHooks:             String("oh"),
  7431  				OrganizationPlan:              String("op"),
  7432  				OrganizationPreReceiveHooks:   String("opr"),
  7433  				OrganizationProjects:          String("op"),
  7434  				OrganizationSecrets:           String("os"),
  7435  				OrganizationSelfHostedRunners: String("osh"),
  7436  				OrganizationUserBlocking:      String("oub"),
  7437  				Packages:                      String("pkg"),
  7438  				Pages:                         String("pg"),
  7439  				PullRequests:                  String("pr"),
  7440  				RepositoryHooks:               String("rh"),
  7441  				RepositoryProjects:            String("rp"),
  7442  				RepositoryPreReceiveHooks:     String("rprh"),
  7443  				Secrets:                       String("s"),
  7444  				SecretScanningAlerts:          String("ssa"),
  7445  				SecurityEvents:                String("se"),
  7446  				SingleFile:                    String("sf"),
  7447  				Statuses:                      String("s"),
  7448  				TeamDiscussions:               String("td"),
  7449  				VulnerabilityAlerts:           String("va"),
  7450  				Workflows:                     String("w"),
  7451  			},
  7452  			CreatedAt:              &Timestamp{referenceTime},
  7453  			UpdatedAt:              &Timestamp{referenceTime},
  7454  			HasMultipleSingleFiles: Bool(false),
  7455  			SuspendedBy: &User{
  7456  				Login:           String("l"),
  7457  				ID:              Int64(1),
  7458  				URL:             String("u"),
  7459  				AvatarURL:       String("a"),
  7460  				GravatarID:      String("g"),
  7461  				Name:            String("n"),
  7462  				Company:         String("c"),
  7463  				Blog:            String("b"),
  7464  				Location:        String("l"),
  7465  				Email:           String("e"),
  7466  				Hireable:        Bool(true),
  7467  				Bio:             String("b"),
  7468  				TwitterUsername: String("t"),
  7469  				PublicRepos:     Int(1),
  7470  				Followers:       Int(1),
  7471  				Following:       Int(1),
  7472  				CreatedAt:       &Timestamp{referenceTime},
  7473  				SuspendedAt:     &Timestamp{referenceTime},
  7474  			},
  7475  			SuspendedAt: &Timestamp{referenceTime},
  7476  		},
  7477  	}
  7478  
  7479  	want := `{
  7480  		"action": "a",
  7481  		"branch": "b",
  7482  		"client_payload": {
  7483  			"key": "value"
  7484  		},
  7485  		"repository": {
  7486  			"id": 1,
  7487  			"name": "n",
  7488  			"url": "s"
  7489  		},
  7490  		"organization": {
  7491  			"name": "n",
  7492  			"company": "c",
  7493  			"blog": "b",
  7494  			"location": "loc",
  7495  			"email": "e",
  7496  			"twitter_username": "tu",
  7497  			"description": "d",
  7498  			"billing_email": "be",
  7499  			"is_verified": true,
  7500  			"has_organization_projects": true,
  7501  			"has_repository_projects": true,
  7502  			"default_repository_permission": "drp",
  7503  			"members_can_create_repositories": true,
  7504  			"members_can_create_public_repositories": false,
  7505  			"members_can_create_private_repositories": true,
  7506  			"members_can_create_internal_repositories": true,
  7507  			"members_allowed_repository_creation_type": "marct",
  7508  			"members_can_create_pages": true,
  7509  			"members_can_create_public_pages": false,
  7510  			"members_can_create_private_pages": true
  7511  		},
  7512  		"sender": {
  7513  			"login": "l",
  7514  			"id": 1,
  7515  			"node_id": "n",
  7516  			"avatar_url": "a",
  7517  			"url": "u",
  7518  			"events_url": "e",
  7519  			"repos_url": "r"
  7520  		},
  7521  		"installation": {
  7522  			"id": 1,
  7523  			"node_id": "nid",
  7524  			"app_id": 1,
  7525  			"app_slug": "as",
  7526  			"target_id": 1,
  7527  			"account": {
  7528  				"login": "l",
  7529  				"id": 1,
  7530  				"avatar_url": "a",
  7531  				"gravatar_id": "g",
  7532  				"name": "n",
  7533  				"company": "c",
  7534  				"blog": "b",
  7535  				"location": "l",
  7536  				"email": "e",
  7537  				"hireable": true,
  7538  				"bio": "b",
  7539  				"twitter_username": "t",
  7540  				"public_repos": 1,
  7541  				"followers": 1,
  7542  				"following": 1,
  7543  				"created_at": ` + referenceTimeStr + `,
  7544  				"suspended_at": ` + referenceTimeStr + `,
  7545  				"url": "u"
  7546  			},
  7547  			"access_tokens_url": "atu",
  7548  			"repositories_url": "ru",
  7549  			"html_url": "hu",
  7550  			"target_type": "tt",
  7551  			"single_file_name": "sfn",
  7552  			"repository_selection": "rs",
  7553  			"events": [
  7554  				"e"
  7555  			],
  7556  			"single_file_paths": [
  7557  				"s"
  7558  			],
  7559  			"permissions": {
  7560  				"actions": "a",
  7561  				"administration": "ad",
  7562  				"checks": "c",
  7563  				"contents": "co",
  7564  				"content_references": "cr",
  7565  				"deployments": "d",
  7566  				"environments": "e",
  7567  				"issues": "i",
  7568  				"metadata": "md",
  7569  				"members": "m",
  7570  				"organization_administration": "oa",
  7571  				"organization_hooks": "oh",
  7572  				"organization_plan": "op",
  7573  				"organization_pre_receive_hooks": "opr",
  7574  				"organization_projects": "op",
  7575  				"organization_secrets": "os",
  7576  				"organization_self_hosted_runners": "osh",
  7577  				"organization_user_blocking": "oub",
  7578  				"packages": "pkg",
  7579  				"pages": "pg",
  7580  				"pull_requests": "pr",
  7581  				"repository_hooks": "rh",
  7582  				"repository_projects": "rp",
  7583  				"repository_pre_receive_hooks": "rprh",
  7584  				"secrets": "s",
  7585  				"secret_scanning_alerts": "ssa",
  7586  				"security_events": "se",
  7587  				"single_file": "sf",
  7588  				"statuses": "s",
  7589  				"team_discussions": "td",
  7590  				"vulnerability_alerts": "va",
  7591  				"workflows": "w"
  7592  			},
  7593  			"created_at": ` + referenceTimeStr + `,
  7594  			"updated_at": ` + referenceTimeStr + `,
  7595  			"has_multiple_single_files": false,
  7596  			"suspended_by": {
  7597  				"login": "l",
  7598  				"id": 1,
  7599  				"avatar_url": "a",
  7600  				"gravatar_id": "g",
  7601  				"name": "n",
  7602  				"company": "c",
  7603  				"blog": "b",
  7604  				"location": "l",
  7605  				"email": "e",
  7606  				"hireable": true,
  7607  				"bio": "b",
  7608  				"twitter_username": "t",
  7609  				"public_repos": 1,
  7610  				"followers": 1,
  7611  				"following": 1,
  7612  				"created_at": ` + referenceTimeStr + `,
  7613  				"suspended_at": ` + referenceTimeStr + `,
  7614  				"url": "u"
  7615  			},
  7616  			"suspended_at": ` + referenceTimeStr + `
  7617  		}
  7618  	}`
  7619  
  7620  	testJSONMarshal(t, u, want)
  7621  }
  7622  
  7623  func TestRepositoryImportEvent_Marshal(t *testing.T) {
  7624  	testJSONMarshal(t, &RepositoryImportEvent{}, "{}")
  7625  
  7626  	u := &RepositoryImportEvent{
  7627  		Status: String("success"),
  7628  		Repo: &Repository{
  7629  			ID:   Int64(1),
  7630  			URL:  String("s"),
  7631  			Name: String("n"),
  7632  		},
  7633  		Org: &Organization{
  7634  			BillingEmail:                         String("be"),
  7635  			Blog:                                 String("b"),
  7636  			Company:                              String("c"),
  7637  			Email:                                String("e"),
  7638  			TwitterUsername:                      String("tu"),
  7639  			Location:                             String("loc"),
  7640  			Name:                                 String("n"),
  7641  			Description:                          String("d"),
  7642  			IsVerified:                           Bool(true),
  7643  			HasOrganizationProjects:              Bool(true),
  7644  			HasRepositoryProjects:                Bool(true),
  7645  			DefaultRepoPermission:                String("drp"),
  7646  			MembersCanCreateRepos:                Bool(true),
  7647  			MembersCanCreateInternalRepos:        Bool(true),
  7648  			MembersCanCreatePrivateRepos:         Bool(true),
  7649  			MembersCanCreatePublicRepos:          Bool(false),
  7650  			MembersAllowedRepositoryCreationType: String("marct"),
  7651  			MembersCanCreatePages:                Bool(true),
  7652  			MembersCanCreatePublicPages:          Bool(false),
  7653  			MembersCanCreatePrivatePages:         Bool(true),
  7654  		},
  7655  		Sender: &User{
  7656  			Login:     String("l"),
  7657  			ID:        Int64(1),
  7658  			NodeID:    String("n"),
  7659  			URL:       String("u"),
  7660  			ReposURL:  String("r"),
  7661  			EventsURL: String("e"),
  7662  			AvatarURL: String("a"),
  7663  		},
  7664  	}
  7665  
  7666  	want := `{
  7667  		"status": "success",
  7668  		"repository": {
  7669  			"id": 1,
  7670  			"name": "n",
  7671  			"url": "s"
  7672  		},
  7673  		"organization": {
  7674  			"name": "n",
  7675  			"company": "c",
  7676  			"blog": "b",
  7677  			"location": "loc",
  7678  			"email": "e",
  7679  			"twitter_username": "tu",
  7680  			"description": "d",
  7681  			"billing_email": "be",
  7682  			"is_verified": true,
  7683  			"has_organization_projects": true,
  7684  			"has_repository_projects": true,
  7685  			"default_repository_permission": "drp",
  7686  			"members_can_create_repositories": true,
  7687  			"members_can_create_public_repositories": false,
  7688  			"members_can_create_private_repositories": true,
  7689  			"members_can_create_internal_repositories": true,
  7690  			"members_allowed_repository_creation_type": "marct",
  7691  			"members_can_create_pages": true,
  7692  			"members_can_create_public_pages": false,
  7693  			"members_can_create_private_pages": true
  7694  		},
  7695  		"sender": {
  7696  			"login": "l",
  7697  			"id": 1,
  7698  			"node_id": "n",
  7699  			"avatar_url": "a",
  7700  			"url": "u",
  7701  			"events_url": "e",
  7702  			"repos_url": "r"
  7703  		}
  7704  	}`
  7705  
  7706  	testJSONMarshal(t, u, want)
  7707  }
  7708  
  7709  func TestRepositoryEvent_Marshal(t *testing.T) {
  7710  	testJSONMarshal(t, &RepositoryEvent{}, "{}")
  7711  
  7712  	u := &RepositoryEvent{
  7713  		Action: String("a"),
  7714  		Repo: &Repository{
  7715  			ID:   Int64(1),
  7716  			URL:  String("s"),
  7717  			Name: String("n"),
  7718  		},
  7719  		Org: &Organization{
  7720  			BillingEmail:                         String("be"),
  7721  			Blog:                                 String("b"),
  7722  			Company:                              String("c"),
  7723  			Email:                                String("e"),
  7724  			TwitterUsername:                      String("tu"),
  7725  			Location:                             String("loc"),
  7726  			Name:                                 String("n"),
  7727  			Description:                          String("d"),
  7728  			IsVerified:                           Bool(true),
  7729  			HasOrganizationProjects:              Bool(true),
  7730  			HasRepositoryProjects:                Bool(true),
  7731  			DefaultRepoPermission:                String("drp"),
  7732  			MembersCanCreateRepos:                Bool(true),
  7733  			MembersCanCreateInternalRepos:        Bool(true),
  7734  			MembersCanCreatePrivateRepos:         Bool(true),
  7735  			MembersCanCreatePublicRepos:          Bool(false),
  7736  			MembersAllowedRepositoryCreationType: String("marct"),
  7737  			MembersCanCreatePages:                Bool(true),
  7738  			MembersCanCreatePublicPages:          Bool(false),
  7739  			MembersCanCreatePrivatePages:         Bool(true),
  7740  		},
  7741  		Sender: &User{
  7742  			Login:     String("l"),
  7743  			ID:        Int64(1),
  7744  			NodeID:    String("n"),
  7745  			URL:       String("u"),
  7746  			ReposURL:  String("r"),
  7747  			EventsURL: String("e"),
  7748  			AvatarURL: String("a"),
  7749  		},
  7750  		Installation: &Installation{
  7751  			ID:       Int64(1),
  7752  			NodeID:   String("nid"),
  7753  			AppID:    Int64(1),
  7754  			AppSlug:  String("as"),
  7755  			TargetID: Int64(1),
  7756  			Account: &User{
  7757  				Login:           String("l"),
  7758  				ID:              Int64(1),
  7759  				URL:             String("u"),
  7760  				AvatarURL:       String("a"),
  7761  				GravatarID:      String("g"),
  7762  				Name:            String("n"),
  7763  				Company:         String("c"),
  7764  				Blog:            String("b"),
  7765  				Location:        String("l"),
  7766  				Email:           String("e"),
  7767  				Hireable:        Bool(true),
  7768  				Bio:             String("b"),
  7769  				TwitterUsername: String("t"),
  7770  				PublicRepos:     Int(1),
  7771  				Followers:       Int(1),
  7772  				Following:       Int(1),
  7773  				CreatedAt:       &Timestamp{referenceTime},
  7774  				SuspendedAt:     &Timestamp{referenceTime},
  7775  			},
  7776  			AccessTokensURL:     String("atu"),
  7777  			RepositoriesURL:     String("ru"),
  7778  			HTMLURL:             String("hu"),
  7779  			TargetType:          String("tt"),
  7780  			SingleFileName:      String("sfn"),
  7781  			RepositorySelection: String("rs"),
  7782  			Events:              []string{"e"},
  7783  			SingleFilePaths:     []string{"s"},
  7784  			Permissions: &InstallationPermissions{
  7785  				Actions:                       String("a"),
  7786  				Administration:                String("ad"),
  7787  				Checks:                        String("c"),
  7788  				Contents:                      String("co"),
  7789  				ContentReferences:             String("cr"),
  7790  				Deployments:                   String("d"),
  7791  				Environments:                  String("e"),
  7792  				Issues:                        String("i"),
  7793  				Metadata:                      String("md"),
  7794  				Members:                       String("m"),
  7795  				OrganizationAdministration:    String("oa"),
  7796  				OrganizationHooks:             String("oh"),
  7797  				OrganizationPlan:              String("op"),
  7798  				OrganizationPreReceiveHooks:   String("opr"),
  7799  				OrganizationProjects:          String("op"),
  7800  				OrganizationSecrets:           String("os"),
  7801  				OrganizationSelfHostedRunners: String("osh"),
  7802  				OrganizationUserBlocking:      String("oub"),
  7803  				Packages:                      String("pkg"),
  7804  				Pages:                         String("pg"),
  7805  				PullRequests:                  String("pr"),
  7806  				RepositoryHooks:               String("rh"),
  7807  				RepositoryProjects:            String("rp"),
  7808  				RepositoryPreReceiveHooks:     String("rprh"),
  7809  				Secrets:                       String("s"),
  7810  				SecretScanningAlerts:          String("ssa"),
  7811  				SecurityEvents:                String("se"),
  7812  				SingleFile:                    String("sf"),
  7813  				Statuses:                      String("s"),
  7814  				TeamDiscussions:               String("td"),
  7815  				VulnerabilityAlerts:           String("va"),
  7816  				Workflows:                     String("w"),
  7817  			},
  7818  			CreatedAt:              &Timestamp{referenceTime},
  7819  			UpdatedAt:              &Timestamp{referenceTime},
  7820  			HasMultipleSingleFiles: Bool(false),
  7821  			SuspendedBy: &User{
  7822  				Login:           String("l"),
  7823  				ID:              Int64(1),
  7824  				URL:             String("u"),
  7825  				AvatarURL:       String("a"),
  7826  				GravatarID:      String("g"),
  7827  				Name:            String("n"),
  7828  				Company:         String("c"),
  7829  				Blog:            String("b"),
  7830  				Location:        String("l"),
  7831  				Email:           String("e"),
  7832  				Hireable:        Bool(true),
  7833  				Bio:             String("b"),
  7834  				TwitterUsername: String("t"),
  7835  				PublicRepos:     Int(1),
  7836  				Followers:       Int(1),
  7837  				Following:       Int(1),
  7838  				CreatedAt:       &Timestamp{referenceTime},
  7839  				SuspendedAt:     &Timestamp{referenceTime},
  7840  			},
  7841  			SuspendedAt: &Timestamp{referenceTime},
  7842  		},
  7843  	}
  7844  
  7845  	want := `{
  7846  		"action": "a",
  7847  		"repository": {
  7848  			"id": 1,
  7849  			"name": "n",
  7850  			"url": "s"
  7851  		},
  7852  		"organization": {
  7853  			"name": "n",
  7854  			"company": "c",
  7855  			"blog": "b",
  7856  			"location": "loc",
  7857  			"email": "e",
  7858  			"twitter_username": "tu",
  7859  			"description": "d",
  7860  			"billing_email": "be",
  7861  			"is_verified": true,
  7862  			"has_organization_projects": true,
  7863  			"has_repository_projects": true,
  7864  			"default_repository_permission": "drp",
  7865  			"members_can_create_repositories": true,
  7866  			"members_can_create_public_repositories": false,
  7867  			"members_can_create_private_repositories": true,
  7868  			"members_can_create_internal_repositories": true,
  7869  			"members_allowed_repository_creation_type": "marct",
  7870  			"members_can_create_pages": true,
  7871  			"members_can_create_public_pages": false,
  7872  			"members_can_create_private_pages": true
  7873  		},
  7874  		"sender": {
  7875  			"login": "l",
  7876  			"id": 1,
  7877  			"node_id": "n",
  7878  			"avatar_url": "a",
  7879  			"url": "u",
  7880  			"events_url": "e",
  7881  			"repos_url": "r"
  7882  		},
  7883  		"installation": {
  7884  			"id": 1,
  7885  			"node_id": "nid",
  7886  			"app_id": 1,
  7887  			"app_slug": "as",
  7888  			"target_id": 1,
  7889  			"account": {
  7890  				"login": "l",
  7891  				"id": 1,
  7892  				"avatar_url": "a",
  7893  				"gravatar_id": "g",
  7894  				"name": "n",
  7895  				"company": "c",
  7896  				"blog": "b",
  7897  				"location": "l",
  7898  				"email": "e",
  7899  				"hireable": true,
  7900  				"bio": "b",
  7901  				"twitter_username": "t",
  7902  				"public_repos": 1,
  7903  				"followers": 1,
  7904  				"following": 1,
  7905  				"created_at": ` + referenceTimeStr + `,
  7906  				"suspended_at": ` + referenceTimeStr + `,
  7907  				"url": "u"
  7908  			},
  7909  			"access_tokens_url": "atu",
  7910  			"repositories_url": "ru",
  7911  			"html_url": "hu",
  7912  			"target_type": "tt",
  7913  			"single_file_name": "sfn",
  7914  			"repository_selection": "rs",
  7915  			"events": [
  7916  				"e"
  7917  			],
  7918  			"single_file_paths": [
  7919  				"s"
  7920  			],
  7921  			"permissions": {
  7922  				"actions": "a",
  7923  				"administration": "ad",
  7924  				"checks": "c",
  7925  				"contents": "co",
  7926  				"content_references": "cr",
  7927  				"deployments": "d",
  7928  				"environments": "e",
  7929  				"issues": "i",
  7930  				"metadata": "md",
  7931  				"members": "m",
  7932  				"organization_administration": "oa",
  7933  				"organization_hooks": "oh",
  7934  				"organization_plan": "op",
  7935  				"organization_pre_receive_hooks": "opr",
  7936  				"organization_projects": "op",
  7937  				"organization_secrets": "os",
  7938  				"organization_self_hosted_runners": "osh",
  7939  				"organization_user_blocking": "oub",
  7940  				"packages": "pkg",
  7941  				"pages": "pg",
  7942  				"pull_requests": "pr",
  7943  				"repository_hooks": "rh",
  7944  				"repository_projects": "rp",
  7945  				"repository_pre_receive_hooks": "rprh",
  7946  				"secrets": "s",
  7947  				"secret_scanning_alerts": "ssa",
  7948  				"security_events": "se",
  7949  				"single_file": "sf",
  7950  				"statuses": "s",
  7951  				"team_discussions": "td",
  7952  				"vulnerability_alerts": "va",
  7953  				"workflows": "w"
  7954  			},
  7955  			"created_at": ` + referenceTimeStr + `,
  7956  			"updated_at": ` + referenceTimeStr + `,
  7957  			"has_multiple_single_files": false,
  7958  			"suspended_by": {
  7959  				"login": "l",
  7960  				"id": 1,
  7961  				"avatar_url": "a",
  7962  				"gravatar_id": "g",
  7963  				"name": "n",
  7964  				"company": "c",
  7965  				"blog": "b",
  7966  				"location": "l",
  7967  				"email": "e",
  7968  				"hireable": true,
  7969  				"bio": "b",
  7970  				"twitter_username": "t",
  7971  				"public_repos": 1,
  7972  				"followers": 1,
  7973  				"following": 1,
  7974  				"created_at": ` + referenceTimeStr + `,
  7975  				"suspended_at": ` + referenceTimeStr + `,
  7976  				"url": "u"
  7977  			},
  7978  			"suspended_at": ` + referenceTimeStr + `
  7979  		}
  7980  	}`
  7981  
  7982  	testJSONMarshal(t, u, want)
  7983  }
  7984  
  7985  func TestReleaseEvent_Marshal(t *testing.T) {
  7986  	testJSONMarshal(t, &ReleaseEvent{}, "{}")
  7987  
  7988  	u := &ReleaseEvent{
  7989  		Action: String("a"),
  7990  		Release: &RepositoryRelease{
  7991  			Name:                   String("n"),
  7992  			DiscussionCategoryName: String("dcn"),
  7993  			ID:                     Int64(2),
  7994  			CreatedAt:              &Timestamp{referenceTime},
  7995  			PublishedAt:            &Timestamp{referenceTime},
  7996  			URL:                    String("url"),
  7997  			HTMLURL:                String("htmlurl"),
  7998  			AssetsURL:              String("assetsurl"),
  7999  			Assets:                 []*ReleaseAsset{{ID: Int64(1)}},
  8000  			UploadURL:              String("uploadurl"),
  8001  			ZipballURL:             String("zipballurl"),
  8002  			TarballURL:             String("tarballurl"),
  8003  			Author:                 &User{Name: String("octocat")},
  8004  			NodeID:                 String("nid"),
  8005  		},
  8006  		Repo: &Repository{
  8007  			ID:   Int64(1),
  8008  			URL:  String("s"),
  8009  			Name: String("n"),
  8010  		},
  8011  		Sender: &User{
  8012  			Login:     String("l"),
  8013  			ID:        Int64(1),
  8014  			NodeID:    String("n"),
  8015  			URL:       String("u"),
  8016  			ReposURL:  String("r"),
  8017  			EventsURL: String("e"),
  8018  			AvatarURL: String("a"),
  8019  		},
  8020  		Installation: &Installation{
  8021  			ID:       Int64(1),
  8022  			NodeID:   String("nid"),
  8023  			AppID:    Int64(1),
  8024  			AppSlug:  String("as"),
  8025  			TargetID: Int64(1),
  8026  			Account: &User{
  8027  				Login:           String("l"),
  8028  				ID:              Int64(1),
  8029  				URL:             String("u"),
  8030  				AvatarURL:       String("a"),
  8031  				GravatarID:      String("g"),
  8032  				Name:            String("n"),
  8033  				Company:         String("c"),
  8034  				Blog:            String("b"),
  8035  				Location:        String("l"),
  8036  				Email:           String("e"),
  8037  				Hireable:        Bool(true),
  8038  				Bio:             String("b"),
  8039  				TwitterUsername: String("t"),
  8040  				PublicRepos:     Int(1),
  8041  				Followers:       Int(1),
  8042  				Following:       Int(1),
  8043  				CreatedAt:       &Timestamp{referenceTime},
  8044  				SuspendedAt:     &Timestamp{referenceTime},
  8045  			},
  8046  			AccessTokensURL:     String("atu"),
  8047  			RepositoriesURL:     String("ru"),
  8048  			HTMLURL:             String("hu"),
  8049  			TargetType:          String("tt"),
  8050  			SingleFileName:      String("sfn"),
  8051  			RepositorySelection: String("rs"),
  8052  			Events:              []string{"e"},
  8053  			SingleFilePaths:     []string{"s"},
  8054  			Permissions: &InstallationPermissions{
  8055  				Actions:                       String("a"),
  8056  				Administration:                String("ad"),
  8057  				Checks:                        String("c"),
  8058  				Contents:                      String("co"),
  8059  				ContentReferences:             String("cr"),
  8060  				Deployments:                   String("d"),
  8061  				Environments:                  String("e"),
  8062  				Issues:                        String("i"),
  8063  				Metadata:                      String("md"),
  8064  				Members:                       String("m"),
  8065  				OrganizationAdministration:    String("oa"),
  8066  				OrganizationHooks:             String("oh"),
  8067  				OrganizationPlan:              String("op"),
  8068  				OrganizationPreReceiveHooks:   String("opr"),
  8069  				OrganizationProjects:          String("op"),
  8070  				OrganizationSecrets:           String("os"),
  8071  				OrganizationSelfHostedRunners: String("osh"),
  8072  				OrganizationUserBlocking:      String("oub"),
  8073  				Packages:                      String("pkg"),
  8074  				Pages:                         String("pg"),
  8075  				PullRequests:                  String("pr"),
  8076  				RepositoryHooks:               String("rh"),
  8077  				RepositoryProjects:            String("rp"),
  8078  				RepositoryPreReceiveHooks:     String("rprh"),
  8079  				Secrets:                       String("s"),
  8080  				SecretScanningAlerts:          String("ssa"),
  8081  				SecurityEvents:                String("se"),
  8082  				SingleFile:                    String("sf"),
  8083  				Statuses:                      String("s"),
  8084  				TeamDiscussions:               String("td"),
  8085  				VulnerabilityAlerts:           String("va"),
  8086  				Workflows:                     String("w"),
  8087  			},
  8088  			CreatedAt:              &Timestamp{referenceTime},
  8089  			UpdatedAt:              &Timestamp{referenceTime},
  8090  			HasMultipleSingleFiles: Bool(false),
  8091  			SuspendedBy: &User{
  8092  				Login:           String("l"),
  8093  				ID:              Int64(1),
  8094  				URL:             String("u"),
  8095  				AvatarURL:       String("a"),
  8096  				GravatarID:      String("g"),
  8097  				Name:            String("n"),
  8098  				Company:         String("c"),
  8099  				Blog:            String("b"),
  8100  				Location:        String("l"),
  8101  				Email:           String("e"),
  8102  				Hireable:        Bool(true),
  8103  				Bio:             String("b"),
  8104  				TwitterUsername: String("t"),
  8105  				PublicRepos:     Int(1),
  8106  				Followers:       Int(1),
  8107  				Following:       Int(1),
  8108  				CreatedAt:       &Timestamp{referenceTime},
  8109  				SuspendedAt:     &Timestamp{referenceTime},
  8110  			},
  8111  			SuspendedAt: &Timestamp{referenceTime},
  8112  		},
  8113  	}
  8114  
  8115  	want := `{
  8116  		"action": "a",
  8117  		"release": {
  8118  			"name": "n",
  8119  			"discussion_category_name": "dcn",
  8120  			"id": 2,
  8121  			"created_at": ` + referenceTimeStr + `,
  8122  			"published_at": ` + referenceTimeStr + `,
  8123  			"url": "url",
  8124  			"html_url": "htmlurl",
  8125  			"assets_url": "assetsurl",
  8126  			"assets": [
  8127  				{
  8128  					"id": 1
  8129  				}
  8130  			],
  8131  			"upload_url": "uploadurl",
  8132  			"zipball_url": "zipballurl",
  8133  			"tarball_url": "tarballurl",
  8134  			"author": {
  8135  				"name": "octocat"
  8136  			},
  8137  			"node_id": "nid"
  8138  		},
  8139  		"repository": {
  8140  			"id": 1,
  8141  			"name": "n",
  8142  			"url": "s"
  8143  		},
  8144  		"sender": {
  8145  			"login": "l",
  8146  			"id": 1,
  8147  			"node_id": "n",
  8148  			"avatar_url": "a",
  8149  			"url": "u",
  8150  			"events_url": "e",
  8151  			"repos_url": "r"
  8152  		},
  8153  		"installation": {
  8154  			"id": 1,
  8155  			"node_id": "nid",
  8156  			"app_id": 1,
  8157  			"app_slug": "as",
  8158  			"target_id": 1,
  8159  			"account": {
  8160  				"login": "l",
  8161  				"id": 1,
  8162  				"avatar_url": "a",
  8163  				"gravatar_id": "g",
  8164  				"name": "n",
  8165  				"company": "c",
  8166  				"blog": "b",
  8167  				"location": "l",
  8168  				"email": "e",
  8169  				"hireable": true,
  8170  				"bio": "b",
  8171  				"twitter_username": "t",
  8172  				"public_repos": 1,
  8173  				"followers": 1,
  8174  				"following": 1,
  8175  				"created_at": ` + referenceTimeStr + `,
  8176  				"suspended_at": ` + referenceTimeStr + `,
  8177  				"url": "u"
  8178  			},
  8179  			"access_tokens_url": "atu",
  8180  			"repositories_url": "ru",
  8181  			"html_url": "hu",
  8182  			"target_type": "tt",
  8183  			"single_file_name": "sfn",
  8184  			"repository_selection": "rs",
  8185  			"events": [
  8186  				"e"
  8187  			],
  8188  			"single_file_paths": [
  8189  				"s"
  8190  			],
  8191  			"permissions": {
  8192  				"actions": "a",
  8193  				"administration": "ad",
  8194  				"checks": "c",
  8195  				"contents": "co",
  8196  				"content_references": "cr",
  8197  				"deployments": "d",
  8198  				"environments": "e",
  8199  				"issues": "i",
  8200  				"metadata": "md",
  8201  				"members": "m",
  8202  				"organization_administration": "oa",
  8203  				"organization_hooks": "oh",
  8204  				"organization_plan": "op",
  8205  				"organization_pre_receive_hooks": "opr",
  8206  				"organization_projects": "op",
  8207  				"organization_secrets": "os",
  8208  				"organization_self_hosted_runners": "osh",
  8209  				"organization_user_blocking": "oub",
  8210  				"packages": "pkg",
  8211  				"pages": "pg",
  8212  				"pull_requests": "pr",
  8213  				"repository_hooks": "rh",
  8214  				"repository_projects": "rp",
  8215  				"repository_pre_receive_hooks": "rprh",
  8216  				"secrets": "s",
  8217  				"secret_scanning_alerts": "ssa",
  8218  				"security_events": "se",
  8219  				"single_file": "sf",
  8220  				"statuses": "s",
  8221  				"team_discussions": "td",
  8222  				"vulnerability_alerts": "va",
  8223  				"workflows": "w"
  8224  			},
  8225  			"created_at": ` + referenceTimeStr + `,
  8226  			"updated_at": ` + referenceTimeStr + `,
  8227  			"has_multiple_single_files": false,
  8228  			"suspended_by": {
  8229  				"login": "l",
  8230  				"id": 1,
  8231  				"avatar_url": "a",
  8232  				"gravatar_id": "g",
  8233  				"name": "n",
  8234  				"company": "c",
  8235  				"blog": "b",
  8236  				"location": "l",
  8237  				"email": "e",
  8238  				"hireable": true,
  8239  				"bio": "b",
  8240  				"twitter_username": "t",
  8241  				"public_repos": 1,
  8242  				"followers": 1,
  8243  				"following": 1,
  8244  				"created_at": ` + referenceTimeStr + `,
  8245  				"suspended_at": ` + referenceTimeStr + `,
  8246  				"url": "u"
  8247  			},
  8248  			"suspended_at": ` + referenceTimeStr + `
  8249  		}
  8250  	}`
  8251  
  8252  	testJSONMarshal(t, u, want)
  8253  }
  8254  
  8255  func TestContentReferenceEvent_Marshal(t *testing.T) {
  8256  	testJSONMarshal(t, &ContentReferenceEvent{}, "{}")
  8257  
  8258  	u := &ContentReferenceEvent{
  8259  		Action: String("a"),
  8260  		ContentReference: &ContentReference{
  8261  			ID:        Int64(1),
  8262  			NodeID:    String("nid"),
  8263  			Reference: String("ref"),
  8264  		},
  8265  		Repo: &Repository{
  8266  			ID:   Int64(1),
  8267  			URL:  String("s"),
  8268  			Name: String("n"),
  8269  		},
  8270  		Sender: &User{
  8271  			Login:     String("l"),
  8272  			ID:        Int64(1),
  8273  			NodeID:    String("n"),
  8274  			URL:       String("u"),
  8275  			ReposURL:  String("r"),
  8276  			EventsURL: String("e"),
  8277  			AvatarURL: String("a"),
  8278  		},
  8279  		Installation: &Installation{
  8280  			ID:       Int64(1),
  8281  			NodeID:   String("nid"),
  8282  			AppID:    Int64(1),
  8283  			AppSlug:  String("as"),
  8284  			TargetID: Int64(1),
  8285  			Account: &User{
  8286  				Login:           String("l"),
  8287  				ID:              Int64(1),
  8288  				URL:             String("u"),
  8289  				AvatarURL:       String("a"),
  8290  				GravatarID:      String("g"),
  8291  				Name:            String("n"),
  8292  				Company:         String("c"),
  8293  				Blog:            String("b"),
  8294  				Location:        String("l"),
  8295  				Email:           String("e"),
  8296  				Hireable:        Bool(true),
  8297  				Bio:             String("b"),
  8298  				TwitterUsername: String("t"),
  8299  				PublicRepos:     Int(1),
  8300  				Followers:       Int(1),
  8301  				Following:       Int(1),
  8302  				CreatedAt:       &Timestamp{referenceTime},
  8303  				SuspendedAt:     &Timestamp{referenceTime},
  8304  			},
  8305  			AccessTokensURL:     String("atu"),
  8306  			RepositoriesURL:     String("ru"),
  8307  			HTMLURL:             String("hu"),
  8308  			TargetType:          String("tt"),
  8309  			SingleFileName:      String("sfn"),
  8310  			RepositorySelection: String("rs"),
  8311  			Events:              []string{"e"},
  8312  			SingleFilePaths:     []string{"s"},
  8313  			Permissions: &InstallationPermissions{
  8314  				Actions:                       String("a"),
  8315  				Administration:                String("ad"),
  8316  				Checks:                        String("c"),
  8317  				Contents:                      String("co"),
  8318  				ContentReferences:             String("cr"),
  8319  				Deployments:                   String("d"),
  8320  				Environments:                  String("e"),
  8321  				Issues:                        String("i"),
  8322  				Metadata:                      String("md"),
  8323  				Members:                       String("m"),
  8324  				OrganizationAdministration:    String("oa"),
  8325  				OrganizationHooks:             String("oh"),
  8326  				OrganizationPlan:              String("op"),
  8327  				OrganizationPreReceiveHooks:   String("opr"),
  8328  				OrganizationProjects:          String("op"),
  8329  				OrganizationSecrets:           String("os"),
  8330  				OrganizationSelfHostedRunners: String("osh"),
  8331  				OrganizationUserBlocking:      String("oub"),
  8332  				Packages:                      String("pkg"),
  8333  				Pages:                         String("pg"),
  8334  				PullRequests:                  String("pr"),
  8335  				RepositoryHooks:               String("rh"),
  8336  				RepositoryProjects:            String("rp"),
  8337  				RepositoryPreReceiveHooks:     String("rprh"),
  8338  				Secrets:                       String("s"),
  8339  				SecretScanningAlerts:          String("ssa"),
  8340  				SecurityEvents:                String("se"),
  8341  				SingleFile:                    String("sf"),
  8342  				Statuses:                      String("s"),
  8343  				TeamDiscussions:               String("td"),
  8344  				VulnerabilityAlerts:           String("va"),
  8345  				Workflows:                     String("w"),
  8346  			},
  8347  			CreatedAt:              &Timestamp{referenceTime},
  8348  			UpdatedAt:              &Timestamp{referenceTime},
  8349  			HasMultipleSingleFiles: Bool(false),
  8350  			SuspendedBy: &User{
  8351  				Login:           String("l"),
  8352  				ID:              Int64(1),
  8353  				URL:             String("u"),
  8354  				AvatarURL:       String("a"),
  8355  				GravatarID:      String("g"),
  8356  				Name:            String("n"),
  8357  				Company:         String("c"),
  8358  				Blog:            String("b"),
  8359  				Location:        String("l"),
  8360  				Email:           String("e"),
  8361  				Hireable:        Bool(true),
  8362  				Bio:             String("b"),
  8363  				TwitterUsername: String("t"),
  8364  				PublicRepos:     Int(1),
  8365  				Followers:       Int(1),
  8366  				Following:       Int(1),
  8367  				CreatedAt:       &Timestamp{referenceTime},
  8368  				SuspendedAt:     &Timestamp{referenceTime},
  8369  			},
  8370  			SuspendedAt: &Timestamp{referenceTime},
  8371  		},
  8372  	}
  8373  
  8374  	want := `{
  8375  		"action": "a",
  8376  		"content_reference": {
  8377  			"id": 1,
  8378  			"node_id": "nid",
  8379  			"reference": "ref"
  8380  		},
  8381  		"repository": {
  8382  			"id": 1,
  8383  			"name": "n",
  8384  			"url": "s"
  8385  		},
  8386  		"sender": {
  8387  			"login": "l",
  8388  			"id": 1,
  8389  			"node_id": "n",
  8390  			"avatar_url": "a",
  8391  			"url": "u",
  8392  			"events_url": "e",
  8393  			"repos_url": "r"
  8394  		},
  8395  		"installation": {
  8396  			"id": 1,
  8397  			"node_id": "nid",
  8398  			"app_id": 1,
  8399  			"app_slug": "as",
  8400  			"target_id": 1,
  8401  			"account": {
  8402  				"login": "l",
  8403  				"id": 1,
  8404  				"avatar_url": "a",
  8405  				"gravatar_id": "g",
  8406  				"name": "n",
  8407  				"company": "c",
  8408  				"blog": "b",
  8409  				"location": "l",
  8410  				"email": "e",
  8411  				"hireable": true,
  8412  				"bio": "b",
  8413  				"twitter_username": "t",
  8414  				"public_repos": 1,
  8415  				"followers": 1,
  8416  				"following": 1,
  8417  				"created_at": ` + referenceTimeStr + `,
  8418  				"suspended_at": ` + referenceTimeStr + `,
  8419  				"url": "u"
  8420  			},
  8421  			"access_tokens_url": "atu",
  8422  			"repositories_url": "ru",
  8423  			"html_url": "hu",
  8424  			"target_type": "tt",
  8425  			"single_file_name": "sfn",
  8426  			"repository_selection": "rs",
  8427  			"events": [
  8428  				"e"
  8429  			],
  8430  			"single_file_paths": [
  8431  				"s"
  8432  			],
  8433  			"permissions": {
  8434  				"actions": "a",
  8435  				"administration": "ad",
  8436  				"checks": "c",
  8437  				"contents": "co",
  8438  				"content_references": "cr",
  8439  				"deployments": "d",
  8440  				"environments": "e",
  8441  				"issues": "i",
  8442  				"metadata": "md",
  8443  				"members": "m",
  8444  				"organization_administration": "oa",
  8445  				"organization_hooks": "oh",
  8446  				"organization_plan": "op",
  8447  				"organization_pre_receive_hooks": "opr",
  8448  				"organization_projects": "op",
  8449  				"organization_secrets": "os",
  8450  				"organization_self_hosted_runners": "osh",
  8451  				"organization_user_blocking": "oub",
  8452  				"packages": "pkg",
  8453  				"pages": "pg",
  8454  				"pull_requests": "pr",
  8455  				"repository_hooks": "rh",
  8456  				"repository_projects": "rp",
  8457  				"repository_pre_receive_hooks": "rprh",
  8458  				"secrets": "s",
  8459  				"secret_scanning_alerts": "ssa",
  8460  				"security_events": "se",
  8461  				"single_file": "sf",
  8462  				"statuses": "s",
  8463  				"team_discussions": "td",
  8464  				"vulnerability_alerts": "va",
  8465  				"workflows": "w"
  8466  			},
  8467  			"created_at": ` + referenceTimeStr + `,
  8468  			"updated_at": ` + referenceTimeStr + `,
  8469  			"has_multiple_single_files": false,
  8470  			"suspended_by": {
  8471  				"login": "l",
  8472  				"id": 1,
  8473  				"avatar_url": "a",
  8474  				"gravatar_id": "g",
  8475  				"name": "n",
  8476  				"company": "c",
  8477  				"blog": "b",
  8478  				"location": "l",
  8479  				"email": "e",
  8480  				"hireable": true,
  8481  				"bio": "b",
  8482  				"twitter_username": "t",
  8483  				"public_repos": 1,
  8484  				"followers": 1,
  8485  				"following": 1,
  8486  				"created_at": ` + referenceTimeStr + `,
  8487  				"suspended_at": ` + referenceTimeStr + `,
  8488  				"url": "u"
  8489  			},
  8490  			"suspended_at": ` + referenceTimeStr + `
  8491  		}
  8492  	}`
  8493  
  8494  	testJSONMarshal(t, u, want)
  8495  }
  8496  
  8497  func TestMemberEvent_Marshal(t *testing.T) {
  8498  	testJSONMarshal(t, &MemberEvent{}, "{}")
  8499  
  8500  	u := &MemberEvent{
  8501  		Action: String("a"),
  8502  		Member: &User{
  8503  			Login:     String("l"),
  8504  			ID:        Int64(1),
  8505  			NodeID:    String("n"),
  8506  			URL:       String("u"),
  8507  			ReposURL:  String("r"),
  8508  			EventsURL: String("e"),
  8509  			AvatarURL: String("a"),
  8510  		},
  8511  		Repo: &Repository{
  8512  			ID:   Int64(1),
  8513  			URL:  String("s"),
  8514  			Name: String("n"),
  8515  		},
  8516  		Sender: &User{
  8517  			Login:     String("l"),
  8518  			ID:        Int64(1),
  8519  			NodeID:    String("n"),
  8520  			URL:       String("u"),
  8521  			ReposURL:  String("r"),
  8522  			EventsURL: String("e"),
  8523  			AvatarURL: String("a"),
  8524  		},
  8525  		Installation: &Installation{
  8526  			ID:       Int64(1),
  8527  			NodeID:   String("nid"),
  8528  			AppID:    Int64(1),
  8529  			AppSlug:  String("as"),
  8530  			TargetID: Int64(1),
  8531  			Account: &User{
  8532  				Login:           String("l"),
  8533  				ID:              Int64(1),
  8534  				URL:             String("u"),
  8535  				AvatarURL:       String("a"),
  8536  				GravatarID:      String("g"),
  8537  				Name:            String("n"),
  8538  				Company:         String("c"),
  8539  				Blog:            String("b"),
  8540  				Location:        String("l"),
  8541  				Email:           String("e"),
  8542  				Hireable:        Bool(true),
  8543  				Bio:             String("b"),
  8544  				TwitterUsername: String("t"),
  8545  				PublicRepos:     Int(1),
  8546  				Followers:       Int(1),
  8547  				Following:       Int(1),
  8548  				CreatedAt:       &Timestamp{referenceTime},
  8549  				SuspendedAt:     &Timestamp{referenceTime},
  8550  			},
  8551  			AccessTokensURL:     String("atu"),
  8552  			RepositoriesURL:     String("ru"),
  8553  			HTMLURL:             String("hu"),
  8554  			TargetType:          String("tt"),
  8555  			SingleFileName:      String("sfn"),
  8556  			RepositorySelection: String("rs"),
  8557  			Events:              []string{"e"},
  8558  			SingleFilePaths:     []string{"s"},
  8559  			Permissions: &InstallationPermissions{
  8560  				Actions:                       String("a"),
  8561  				Administration:                String("ad"),
  8562  				Checks:                        String("c"),
  8563  				Contents:                      String("co"),
  8564  				ContentReferences:             String("cr"),
  8565  				Deployments:                   String("d"),
  8566  				Environments:                  String("e"),
  8567  				Issues:                        String("i"),
  8568  				Metadata:                      String("md"),
  8569  				Members:                       String("m"),
  8570  				OrganizationAdministration:    String("oa"),
  8571  				OrganizationHooks:             String("oh"),
  8572  				OrganizationPlan:              String("op"),
  8573  				OrganizationPreReceiveHooks:   String("opr"),
  8574  				OrganizationProjects:          String("op"),
  8575  				OrganizationSecrets:           String("os"),
  8576  				OrganizationSelfHostedRunners: String("osh"),
  8577  				OrganizationUserBlocking:      String("oub"),
  8578  				Packages:                      String("pkg"),
  8579  				Pages:                         String("pg"),
  8580  				PullRequests:                  String("pr"),
  8581  				RepositoryHooks:               String("rh"),
  8582  				RepositoryProjects:            String("rp"),
  8583  				RepositoryPreReceiveHooks:     String("rprh"),
  8584  				Secrets:                       String("s"),
  8585  				SecretScanningAlerts:          String("ssa"),
  8586  				SecurityEvents:                String("se"),
  8587  				SingleFile:                    String("sf"),
  8588  				Statuses:                      String("s"),
  8589  				TeamDiscussions:               String("td"),
  8590  				VulnerabilityAlerts:           String("va"),
  8591  				Workflows:                     String("w"),
  8592  			},
  8593  			CreatedAt:              &Timestamp{referenceTime},
  8594  			UpdatedAt:              &Timestamp{referenceTime},
  8595  			HasMultipleSingleFiles: Bool(false),
  8596  			SuspendedBy: &User{
  8597  				Login:           String("l"),
  8598  				ID:              Int64(1),
  8599  				URL:             String("u"),
  8600  				AvatarURL:       String("a"),
  8601  				GravatarID:      String("g"),
  8602  				Name:            String("n"),
  8603  				Company:         String("c"),
  8604  				Blog:            String("b"),
  8605  				Location:        String("l"),
  8606  				Email:           String("e"),
  8607  				Hireable:        Bool(true),
  8608  				Bio:             String("b"),
  8609  				TwitterUsername: String("t"),
  8610  				PublicRepos:     Int(1),
  8611  				Followers:       Int(1),
  8612  				Following:       Int(1),
  8613  				CreatedAt:       &Timestamp{referenceTime},
  8614  				SuspendedAt:     &Timestamp{referenceTime},
  8615  			},
  8616  			SuspendedAt: &Timestamp{referenceTime},
  8617  		},
  8618  	}
  8619  
  8620  	want := `{
  8621  		"action": "a",
  8622  		"member": {
  8623  			"login": "l",
  8624  			"id": 1,
  8625  			"node_id": "n",
  8626  			"avatar_url": "a",
  8627  			"url": "u",
  8628  			"events_url": "e",
  8629  			"repos_url": "r"
  8630  		},
  8631  		"repository": {
  8632  			"id": 1,
  8633  			"name": "n",
  8634  			"url": "s"
  8635  		},
  8636  		"sender": {
  8637  			"login": "l",
  8638  			"id": 1,
  8639  			"node_id": "n",
  8640  			"avatar_url": "a",
  8641  			"url": "u",
  8642  			"events_url": "e",
  8643  			"repos_url": "r"
  8644  		},
  8645  		"installation": {
  8646  			"id": 1,
  8647  			"node_id": "nid",
  8648  			"app_id": 1,
  8649  			"app_slug": "as",
  8650  			"target_id": 1,
  8651  			"account": {
  8652  				"login": "l",
  8653  				"id": 1,
  8654  				"avatar_url": "a",
  8655  				"gravatar_id": "g",
  8656  				"name": "n",
  8657  				"company": "c",
  8658  				"blog": "b",
  8659  				"location": "l",
  8660  				"email": "e",
  8661  				"hireable": true,
  8662  				"bio": "b",
  8663  				"twitter_username": "t",
  8664  				"public_repos": 1,
  8665  				"followers": 1,
  8666  				"following": 1,
  8667  				"created_at": ` + referenceTimeStr + `,
  8668  				"suspended_at": ` + referenceTimeStr + `,
  8669  				"url": "u"
  8670  			},
  8671  			"access_tokens_url": "atu",
  8672  			"repositories_url": "ru",
  8673  			"html_url": "hu",
  8674  			"target_type": "tt",
  8675  			"single_file_name": "sfn",
  8676  			"repository_selection": "rs",
  8677  			"events": [
  8678  				"e"
  8679  			],
  8680  			"single_file_paths": [
  8681  				"s"
  8682  			],
  8683  			"permissions": {
  8684  				"actions": "a",
  8685  				"administration": "ad",
  8686  				"checks": "c",
  8687  				"contents": "co",
  8688  				"content_references": "cr",
  8689  				"deployments": "d",
  8690  				"environments": "e",
  8691  				"issues": "i",
  8692  				"metadata": "md",
  8693  				"members": "m",
  8694  				"organization_administration": "oa",
  8695  				"organization_hooks": "oh",
  8696  				"organization_plan": "op",
  8697  				"organization_pre_receive_hooks": "opr",
  8698  				"organization_projects": "op",
  8699  				"organization_secrets": "os",
  8700  				"organization_self_hosted_runners": "osh",
  8701  				"organization_user_blocking": "oub",
  8702  				"packages": "pkg",
  8703  				"pages": "pg",
  8704  				"pull_requests": "pr",
  8705  				"repository_hooks": "rh",
  8706  				"repository_projects": "rp",
  8707  				"repository_pre_receive_hooks": "rprh",
  8708  				"secrets": "s",
  8709  				"secret_scanning_alerts": "ssa",
  8710  				"security_events": "se",
  8711  				"single_file": "sf",
  8712  				"statuses": "s",
  8713  				"team_discussions": "td",
  8714  				"vulnerability_alerts": "va",
  8715  				"workflows": "w"
  8716  			},
  8717  			"created_at": ` + referenceTimeStr + `,
  8718  			"updated_at": ` + referenceTimeStr + `,
  8719  			"has_multiple_single_files": false,
  8720  			"suspended_by": {
  8721  				"login": "l",
  8722  				"id": 1,
  8723  				"avatar_url": "a",
  8724  				"gravatar_id": "g",
  8725  				"name": "n",
  8726  				"company": "c",
  8727  				"blog": "b",
  8728  				"location": "l",
  8729  				"email": "e",
  8730  				"hireable": true,
  8731  				"bio": "b",
  8732  				"twitter_username": "t",
  8733  				"public_repos": 1,
  8734  				"followers": 1,
  8735  				"following": 1,
  8736  				"created_at": ` + referenceTimeStr + `,
  8737  				"suspended_at": ` + referenceTimeStr + `,
  8738  				"url": "u"
  8739  			},
  8740  			"suspended_at": ` + referenceTimeStr + `
  8741  		}
  8742  	}`
  8743  
  8744  	testJSONMarshal(t, u, want)
  8745  }
  8746  
  8747  func TestMembershipEvent_Marshal(t *testing.T) {
  8748  	testJSONMarshal(t, &MembershipEvent{}, "{}")
  8749  
  8750  	u := &MembershipEvent{
  8751  		Action: String("a"),
  8752  		Scope:  String("s"),
  8753  		Member: &User{
  8754  			Login:     String("l"),
  8755  			ID:        Int64(1),
  8756  			NodeID:    String("n"),
  8757  			URL:       String("u"),
  8758  			ReposURL:  String("r"),
  8759  			EventsURL: String("e"),
  8760  			AvatarURL: String("a"),
  8761  		},
  8762  		Team: &Team{
  8763  			ID:              Int64(1),
  8764  			NodeID:          String("n"),
  8765  			Name:            String("n"),
  8766  			Description:     String("d"),
  8767  			URL:             String("u"),
  8768  			Slug:            String("s"),
  8769  			Permission:      String("p"),
  8770  			Privacy:         String("p"),
  8771  			MembersCount:    Int(1),
  8772  			ReposCount:      Int(1),
  8773  			MembersURL:      String("m"),
  8774  			RepositoriesURL: String("r"),
  8775  			Organization: &Organization{
  8776  				Login:     String("l"),
  8777  				ID:        Int64(1),
  8778  				NodeID:    String("n"),
  8779  				AvatarURL: String("a"),
  8780  				HTMLURL:   String("h"),
  8781  				Name:      String("n"),
  8782  				Company:   String("c"),
  8783  				Blog:      String("b"),
  8784  				Location:  String("l"),
  8785  				Email:     String("e"),
  8786  			},
  8787  			Parent: &Team{
  8788  				ID:           Int64(1),
  8789  				NodeID:       String("n"),
  8790  				Name:         String("n"),
  8791  				Description:  String("d"),
  8792  				URL:          String("u"),
  8793  				Slug:         String("s"),
  8794  				Permission:   String("p"),
  8795  				Privacy:      String("p"),
  8796  				MembersCount: Int(1),
  8797  				ReposCount:   Int(1),
  8798  			},
  8799  			LDAPDN: String("l"),
  8800  		},
  8801  		Org: &Organization{
  8802  			BillingEmail:                         String("be"),
  8803  			Blog:                                 String("b"),
  8804  			Company:                              String("c"),
  8805  			Email:                                String("e"),
  8806  			TwitterUsername:                      String("tu"),
  8807  			Location:                             String("loc"),
  8808  			Name:                                 String("n"),
  8809  			Description:                          String("d"),
  8810  			IsVerified:                           Bool(true),
  8811  			HasOrganizationProjects:              Bool(true),
  8812  			HasRepositoryProjects:                Bool(true),
  8813  			DefaultRepoPermission:                String("drp"),
  8814  			MembersCanCreateRepos:                Bool(true),
  8815  			MembersCanCreateInternalRepos:        Bool(true),
  8816  			MembersCanCreatePrivateRepos:         Bool(true),
  8817  			MembersCanCreatePublicRepos:          Bool(false),
  8818  			MembersAllowedRepositoryCreationType: String("marct"),
  8819  			MembersCanCreatePages:                Bool(true),
  8820  			MembersCanCreatePublicPages:          Bool(false),
  8821  			MembersCanCreatePrivatePages:         Bool(true),
  8822  		},
  8823  		Sender: &User{
  8824  			Login:     String("l"),
  8825  			ID:        Int64(1),
  8826  			NodeID:    String("n"),
  8827  			URL:       String("u"),
  8828  			ReposURL:  String("r"),
  8829  			EventsURL: String("e"),
  8830  			AvatarURL: String("a"),
  8831  		},
  8832  		Installation: &Installation{
  8833  			ID:       Int64(1),
  8834  			NodeID:   String("nid"),
  8835  			AppID:    Int64(1),
  8836  			AppSlug:  String("as"),
  8837  			TargetID: Int64(1),
  8838  			Account: &User{
  8839  				Login:           String("l"),
  8840  				ID:              Int64(1),
  8841  				URL:             String("u"),
  8842  				AvatarURL:       String("a"),
  8843  				GravatarID:      String("g"),
  8844  				Name:            String("n"),
  8845  				Company:         String("c"),
  8846  				Blog:            String("b"),
  8847  				Location:        String("l"),
  8848  				Email:           String("e"),
  8849  				Hireable:        Bool(true),
  8850  				Bio:             String("b"),
  8851  				TwitterUsername: String("t"),
  8852  				PublicRepos:     Int(1),
  8853  				Followers:       Int(1),
  8854  				Following:       Int(1),
  8855  				CreatedAt:       &Timestamp{referenceTime},
  8856  				SuspendedAt:     &Timestamp{referenceTime},
  8857  			},
  8858  			AccessTokensURL:     String("atu"),
  8859  			RepositoriesURL:     String("ru"),
  8860  			HTMLURL:             String("hu"),
  8861  			TargetType:          String("tt"),
  8862  			SingleFileName:      String("sfn"),
  8863  			RepositorySelection: String("rs"),
  8864  			Events:              []string{"e"},
  8865  			SingleFilePaths:     []string{"s"},
  8866  			Permissions: &InstallationPermissions{
  8867  				Actions:                       String("a"),
  8868  				Administration:                String("ad"),
  8869  				Checks:                        String("c"),
  8870  				Contents:                      String("co"),
  8871  				ContentReferences:             String("cr"),
  8872  				Deployments:                   String("d"),
  8873  				Environments:                  String("e"),
  8874  				Issues:                        String("i"),
  8875  				Metadata:                      String("md"),
  8876  				Members:                       String("m"),
  8877  				OrganizationAdministration:    String("oa"),
  8878  				OrganizationHooks:             String("oh"),
  8879  				OrganizationPlan:              String("op"),
  8880  				OrganizationPreReceiveHooks:   String("opr"),
  8881  				OrganizationProjects:          String("op"),
  8882  				OrganizationSecrets:           String("os"),
  8883  				OrganizationSelfHostedRunners: String("osh"),
  8884  				OrganizationUserBlocking:      String("oub"),
  8885  				Packages:                      String("pkg"),
  8886  				Pages:                         String("pg"),
  8887  				PullRequests:                  String("pr"),
  8888  				RepositoryHooks:               String("rh"),
  8889  				RepositoryProjects:            String("rp"),
  8890  				RepositoryPreReceiveHooks:     String("rprh"),
  8891  				Secrets:                       String("s"),
  8892  				SecretScanningAlerts:          String("ssa"),
  8893  				SecurityEvents:                String("se"),
  8894  				SingleFile:                    String("sf"),
  8895  				Statuses:                      String("s"),
  8896  				TeamDiscussions:               String("td"),
  8897  				VulnerabilityAlerts:           String("va"),
  8898  				Workflows:                     String("w"),
  8899  			},
  8900  			CreatedAt:              &Timestamp{referenceTime},
  8901  			UpdatedAt:              &Timestamp{referenceTime},
  8902  			HasMultipleSingleFiles: Bool(false),
  8903  			SuspendedBy: &User{
  8904  				Login:           String("l"),
  8905  				ID:              Int64(1),
  8906  				URL:             String("u"),
  8907  				AvatarURL:       String("a"),
  8908  				GravatarID:      String("g"),
  8909  				Name:            String("n"),
  8910  				Company:         String("c"),
  8911  				Blog:            String("b"),
  8912  				Location:        String("l"),
  8913  				Email:           String("e"),
  8914  				Hireable:        Bool(true),
  8915  				Bio:             String("b"),
  8916  				TwitterUsername: String("t"),
  8917  				PublicRepos:     Int(1),
  8918  				Followers:       Int(1),
  8919  				Following:       Int(1),
  8920  				CreatedAt:       &Timestamp{referenceTime},
  8921  				SuspendedAt:     &Timestamp{referenceTime},
  8922  			},
  8923  			SuspendedAt: &Timestamp{referenceTime},
  8924  		},
  8925  	}
  8926  
  8927  	want := `{
  8928  		"action": "a",
  8929  		"scope": "s",
  8930  		"member": {
  8931  			"login": "l",
  8932  			"id": 1,
  8933  			"node_id": "n",
  8934  			"avatar_url": "a",
  8935  			"url": "u",
  8936  			"events_url": "e",
  8937  			"repos_url": "r"
  8938  		},
  8939  		"team": {
  8940  			"id": 1,
  8941  			"node_id": "n",
  8942  			"name": "n",
  8943  			"description": "d",
  8944  			"url": "u",
  8945  			"slug": "s",
  8946  			"permission": "p",
  8947  			"privacy": "p",
  8948  			"members_count": 1,
  8949  			"repos_count": 1,
  8950  			"organization": {
  8951  				"login": "l",
  8952  				"id": 1,
  8953  				"node_id": "n",
  8954  				"avatar_url": "a",
  8955  				"html_url": "h",
  8956  				"name": "n",
  8957  				"company": "c",
  8958  				"blog": "b",
  8959  				"location": "l",
  8960  				"email": "e"
  8961  			},
  8962  			"members_url": "m",
  8963  			"repositories_url": "r",
  8964  			"parent": {
  8965  				"id": 1,
  8966  				"node_id": "n",
  8967  				"name": "n",
  8968  				"description": "d",
  8969  				"url": "u",
  8970  				"slug": "s",
  8971  				"permission": "p",
  8972  				"privacy": "p",
  8973  				"members_count": 1,
  8974  				"repos_count": 1
  8975  			},
  8976  			"ldap_dn": "l"
  8977  		},
  8978  		"organization": {
  8979  			"name": "n",
  8980  			"company": "c",
  8981  			"blog": "b",
  8982  			"location": "loc",
  8983  			"email": "e",
  8984  			"twitter_username": "tu",
  8985  			"description": "d",
  8986  			"billing_email": "be",
  8987  			"is_verified": true,
  8988  			"has_organization_projects": true,
  8989  			"has_repository_projects": true,
  8990  			"default_repository_permission": "drp",
  8991  			"members_can_create_repositories": true,
  8992  			"members_can_create_public_repositories": false,
  8993  			"members_can_create_private_repositories": true,
  8994  			"members_can_create_internal_repositories": true,
  8995  			"members_allowed_repository_creation_type": "marct",
  8996  			"members_can_create_pages": true,
  8997  			"members_can_create_public_pages": false,
  8998  			"members_can_create_private_pages": true
  8999  		},
  9000  		"sender": {
  9001  			"login": "l",
  9002  			"id": 1,
  9003  			"node_id": "n",
  9004  			"avatar_url": "a",
  9005  			"url": "u",
  9006  			"events_url": "e",
  9007  			"repos_url": "r"
  9008  		},
  9009  		"installation": {
  9010  			"id": 1,
  9011  			"node_id": "nid",
  9012  			"app_id": 1,
  9013  			"app_slug": "as",
  9014  			"target_id": 1,
  9015  			"account": {
  9016  				"login": "l",
  9017  				"id": 1,
  9018  				"avatar_url": "a",
  9019  				"gravatar_id": "g",
  9020  				"name": "n",
  9021  				"company": "c",
  9022  				"blog": "b",
  9023  				"location": "l",
  9024  				"email": "e",
  9025  				"hireable": true,
  9026  				"bio": "b",
  9027  				"twitter_username": "t",
  9028  				"public_repos": 1,
  9029  				"followers": 1,
  9030  				"following": 1,
  9031  				"created_at": ` + referenceTimeStr + `,
  9032  				"suspended_at": ` + referenceTimeStr + `,
  9033  				"url": "u"
  9034  			},
  9035  			"access_tokens_url": "atu",
  9036  			"repositories_url": "ru",
  9037  			"html_url": "hu",
  9038  			"target_type": "tt",
  9039  			"single_file_name": "sfn",
  9040  			"repository_selection": "rs",
  9041  			"events": [
  9042  				"e"
  9043  			],
  9044  			"single_file_paths": [
  9045  				"s"
  9046  			],
  9047  			"permissions": {
  9048  				"actions": "a",
  9049  				"administration": "ad",
  9050  				"checks": "c",
  9051  				"contents": "co",
  9052  				"content_references": "cr",
  9053  				"deployments": "d",
  9054  				"environments": "e",
  9055  				"issues": "i",
  9056  				"metadata": "md",
  9057  				"members": "m",
  9058  				"organization_administration": "oa",
  9059  				"organization_hooks": "oh",
  9060  				"organization_plan": "op",
  9061  				"organization_pre_receive_hooks": "opr",
  9062  				"organization_projects": "op",
  9063  				"organization_secrets": "os",
  9064  				"organization_self_hosted_runners": "osh",
  9065  				"organization_user_blocking": "oub",
  9066  				"packages": "pkg",
  9067  				"pages": "pg",
  9068  				"pull_requests": "pr",
  9069  				"repository_hooks": "rh",
  9070  				"repository_projects": "rp",
  9071  				"repository_pre_receive_hooks": "rprh",
  9072  				"secrets": "s",
  9073  				"secret_scanning_alerts": "ssa",
  9074  				"security_events": "se",
  9075  				"single_file": "sf",
  9076  				"statuses": "s",
  9077  				"team_discussions": "td",
  9078  				"vulnerability_alerts": "va",
  9079  				"workflows": "w"
  9080  			},
  9081  			"created_at": ` + referenceTimeStr + `,
  9082  			"updated_at": ` + referenceTimeStr + `,
  9083  			"has_multiple_single_files": false,
  9084  			"suspended_by": {
  9085  				"login": "l",
  9086  				"id": 1,
  9087  				"avatar_url": "a",
  9088  				"gravatar_id": "g",
  9089  				"name": "n",
  9090  				"company": "c",
  9091  				"blog": "b",
  9092  				"location": "l",
  9093  				"email": "e",
  9094  				"hireable": true,
  9095  				"bio": "b",
  9096  				"twitter_username": "t",
  9097  				"public_repos": 1,
  9098  				"followers": 1,
  9099  				"following": 1,
  9100  				"created_at": ` + referenceTimeStr + `,
  9101  				"suspended_at": ` + referenceTimeStr + `,
  9102  				"url": "u"
  9103  			},
  9104  			"suspended_at": ` + referenceTimeStr + `
  9105  		}
  9106  	}`
  9107  
  9108  	testJSONMarshal(t, u, want)
  9109  }
  9110  
  9111  func TestMergeGroupEvent_Marshal(t *testing.T) {
  9112  	testJSONMarshal(t, &MergeGroupEvent{}, "{}")
  9113  
  9114  	u := &MergeGroupEvent{
  9115  		Action: String("a"),
  9116  		MergeGroup: &MergeGroup{
  9117  			HeadSHA:    String("hs"),
  9118  			HeadRef:    String("hr"),
  9119  			BaseSHA:    String("bs"),
  9120  			BaseRef:    String("br"),
  9121  			HeadCommit: &Commit{NodeID: String("nid")},
  9122  		},
  9123  		Repo: &Repository{
  9124  			ID:   Int64(1),
  9125  			URL:  String("s"),
  9126  			Name: String("n"),
  9127  		},
  9128  		Org: &Organization{
  9129  			BillingEmail:                         String("be"),
  9130  			Blog:                                 String("b"),
  9131  			Company:                              String("c"),
  9132  			Email:                                String("e"),
  9133  			TwitterUsername:                      String("tu"),
  9134  			Location:                             String("loc"),
  9135  			Name:                                 String("n"),
  9136  			Description:                          String("d"),
  9137  			IsVerified:                           Bool(true),
  9138  			HasOrganizationProjects:              Bool(true),
  9139  			HasRepositoryProjects:                Bool(true),
  9140  			DefaultRepoPermission:                String("drp"),
  9141  			MembersCanCreateRepos:                Bool(true),
  9142  			MembersCanCreateInternalRepos:        Bool(true),
  9143  			MembersCanCreatePrivateRepos:         Bool(true),
  9144  			MembersCanCreatePublicRepos:          Bool(false),
  9145  			MembersAllowedRepositoryCreationType: String("marct"),
  9146  			MembersCanCreatePages:                Bool(true),
  9147  			MembersCanCreatePublicPages:          Bool(false),
  9148  			MembersCanCreatePrivatePages:         Bool(true),
  9149  		},
  9150  		Sender: &User{
  9151  			Login:     String("l"),
  9152  			ID:        Int64(1),
  9153  			NodeID:    String("n"),
  9154  			URL:       String("u"),
  9155  			ReposURL:  String("r"),
  9156  			EventsURL: String("e"),
  9157  			AvatarURL: String("a"),
  9158  		},
  9159  		Installation: &Installation{
  9160  			ID:       Int64(1),
  9161  			NodeID:   String("nid"),
  9162  			AppID:    Int64(1),
  9163  			AppSlug:  String("as"),
  9164  			TargetID: Int64(1),
  9165  			Account: &User{
  9166  				Login:           String("l"),
  9167  				ID:              Int64(1),
  9168  				URL:             String("u"),
  9169  				AvatarURL:       String("a"),
  9170  				GravatarID:      String("g"),
  9171  				Name:            String("n"),
  9172  				Company:         String("c"),
  9173  				Blog:            String("b"),
  9174  				Location:        String("l"),
  9175  				Email:           String("e"),
  9176  				Hireable:        Bool(true),
  9177  				Bio:             String("b"),
  9178  				TwitterUsername: String("t"),
  9179  				PublicRepos:     Int(1),
  9180  				Followers:       Int(1),
  9181  				Following:       Int(1),
  9182  				CreatedAt:       &Timestamp{referenceTime},
  9183  				SuspendedAt:     &Timestamp{referenceTime},
  9184  			},
  9185  			AccessTokensURL:     String("atu"),
  9186  			RepositoriesURL:     String("ru"),
  9187  			HTMLURL:             String("hu"),
  9188  			TargetType:          String("tt"),
  9189  			SingleFileName:      String("sfn"),
  9190  			RepositorySelection: String("rs"),
  9191  			Events:              []string{"e"},
  9192  			SingleFilePaths:     []string{"s"},
  9193  			Permissions: &InstallationPermissions{
  9194  				Actions:                       String("a"),
  9195  				Administration:                String("ad"),
  9196  				Checks:                        String("c"),
  9197  				Contents:                      String("co"),
  9198  				ContentReferences:             String("cr"),
  9199  				Deployments:                   String("d"),
  9200  				Environments:                  String("e"),
  9201  				Issues:                        String("i"),
  9202  				Metadata:                      String("md"),
  9203  				Members:                       String("m"),
  9204  				OrganizationAdministration:    String("oa"),
  9205  				OrganizationHooks:             String("oh"),
  9206  				OrganizationPlan:              String("op"),
  9207  				OrganizationPreReceiveHooks:   String("opr"),
  9208  				OrganizationProjects:          String("op"),
  9209  				OrganizationSecrets:           String("os"),
  9210  				OrganizationSelfHostedRunners: String("osh"),
  9211  				OrganizationUserBlocking:      String("oub"),
  9212  				Packages:                      String("pkg"),
  9213  				Pages:                         String("pg"),
  9214  				PullRequests:                  String("pr"),
  9215  				RepositoryHooks:               String("rh"),
  9216  				RepositoryProjects:            String("rp"),
  9217  				RepositoryPreReceiveHooks:     String("rprh"),
  9218  				Secrets:                       String("s"),
  9219  				SecretScanningAlerts:          String("ssa"),
  9220  				SecurityEvents:                String("se"),
  9221  				SingleFile:                    String("sf"),
  9222  				Statuses:                      String("s"),
  9223  				TeamDiscussions:               String("td"),
  9224  				VulnerabilityAlerts:           String("va"),
  9225  				Workflows:                     String("w"),
  9226  			},
  9227  			CreatedAt:              &Timestamp{referenceTime},
  9228  			UpdatedAt:              &Timestamp{referenceTime},
  9229  			HasMultipleSingleFiles: Bool(false),
  9230  			SuspendedBy: &User{
  9231  				Login:           String("l"),
  9232  				ID:              Int64(1),
  9233  				URL:             String("u"),
  9234  				AvatarURL:       String("a"),
  9235  				GravatarID:      String("g"),
  9236  				Name:            String("n"),
  9237  				Company:         String("c"),
  9238  				Blog:            String("b"),
  9239  				Location:        String("l"),
  9240  				Email:           String("e"),
  9241  				Hireable:        Bool(true),
  9242  				Bio:             String("b"),
  9243  				TwitterUsername: String("t"),
  9244  				PublicRepos:     Int(1),
  9245  				Followers:       Int(1),
  9246  				Following:       Int(1),
  9247  				CreatedAt:       &Timestamp{referenceTime},
  9248  				SuspendedAt:     &Timestamp{referenceTime},
  9249  			},
  9250  			SuspendedAt: &Timestamp{referenceTime},
  9251  		},
  9252  	}
  9253  
  9254  	want := `{
  9255  		"action": "a",
  9256  		"merge_group": {
  9257  			"head_sha": "hs",
  9258  			"head_ref": "hr",
  9259  			"base_sha": "bs",
  9260  			"base_ref": "br",
  9261  			"head_commit": {
  9262  				"node_id": "nid"
  9263  			}
  9264  		},
  9265  		"repository": {
  9266  			"id": 1,
  9267  			"name": "n",
  9268  			"url": "s"
  9269  		},
  9270  		"organization": {
  9271  			"name": "n",
  9272  			"company": "c",
  9273  			"blog": "b",
  9274  			"location": "loc",
  9275  			"email": "e",
  9276  			"twitter_username": "tu",
  9277  			"description": "d",
  9278  			"billing_email": "be",
  9279  			"is_verified": true,
  9280  			"has_organization_projects": true,
  9281  			"has_repository_projects": true,
  9282  			"default_repository_permission": "drp",
  9283  			"members_can_create_repositories": true,
  9284  			"members_can_create_public_repositories": false,
  9285  			"members_can_create_private_repositories": true,
  9286  			"members_can_create_internal_repositories": true,
  9287  			"members_allowed_repository_creation_type": "marct",
  9288  			"members_can_create_pages": true,
  9289  			"members_can_create_public_pages": false,
  9290  			"members_can_create_private_pages": true
  9291  		},
  9292  		"sender": {
  9293  			"login": "l",
  9294  			"id": 1,
  9295  			"node_id": "n",
  9296  			"avatar_url": "a",
  9297  			"url": "u",
  9298  			"events_url": "e",
  9299  			"repos_url": "r"
  9300  		},
  9301  		"installation": {
  9302  			"id": 1,
  9303  			"node_id": "nid",
  9304  			"app_id": 1,
  9305  			"app_slug": "as",
  9306  			"target_id": 1,
  9307  			"account": {
  9308  				"login": "l",
  9309  				"id": 1,
  9310  				"avatar_url": "a",
  9311  				"gravatar_id": "g",
  9312  				"name": "n",
  9313  				"company": "c",
  9314  				"blog": "b",
  9315  				"location": "l",
  9316  				"email": "e",
  9317  				"hireable": true,
  9318  				"bio": "b",
  9319  				"twitter_username": "t",
  9320  				"public_repos": 1,
  9321  				"followers": 1,
  9322  				"following": 1,
  9323  				"created_at": ` + referenceTimeStr + `,
  9324  				"suspended_at": ` + referenceTimeStr + `,
  9325  				"url": "u"
  9326  			},
  9327  			"access_tokens_url": "atu",
  9328  			"repositories_url": "ru",
  9329  			"html_url": "hu",
  9330  			"target_type": "tt",
  9331  			"single_file_name": "sfn",
  9332  			"repository_selection": "rs",
  9333  			"events": [
  9334  				"e"
  9335  			],
  9336  			"single_file_paths": [
  9337  				"s"
  9338  			],
  9339  			"permissions": {
  9340  				"actions": "a",
  9341  				"administration": "ad",
  9342  				"checks": "c",
  9343  				"contents": "co",
  9344  				"content_references": "cr",
  9345  				"deployments": "d",
  9346  				"environments": "e",
  9347  				"issues": "i",
  9348  				"metadata": "md",
  9349  				"members": "m",
  9350  				"organization_administration": "oa",
  9351  				"organization_hooks": "oh",
  9352  				"organization_plan": "op",
  9353  				"organization_pre_receive_hooks": "opr",
  9354  				"organization_projects": "op",
  9355  				"organization_secrets": "os",
  9356  				"organization_self_hosted_runners": "osh",
  9357  				"organization_user_blocking": "oub",
  9358  				"packages": "pkg",
  9359  				"pages": "pg",
  9360  				"pull_requests": "pr",
  9361  				"repository_hooks": "rh",
  9362  				"repository_projects": "rp",
  9363  				"repository_pre_receive_hooks": "rprh",
  9364  				"secrets": "s",
  9365  				"secret_scanning_alerts": "ssa",
  9366  				"security_events": "se",
  9367  				"single_file": "sf",
  9368  				"statuses": "s",
  9369  				"team_discussions": "td",
  9370  				"vulnerability_alerts": "va",
  9371  				"workflows": "w"
  9372  			},
  9373  			"created_at": ` + referenceTimeStr + `,
  9374  			"updated_at": ` + referenceTimeStr + `,
  9375  			"has_multiple_single_files": false,
  9376  			"suspended_by": {
  9377  				"login": "l",
  9378  				"id": 1,
  9379  				"avatar_url": "a",
  9380  				"gravatar_id": "g",
  9381  				"name": "n",
  9382  				"company": "c",
  9383  				"blog": "b",
  9384  				"location": "l",
  9385  				"email": "e",
  9386  				"hireable": true,
  9387  				"bio": "b",
  9388  				"twitter_username": "t",
  9389  				"public_repos": 1,
  9390  				"followers": 1,
  9391  				"following": 1,
  9392  				"created_at": ` + referenceTimeStr + `,
  9393  				"suspended_at": ` + referenceTimeStr + `,
  9394  				"url": "u"
  9395  			},
  9396  			"suspended_at": ` + referenceTimeStr + `
  9397  		}
  9398  	}`
  9399  
  9400  	testJSONMarshal(t, u, want)
  9401  }
  9402  
  9403  func TestOrgBlockEvent_Marshal(t *testing.T) {
  9404  	testJSONMarshal(t, &OrgBlockEvent{}, "{}")
  9405  
  9406  	u := &OrgBlockEvent{
  9407  		Action: String("a"),
  9408  		BlockedUser: &User{
  9409  			Login:     String("l"),
  9410  			ID:        Int64(1),
  9411  			NodeID:    String("n"),
  9412  			URL:       String("u"),
  9413  			ReposURL:  String("r"),
  9414  			EventsURL: String("e"),
  9415  			AvatarURL: String("a"),
  9416  		},
  9417  		Organization: &Organization{
  9418  			BillingEmail:                         String("be"),
  9419  			Blog:                                 String("b"),
  9420  			Company:                              String("c"),
  9421  			Email:                                String("e"),
  9422  			TwitterUsername:                      String("tu"),
  9423  			Location:                             String("loc"),
  9424  			Name:                                 String("n"),
  9425  			Description:                          String("d"),
  9426  			IsVerified:                           Bool(true),
  9427  			HasOrganizationProjects:              Bool(true),
  9428  			HasRepositoryProjects:                Bool(true),
  9429  			DefaultRepoPermission:                String("drp"),
  9430  			MembersCanCreateRepos:                Bool(true),
  9431  			MembersCanCreateInternalRepos:        Bool(true),
  9432  			MembersCanCreatePrivateRepos:         Bool(true),
  9433  			MembersCanCreatePublicRepos:          Bool(false),
  9434  			MembersAllowedRepositoryCreationType: String("marct"),
  9435  			MembersCanCreatePages:                Bool(true),
  9436  			MembersCanCreatePublicPages:          Bool(false),
  9437  			MembersCanCreatePrivatePages:         Bool(true),
  9438  		},
  9439  		Sender: &User{
  9440  			Login:     String("l"),
  9441  			ID:        Int64(1),
  9442  			NodeID:    String("n"),
  9443  			URL:       String("u"),
  9444  			ReposURL:  String("r"),
  9445  			EventsURL: String("e"),
  9446  			AvatarURL: String("a"),
  9447  		},
  9448  		Installation: &Installation{
  9449  			ID:       Int64(1),
  9450  			NodeID:   String("nid"),
  9451  			AppID:    Int64(1),
  9452  			AppSlug:  String("as"),
  9453  			TargetID: Int64(1),
  9454  			Account: &User{
  9455  				Login:           String("l"),
  9456  				ID:              Int64(1),
  9457  				URL:             String("u"),
  9458  				AvatarURL:       String("a"),
  9459  				GravatarID:      String("g"),
  9460  				Name:            String("n"),
  9461  				Company:         String("c"),
  9462  				Blog:            String("b"),
  9463  				Location:        String("l"),
  9464  				Email:           String("e"),
  9465  				Hireable:        Bool(true),
  9466  				Bio:             String("b"),
  9467  				TwitterUsername: String("t"),
  9468  				PublicRepos:     Int(1),
  9469  				Followers:       Int(1),
  9470  				Following:       Int(1),
  9471  				CreatedAt:       &Timestamp{referenceTime},
  9472  				SuspendedAt:     &Timestamp{referenceTime},
  9473  			},
  9474  			AccessTokensURL:     String("atu"),
  9475  			RepositoriesURL:     String("ru"),
  9476  			HTMLURL:             String("hu"),
  9477  			TargetType:          String("tt"),
  9478  			SingleFileName:      String("sfn"),
  9479  			RepositorySelection: String("rs"),
  9480  			Events:              []string{"e"},
  9481  			SingleFilePaths:     []string{"s"},
  9482  			Permissions: &InstallationPermissions{
  9483  				Actions:                       String("a"),
  9484  				Administration:                String("ad"),
  9485  				Checks:                        String("c"),
  9486  				Contents:                      String("co"),
  9487  				ContentReferences:             String("cr"),
  9488  				Deployments:                   String("d"),
  9489  				Environments:                  String("e"),
  9490  				Issues:                        String("i"),
  9491  				Metadata:                      String("md"),
  9492  				Members:                       String("m"),
  9493  				OrganizationAdministration:    String("oa"),
  9494  				OrganizationHooks:             String("oh"),
  9495  				OrganizationPlan:              String("op"),
  9496  				OrganizationPreReceiveHooks:   String("opr"),
  9497  				OrganizationProjects:          String("op"),
  9498  				OrganizationSecrets:           String("os"),
  9499  				OrganizationSelfHostedRunners: String("osh"),
  9500  				OrganizationUserBlocking:      String("oub"),
  9501  				Packages:                      String("pkg"),
  9502  				Pages:                         String("pg"),
  9503  				PullRequests:                  String("pr"),
  9504  				RepositoryHooks:               String("rh"),
  9505  				RepositoryProjects:            String("rp"),
  9506  				RepositoryPreReceiveHooks:     String("rprh"),
  9507  				Secrets:                       String("s"),
  9508  				SecretScanningAlerts:          String("ssa"),
  9509  				SecurityEvents:                String("se"),
  9510  				SingleFile:                    String("sf"),
  9511  				Statuses:                      String("s"),
  9512  				TeamDiscussions:               String("td"),
  9513  				VulnerabilityAlerts:           String("va"),
  9514  				Workflows:                     String("w"),
  9515  			},
  9516  			CreatedAt:              &Timestamp{referenceTime},
  9517  			UpdatedAt:              &Timestamp{referenceTime},
  9518  			HasMultipleSingleFiles: Bool(false),
  9519  			SuspendedBy: &User{
  9520  				Login:           String("l"),
  9521  				ID:              Int64(1),
  9522  				URL:             String("u"),
  9523  				AvatarURL:       String("a"),
  9524  				GravatarID:      String("g"),
  9525  				Name:            String("n"),
  9526  				Company:         String("c"),
  9527  				Blog:            String("b"),
  9528  				Location:        String("l"),
  9529  				Email:           String("e"),
  9530  				Hireable:        Bool(true),
  9531  				Bio:             String("b"),
  9532  				TwitterUsername: String("t"),
  9533  				PublicRepos:     Int(1),
  9534  				Followers:       Int(1),
  9535  				Following:       Int(1),
  9536  				CreatedAt:       &Timestamp{referenceTime},
  9537  				SuspendedAt:     &Timestamp{referenceTime},
  9538  			},
  9539  			SuspendedAt: &Timestamp{referenceTime},
  9540  		},
  9541  	}
  9542  
  9543  	want := `{
  9544  		"action": "a",
  9545  		"blocked_user": {
  9546  			"login": "l",
  9547  			"id": 1,
  9548  			"node_id": "n",
  9549  			"avatar_url": "a",
  9550  			"url": "u",
  9551  			"events_url": "e",
  9552  			"repos_url": "r"
  9553  		},
  9554  		"organization": {
  9555  			"name": "n",
  9556  			"company": "c",
  9557  			"blog": "b",
  9558  			"location": "loc",
  9559  			"email": "e",
  9560  			"twitter_username": "tu",
  9561  			"description": "d",
  9562  			"billing_email": "be",
  9563  			"is_verified": true,
  9564  			"has_organization_projects": true,
  9565  			"has_repository_projects": true,
  9566  			"default_repository_permission": "drp",
  9567  			"members_can_create_repositories": true,
  9568  			"members_can_create_public_repositories": false,
  9569  			"members_can_create_private_repositories": true,
  9570  			"members_can_create_internal_repositories": true,
  9571  			"members_allowed_repository_creation_type": "marct",
  9572  			"members_can_create_pages": true,
  9573  			"members_can_create_public_pages": false,
  9574  			"members_can_create_private_pages": true
  9575  		},
  9576  		"sender": {
  9577  			"login": "l",
  9578  			"id": 1,
  9579  			"node_id": "n",
  9580  			"avatar_url": "a",
  9581  			"url": "u",
  9582  			"events_url": "e",
  9583  			"repos_url": "r"
  9584  		},
  9585  		"installation": {
  9586  			"id": 1,
  9587  			"node_id": "nid",
  9588  			"app_id": 1,
  9589  			"app_slug": "as",
  9590  			"target_id": 1,
  9591  			"account": {
  9592  				"login": "l",
  9593  				"id": 1,
  9594  				"avatar_url": "a",
  9595  				"gravatar_id": "g",
  9596  				"name": "n",
  9597  				"company": "c",
  9598  				"blog": "b",
  9599  				"location": "l",
  9600  				"email": "e",
  9601  				"hireable": true,
  9602  				"bio": "b",
  9603  				"twitter_username": "t",
  9604  				"public_repos": 1,
  9605  				"followers": 1,
  9606  				"following": 1,
  9607  				"created_at": ` + referenceTimeStr + `,
  9608  				"suspended_at": ` + referenceTimeStr + `,
  9609  				"url": "u"
  9610  			},
  9611  			"access_tokens_url": "atu",
  9612  			"repositories_url": "ru",
  9613  			"html_url": "hu",
  9614  			"target_type": "tt",
  9615  			"single_file_name": "sfn",
  9616  			"repository_selection": "rs",
  9617  			"events": [
  9618  				"e"
  9619  			],
  9620  			"single_file_paths": [
  9621  				"s"
  9622  			],
  9623  			"permissions": {
  9624  				"actions": "a",
  9625  				"administration": "ad",
  9626  				"checks": "c",
  9627  				"contents": "co",
  9628  				"content_references": "cr",
  9629  				"deployments": "d",
  9630  				"environments": "e",
  9631  				"issues": "i",
  9632  				"metadata": "md",
  9633  				"members": "m",
  9634  				"organization_administration": "oa",
  9635  				"organization_hooks": "oh",
  9636  				"organization_plan": "op",
  9637  				"organization_pre_receive_hooks": "opr",
  9638  				"organization_projects": "op",
  9639  				"organization_secrets": "os",
  9640  				"organization_self_hosted_runners": "osh",
  9641  				"organization_user_blocking": "oub",
  9642  				"packages": "pkg",
  9643  				"pages": "pg",
  9644  				"pull_requests": "pr",
  9645  				"repository_hooks": "rh",
  9646  				"repository_projects": "rp",
  9647  				"repository_pre_receive_hooks": "rprh",
  9648  				"secrets": "s",
  9649  				"secret_scanning_alerts": "ssa",
  9650  				"security_events": "se",
  9651  				"single_file": "sf",
  9652  				"statuses": "s",
  9653  				"team_discussions": "td",
  9654  				"vulnerability_alerts": "va",
  9655  				"workflows": "w"
  9656  			},
  9657  			"created_at": ` + referenceTimeStr + `,
  9658  			"updated_at": ` + referenceTimeStr + `,
  9659  			"has_multiple_single_files": false,
  9660  			"suspended_by": {
  9661  				"login": "l",
  9662  				"id": 1,
  9663  				"avatar_url": "a",
  9664  				"gravatar_id": "g",
  9665  				"name": "n",
  9666  				"company": "c",
  9667  				"blog": "b",
  9668  				"location": "l",
  9669  				"email": "e",
  9670  				"hireable": true,
  9671  				"bio": "b",
  9672  				"twitter_username": "t",
  9673  				"public_repos": 1,
  9674  				"followers": 1,
  9675  				"following": 1,
  9676  				"created_at": ` + referenceTimeStr + `,
  9677  				"suspended_at": ` + referenceTimeStr + `,
  9678  				"url": "u"
  9679  			},
  9680  			"suspended_at": ` + referenceTimeStr + `
  9681  		}
  9682  	}`
  9683  
  9684  	testJSONMarshal(t, u, want)
  9685  }
  9686  
  9687  func TestGollumEvent_Marshal(t *testing.T) {
  9688  	testJSONMarshal(t, &GollumEvent{}, "{}")
  9689  
  9690  	u := &GollumEvent{
  9691  		Pages: []*Page{
  9692  			{
  9693  				PageName: String("pn"),
  9694  				Title:    String("t"),
  9695  				Summary:  String("s"),
  9696  				Action:   String("a"),
  9697  				SHA:      String("sha"),
  9698  				HTMLURL:  String("hu"),
  9699  			},
  9700  		},
  9701  		Repo: &Repository{
  9702  			ID:   Int64(1),
  9703  			URL:  String("s"),
  9704  			Name: String("n"),
  9705  		},
  9706  		Sender: &User{
  9707  			Login:     String("l"),
  9708  			ID:        Int64(1),
  9709  			NodeID:    String("n"),
  9710  			URL:       String("u"),
  9711  			ReposURL:  String("r"),
  9712  			EventsURL: String("e"),
  9713  			AvatarURL: String("a"),
  9714  		},
  9715  		Installation: &Installation{
  9716  			ID:       Int64(1),
  9717  			NodeID:   String("nid"),
  9718  			AppID:    Int64(1),
  9719  			AppSlug:  String("as"),
  9720  			TargetID: Int64(1),
  9721  			Account: &User{
  9722  				Login:           String("l"),
  9723  				ID:              Int64(1),
  9724  				URL:             String("u"),
  9725  				AvatarURL:       String("a"),
  9726  				GravatarID:      String("g"),
  9727  				Name:            String("n"),
  9728  				Company:         String("c"),
  9729  				Blog:            String("b"),
  9730  				Location:        String("l"),
  9731  				Email:           String("e"),
  9732  				Hireable:        Bool(true),
  9733  				Bio:             String("b"),
  9734  				TwitterUsername: String("t"),
  9735  				PublicRepos:     Int(1),
  9736  				Followers:       Int(1),
  9737  				Following:       Int(1),
  9738  				CreatedAt:       &Timestamp{referenceTime},
  9739  				SuspendedAt:     &Timestamp{referenceTime},
  9740  			},
  9741  			AccessTokensURL:     String("atu"),
  9742  			RepositoriesURL:     String("ru"),
  9743  			HTMLURL:             String("hu"),
  9744  			TargetType:          String("tt"),
  9745  			SingleFileName:      String("sfn"),
  9746  			RepositorySelection: String("rs"),
  9747  			Events:              []string{"e"},
  9748  			SingleFilePaths:     []string{"s"},
  9749  			Permissions: &InstallationPermissions{
  9750  				Actions:                       String("a"),
  9751  				Administration:                String("ad"),
  9752  				Checks:                        String("c"),
  9753  				Contents:                      String("co"),
  9754  				ContentReferences:             String("cr"),
  9755  				Deployments:                   String("d"),
  9756  				Environments:                  String("e"),
  9757  				Issues:                        String("i"),
  9758  				Metadata:                      String("md"),
  9759  				Members:                       String("m"),
  9760  				OrganizationAdministration:    String("oa"),
  9761  				OrganizationHooks:             String("oh"),
  9762  				OrganizationPlan:              String("op"),
  9763  				OrganizationPreReceiveHooks:   String("opr"),
  9764  				OrganizationProjects:          String("op"),
  9765  				OrganizationSecrets:           String("os"),
  9766  				OrganizationSelfHostedRunners: String("osh"),
  9767  				OrganizationUserBlocking:      String("oub"),
  9768  				Packages:                      String("pkg"),
  9769  				Pages:                         String("pg"),
  9770  				PullRequests:                  String("pr"),
  9771  				RepositoryHooks:               String("rh"),
  9772  				RepositoryProjects:            String("rp"),
  9773  				RepositoryPreReceiveHooks:     String("rprh"),
  9774  				Secrets:                       String("s"),
  9775  				SecretScanningAlerts:          String("ssa"),
  9776  				SecurityEvents:                String("se"),
  9777  				SingleFile:                    String("sf"),
  9778  				Statuses:                      String("s"),
  9779  				TeamDiscussions:               String("td"),
  9780  				VulnerabilityAlerts:           String("va"),
  9781  				Workflows:                     String("w"),
  9782  			},
  9783  			CreatedAt:              &Timestamp{referenceTime},
  9784  			UpdatedAt:              &Timestamp{referenceTime},
  9785  			HasMultipleSingleFiles: Bool(false),
  9786  			SuspendedBy: &User{
  9787  				Login:           String("l"),
  9788  				ID:              Int64(1),
  9789  				URL:             String("u"),
  9790  				AvatarURL:       String("a"),
  9791  				GravatarID:      String("g"),
  9792  				Name:            String("n"),
  9793  				Company:         String("c"),
  9794  				Blog:            String("b"),
  9795  				Location:        String("l"),
  9796  				Email:           String("e"),
  9797  				Hireable:        Bool(true),
  9798  				Bio:             String("b"),
  9799  				TwitterUsername: String("t"),
  9800  				PublicRepos:     Int(1),
  9801  				Followers:       Int(1),
  9802  				Following:       Int(1),
  9803  				CreatedAt:       &Timestamp{referenceTime},
  9804  				SuspendedAt:     &Timestamp{referenceTime},
  9805  			},
  9806  			SuspendedAt: &Timestamp{referenceTime},
  9807  		},
  9808  	}
  9809  
  9810  	want := `{
  9811  		"pages": [
  9812  			{
  9813  				"page_name": "pn",
  9814  				"title": "t",
  9815  				"summary": "s",
  9816  				"action": "a",
  9817  				"sha": "sha",
  9818  				"html_url": "hu"
  9819  			}
  9820  		],
  9821  		"repository": {
  9822  			"id": 1,
  9823  			"name": "n",
  9824  			"url": "s"
  9825  		},
  9826  		"sender": {
  9827  			"login": "l",
  9828  			"id": 1,
  9829  			"node_id": "n",
  9830  			"avatar_url": "a",
  9831  			"url": "u",
  9832  			"events_url": "e",
  9833  			"repos_url": "r"
  9834  		},
  9835  		"installation": {
  9836  			"id": 1,
  9837  			"node_id": "nid",
  9838  			"app_id": 1,
  9839  			"app_slug": "as",
  9840  			"target_id": 1,
  9841  			"account": {
  9842  				"login": "l",
  9843  				"id": 1,
  9844  				"avatar_url": "a",
  9845  				"gravatar_id": "g",
  9846  				"name": "n",
  9847  				"company": "c",
  9848  				"blog": "b",
  9849  				"location": "l",
  9850  				"email": "e",
  9851  				"hireable": true,
  9852  				"bio": "b",
  9853  				"twitter_username": "t",
  9854  				"public_repos": 1,
  9855  				"followers": 1,
  9856  				"following": 1,
  9857  				"created_at": ` + referenceTimeStr + `,
  9858  				"suspended_at": ` + referenceTimeStr + `,
  9859  				"url": "u"
  9860  			},
  9861  			"access_tokens_url": "atu",
  9862  			"repositories_url": "ru",
  9863  			"html_url": "hu",
  9864  			"target_type": "tt",
  9865  			"single_file_name": "sfn",
  9866  			"repository_selection": "rs",
  9867  			"events": [
  9868  				"e"
  9869  			],
  9870  			"single_file_paths": [
  9871  				"s"
  9872  			],
  9873  			"permissions": {
  9874  				"actions": "a",
  9875  				"administration": "ad",
  9876  				"checks": "c",
  9877  				"contents": "co",
  9878  				"content_references": "cr",
  9879  				"deployments": "d",
  9880  				"environments": "e",
  9881  				"issues": "i",
  9882  				"metadata": "md",
  9883  				"members": "m",
  9884  				"organization_administration": "oa",
  9885  				"organization_hooks": "oh",
  9886  				"organization_plan": "op",
  9887  				"organization_pre_receive_hooks": "opr",
  9888  				"organization_projects": "op",
  9889  				"organization_secrets": "os",
  9890  				"organization_self_hosted_runners": "osh",
  9891  				"organization_user_blocking": "oub",
  9892  				"packages": "pkg",
  9893  				"pages": "pg",
  9894  				"pull_requests": "pr",
  9895  				"repository_hooks": "rh",
  9896  				"repository_projects": "rp",
  9897  				"repository_pre_receive_hooks": "rprh",
  9898  				"secrets": "s",
  9899  				"secret_scanning_alerts": "ssa",
  9900  				"security_events": "se",
  9901  				"single_file": "sf",
  9902  				"statuses": "s",
  9903  				"team_discussions": "td",
  9904  				"vulnerability_alerts": "va",
  9905  				"workflows": "w"
  9906  			},
  9907  			"created_at": ` + referenceTimeStr + `,
  9908  			"updated_at": ` + referenceTimeStr + `,
  9909  			"has_multiple_single_files": false,
  9910  			"suspended_by": {
  9911  				"login": "l",
  9912  				"id": 1,
  9913  				"avatar_url": "a",
  9914  				"gravatar_id": "g",
  9915  				"name": "n",
  9916  				"company": "c",
  9917  				"blog": "b",
  9918  				"location": "l",
  9919  				"email": "e",
  9920  				"hireable": true,
  9921  				"bio": "b",
  9922  				"twitter_username": "t",
  9923  				"public_repos": 1,
  9924  				"followers": 1,
  9925  				"following": 1,
  9926  				"created_at": ` + referenceTimeStr + `,
  9927  				"suspended_at": ` + referenceTimeStr + `,
  9928  				"url": "u"
  9929  			},
  9930  			"suspended_at": ` + referenceTimeStr + `
  9931  		}
  9932  	}`
  9933  
  9934  	testJSONMarshal(t, u, want)
  9935  }
  9936  
  9937  func TestWorkflowRunEvent_Marshal(t *testing.T) {
  9938  	testJSONMarshal(t, &WorkflowRunEvent{}, "{}")
  9939  
  9940  	u := &WorkflowRunEvent{
  9941  		Action: String("a"),
  9942  		Workflow: &Workflow{
  9943  			ID:        Int64(1),
  9944  			NodeID:    String("nid"),
  9945  			Name:      String("n"),
  9946  			Path:      String("p"),
  9947  			State:     String("s"),
  9948  			CreatedAt: &Timestamp{referenceTime},
  9949  			UpdatedAt: &Timestamp{referenceTime},
  9950  			URL:       String("u"),
  9951  			HTMLURL:   String("h"),
  9952  			BadgeURL:  String("b"),
  9953  		},
  9954  		WorkflowRun: &WorkflowRun{
  9955  			ID:         Int64(1),
  9956  			Name:       String("n"),
  9957  			NodeID:     String("nid"),
  9958  			HeadBranch: String("hb"),
  9959  			HeadSHA:    String("hs"),
  9960  			RunNumber:  Int(1),
  9961  			RunAttempt: Int(1),
  9962  			Event:      String("e"),
  9963  			Status:     String("s"),
  9964  			Conclusion: String("c"),
  9965  			WorkflowID: Int64(1),
  9966  			URL:        String("u"),
  9967  			HTMLURL:    String("h"),
  9968  			PullRequests: []*PullRequest{
  9969  				{
  9970  					URL:    String("u"),
  9971  					ID:     Int64(1),
  9972  					Number: Int(1),
  9973  					Head: &PullRequestBranch{
  9974  						Ref: String("r"),
  9975  						SHA: String("s"),
  9976  						Repo: &Repository{
  9977  							ID:   Int64(1),
  9978  							URL:  String("s"),
  9979  							Name: String("n"),
  9980  						},
  9981  					},
  9982  					Base: &PullRequestBranch{
  9983  						Ref: String("r"),
  9984  						SHA: String("s"),
  9985  						Repo: &Repository{
  9986  							ID:   Int64(1),
  9987  							URL:  String("u"),
  9988  							Name: String("n"),
  9989  						},
  9990  					},
  9991  				},
  9992  			},
  9993  			CreatedAt:          &Timestamp{referenceTime},
  9994  			UpdatedAt:          &Timestamp{referenceTime},
  9995  			RunStartedAt:       &Timestamp{referenceTime},
  9996  			JobsURL:            String("j"),
  9997  			LogsURL:            String("l"),
  9998  			CheckSuiteURL:      String("c"),
  9999  			ArtifactsURL:       String("a"),
 10000  			CancelURL:          String("c"),
 10001  			RerunURL:           String("r"),
 10002  			PreviousAttemptURL: String("p"),
 10003  			HeadCommit: &HeadCommit{
 10004  				Message: String("m"),
 10005  				Author: &CommitAuthor{
 10006  					Name:  String("n"),
 10007  					Email: String("e"),
 10008  					Login: String("l"),
 10009  				},
 10010  				URL:       String("u"),
 10011  				Distinct:  Bool(false),
 10012  				SHA:       String("s"),
 10013  				ID:        String("i"),
 10014  				TreeID:    String("tid"),
 10015  				Timestamp: &Timestamp{referenceTime},
 10016  				Committer: &CommitAuthor{
 10017  					Name:  String("n"),
 10018  					Email: String("e"),
 10019  					Login: String("l"),
 10020  				},
 10021  			},
 10022  			WorkflowURL: String("w"),
 10023  			Repository: &Repository{
 10024  				ID:   Int64(1),
 10025  				URL:  String("u"),
 10026  				Name: String("n"),
 10027  			},
 10028  			HeadRepository: &Repository{
 10029  				ID:   Int64(1),
 10030  				URL:  String("u"),
 10031  				Name: String("n"),
 10032  			},
 10033  		},
 10034  		Org: &Organization{
 10035  			BillingEmail:                         String("be"),
 10036  			Blog:                                 String("b"),
 10037  			Company:                              String("c"),
 10038  			Email:                                String("e"),
 10039  			TwitterUsername:                      String("tu"),
 10040  			Location:                             String("loc"),
 10041  			Name:                                 String("n"),
 10042  			Description:                          String("d"),
 10043  			IsVerified:                           Bool(true),
 10044  			HasOrganizationProjects:              Bool(true),
 10045  			HasRepositoryProjects:                Bool(true),
 10046  			DefaultRepoPermission:                String("drp"),
 10047  			MembersCanCreateRepos:                Bool(true),
 10048  			MembersCanCreateInternalRepos:        Bool(true),
 10049  			MembersCanCreatePrivateRepos:         Bool(true),
 10050  			MembersCanCreatePublicRepos:          Bool(false),
 10051  			MembersAllowedRepositoryCreationType: String("marct"),
 10052  			MembersCanCreatePages:                Bool(true),
 10053  			MembersCanCreatePublicPages:          Bool(false),
 10054  			MembersCanCreatePrivatePages:         Bool(true),
 10055  		},
 10056  		Repo: &Repository{
 10057  			ID:   Int64(1),
 10058  			URL:  String("s"),
 10059  			Name: String("n"),
 10060  		},
 10061  		Sender: &User{
 10062  			Login:     String("l"),
 10063  			ID:        Int64(1),
 10064  			NodeID:    String("n"),
 10065  			URL:       String("u"),
 10066  			ReposURL:  String("r"),
 10067  			EventsURL: String("e"),
 10068  			AvatarURL: String("a"),
 10069  		},
 10070  	}
 10071  
 10072  	want := `{
 10073  		"action": "a",
 10074  		"workflow": {
 10075  			"id": 1,
 10076  			"node_id": "nid",
 10077  			"name": "n",
 10078  			"path": "p",
 10079  			"state": "s",
 10080  			"created_at": ` + referenceTimeStr + `,
 10081  			"updated_at": ` + referenceTimeStr + `,
 10082  			"url": "u",
 10083  			"html_url": "h",
 10084  			"badge_url": "b"
 10085  		},
 10086  		"workflow_run": {
 10087  			"id": 1,
 10088  			"name": "n",
 10089  			"node_id": "nid",
 10090  			"head_branch": "hb",
 10091  			"head_sha": "hs",
 10092  			"run_number": 1,
 10093  			"run_attempt": 1,
 10094  			"event": "e",
 10095  			"status": "s",
 10096  			"conclusion": "c",
 10097  			"workflow_id": 1,
 10098  			"url": "u",
 10099  			"html_url": "h",
 10100  			"pull_requests": [
 10101  				{
 10102  					"id": 1,
 10103  					"number": 1,
 10104  					"url": "u",
 10105  					"head": {
 10106  						"ref": "r",
 10107  						"sha": "s",
 10108  						"repo": {
 10109  							"id": 1,
 10110  							"name": "n",
 10111  							"url": "s"
 10112  						}
 10113  					},
 10114  					"base": {
 10115  						"ref": "r",
 10116  						"sha": "s",
 10117  						"repo": {
 10118  							"id": 1,
 10119  							"name": "n",
 10120  							"url": "u"
 10121  						}
 10122  					}
 10123  				}
 10124  			],
 10125  			"created_at": ` + referenceTimeStr + `,
 10126  			"updated_at": ` + referenceTimeStr + `,
 10127  			"run_started_at": ` + referenceTimeStr + `,
 10128  			"jobs_url": "j",
 10129  			"logs_url": "l",
 10130  			"check_suite_url": "c",
 10131  			"artifacts_url": "a",
 10132  			"cancel_url": "c",
 10133  			"rerun_url": "r",
 10134  			"previous_attempt_url": "p",
 10135  			"head_commit": {
 10136  				"message": "m",
 10137  				"author": {
 10138  					"name": "n",
 10139  					"email": "e",
 10140  					"username": "l"
 10141  				},
 10142  				"url": "u",
 10143  				"distinct": false,
 10144  				"sha": "s",
 10145  				"id": "i",
 10146  				"tree_id": "tid",
 10147  				"timestamp": ` + referenceTimeStr + `,
 10148  				"committer": {
 10149  					"name": "n",
 10150  					"email": "e",
 10151  					"username": "l"
 10152  				}
 10153  			},
 10154  			"workflow_url": "w",
 10155  			"repository": {
 10156  				"id": 1,
 10157  				"name": "n",
 10158  				"url": "u"
 10159  			},
 10160  			"head_repository": {
 10161  				"id": 1,
 10162  				"name": "n",
 10163  				"url": "u"
 10164  			}
 10165  		},
 10166  		"organization": {
 10167  			"name": "n",
 10168  			"company": "c",
 10169  			"blog": "b",
 10170  			"location": "loc",
 10171  			"email": "e",
 10172  			"twitter_username": "tu",
 10173  			"description": "d",
 10174  			"billing_email": "be",
 10175  			"is_verified": true,
 10176  			"has_organization_projects": true,
 10177  			"has_repository_projects": true,
 10178  			"default_repository_permission": "drp",
 10179  			"members_can_create_repositories": true,
 10180  			"members_can_create_public_repositories": false,
 10181  			"members_can_create_private_repositories": true,
 10182  			"members_can_create_internal_repositories": true,
 10183  			"members_allowed_repository_creation_type": "marct",
 10184  			"members_can_create_pages": true,
 10185  			"members_can_create_public_pages": false,
 10186  			"members_can_create_private_pages": true
 10187  		},
 10188  		"repository": {
 10189  			"id": 1,
 10190  			"name": "n",
 10191  			"url": "s"
 10192  		},
 10193  		"sender": {
 10194  			"login": "l",
 10195  			"id": 1,
 10196  			"node_id": "n",
 10197  			"avatar_url": "a",
 10198  			"url": "u",
 10199  			"events_url": "e",
 10200  			"repos_url": "r"
 10201  		}
 10202  	}`
 10203  
 10204  	testJSONMarshal(t, u, want)
 10205  }
 10206  
 10207  func TestWorkflowDispatchEvent_Marshal(t *testing.T) {
 10208  	testJSONMarshal(t, &WorkflowDispatchEvent{}, "{}")
 10209  
 10210  	i := make(map[string]interface{})
 10211  	i["key"] = "value"
 10212  
 10213  	jsonMsg, _ := json.Marshal(i)
 10214  	u := &WorkflowDispatchEvent{
 10215  		Inputs:   jsonMsg,
 10216  		Ref:      String("r"),
 10217  		Workflow: String("w"),
 10218  		Repo: &Repository{
 10219  			ID:   Int64(1),
 10220  			URL:  String("s"),
 10221  			Name: String("n"),
 10222  		},
 10223  		Org: &Organization{
 10224  			BillingEmail:                         String("be"),
 10225  			Blog:                                 String("b"),
 10226  			Company:                              String("c"),
 10227  			Email:                                String("e"),
 10228  			TwitterUsername:                      String("tu"),
 10229  			Location:                             String("loc"),
 10230  			Name:                                 String("n"),
 10231  			Description:                          String("d"),
 10232  			IsVerified:                           Bool(true),
 10233  			HasOrganizationProjects:              Bool(true),
 10234  			HasRepositoryProjects:                Bool(true),
 10235  			DefaultRepoPermission:                String("drp"),
 10236  			MembersCanCreateRepos:                Bool(true),
 10237  			MembersCanCreateInternalRepos:        Bool(true),
 10238  			MembersCanCreatePrivateRepos:         Bool(true),
 10239  			MembersCanCreatePublicRepos:          Bool(false),
 10240  			MembersAllowedRepositoryCreationType: String("marct"),
 10241  			MembersCanCreatePages:                Bool(true),
 10242  			MembersCanCreatePublicPages:          Bool(false),
 10243  			MembersCanCreatePrivatePages:         Bool(true),
 10244  		},
 10245  		Sender: &User{
 10246  			Login:     String("l"),
 10247  			ID:        Int64(1),
 10248  			NodeID:    String("n"),
 10249  			URL:       String("u"),
 10250  			ReposURL:  String("r"),
 10251  			EventsURL: String("e"),
 10252  			AvatarURL: String("a"),
 10253  		},
 10254  	}
 10255  
 10256  	want := `{
 10257  		"inputs": {
 10258  			"key": "value"
 10259  		},
 10260  		"ref": "r",
 10261  		"workflow": "w",
 10262  		"repository": {
 10263  			"id": 1,
 10264  			"name": "n",
 10265  			"url": "s"
 10266  		},
 10267  		"organization": {
 10268  			"name": "n",
 10269  			"company": "c",
 10270  			"blog": "b",
 10271  			"location": "loc",
 10272  			"email": "e",
 10273  			"twitter_username": "tu",
 10274  			"description": "d",
 10275  			"billing_email": "be",
 10276  			"is_verified": true,
 10277  			"has_organization_projects": true,
 10278  			"has_repository_projects": true,
 10279  			"default_repository_permission": "drp",
 10280  			"members_can_create_repositories": true,
 10281  			"members_can_create_public_repositories": false,
 10282  			"members_can_create_private_repositories": true,
 10283  			"members_can_create_internal_repositories": true,
 10284  			"members_allowed_repository_creation_type": "marct",
 10285  			"members_can_create_pages": true,
 10286  			"members_can_create_public_pages": false,
 10287  			"members_can_create_private_pages": true
 10288  		},
 10289  		"sender": {
 10290  			"login": "l",
 10291  			"id": 1,
 10292  			"node_id": "n",
 10293  			"avatar_url": "a",
 10294  			"url": "u",
 10295  			"events_url": "e",
 10296  			"repos_url": "r"
 10297  		}
 10298  	}`
 10299  
 10300  	testJSONMarshal(t, u, want)
 10301  }
 10302  
 10303  func TestWatchEvent_Marshal(t *testing.T) {
 10304  	testJSONMarshal(t, &WatchEvent{}, "{}")
 10305  
 10306  	u := &WatchEvent{
 10307  		Action: String("a"),
 10308  		Repo: &Repository{
 10309  			ID:   Int64(1),
 10310  			URL:  String("s"),
 10311  			Name: String("n"),
 10312  		},
 10313  		Sender: &User{
 10314  			Login:     String("l"),
 10315  			ID:        Int64(1),
 10316  			NodeID:    String("n"),
 10317  			URL:       String("u"),
 10318  			ReposURL:  String("r"),
 10319  			EventsURL: String("e"),
 10320  			AvatarURL: String("a"),
 10321  		},
 10322  		Installation: &Installation{
 10323  			ID:       Int64(1),
 10324  			NodeID:   String("nid"),
 10325  			AppID:    Int64(1),
 10326  			AppSlug:  String("as"),
 10327  			TargetID: Int64(1),
 10328  			Account: &User{
 10329  				Login:           String("l"),
 10330  				ID:              Int64(1),
 10331  				URL:             String("u"),
 10332  				AvatarURL:       String("a"),
 10333  				GravatarID:      String("g"),
 10334  				Name:            String("n"),
 10335  				Company:         String("c"),
 10336  				Blog:            String("b"),
 10337  				Location:        String("l"),
 10338  				Email:           String("e"),
 10339  				Hireable:        Bool(true),
 10340  				Bio:             String("b"),
 10341  				TwitterUsername: String("t"),
 10342  				PublicRepos:     Int(1),
 10343  				Followers:       Int(1),
 10344  				Following:       Int(1),
 10345  				CreatedAt:       &Timestamp{referenceTime},
 10346  				SuspendedAt:     &Timestamp{referenceTime},
 10347  			},
 10348  			AccessTokensURL:     String("atu"),
 10349  			RepositoriesURL:     String("ru"),
 10350  			HTMLURL:             String("hu"),
 10351  			TargetType:          String("tt"),
 10352  			SingleFileName:      String("sfn"),
 10353  			RepositorySelection: String("rs"),
 10354  			Events:              []string{"e"},
 10355  			SingleFilePaths:     []string{"s"},
 10356  			Permissions: &InstallationPermissions{
 10357  				Actions:                       String("a"),
 10358  				Administration:                String("ad"),
 10359  				Checks:                        String("c"),
 10360  				Contents:                      String("co"),
 10361  				ContentReferences:             String("cr"),
 10362  				Deployments:                   String("d"),
 10363  				Environments:                  String("e"),
 10364  				Issues:                        String("i"),
 10365  				Metadata:                      String("md"),
 10366  				Members:                       String("m"),
 10367  				OrganizationAdministration:    String("oa"),
 10368  				OrganizationHooks:             String("oh"),
 10369  				OrganizationPlan:              String("op"),
 10370  				OrganizationPreReceiveHooks:   String("opr"),
 10371  				OrganizationProjects:          String("op"),
 10372  				OrganizationSecrets:           String("os"),
 10373  				OrganizationSelfHostedRunners: String("osh"),
 10374  				OrganizationUserBlocking:      String("oub"),
 10375  				Packages:                      String("pkg"),
 10376  				Pages:                         String("pg"),
 10377  				PullRequests:                  String("pr"),
 10378  				RepositoryHooks:               String("rh"),
 10379  				RepositoryProjects:            String("rp"),
 10380  				RepositoryPreReceiveHooks:     String("rprh"),
 10381  				Secrets:                       String("s"),
 10382  				SecretScanningAlerts:          String("ssa"),
 10383  				SecurityEvents:                String("se"),
 10384  				SingleFile:                    String("sf"),
 10385  				Statuses:                      String("s"),
 10386  				TeamDiscussions:               String("td"),
 10387  				VulnerabilityAlerts:           String("va"),
 10388  				Workflows:                     String("w"),
 10389  			},
 10390  			CreatedAt:              &Timestamp{referenceTime},
 10391  			UpdatedAt:              &Timestamp{referenceTime},
 10392  			HasMultipleSingleFiles: Bool(false),
 10393  			SuspendedBy: &User{
 10394  				Login:           String("l"),
 10395  				ID:              Int64(1),
 10396  				URL:             String("u"),
 10397  				AvatarURL:       String("a"),
 10398  				GravatarID:      String("g"),
 10399  				Name:            String("n"),
 10400  				Company:         String("c"),
 10401  				Blog:            String("b"),
 10402  				Location:        String("l"),
 10403  				Email:           String("e"),
 10404  				Hireable:        Bool(true),
 10405  				Bio:             String("b"),
 10406  				TwitterUsername: String("t"),
 10407  				PublicRepos:     Int(1),
 10408  				Followers:       Int(1),
 10409  				Following:       Int(1),
 10410  				CreatedAt:       &Timestamp{referenceTime},
 10411  				SuspendedAt:     &Timestamp{referenceTime},
 10412  			},
 10413  			SuspendedAt: &Timestamp{referenceTime},
 10414  		},
 10415  	}
 10416  
 10417  	want := `{
 10418  		"action": "a",
 10419  		"repository": {
 10420  			"id": 1,
 10421  			"name": "n",
 10422  			"url": "s"
 10423  		},
 10424  		"sender": {
 10425  			"login": "l",
 10426  			"id": 1,
 10427  			"node_id": "n",
 10428  			"avatar_url": "a",
 10429  			"url": "u",
 10430  			"events_url": "e",
 10431  			"repos_url": "r"
 10432  		},
 10433  		"installation": {
 10434  			"id": 1,
 10435  			"node_id": "nid",
 10436  			"app_id": 1,
 10437  			"app_slug": "as",
 10438  			"target_id": 1,
 10439  			"account": {
 10440  				"login": "l",
 10441  				"id": 1,
 10442  				"avatar_url": "a",
 10443  				"gravatar_id": "g",
 10444  				"name": "n",
 10445  				"company": "c",
 10446  				"blog": "b",
 10447  				"location": "l",
 10448  				"email": "e",
 10449  				"hireable": true,
 10450  				"bio": "b",
 10451  				"twitter_username": "t",
 10452  				"public_repos": 1,
 10453  				"followers": 1,
 10454  				"following": 1,
 10455  				"created_at": ` + referenceTimeStr + `,
 10456  				"suspended_at": ` + referenceTimeStr + `,
 10457  				"url": "u"
 10458  			},
 10459  			"access_tokens_url": "atu",
 10460  			"repositories_url": "ru",
 10461  			"html_url": "hu",
 10462  			"target_type": "tt",
 10463  			"single_file_name": "sfn",
 10464  			"repository_selection": "rs",
 10465  			"events": [
 10466  				"e"
 10467  			],
 10468  			"single_file_paths": [
 10469  				"s"
 10470  			],
 10471  			"permissions": {
 10472  				"actions": "a",
 10473  				"administration": "ad",
 10474  				"checks": "c",
 10475  				"contents": "co",
 10476  				"content_references": "cr",
 10477  				"deployments": "d",
 10478  				"environments": "e",
 10479  				"issues": "i",
 10480  				"metadata": "md",
 10481  				"members": "m",
 10482  				"organization_administration": "oa",
 10483  				"organization_hooks": "oh",
 10484  				"organization_plan": "op",
 10485  				"organization_pre_receive_hooks": "opr",
 10486  				"organization_projects": "op",
 10487  				"organization_secrets": "os",
 10488  				"organization_self_hosted_runners": "osh",
 10489  				"organization_user_blocking": "oub",
 10490  				"packages": "pkg",
 10491  				"pages": "pg",
 10492  				"pull_requests": "pr",
 10493  				"repository_hooks": "rh",
 10494  				"repository_projects": "rp",
 10495  				"repository_pre_receive_hooks": "rprh",
 10496  				"secrets": "s",
 10497  				"secret_scanning_alerts": "ssa",
 10498  				"security_events": "se",
 10499  				"single_file": "sf",
 10500  				"statuses": "s",
 10501  				"team_discussions": "td",
 10502  				"vulnerability_alerts": "va",
 10503  				"workflows": "w"
 10504  			},
 10505  			"created_at": ` + referenceTimeStr + `,
 10506  			"updated_at": ` + referenceTimeStr + `,
 10507  			"has_multiple_single_files": false,
 10508  			"suspended_by": {
 10509  				"login": "l",
 10510  				"id": 1,
 10511  				"avatar_url": "a",
 10512  				"gravatar_id": "g",
 10513  				"name": "n",
 10514  				"company": "c",
 10515  				"blog": "b",
 10516  				"location": "l",
 10517  				"email": "e",
 10518  				"hireable": true,
 10519  				"bio": "b",
 10520  				"twitter_username": "t",
 10521  				"public_repos": 1,
 10522  				"followers": 1,
 10523  				"following": 1,
 10524  				"created_at": ` + referenceTimeStr + `,
 10525  				"suspended_at": ` + referenceTimeStr + `,
 10526  				"url": "u"
 10527  			},
 10528  			"suspended_at": ` + referenceTimeStr + `
 10529  		}
 10530  	}`
 10531  
 10532  	testJSONMarshal(t, u, want)
 10533  }
 10534  
 10535  func TestUserEvent_Marshal(t *testing.T) {
 10536  	testJSONMarshal(t, &UserEvent{}, "{}")
 10537  
 10538  	u := &UserEvent{
 10539  		User: &User{
 10540  			Login:     String("l"),
 10541  			ID:        Int64(1),
 10542  			NodeID:    String("n"),
 10543  			URL:       String("u"),
 10544  			ReposURL:  String("r"),
 10545  			EventsURL: String("e"),
 10546  			AvatarURL: String("a"),
 10547  		},
 10548  		// The action performed. Possible values are: "created" or "deleted".
 10549  		Action: String("a"),
 10550  		Enterprise: &Enterprise{
 10551  			ID:          Int(1),
 10552  			Slug:        String("s"),
 10553  			Name:        String("n"),
 10554  			NodeID:      String("nid"),
 10555  			AvatarURL:   String("au"),
 10556  			Description: String("d"),
 10557  			WebsiteURL:  String("wu"),
 10558  			HTMLURL:     String("hu"),
 10559  			CreatedAt:   &Timestamp{referenceTime},
 10560  			UpdatedAt:   &Timestamp{referenceTime},
 10561  		},
 10562  		Sender: &User{
 10563  			Login:     String("l"),
 10564  			ID:        Int64(1),
 10565  			NodeID:    String("n"),
 10566  			URL:       String("u"),
 10567  			ReposURL:  String("r"),
 10568  			EventsURL: String("e"),
 10569  			AvatarURL: String("a"),
 10570  		},
 10571  	}
 10572  
 10573  	want := `{
 10574  		"user": {
 10575  			"login": "l",
 10576  			"id": 1,
 10577  			"node_id": "n",
 10578  			"avatar_url": "a",
 10579  			"url": "u",
 10580  			"events_url": "e",
 10581  			"repos_url": "r"
 10582  		},
 10583  		"action": "a",
 10584  		"enterprise": {
 10585  			"id": 1,
 10586  			"slug": "s",
 10587  			"name": "n",
 10588  			"node_id": "nid",
 10589  			"avatar_url": "au",
 10590  			"description": "d",
 10591  			"website_url": "wu",
 10592  			"html_url": "hu",
 10593  			"created_at": ` + referenceTimeStr + `,
 10594  			"updated_at": ` + referenceTimeStr + `
 10595  		},
 10596  		"sender": {
 10597  			"login": "l",
 10598  			"id": 1,
 10599  			"node_id": "n",
 10600  			"avatar_url": "a",
 10601  			"url": "u",
 10602  			"events_url": "e",
 10603  			"repos_url": "r"
 10604  		}
 10605  	}`
 10606  
 10607  	testJSONMarshal(t, u, want)
 10608  }
 10609  
 10610  func TestCheckRunEvent_Marshal(t *testing.T) {
 10611  	testJSONMarshal(t, &CheckRunEvent{}, "{}")
 10612  
 10613  	r := &CheckRunEvent{
 10614  		CheckRun: &CheckRun{
 10615  			ID:          Int64(1),
 10616  			NodeID:      String("n"),
 10617  			HeadSHA:     String("h"),
 10618  			ExternalID:  String("1"),
 10619  			URL:         String("u"),
 10620  			HTMLURL:     String("u"),
 10621  			DetailsURL:  String("u"),
 10622  			Status:      String("s"),
 10623  			Conclusion:  String("c"),
 10624  			StartedAt:   &Timestamp{referenceTime},
 10625  			CompletedAt: &Timestamp{referenceTime},
 10626  			Output: &CheckRunOutput{
 10627  				Annotations: []*CheckRunAnnotation{
 10628  					{
 10629  						AnnotationLevel: String("a"),
 10630  						EndLine:         Int(1),
 10631  						Message:         String("m"),
 10632  						Path:            String("p"),
 10633  						RawDetails:      String("r"),
 10634  						StartLine:       Int(1),
 10635  						Title:           String("t"),
 10636  					},
 10637  				},
 10638  				AnnotationsCount: Int(1),
 10639  				AnnotationsURL:   String("a"),
 10640  				Images: []*CheckRunImage{
 10641  					{
 10642  						Alt:      String("a"),
 10643  						ImageURL: String("i"),
 10644  						Caption:  String("c"),
 10645  					},
 10646  				},
 10647  				Title:   String("t"),
 10648  				Summary: String("s"),
 10649  				Text:    String("t"),
 10650  			},
 10651  			Name: String("n"),
 10652  			CheckSuite: &CheckSuite{
 10653  				ID: Int64(1),
 10654  			},
 10655  			App: &App{
 10656  				ID:     Int64(1),
 10657  				NodeID: String("n"),
 10658  				Owner: &User{
 10659  					Login:     String("l"),
 10660  					ID:        Int64(1),
 10661  					NodeID:    String("n"),
 10662  					URL:       String("u"),
 10663  					ReposURL:  String("r"),
 10664  					EventsURL: String("e"),
 10665  					AvatarURL: String("a"),
 10666  				},
 10667  				Name:        String("n"),
 10668  				Description: String("d"),
 10669  				HTMLURL:     String("h"),
 10670  				ExternalURL: String("u"),
 10671  				CreatedAt:   &Timestamp{referenceTime},
 10672  				UpdatedAt:   &Timestamp{referenceTime},
 10673  			},
 10674  			PullRequests: []*PullRequest{
 10675  				{
 10676  					URL:    String("u"),
 10677  					ID:     Int64(1),
 10678  					Number: Int(1),
 10679  					Head: &PullRequestBranch{
 10680  						Ref: String("r"),
 10681  						SHA: String("s"),
 10682  						Repo: &Repository{
 10683  							ID:   Int64(1),
 10684  							URL:  String("s"),
 10685  							Name: String("n"),
 10686  						},
 10687  					},
 10688  					Base: &PullRequestBranch{
 10689  						Ref: String("r"),
 10690  						SHA: String("s"),
 10691  						Repo: &Repository{
 10692  							ID:   Int64(1),
 10693  							URL:  String("u"),
 10694  							Name: String("n"),
 10695  						},
 10696  					},
 10697  				},
 10698  			},
 10699  		},
 10700  		Action: String("a"),
 10701  		Repo: &Repository{
 10702  			ID:   Int64(1),
 10703  			URL:  String("s"),
 10704  			Name: String("n"),
 10705  		},
 10706  		Org: &Organization{
 10707  			BillingEmail:                         String("be"),
 10708  			Blog:                                 String("b"),
 10709  			Company:                              String("c"),
 10710  			Email:                                String("e"),
 10711  			TwitterUsername:                      String("tu"),
 10712  			Location:                             String("loc"),
 10713  			Name:                                 String("n"),
 10714  			Description:                          String("d"),
 10715  			IsVerified:                           Bool(true),
 10716  			HasOrganizationProjects:              Bool(true),
 10717  			HasRepositoryProjects:                Bool(true),
 10718  			DefaultRepoPermission:                String("drp"),
 10719  			MembersCanCreateRepos:                Bool(true),
 10720  			MembersCanCreateInternalRepos:        Bool(true),
 10721  			MembersCanCreatePrivateRepos:         Bool(true),
 10722  			MembersCanCreatePublicRepos:          Bool(false),
 10723  			MembersAllowedRepositoryCreationType: String("marct"),
 10724  			MembersCanCreatePages:                Bool(true),
 10725  			MembersCanCreatePublicPages:          Bool(false),
 10726  			MembersCanCreatePrivatePages:         Bool(true),
 10727  		},
 10728  		Sender: &User{
 10729  			Login:     String("l"),
 10730  			ID:        Int64(1),
 10731  			NodeID:    String("n"),
 10732  			URL:       String("u"),
 10733  			ReposURL:  String("r"),
 10734  			EventsURL: String("e"),
 10735  			AvatarURL: String("a"),
 10736  		},
 10737  		Installation: &Installation{
 10738  			ID:       Int64(1),
 10739  			NodeID:   String("nid"),
 10740  			AppID:    Int64(1),
 10741  			AppSlug:  String("as"),
 10742  			TargetID: Int64(1),
 10743  			Account: &User{
 10744  				Login:           String("l"),
 10745  				ID:              Int64(1),
 10746  				URL:             String("u"),
 10747  				AvatarURL:       String("a"),
 10748  				GravatarID:      String("g"),
 10749  				Name:            String("n"),
 10750  				Company:         String("c"),
 10751  				Blog:            String("b"),
 10752  				Location:        String("l"),
 10753  				Email:           String("e"),
 10754  				Hireable:        Bool(true),
 10755  				Bio:             String("b"),
 10756  				TwitterUsername: String("t"),
 10757  				PublicRepos:     Int(1),
 10758  				Followers:       Int(1),
 10759  				Following:       Int(1),
 10760  				CreatedAt:       &Timestamp{referenceTime},
 10761  				SuspendedAt:     &Timestamp{referenceTime},
 10762  			},
 10763  			AccessTokensURL:     String("atu"),
 10764  			RepositoriesURL:     String("ru"),
 10765  			HTMLURL:             String("hu"),
 10766  			TargetType:          String("tt"),
 10767  			SingleFileName:      String("sfn"),
 10768  			RepositorySelection: String("rs"),
 10769  			Events:              []string{"e"},
 10770  			SingleFilePaths:     []string{"s"},
 10771  			Permissions: &InstallationPermissions{
 10772  				Actions:                       String("a"),
 10773  				Administration:                String("ad"),
 10774  				Checks:                        String("c"),
 10775  				Contents:                      String("co"),
 10776  				ContentReferences:             String("cr"),
 10777  				Deployments:                   String("d"),
 10778  				Environments:                  String("e"),
 10779  				Issues:                        String("i"),
 10780  				Metadata:                      String("md"),
 10781  				Members:                       String("m"),
 10782  				OrganizationAdministration:    String("oa"),
 10783  				OrganizationHooks:             String("oh"),
 10784  				OrganizationPlan:              String("op"),
 10785  				OrganizationPreReceiveHooks:   String("opr"),
 10786  				OrganizationProjects:          String("op"),
 10787  				OrganizationSecrets:           String("os"),
 10788  				OrganizationSelfHostedRunners: String("osh"),
 10789  				OrganizationUserBlocking:      String("oub"),
 10790  				Packages:                      String("pkg"),
 10791  				Pages:                         String("pg"),
 10792  				PullRequests:                  String("pr"),
 10793  				RepositoryHooks:               String("rh"),
 10794  				RepositoryProjects:            String("rp"),
 10795  				RepositoryPreReceiveHooks:     String("rprh"),
 10796  				Secrets:                       String("s"),
 10797  				SecretScanningAlerts:          String("ssa"),
 10798  				SecurityEvents:                String("se"),
 10799  				SingleFile:                    String("sf"),
 10800  				Statuses:                      String("s"),
 10801  				TeamDiscussions:               String("td"),
 10802  				VulnerabilityAlerts:           String("va"),
 10803  				Workflows:                     String("w"),
 10804  			},
 10805  			CreatedAt:              &Timestamp{referenceTime},
 10806  			UpdatedAt:              &Timestamp{referenceTime},
 10807  			HasMultipleSingleFiles: Bool(false),
 10808  			SuspendedBy: &User{
 10809  				Login:           String("l"),
 10810  				ID:              Int64(1),
 10811  				URL:             String("u"),
 10812  				AvatarURL:       String("a"),
 10813  				GravatarID:      String("g"),
 10814  				Name:            String("n"),
 10815  				Company:         String("c"),
 10816  				Blog:            String("b"),
 10817  				Location:        String("l"),
 10818  				Email:           String("e"),
 10819  				Hireable:        Bool(true),
 10820  				Bio:             String("b"),
 10821  				TwitterUsername: String("t"),
 10822  				PublicRepos:     Int(1),
 10823  				Followers:       Int(1),
 10824  				Following:       Int(1),
 10825  				CreatedAt:       &Timestamp{referenceTime},
 10826  				SuspendedAt:     &Timestamp{referenceTime},
 10827  			},
 10828  			SuspendedAt: &Timestamp{referenceTime},
 10829  		},
 10830  		RequestedAction: &RequestedAction{
 10831  			Identifier: "i",
 10832  		},
 10833  	}
 10834  
 10835  	want := `{
 10836  		"check_run": {
 10837  			"id": 1,
 10838  			"node_id": "n",
 10839  			"head_sha": "h",
 10840  			"external_id": "1",
 10841  			"url": "u",
 10842  			"html_url": "u",
 10843  			"details_url": "u",
 10844  			"status": "s",
 10845  			"conclusion": "c",
 10846  			"started_at": ` + referenceTimeStr + `,
 10847  			"completed_at": ` + referenceTimeStr + `,
 10848  			"output": {
 10849  				"title": "t",
 10850  				"summary": "s",
 10851  				"text": "t",
 10852  				"annotations_count": 1,
 10853  				"annotations_url": "a",
 10854  				"annotations": [
 10855  					{
 10856  						"path": "p",
 10857  						"start_line": 1,
 10858  						"end_line": 1,
 10859  						"annotation_level": "a",
 10860  						"message": "m",
 10861  						"title": "t",
 10862  						"raw_details": "r"
 10863  					}
 10864  				],
 10865  				"images": [
 10866  					{
 10867  						"alt": "a",
 10868  						"image_url": "i",
 10869  						"caption": "c"
 10870  					}
 10871  				]
 10872  			},
 10873  			"name": "n",
 10874  			"check_suite": {
 10875  				"id": 1
 10876  			},
 10877  			"app": {
 10878  				"id": 1,
 10879  				"node_id": "n",
 10880  				"owner": {
 10881  					"login": "l",
 10882  					"id": 1,
 10883  					"node_id": "n",
 10884  					"avatar_url": "a",
 10885  					"url": "u",
 10886  					"events_url": "e",
 10887  					"repos_url": "r"
 10888  				},
 10889  				"name": "n",
 10890  				"description": "d",
 10891  				"external_url": "u",
 10892  				"html_url": "h",
 10893  				"created_at": ` + referenceTimeStr + `,
 10894  				"updated_at": ` + referenceTimeStr + `
 10895  			},
 10896  			"pull_requests": [
 10897  				{
 10898  					"id": 1,
 10899  					"number": 1,
 10900  					"url": "u",
 10901  					"head": {
 10902  						"ref": "r",
 10903  						"sha": "s",
 10904  						"repo": {
 10905  							"id": 1,
 10906  							"name": "n",
 10907  							"url": "s"
 10908  						}
 10909  					},
 10910  					"base": {
 10911  						"ref": "r",
 10912  						"sha": "s",
 10913  						"repo": {
 10914  							"id": 1,
 10915  							"name": "n",
 10916  							"url": "u"
 10917  						}
 10918  					}
 10919  				}
 10920  			]
 10921  		},
 10922  		"action": "a",
 10923  		"repository": {
 10924  			"id": 1,
 10925  			"name": "n",
 10926  			"url": "s"
 10927  		},
 10928  		"organization": {
 10929  			"name": "n",
 10930  			"company": "c",
 10931  			"blog": "b",
 10932  			"location": "loc",
 10933  			"email": "e",
 10934  			"twitter_username": "tu",
 10935  			"description": "d",
 10936  			"billing_email": "be",
 10937  			"is_verified": true,
 10938  			"has_organization_projects": true,
 10939  			"has_repository_projects": true,
 10940  			"default_repository_permission": "drp",
 10941  			"members_can_create_repositories": true,
 10942  			"members_can_create_public_repositories": false,
 10943  			"members_can_create_private_repositories": true,
 10944  			"members_can_create_internal_repositories": true,
 10945  			"members_allowed_repository_creation_type": "marct",
 10946  			"members_can_create_pages": true,
 10947  			"members_can_create_public_pages": false,
 10948  			"members_can_create_private_pages": true
 10949  		},
 10950  		"sender": {
 10951  			"login": "l",
 10952  			"id": 1,
 10953  			"node_id": "n",
 10954  			"avatar_url": "a",
 10955  			"url": "u",
 10956  			"events_url": "e",
 10957  			"repos_url": "r"
 10958  		},
 10959  		"installation": {
 10960  			"id": 1,
 10961  			"node_id": "nid",
 10962  			"app_id": 1,
 10963  			"app_slug": "as",
 10964  			"target_id": 1,
 10965  			"account": {
 10966  				"login": "l",
 10967  				"id": 1,
 10968  				"avatar_url": "a",
 10969  				"gravatar_id": "g",
 10970  				"name": "n",
 10971  				"company": "c",
 10972  				"blog": "b",
 10973  				"location": "l",
 10974  				"email": "e",
 10975  				"hireable": true,
 10976  				"bio": "b",
 10977  				"twitter_username": "t",
 10978  				"public_repos": 1,
 10979  				"followers": 1,
 10980  				"following": 1,
 10981  				"created_at": ` + referenceTimeStr + `,
 10982  				"suspended_at": ` + referenceTimeStr + `,
 10983  				"url": "u"
 10984  			},
 10985  			"access_tokens_url": "atu",
 10986  			"repositories_url": "ru",
 10987  			"html_url": "hu",
 10988  			"target_type": "tt",
 10989  			"single_file_name": "sfn",
 10990  			"repository_selection": "rs",
 10991  			"events": [
 10992  				"e"
 10993  			],
 10994  			"single_file_paths": [
 10995  				"s"
 10996  			],
 10997  			"permissions": {
 10998  				"actions": "a",
 10999  				"administration": "ad",
 11000  				"checks": "c",
 11001  				"contents": "co",
 11002  				"content_references": "cr",
 11003  				"deployments": "d",
 11004  				"environments": "e",
 11005  				"issues": "i",
 11006  				"metadata": "md",
 11007  				"members": "m",
 11008  				"organization_administration": "oa",
 11009  				"organization_hooks": "oh",
 11010  				"organization_plan": "op",
 11011  				"organization_pre_receive_hooks": "opr",
 11012  				"organization_projects": "op",
 11013  				"organization_secrets": "os",
 11014  				"organization_self_hosted_runners": "osh",
 11015  				"organization_user_blocking": "oub",
 11016  				"packages": "pkg",
 11017  				"pages": "pg",
 11018  				"pull_requests": "pr",
 11019  				"repository_hooks": "rh",
 11020  				"repository_projects": "rp",
 11021  				"repository_pre_receive_hooks": "rprh",
 11022  				"secrets": "s",
 11023  				"secret_scanning_alerts": "ssa",
 11024  				"security_events": "se",
 11025  				"single_file": "sf",
 11026  				"statuses": "s",
 11027  				"team_discussions": "td",
 11028  				"vulnerability_alerts": "va",
 11029  				"workflows": "w"
 11030  			},
 11031  			"created_at": ` + referenceTimeStr + `,
 11032  			"updated_at": ` + referenceTimeStr + `,
 11033  			"has_multiple_single_files": false,
 11034  			"suspended_by": {
 11035  				"login": "l",
 11036  				"id": 1,
 11037  				"avatar_url": "a",
 11038  				"gravatar_id": "g",
 11039  				"name": "n",
 11040  				"company": "c",
 11041  				"blog": "b",
 11042  				"location": "l",
 11043  				"email": "e",
 11044  				"hireable": true,
 11045  				"bio": "b",
 11046  				"twitter_username": "t",
 11047  				"public_repos": 1,
 11048  				"followers": 1,
 11049  				"following": 1,
 11050  				"created_at": ` + referenceTimeStr + `,
 11051  				"suspended_at": ` + referenceTimeStr + `,
 11052  				"url": "u"
 11053  			},
 11054  			"suspended_at": ` + referenceTimeStr + `
 11055  		},
 11056  		"requested_action": {
 11057  			"identifier": "i"
 11058  		}
 11059  	}`
 11060  
 11061  	testJSONMarshal(t, r, want)
 11062  }
 11063  
 11064  func TestCheckSuiteEvent_Marshal(t *testing.T) {
 11065  	testJSONMarshal(t, &CheckSuiteEvent{}, "{}")
 11066  
 11067  	r := &CheckSuiteEvent{
 11068  		CheckSuite: &CheckSuite{
 11069  			ID:         Int64(1),
 11070  			NodeID:     String("n"),
 11071  			HeadBranch: String("h"),
 11072  			HeadSHA:    String("h"),
 11073  			URL:        String("u"),
 11074  			BeforeSHA:  String("b"),
 11075  			AfterSHA:   String("a"),
 11076  			Status:     String("s"),
 11077  			Conclusion: String("c"),
 11078  			App: &App{
 11079  				ID:     Int64(1),
 11080  				NodeID: String("n"),
 11081  				Owner: &User{
 11082  					Login:     String("l"),
 11083  					ID:        Int64(1),
 11084  					NodeID:    String("n"),
 11085  					URL:       String("u"),
 11086  					ReposURL:  String("r"),
 11087  					EventsURL: String("e"),
 11088  					AvatarURL: String("a"),
 11089  				},
 11090  				Name:        String("n"),
 11091  				Description: String("d"),
 11092  				HTMLURL:     String("h"),
 11093  				ExternalURL: String("u"),
 11094  				CreatedAt:   &Timestamp{referenceTime},
 11095  				UpdatedAt:   &Timestamp{referenceTime},
 11096  			},
 11097  			Repository: &Repository{
 11098  				ID: Int64(1),
 11099  			},
 11100  			PullRequests: []*PullRequest{
 11101  				{
 11102  					URL:    String("u"),
 11103  					ID:     Int64(1),
 11104  					Number: Int(1),
 11105  					Head: &PullRequestBranch{
 11106  						Ref: String("r"),
 11107  						SHA: String("s"),
 11108  						Repo: &Repository{
 11109  							ID:   Int64(1),
 11110  							URL:  String("s"),
 11111  							Name: String("n"),
 11112  						},
 11113  					},
 11114  					Base: &PullRequestBranch{
 11115  						Ref: String("r"),
 11116  						SHA: String("s"),
 11117  						Repo: &Repository{
 11118  							ID:   Int64(1),
 11119  							URL:  String("u"),
 11120  							Name: String("n"),
 11121  						},
 11122  					},
 11123  				},
 11124  			},
 11125  			HeadCommit: &Commit{
 11126  				SHA: String("s"),
 11127  			},
 11128  		},
 11129  		Action: String("a"),
 11130  		Repo: &Repository{
 11131  			ID:   Int64(1),
 11132  			URL:  String("s"),
 11133  			Name: String("n"),
 11134  		},
 11135  		Org: &Organization{
 11136  			BillingEmail:                         String("be"),
 11137  			Blog:                                 String("b"),
 11138  			Company:                              String("c"),
 11139  			Email:                                String("e"),
 11140  			TwitterUsername:                      String("tu"),
 11141  			Location:                             String("loc"),
 11142  			Name:                                 String("n"),
 11143  			Description:                          String("d"),
 11144  			IsVerified:                           Bool(true),
 11145  			HasOrganizationProjects:              Bool(true),
 11146  			HasRepositoryProjects:                Bool(true),
 11147  			DefaultRepoPermission:                String("drp"),
 11148  			MembersCanCreateRepos:                Bool(true),
 11149  			MembersCanCreateInternalRepos:        Bool(true),
 11150  			MembersCanCreatePrivateRepos:         Bool(true),
 11151  			MembersCanCreatePublicRepos:          Bool(false),
 11152  			MembersAllowedRepositoryCreationType: String("marct"),
 11153  			MembersCanCreatePages:                Bool(true),
 11154  			MembersCanCreatePublicPages:          Bool(false),
 11155  			MembersCanCreatePrivatePages:         Bool(true),
 11156  		},
 11157  		Sender: &User{
 11158  			Login:     String("l"),
 11159  			ID:        Int64(1),
 11160  			NodeID:    String("n"),
 11161  			URL:       String("u"),
 11162  			ReposURL:  String("r"),
 11163  			EventsURL: String("e"),
 11164  			AvatarURL: String("a"),
 11165  		},
 11166  		Installation: &Installation{
 11167  			ID:       Int64(1),
 11168  			NodeID:   String("nid"),
 11169  			AppID:    Int64(1),
 11170  			AppSlug:  String("as"),
 11171  			TargetID: Int64(1),
 11172  			Account: &User{
 11173  				Login:           String("l"),
 11174  				ID:              Int64(1),
 11175  				URL:             String("u"),
 11176  				AvatarURL:       String("a"),
 11177  				GravatarID:      String("g"),
 11178  				Name:            String("n"),
 11179  				Company:         String("c"),
 11180  				Blog:            String("b"),
 11181  				Location:        String("l"),
 11182  				Email:           String("e"),
 11183  				Hireable:        Bool(true),
 11184  				Bio:             String("b"),
 11185  				TwitterUsername: String("t"),
 11186  				PublicRepos:     Int(1),
 11187  				Followers:       Int(1),
 11188  				Following:       Int(1),
 11189  				CreatedAt:       &Timestamp{referenceTime},
 11190  				SuspendedAt:     &Timestamp{referenceTime},
 11191  			},
 11192  			AccessTokensURL:     String("atu"),
 11193  			RepositoriesURL:     String("ru"),
 11194  			HTMLURL:             String("hu"),
 11195  			TargetType:          String("tt"),
 11196  			SingleFileName:      String("sfn"),
 11197  			RepositorySelection: String("rs"),
 11198  			Events:              []string{"e"},
 11199  			SingleFilePaths:     []string{"s"},
 11200  			Permissions: &InstallationPermissions{
 11201  				Actions:                       String("a"),
 11202  				Administration:                String("ad"),
 11203  				Checks:                        String("c"),
 11204  				Contents:                      String("co"),
 11205  				ContentReferences:             String("cr"),
 11206  				Deployments:                   String("d"),
 11207  				Environments:                  String("e"),
 11208  				Issues:                        String("i"),
 11209  				Metadata:                      String("md"),
 11210  				Members:                       String("m"),
 11211  				OrganizationAdministration:    String("oa"),
 11212  				OrganizationHooks:             String("oh"),
 11213  				OrganizationPlan:              String("op"),
 11214  				OrganizationPreReceiveHooks:   String("opr"),
 11215  				OrganizationProjects:          String("op"),
 11216  				OrganizationSecrets:           String("os"),
 11217  				OrganizationSelfHostedRunners: String("osh"),
 11218  				OrganizationUserBlocking:      String("oub"),
 11219  				Packages:                      String("pkg"),
 11220  				Pages:                         String("pg"),
 11221  				PullRequests:                  String("pr"),
 11222  				RepositoryHooks:               String("rh"),
 11223  				RepositoryProjects:            String("rp"),
 11224  				RepositoryPreReceiveHooks:     String("rprh"),
 11225  				Secrets:                       String("s"),
 11226  				SecretScanningAlerts:          String("ssa"),
 11227  				SecurityEvents:                String("se"),
 11228  				SingleFile:                    String("sf"),
 11229  				Statuses:                      String("s"),
 11230  				TeamDiscussions:               String("td"),
 11231  				VulnerabilityAlerts:           String("va"),
 11232  				Workflows:                     String("w"),
 11233  			},
 11234  			CreatedAt:              &Timestamp{referenceTime},
 11235  			UpdatedAt:              &Timestamp{referenceTime},
 11236  			HasMultipleSingleFiles: Bool(false),
 11237  			SuspendedBy: &User{
 11238  				Login:           String("l"),
 11239  				ID:              Int64(1),
 11240  				URL:             String("u"),
 11241  				AvatarURL:       String("a"),
 11242  				GravatarID:      String("g"),
 11243  				Name:            String("n"),
 11244  				Company:         String("c"),
 11245  				Blog:            String("b"),
 11246  				Location:        String("l"),
 11247  				Email:           String("e"),
 11248  				Hireable:        Bool(true),
 11249  				Bio:             String("b"),
 11250  				TwitterUsername: String("t"),
 11251  				PublicRepos:     Int(1),
 11252  				Followers:       Int(1),
 11253  				Following:       Int(1),
 11254  				CreatedAt:       &Timestamp{referenceTime},
 11255  				SuspendedAt:     &Timestamp{referenceTime},
 11256  			},
 11257  			SuspendedAt: &Timestamp{referenceTime},
 11258  		},
 11259  	}
 11260  
 11261  	want := `{
 11262  		"check_suite": {
 11263  			"id": 1,
 11264  			"node_id": "n",
 11265  			"head_branch": "h",
 11266  			"head_sha": "h",
 11267  			"url": "u",
 11268  			"before": "b",
 11269  			"after": "a",
 11270  			"status": "s",
 11271  			"conclusion": "c",
 11272  			"app": {
 11273  				"id": 1,
 11274  				"node_id": "n",
 11275  				"owner": {
 11276  					"login": "l",
 11277  					"id": 1,
 11278  					"node_id": "n",
 11279  					"avatar_url": "a",
 11280  					"url": "u",
 11281  					"events_url": "e",
 11282  					"repos_url": "r"
 11283  				},
 11284  				"name": "n",
 11285  				"description": "d",
 11286  				"external_url": "u",
 11287  				"html_url": "h",
 11288  				"created_at": ` + referenceTimeStr + `,
 11289  				"updated_at": ` + referenceTimeStr + `
 11290  			},
 11291  			"repository": {
 11292  				"id": 1
 11293  			},
 11294  			"pull_requests": [
 11295  			{
 11296  				"id": 1,
 11297  				"number": 1,
 11298  				"url": "u",
 11299  				"head": {
 11300  					"ref": "r",
 11301  					"sha": "s",
 11302  					"repo": {
 11303  						"id": 1,
 11304  						"name": "n",
 11305  						"url": "s"
 11306  					}
 11307  				},
 11308  				"base": {
 11309  					"ref": "r",
 11310  					"sha": "s",
 11311  					"repo": {
 11312  						"id": 1,
 11313  						"name": "n",
 11314  						"url": "u"
 11315  					}
 11316  				}
 11317  			}
 11318  		],
 11319  		"head_commit": {
 11320  			"sha": "s"
 11321  		}
 11322  		},
 11323  		"action": "a",
 11324  		"repository": {
 11325  			"id": 1,
 11326  			"name": "n",
 11327  			"url": "s"
 11328  		},
 11329  		"organization": {
 11330  			"name": "n",
 11331  			"company": "c",
 11332  			"blog": "b",
 11333  			"location": "loc",
 11334  			"email": "e",
 11335  			"twitter_username": "tu",
 11336  			"description": "d",
 11337  			"billing_email": "be",
 11338  			"is_verified": true,
 11339  			"has_organization_projects": true,
 11340  			"has_repository_projects": true,
 11341  			"default_repository_permission": "drp",
 11342  			"members_can_create_repositories": true,
 11343  			"members_can_create_public_repositories": false,
 11344  			"members_can_create_private_repositories": true,
 11345  			"members_can_create_internal_repositories": true,
 11346  			"members_allowed_repository_creation_type": "marct",
 11347  			"members_can_create_pages": true,
 11348  			"members_can_create_public_pages": false,
 11349  			"members_can_create_private_pages": true
 11350  		},
 11351  		"sender": {
 11352  			"login": "l",
 11353  			"id": 1,
 11354  			"node_id": "n",
 11355  			"avatar_url": "a",
 11356  			"url": "u",
 11357  			"events_url": "e",
 11358  			"repos_url": "r"
 11359  		},
 11360  		"installation": {
 11361  			"id": 1,
 11362  			"node_id": "nid",
 11363  			"app_id": 1,
 11364  			"app_slug": "as",
 11365  			"target_id": 1,
 11366  			"account": {
 11367  				"login": "l",
 11368  				"id": 1,
 11369  				"avatar_url": "a",
 11370  				"gravatar_id": "g",
 11371  				"name": "n",
 11372  				"company": "c",
 11373  				"blog": "b",
 11374  				"location": "l",
 11375  				"email": "e",
 11376  				"hireable": true,
 11377  				"bio": "b",
 11378  				"twitter_username": "t",
 11379  				"public_repos": 1,
 11380  				"followers": 1,
 11381  				"following": 1,
 11382  				"created_at": ` + referenceTimeStr + `,
 11383  				"suspended_at": ` + referenceTimeStr + `,
 11384  				"url": "u"
 11385  			},
 11386  			"access_tokens_url": "atu",
 11387  			"repositories_url": "ru",
 11388  			"html_url": "hu",
 11389  			"target_type": "tt",
 11390  			"single_file_name": "sfn",
 11391  			"repository_selection": "rs",
 11392  			"events": [
 11393  				"e"
 11394  			],
 11395  			"single_file_paths": [
 11396  				"s"
 11397  			],
 11398  			"permissions": {
 11399  				"actions": "a",
 11400  				"administration": "ad",
 11401  				"checks": "c",
 11402  				"contents": "co",
 11403  				"content_references": "cr",
 11404  				"deployments": "d",
 11405  				"environments": "e",
 11406  				"issues": "i",
 11407  				"metadata": "md",
 11408  				"members": "m",
 11409  				"organization_administration": "oa",
 11410  				"organization_hooks": "oh",
 11411  				"organization_plan": "op",
 11412  				"organization_pre_receive_hooks": "opr",
 11413  				"organization_projects": "op",
 11414  				"organization_secrets": "os",
 11415  				"organization_self_hosted_runners": "osh",
 11416  				"organization_user_blocking": "oub",
 11417  				"packages": "pkg",
 11418  				"pages": "pg",
 11419  				"pull_requests": "pr",
 11420  				"repository_hooks": "rh",
 11421  				"repository_projects": "rp",
 11422  				"repository_pre_receive_hooks": "rprh",
 11423  				"secrets": "s",
 11424  				"secret_scanning_alerts": "ssa",
 11425  				"security_events": "se",
 11426  				"single_file": "sf",
 11427  				"statuses": "s",
 11428  				"team_discussions": "td",
 11429  				"vulnerability_alerts": "va",
 11430  				"workflows": "w"
 11431  			},
 11432  			"created_at": ` + referenceTimeStr + `,
 11433  			"updated_at": ` + referenceTimeStr + `,
 11434  			"has_multiple_single_files": false,
 11435  			"suspended_by": {
 11436  				"login": "l",
 11437  				"id": 1,
 11438  				"avatar_url": "a",
 11439  				"gravatar_id": "g",
 11440  				"name": "n",
 11441  				"company": "c",
 11442  				"blog": "b",
 11443  				"location": "l",
 11444  				"email": "e",
 11445  				"hireable": true,
 11446  				"bio": "b",
 11447  				"twitter_username": "t",
 11448  				"public_repos": 1,
 11449  				"followers": 1,
 11450  				"following": 1,
 11451  				"created_at": ` + referenceTimeStr + `,
 11452  				"suspended_at": ` + referenceTimeStr + `,
 11453  				"url": "u"
 11454  			},
 11455  			"suspended_at": ` + referenceTimeStr + `
 11456  		}
 11457  	}`
 11458  
 11459  	testJSONMarshal(t, r, want)
 11460  }
 11461  
 11462  func TestDeployKeyEvent_Marshal(t *testing.T) {
 11463  	testJSONMarshal(t, &DeployKeyEvent{}, "{}")
 11464  
 11465  	u := &DeployKeyEvent{
 11466  		Action: String("a"),
 11467  		Key: &Key{
 11468  			ID:        Int64(1),
 11469  			Key:       String("k"),
 11470  			URL:       String("k"),
 11471  			Title:     String("k"),
 11472  			ReadOnly:  Bool(false),
 11473  			Verified:  Bool(false),
 11474  			CreatedAt: &Timestamp{referenceTime},
 11475  		},
 11476  		Repo: &Repository{
 11477  			ID:   Int64(1),
 11478  			URL:  String("s"),
 11479  			Name: String("n"),
 11480  		},
 11481  		Organization: &Organization{
 11482  			BillingEmail:                         String("be"),
 11483  			Blog:                                 String("b"),
 11484  			Company:                              String("c"),
 11485  			Email:                                String("e"),
 11486  			TwitterUsername:                      String("tu"),
 11487  			Location:                             String("loc"),
 11488  			Name:                                 String("n"),
 11489  			Description:                          String("d"),
 11490  			IsVerified:                           Bool(true),
 11491  			HasOrganizationProjects:              Bool(true),
 11492  			HasRepositoryProjects:                Bool(true),
 11493  			DefaultRepoPermission:                String("drp"),
 11494  			MembersCanCreateRepos:                Bool(true),
 11495  			MembersCanCreateInternalRepos:        Bool(true),
 11496  			MembersCanCreatePrivateRepos:         Bool(true),
 11497  			MembersCanCreatePublicRepos:          Bool(false),
 11498  			MembersAllowedRepositoryCreationType: String("marct"),
 11499  			MembersCanCreatePages:                Bool(true),
 11500  			MembersCanCreatePublicPages:          Bool(false),
 11501  			MembersCanCreatePrivatePages:         Bool(true),
 11502  		},
 11503  		Sender: &User{
 11504  			Login:     String("l"),
 11505  			ID:        Int64(1),
 11506  			NodeID:    String("n"),
 11507  			AvatarURL: String("a"),
 11508  			URL:       String("u"),
 11509  			EventsURL: String("e"),
 11510  			ReposURL:  String("r"),
 11511  		},
 11512  	}
 11513  
 11514  	want := `{
 11515  		"action": "a",
 11516  		"key": {
 11517  			"id": 1,
 11518  			"key": "k",
 11519  			"url": "k",
 11520  			"title": "k",
 11521  			"read_only": false,
 11522  			"verified": false,
 11523  			"created_at": ` + referenceTimeStr + `
 11524  		},
 11525  		"repository": {
 11526  			"id": 1,
 11527  			"name": "n",
 11528  			"url": "s"
 11529  		},
 11530  		"organization": {
 11531  			"name": "n",
 11532  			"company": "c",
 11533  			"blog": "b",
 11534  			"location": "loc",
 11535  			"email": "e",
 11536  			"twitter_username": "tu",
 11537  			"description": "d",
 11538  			"billing_email": "be",
 11539  			"is_verified": true,
 11540  			"has_organization_projects": true,
 11541  			"has_repository_projects": true,
 11542  			"default_repository_permission": "drp",
 11543  			"members_can_create_repositories": true,
 11544  			"members_can_create_public_repositories": false,
 11545  			"members_can_create_private_repositories": true,
 11546  			"members_can_create_internal_repositories": true,
 11547  			"members_allowed_repository_creation_type": "marct",
 11548  			"members_can_create_pages": true,
 11549  			"members_can_create_public_pages": false,
 11550  			"members_can_create_private_pages": true
 11551  		},
 11552  		"sender": {
 11553  			"login": "l",
 11554  			"id": 1,
 11555  			"node_id": "n",
 11556  			"avatar_url": "a",
 11557  			"url": "u",
 11558  			"events_url": "e",
 11559  			"repos_url": "r"
 11560  		}
 11561  	}`
 11562  
 11563  	testJSONMarshal(t, u, want)
 11564  }
 11565  
 11566  func TestMetaEvent_Marshal(t *testing.T) {
 11567  	testJSONMarshal(t, &MetaEvent{}, "{}")
 11568  
 11569  	v := make(map[string]interface{})
 11570  	v["a"] = "b"
 11571  
 11572  	u := &MetaEvent{
 11573  		Action: String("a"),
 11574  		HookID: Int64(1),
 11575  		Hook: &Hook{
 11576  			CreatedAt:    &Timestamp{referenceTime},
 11577  			UpdatedAt:    &Timestamp{referenceTime},
 11578  			URL:          String("u"),
 11579  			ID:           Int64(1),
 11580  			Type:         String("t"),
 11581  			Name:         String("n"),
 11582  			TestURL:      String("tu"),
 11583  			PingURL:      String("pu"),
 11584  			LastResponse: v,
 11585  			Config:       v,
 11586  			Events:       []string{"a"},
 11587  			Active:       Bool(true),
 11588  		},
 11589  	}
 11590  
 11591  	want := `{
 11592  		"action": "a",
 11593  		"hook_id": 1,
 11594  		"hook": {
 11595  			"created_at": ` + referenceTimeStr + `,
 11596  			"updated_at": ` + referenceTimeStr + `,
 11597  			"url": "u",
 11598  			"id": 1,
 11599  			"type": "t",
 11600  			"name": "n",
 11601  			"test_url": "tu",
 11602  			"ping_url": "pu",
 11603  			"last_response": {
 11604  				"a": "b"
 11605  			},
 11606  			"config": {
 11607  				"a": "b"
 11608  			},
 11609  			"events": [
 11610  				"a"
 11611  			],
 11612  			"active": true
 11613  		}
 11614  	}`
 11615  
 11616  	testJSONMarshal(t, u, want)
 11617  }
 11618  
 11619  func TestRequestedAction_Marshal(t *testing.T) {
 11620  	testJSONMarshal(t, &RequestedAction{}, "{}")
 11621  
 11622  	r := &RequestedAction{
 11623  		Identifier: "i",
 11624  	}
 11625  
 11626  	want := `{
 11627  		"identifier": "i"
 11628  	}`
 11629  
 11630  	testJSONMarshal(t, r, want)
 11631  }
 11632  
 11633  func TestCreateEvent_Marshal(t *testing.T) {
 11634  	testJSONMarshal(t, &CreateEvent{}, "{}")
 11635  
 11636  	r := &CreateEvent{
 11637  		Ref:          String("r"),
 11638  		RefType:      String("rt"),
 11639  		MasterBranch: String("mb"),
 11640  		Description:  String("d"),
 11641  		PusherType:   String("pt"),
 11642  		Repo: &Repository{
 11643  			ID:   Int64(1),
 11644  			URL:  String("s"),
 11645  			Name: String("n"),
 11646  		},
 11647  		Sender: &User{
 11648  			Login:     String("l"),
 11649  			ID:        Int64(1),
 11650  			NodeID:    String("n"),
 11651  			URL:       String("u"),
 11652  			ReposURL:  String("r"),
 11653  			EventsURL: String("e"),
 11654  			AvatarURL: String("a"),
 11655  		},
 11656  		Installation: &Installation{
 11657  			ID:       Int64(1),
 11658  			NodeID:   String("nid"),
 11659  			AppID:    Int64(1),
 11660  			AppSlug:  String("as"),
 11661  			TargetID: Int64(1),
 11662  			Account: &User{
 11663  				Login:           String("l"),
 11664  				ID:              Int64(1),
 11665  				URL:             String("u"),
 11666  				AvatarURL:       String("a"),
 11667  				GravatarID:      String("g"),
 11668  				Name:            String("n"),
 11669  				Company:         String("c"),
 11670  				Blog:            String("b"),
 11671  				Location:        String("l"),
 11672  				Email:           String("e"),
 11673  				Hireable:        Bool(true),
 11674  				Bio:             String("b"),
 11675  				TwitterUsername: String("t"),
 11676  				PublicRepos:     Int(1),
 11677  				Followers:       Int(1),
 11678  				Following:       Int(1),
 11679  				CreatedAt:       &Timestamp{referenceTime},
 11680  				SuspendedAt:     &Timestamp{referenceTime},
 11681  			},
 11682  			AccessTokensURL:     String("atu"),
 11683  			RepositoriesURL:     String("ru"),
 11684  			HTMLURL:             String("hu"),
 11685  			TargetType:          String("tt"),
 11686  			SingleFileName:      String("sfn"),
 11687  			RepositorySelection: String("rs"),
 11688  			Events:              []string{"e"},
 11689  			SingleFilePaths:     []string{"s"},
 11690  			Permissions: &InstallationPermissions{
 11691  				Actions:                       String("a"),
 11692  				Administration:                String("ad"),
 11693  				Checks:                        String("c"),
 11694  				Contents:                      String("co"),
 11695  				ContentReferences:             String("cr"),
 11696  				Deployments:                   String("d"),
 11697  				Environments:                  String("e"),
 11698  				Issues:                        String("i"),
 11699  				Metadata:                      String("md"),
 11700  				Members:                       String("m"),
 11701  				OrganizationAdministration:    String("oa"),
 11702  				OrganizationHooks:             String("oh"),
 11703  				OrganizationPlan:              String("op"),
 11704  				OrganizationPreReceiveHooks:   String("opr"),
 11705  				OrganizationProjects:          String("op"),
 11706  				OrganizationSecrets:           String("os"),
 11707  				OrganizationSelfHostedRunners: String("osh"),
 11708  				OrganizationUserBlocking:      String("oub"),
 11709  				Packages:                      String("pkg"),
 11710  				Pages:                         String("pg"),
 11711  				PullRequests:                  String("pr"),
 11712  				RepositoryHooks:               String("rh"),
 11713  				RepositoryProjects:            String("rp"),
 11714  				RepositoryPreReceiveHooks:     String("rprh"),
 11715  				Secrets:                       String("s"),
 11716  				SecretScanningAlerts:          String("ssa"),
 11717  				SecurityEvents:                String("se"),
 11718  				SingleFile:                    String("sf"),
 11719  				Statuses:                      String("s"),
 11720  				TeamDiscussions:               String("td"),
 11721  				VulnerabilityAlerts:           String("va"),
 11722  				Workflows:                     String("w"),
 11723  			},
 11724  			CreatedAt:              &Timestamp{referenceTime},
 11725  			UpdatedAt:              &Timestamp{referenceTime},
 11726  			HasMultipleSingleFiles: Bool(false),
 11727  			SuspendedBy: &User{
 11728  				Login:           String("l"),
 11729  				ID:              Int64(1),
 11730  				URL:             String("u"),
 11731  				AvatarURL:       String("a"),
 11732  				GravatarID:      String("g"),
 11733  				Name:            String("n"),
 11734  				Company:         String("c"),
 11735  				Blog:            String("b"),
 11736  				Location:        String("l"),
 11737  				Email:           String("e"),
 11738  				Hireable:        Bool(true),
 11739  				Bio:             String("b"),
 11740  				TwitterUsername: String("t"),
 11741  				PublicRepos:     Int(1),
 11742  				Followers:       Int(1),
 11743  				Following:       Int(1),
 11744  				CreatedAt:       &Timestamp{referenceTime},
 11745  				SuspendedAt:     &Timestamp{referenceTime},
 11746  			},
 11747  			SuspendedAt: &Timestamp{referenceTime},
 11748  		},
 11749  	}
 11750  
 11751  	want := `{
 11752  		"ref": "r",
 11753  		"ref_type": "rt",
 11754  		"master_branch": "mb",
 11755  		"description": "d",
 11756  		"pusher_type": "pt",
 11757  		"repository": {
 11758  			"id": 1,
 11759  			"name": "n",
 11760  			"url": "s"
 11761  		},
 11762  		"sender": {
 11763  			"login": "l",
 11764  			"id": 1,
 11765  			"node_id": "n",
 11766  			"avatar_url": "a",
 11767  			"url": "u",
 11768  			"events_url": "e",
 11769  			"repos_url": "r"
 11770  		},
 11771  		"installation": {
 11772  			"id": 1,
 11773  			"node_id": "nid",
 11774  			"app_id": 1,
 11775  			"app_slug": "as",
 11776  			"target_id": 1,
 11777  			"account": {
 11778  				"login": "l",
 11779  				"id": 1,
 11780  				"avatar_url": "a",
 11781  				"gravatar_id": "g",
 11782  				"name": "n",
 11783  				"company": "c",
 11784  				"blog": "b",
 11785  				"location": "l",
 11786  				"email": "e",
 11787  				"hireable": true,
 11788  				"bio": "b",
 11789  				"twitter_username": "t",
 11790  				"public_repos": 1,
 11791  				"followers": 1,
 11792  				"following": 1,
 11793  				"created_at": ` + referenceTimeStr + `,
 11794  				"suspended_at": ` + referenceTimeStr + `,
 11795  				"url": "u"
 11796  			},
 11797  			"access_tokens_url": "atu",
 11798  			"repositories_url": "ru",
 11799  			"html_url": "hu",
 11800  			"target_type": "tt",
 11801  			"single_file_name": "sfn",
 11802  			"repository_selection": "rs",
 11803  			"events": [
 11804  				"e"
 11805  			],
 11806  			"single_file_paths": [
 11807  				"s"
 11808  			],
 11809  			"permissions": {
 11810  				"actions": "a",
 11811  				"administration": "ad",
 11812  				"checks": "c",
 11813  				"contents": "co",
 11814  				"content_references": "cr",
 11815  				"deployments": "d",
 11816  				"environments": "e",
 11817  				"issues": "i",
 11818  				"metadata": "md",
 11819  				"members": "m",
 11820  				"organization_administration": "oa",
 11821  				"organization_hooks": "oh",
 11822  				"organization_plan": "op",
 11823  				"organization_pre_receive_hooks": "opr",
 11824  				"organization_projects": "op",
 11825  				"organization_secrets": "os",
 11826  				"organization_self_hosted_runners": "osh",
 11827  				"organization_user_blocking": "oub",
 11828  				"packages": "pkg",
 11829  				"pages": "pg",
 11830  				"pull_requests": "pr",
 11831  				"repository_hooks": "rh",
 11832  				"repository_projects": "rp",
 11833  				"repository_pre_receive_hooks": "rprh",
 11834  				"secrets": "s",
 11835  				"secret_scanning_alerts": "ssa",
 11836  				"security_events": "se",
 11837  				"single_file": "sf",
 11838  				"statuses": "s",
 11839  				"team_discussions": "td",
 11840  				"vulnerability_alerts": "va",
 11841  				"workflows": "w"
 11842  			},
 11843  			"created_at": ` + referenceTimeStr + `,
 11844  			"updated_at": ` + referenceTimeStr + `,
 11845  			"has_multiple_single_files": false,
 11846  			"suspended_by": {
 11847  				"login": "l",
 11848  				"id": 1,
 11849  				"avatar_url": "a",
 11850  				"gravatar_id": "g",
 11851  				"name": "n",
 11852  				"company": "c",
 11853  				"blog": "b",
 11854  				"location": "l",
 11855  				"email": "e",
 11856  				"hireable": true,
 11857  				"bio": "b",
 11858  				"twitter_username": "t",
 11859  				"public_repos": 1,
 11860  				"followers": 1,
 11861  				"following": 1,
 11862  				"created_at": ` + referenceTimeStr + `,
 11863  				"suspended_at": ` + referenceTimeStr + `,
 11864  				"url": "u"
 11865  			},
 11866  			"suspended_at": ` + referenceTimeStr + `
 11867  		}
 11868  	}`
 11869  
 11870  	testJSONMarshal(t, r, want)
 11871  }
 11872  
 11873  func TestDeleteEvent_Marshal(t *testing.T) {
 11874  	testJSONMarshal(t, &DeleteEvent{}, "{}")
 11875  
 11876  	r := &DeleteEvent{
 11877  		Ref:        String("r"),
 11878  		RefType:    String("rt"),
 11879  		PusherType: String("pt"),
 11880  		Repo: &Repository{
 11881  			ID:   Int64(1),
 11882  			URL:  String("s"),
 11883  			Name: String("n"),
 11884  		},
 11885  		Sender: &User{
 11886  			Login:     String("l"),
 11887  			ID:        Int64(1),
 11888  			NodeID:    String("n"),
 11889  			URL:       String("u"),
 11890  			ReposURL:  String("r"),
 11891  			EventsURL: String("e"),
 11892  			AvatarURL: String("a"),
 11893  		},
 11894  		Installation: &Installation{
 11895  			ID:       Int64(1),
 11896  			NodeID:   String("nid"),
 11897  			AppID:    Int64(1),
 11898  			AppSlug:  String("as"),
 11899  			TargetID: Int64(1),
 11900  			Account: &User{
 11901  				Login:           String("l"),
 11902  				ID:              Int64(1),
 11903  				URL:             String("u"),
 11904  				AvatarURL:       String("a"),
 11905  				GravatarID:      String("g"),
 11906  				Name:            String("n"),
 11907  				Company:         String("c"),
 11908  				Blog:            String("b"),
 11909  				Location:        String("l"),
 11910  				Email:           String("e"),
 11911  				Hireable:        Bool(true),
 11912  				Bio:             String("b"),
 11913  				TwitterUsername: String("t"),
 11914  				PublicRepos:     Int(1),
 11915  				Followers:       Int(1),
 11916  				Following:       Int(1),
 11917  				CreatedAt:       &Timestamp{referenceTime},
 11918  				SuspendedAt:     &Timestamp{referenceTime},
 11919  			},
 11920  			AccessTokensURL:     String("atu"),
 11921  			RepositoriesURL:     String("ru"),
 11922  			HTMLURL:             String("hu"),
 11923  			TargetType:          String("tt"),
 11924  			SingleFileName:      String("sfn"),
 11925  			RepositorySelection: String("rs"),
 11926  			Events:              []string{"e"},
 11927  			SingleFilePaths:     []string{"s"},
 11928  			Permissions: &InstallationPermissions{
 11929  				Actions:                       String("a"),
 11930  				Administration:                String("ad"),
 11931  				Checks:                        String("c"),
 11932  				Contents:                      String("co"),
 11933  				ContentReferences:             String("cr"),
 11934  				Deployments:                   String("d"),
 11935  				Environments:                  String("e"),
 11936  				Issues:                        String("i"),
 11937  				Metadata:                      String("md"),
 11938  				Members:                       String("m"),
 11939  				OrganizationAdministration:    String("oa"),
 11940  				OrganizationHooks:             String("oh"),
 11941  				OrganizationPlan:              String("op"),
 11942  				OrganizationPreReceiveHooks:   String("opr"),
 11943  				OrganizationProjects:          String("op"),
 11944  				OrganizationSecrets:           String("os"),
 11945  				OrganizationSelfHostedRunners: String("osh"),
 11946  				OrganizationUserBlocking:      String("oub"),
 11947  				Packages:                      String("pkg"),
 11948  				Pages:                         String("pg"),
 11949  				PullRequests:                  String("pr"),
 11950  				RepositoryHooks:               String("rh"),
 11951  				RepositoryProjects:            String("rp"),
 11952  				RepositoryPreReceiveHooks:     String("rprh"),
 11953  				Secrets:                       String("s"),
 11954  				SecretScanningAlerts:          String("ssa"),
 11955  				SecurityEvents:                String("se"),
 11956  				SingleFile:                    String("sf"),
 11957  				Statuses:                      String("s"),
 11958  				TeamDiscussions:               String("td"),
 11959  				VulnerabilityAlerts:           String("va"),
 11960  				Workflows:                     String("w"),
 11961  			},
 11962  			CreatedAt:              &Timestamp{referenceTime},
 11963  			UpdatedAt:              &Timestamp{referenceTime},
 11964  			HasMultipleSingleFiles: Bool(false),
 11965  			SuspendedBy: &User{
 11966  				Login:           String("l"),
 11967  				ID:              Int64(1),
 11968  				URL:             String("u"),
 11969  				AvatarURL:       String("a"),
 11970  				GravatarID:      String("g"),
 11971  				Name:            String("n"),
 11972  				Company:         String("c"),
 11973  				Blog:            String("b"),
 11974  				Location:        String("l"),
 11975  				Email:           String("e"),
 11976  				Hireable:        Bool(true),
 11977  				Bio:             String("b"),
 11978  				TwitterUsername: String("t"),
 11979  				PublicRepos:     Int(1),
 11980  				Followers:       Int(1),
 11981  				Following:       Int(1),
 11982  				CreatedAt:       &Timestamp{referenceTime},
 11983  				SuspendedAt:     &Timestamp{referenceTime},
 11984  			},
 11985  			SuspendedAt: &Timestamp{referenceTime},
 11986  		},
 11987  	}
 11988  
 11989  	want := `{
 11990  		"ref": "r",
 11991  		"ref_type": "rt",
 11992  		"pusher_type": "pt",
 11993  		"repository": {
 11994  			"id": 1,
 11995  			"name": "n",
 11996  			"url": "s"
 11997  		},
 11998  		"sender": {
 11999  			"login": "l",
 12000  			"id": 1,
 12001  			"node_id": "n",
 12002  			"avatar_url": "a",
 12003  			"url": "u",
 12004  			"events_url": "e",
 12005  			"repos_url": "r"
 12006  		},
 12007  		"installation": {
 12008  			"id": 1,
 12009  			"node_id": "nid",
 12010  			"app_id": 1,
 12011  			"app_slug": "as",
 12012  			"target_id": 1,
 12013  			"account": {
 12014  				"login": "l",
 12015  				"id": 1,
 12016  				"avatar_url": "a",
 12017  				"gravatar_id": "g",
 12018  				"name": "n",
 12019  				"company": "c",
 12020  				"blog": "b",
 12021  				"location": "l",
 12022  				"email": "e",
 12023  				"hireable": true,
 12024  				"bio": "b",
 12025  				"twitter_username": "t",
 12026  				"public_repos": 1,
 12027  				"followers": 1,
 12028  				"following": 1,
 12029  				"created_at": ` + referenceTimeStr + `,
 12030  				"suspended_at": ` + referenceTimeStr + `,
 12031  				"url": "u"
 12032  			},
 12033  			"access_tokens_url": "atu",
 12034  			"repositories_url": "ru",
 12035  			"html_url": "hu",
 12036  			"target_type": "tt",
 12037  			"single_file_name": "sfn",
 12038  			"repository_selection": "rs",
 12039  			"events": [
 12040  				"e"
 12041  			],
 12042  			"single_file_paths": [
 12043  				"s"
 12044  			],
 12045  			"permissions": {
 12046  				"actions": "a",
 12047  				"administration": "ad",
 12048  				"checks": "c",
 12049  				"contents": "co",
 12050  				"content_references": "cr",
 12051  				"deployments": "d",
 12052  				"environments": "e",
 12053  				"issues": "i",
 12054  				"metadata": "md",
 12055  				"members": "m",
 12056  				"organization_administration": "oa",
 12057  				"organization_hooks": "oh",
 12058  				"organization_plan": "op",
 12059  				"organization_pre_receive_hooks": "opr",
 12060  				"organization_projects": "op",
 12061  				"organization_secrets": "os",
 12062  				"organization_self_hosted_runners": "osh",
 12063  				"organization_user_blocking": "oub",
 12064  				"packages": "pkg",
 12065  				"pages": "pg",
 12066  				"pull_requests": "pr",
 12067  				"repository_hooks": "rh",
 12068  				"repository_projects": "rp",
 12069  				"repository_pre_receive_hooks": "rprh",
 12070  				"secrets": "s",
 12071  				"secret_scanning_alerts": "ssa",
 12072  				"security_events": "se",
 12073  				"single_file": "sf",
 12074  				"statuses": "s",
 12075  				"team_discussions": "td",
 12076  				"vulnerability_alerts": "va",
 12077  				"workflows": "w"
 12078  			},
 12079  			"created_at": ` + referenceTimeStr + `,
 12080  			"updated_at": ` + referenceTimeStr + `,
 12081  			"has_multiple_single_files": false,
 12082  			"suspended_by": {
 12083  				"login": "l",
 12084  				"id": 1,
 12085  				"avatar_url": "a",
 12086  				"gravatar_id": "g",
 12087  				"name": "n",
 12088  				"company": "c",
 12089  				"blog": "b",
 12090  				"location": "l",
 12091  				"email": "e",
 12092  				"hireable": true,
 12093  				"bio": "b",
 12094  				"twitter_username": "t",
 12095  				"public_repos": 1,
 12096  				"followers": 1,
 12097  				"following": 1,
 12098  				"created_at": ` + referenceTimeStr + `,
 12099  				"suspended_at": ` + referenceTimeStr + `,
 12100  				"url": "u"
 12101  			},
 12102  			"suspended_at": ` + referenceTimeStr + `
 12103  		}
 12104  	}`
 12105  
 12106  	testJSONMarshal(t, r, want)
 12107  }
 12108  
 12109  func TestForkEvent_Marshal(t *testing.T) {
 12110  	testJSONMarshal(t, &ForkEvent{}, "{}")
 12111  
 12112  	u := &ForkEvent{
 12113  		Forkee: &Repository{
 12114  			ID:   Int64(1),
 12115  			URL:  String("s"),
 12116  			Name: String("n"),
 12117  		},
 12118  		Repo: &Repository{
 12119  			ID:   Int64(1),
 12120  			URL:  String("s"),
 12121  			Name: String("n"),
 12122  		},
 12123  		Sender: &User{
 12124  			Login:     String("l"),
 12125  			ID:        Int64(1),
 12126  			NodeID:    String("n"),
 12127  			URL:       String("u"),
 12128  			ReposURL:  String("r"),
 12129  			EventsURL: String("e"),
 12130  			AvatarURL: String("a"),
 12131  		},
 12132  		Installation: &Installation{
 12133  			ID:       Int64(1),
 12134  			NodeID:   String("nid"),
 12135  			AppID:    Int64(1),
 12136  			AppSlug:  String("as"),
 12137  			TargetID: Int64(1),
 12138  			Account: &User{
 12139  				Login:           String("l"),
 12140  				ID:              Int64(1),
 12141  				URL:             String("u"),
 12142  				AvatarURL:       String("a"),
 12143  				GravatarID:      String("g"),
 12144  				Name:            String("n"),
 12145  				Company:         String("c"),
 12146  				Blog:            String("b"),
 12147  				Location:        String("l"),
 12148  				Email:           String("e"),
 12149  				Hireable:        Bool(true),
 12150  				Bio:             String("b"),
 12151  				TwitterUsername: String("t"),
 12152  				PublicRepos:     Int(1),
 12153  				Followers:       Int(1),
 12154  				Following:       Int(1),
 12155  				CreatedAt:       &Timestamp{referenceTime},
 12156  				SuspendedAt:     &Timestamp{referenceTime},
 12157  			},
 12158  			AccessTokensURL:     String("atu"),
 12159  			RepositoriesURL:     String("ru"),
 12160  			HTMLURL:             String("hu"),
 12161  			TargetType:          String("tt"),
 12162  			SingleFileName:      String("sfn"),
 12163  			RepositorySelection: String("rs"),
 12164  			Events:              []string{"e"},
 12165  			SingleFilePaths:     []string{"s"},
 12166  			Permissions: &InstallationPermissions{
 12167  				Actions:                       String("a"),
 12168  				Administration:                String("ad"),
 12169  				Checks:                        String("c"),
 12170  				Contents:                      String("co"),
 12171  				ContentReferences:             String("cr"),
 12172  				Deployments:                   String("d"),
 12173  				Environments:                  String("e"),
 12174  				Issues:                        String("i"),
 12175  				Metadata:                      String("md"),
 12176  				Members:                       String("m"),
 12177  				OrganizationAdministration:    String("oa"),
 12178  				OrganizationHooks:             String("oh"),
 12179  				OrganizationPlan:              String("op"),
 12180  				OrganizationPreReceiveHooks:   String("opr"),
 12181  				OrganizationProjects:          String("op"),
 12182  				OrganizationSecrets:           String("os"),
 12183  				OrganizationSelfHostedRunners: String("osh"),
 12184  				OrganizationUserBlocking:      String("oub"),
 12185  				Packages:                      String("pkg"),
 12186  				Pages:                         String("pg"),
 12187  				PullRequests:                  String("pr"),
 12188  				RepositoryHooks:               String("rh"),
 12189  				RepositoryProjects:            String("rp"),
 12190  				RepositoryPreReceiveHooks:     String("rprh"),
 12191  				Secrets:                       String("s"),
 12192  				SecretScanningAlerts:          String("ssa"),
 12193  				SecurityEvents:                String("se"),
 12194  				SingleFile:                    String("sf"),
 12195  				Statuses:                      String("s"),
 12196  				TeamDiscussions:               String("td"),
 12197  				VulnerabilityAlerts:           String("va"),
 12198  				Workflows:                     String("w"),
 12199  			},
 12200  			CreatedAt:              &Timestamp{referenceTime},
 12201  			UpdatedAt:              &Timestamp{referenceTime},
 12202  			HasMultipleSingleFiles: Bool(false),
 12203  			SuspendedBy: &User{
 12204  				Login:           String("l"),
 12205  				ID:              Int64(1),
 12206  				URL:             String("u"),
 12207  				AvatarURL:       String("a"),
 12208  				GravatarID:      String("g"),
 12209  				Name:            String("n"),
 12210  				Company:         String("c"),
 12211  				Blog:            String("b"),
 12212  				Location:        String("l"),
 12213  				Email:           String("e"),
 12214  				Hireable:        Bool(true),
 12215  				Bio:             String("b"),
 12216  				TwitterUsername: String("t"),
 12217  				PublicRepos:     Int(1),
 12218  				Followers:       Int(1),
 12219  				Following:       Int(1),
 12220  				CreatedAt:       &Timestamp{referenceTime},
 12221  				SuspendedAt:     &Timestamp{referenceTime},
 12222  			},
 12223  			SuspendedAt: &Timestamp{referenceTime},
 12224  		},
 12225  	}
 12226  
 12227  	want := `{
 12228  		"forkee": {
 12229  			"id": 1,
 12230  			"name": "n",
 12231  			"url": "s"
 12232  		},
 12233  		"repository": {
 12234  			"id": 1,
 12235  			"name": "n",
 12236  			"url": "s"
 12237  		},
 12238  		"sender": {
 12239  			"login": "l",
 12240  			"id": 1,
 12241  			"node_id": "n",
 12242  			"avatar_url": "a",
 12243  			"url": "u",
 12244  			"events_url": "e",
 12245  			"repos_url": "r"
 12246  		},
 12247  		"installation": {
 12248  			"id": 1,
 12249  			"node_id": "nid",
 12250  			"app_id": 1,
 12251  			"app_slug": "as",
 12252  			"target_id": 1,
 12253  			"account": {
 12254  				"login": "l",
 12255  				"id": 1,
 12256  				"avatar_url": "a",
 12257  				"gravatar_id": "g",
 12258  				"name": "n",
 12259  				"company": "c",
 12260  				"blog": "b",
 12261  				"location": "l",
 12262  				"email": "e",
 12263  				"hireable": true,
 12264  				"bio": "b",
 12265  				"twitter_username": "t",
 12266  				"public_repos": 1,
 12267  				"followers": 1,
 12268  				"following": 1,
 12269  				"created_at": ` + referenceTimeStr + `,
 12270  				"suspended_at": ` + referenceTimeStr + `,
 12271  				"url": "u"
 12272  			},
 12273  			"access_tokens_url": "atu",
 12274  			"repositories_url": "ru",
 12275  			"html_url": "hu",
 12276  			"target_type": "tt",
 12277  			"single_file_name": "sfn",
 12278  			"repository_selection": "rs",
 12279  			"events": [
 12280  				"e"
 12281  			],
 12282  			"single_file_paths": [
 12283  				"s"
 12284  			],
 12285  			"permissions": {
 12286  				"actions": "a",
 12287  				"administration": "ad",
 12288  				"checks": "c",
 12289  				"contents": "co",
 12290  				"content_references": "cr",
 12291  				"deployments": "d",
 12292  				"environments": "e",
 12293  				"issues": "i",
 12294  				"metadata": "md",
 12295  				"members": "m",
 12296  				"organization_administration": "oa",
 12297  				"organization_hooks": "oh",
 12298  				"organization_plan": "op",
 12299  				"organization_pre_receive_hooks": "opr",
 12300  				"organization_projects": "op",
 12301  				"organization_secrets": "os",
 12302  				"organization_self_hosted_runners": "osh",
 12303  				"organization_user_blocking": "oub",
 12304  				"packages": "pkg",
 12305  				"pages": "pg",
 12306  				"pull_requests": "pr",
 12307  				"repository_hooks": "rh",
 12308  				"repository_projects": "rp",
 12309  				"repository_pre_receive_hooks": "rprh",
 12310  				"secrets": "s",
 12311  				"secret_scanning_alerts": "ssa",
 12312  				"security_events": "se",
 12313  				"single_file": "sf",
 12314  				"statuses": "s",
 12315  				"team_discussions": "td",
 12316  				"vulnerability_alerts": "va",
 12317  				"workflows": "w"
 12318  			},
 12319  			"created_at": ` + referenceTimeStr + `,
 12320  			"updated_at": ` + referenceTimeStr + `,
 12321  			"has_multiple_single_files": false,
 12322  			"suspended_by": {
 12323  				"login": "l",
 12324  				"id": 1,
 12325  				"avatar_url": "a",
 12326  				"gravatar_id": "g",
 12327  				"name": "n",
 12328  				"company": "c",
 12329  				"blog": "b",
 12330  				"location": "l",
 12331  				"email": "e",
 12332  				"hireable": true,
 12333  				"bio": "b",
 12334  				"twitter_username": "t",
 12335  				"public_repos": 1,
 12336  				"followers": 1,
 12337  				"following": 1,
 12338  				"created_at": ` + referenceTimeStr + `,
 12339  				"suspended_at": ` + referenceTimeStr + `,
 12340  				"url": "u"
 12341  			},
 12342  			"suspended_at": ` + referenceTimeStr + `
 12343  		}
 12344  	}`
 12345  
 12346  	testJSONMarshal(t, u, want)
 12347  }
 12348  
 12349  func TestGitHubAppAuthorizationEvent_Marshal(t *testing.T) {
 12350  	testJSONMarshal(t, &GitHubAppAuthorizationEvent{}, "{}")
 12351  
 12352  	u := &GitHubAppAuthorizationEvent{
 12353  		Action: String("a"),
 12354  		Sender: &User{
 12355  			Login:     String("l"),
 12356  			ID:        Int64(1),
 12357  			NodeID:    String("n"),
 12358  			URL:       String("u"),
 12359  			ReposURL:  String("r"),
 12360  			EventsURL: String("e"),
 12361  			AvatarURL: String("a"),
 12362  		},
 12363  	}
 12364  
 12365  	want := `{
 12366  		"action": "a",
 12367  		"sender": {
 12368  			"login": "l",
 12369  			"id": 1,
 12370  			"node_id": "n",
 12371  			"avatar_url": "a",
 12372  			"url": "u",
 12373  			"events_url": "e",
 12374  			"repos_url": "r"
 12375  		}
 12376  	}`
 12377  
 12378  	testJSONMarshal(t, u, want)
 12379  }
 12380  
 12381  func TestInstallationEvent_Marshal(t *testing.T) {
 12382  	testJSONMarshal(t, &InstallationEvent{}, "{}")
 12383  
 12384  	u := &InstallationEvent{
 12385  		Action: String("a"),
 12386  		Repositories: []*Repository{
 12387  			{
 12388  				ID:   Int64(1),
 12389  				URL:  String("u"),
 12390  				Name: String("n"),
 12391  			},
 12392  		},
 12393  		Sender: &User{
 12394  			Login:     String("l"),
 12395  			ID:        Int64(1),
 12396  			NodeID:    String("n"),
 12397  			URL:       String("u"),
 12398  			ReposURL:  String("r"),
 12399  			EventsURL: String("e"),
 12400  			AvatarURL: String("a"),
 12401  		},
 12402  		Installation: &Installation{
 12403  			ID:       Int64(1),
 12404  			NodeID:   String("nid"),
 12405  			AppID:    Int64(1),
 12406  			AppSlug:  String("as"),
 12407  			TargetID: Int64(1),
 12408  			Account: &User{
 12409  				Login:           String("l"),
 12410  				ID:              Int64(1),
 12411  				URL:             String("u"),
 12412  				AvatarURL:       String("a"),
 12413  				GravatarID:      String("g"),
 12414  				Name:            String("n"),
 12415  				Company:         String("c"),
 12416  				Blog:            String("b"),
 12417  				Location:        String("l"),
 12418  				Email:           String("e"),
 12419  				Hireable:        Bool(true),
 12420  				Bio:             String("b"),
 12421  				TwitterUsername: String("t"),
 12422  				PublicRepos:     Int(1),
 12423  				Followers:       Int(1),
 12424  				Following:       Int(1),
 12425  				CreatedAt:       &Timestamp{referenceTime},
 12426  				SuspendedAt:     &Timestamp{referenceTime},
 12427  			},
 12428  			AccessTokensURL:     String("atu"),
 12429  			RepositoriesURL:     String("ru"),
 12430  			HTMLURL:             String("hu"),
 12431  			TargetType:          String("tt"),
 12432  			SingleFileName:      String("sfn"),
 12433  			RepositorySelection: String("rs"),
 12434  			Events:              []string{"e"},
 12435  			SingleFilePaths:     []string{"s"},
 12436  			Permissions: &InstallationPermissions{
 12437  				Actions:                       String("a"),
 12438  				Administration:                String("ad"),
 12439  				Checks:                        String("c"),
 12440  				Contents:                      String("co"),
 12441  				ContentReferences:             String("cr"),
 12442  				Deployments:                   String("d"),
 12443  				Environments:                  String("e"),
 12444  				Issues:                        String("i"),
 12445  				Metadata:                      String("md"),
 12446  				Members:                       String("m"),
 12447  				OrganizationAdministration:    String("oa"),
 12448  				OrganizationHooks:             String("oh"),
 12449  				OrganizationPlan:              String("op"),
 12450  				OrganizationPreReceiveHooks:   String("opr"),
 12451  				OrganizationProjects:          String("op"),
 12452  				OrganizationSecrets:           String("os"),
 12453  				OrganizationSelfHostedRunners: String("osh"),
 12454  				OrganizationUserBlocking:      String("oub"),
 12455  				Packages:                      String("pkg"),
 12456  				Pages:                         String("pg"),
 12457  				PullRequests:                  String("pr"),
 12458  				RepositoryHooks:               String("rh"),
 12459  				RepositoryProjects:            String("rp"),
 12460  				RepositoryPreReceiveHooks:     String("rprh"),
 12461  				Secrets:                       String("s"),
 12462  				SecretScanningAlerts:          String("ssa"),
 12463  				SecurityEvents:                String("se"),
 12464  				SingleFile:                    String("sf"),
 12465  				Statuses:                      String("s"),
 12466  				TeamDiscussions:               String("td"),
 12467  				VulnerabilityAlerts:           String("va"),
 12468  				Workflows:                     String("w"),
 12469  			},
 12470  			CreatedAt:              &Timestamp{referenceTime},
 12471  			UpdatedAt:              &Timestamp{referenceTime},
 12472  			HasMultipleSingleFiles: Bool(false),
 12473  			SuspendedBy: &User{
 12474  				Login:           String("l"),
 12475  				ID:              Int64(1),
 12476  				URL:             String("u"),
 12477  				AvatarURL:       String("a"),
 12478  				GravatarID:      String("g"),
 12479  				Name:            String("n"),
 12480  				Company:         String("c"),
 12481  				Blog:            String("b"),
 12482  				Location:        String("l"),
 12483  				Email:           String("e"),
 12484  				Hireable:        Bool(true),
 12485  				Bio:             String("b"),
 12486  				TwitterUsername: String("t"),
 12487  				PublicRepos:     Int(1),
 12488  				Followers:       Int(1),
 12489  				Following:       Int(1),
 12490  				CreatedAt:       &Timestamp{referenceTime},
 12491  				SuspendedAt:     &Timestamp{referenceTime},
 12492  			},
 12493  			SuspendedAt: &Timestamp{referenceTime},
 12494  		},
 12495  	}
 12496  
 12497  	want := `{
 12498  		"action": "a",
 12499  		"repositories": [
 12500  			{
 12501  				"id":1,
 12502  				"name":"n",
 12503  				"url":"u"
 12504  			}
 12505  		],
 12506  		"sender": {
 12507  			"login": "l",
 12508  			"id": 1,
 12509  			"node_id": "n",
 12510  			"avatar_url": "a",
 12511  			"url": "u",
 12512  			"events_url": "e",
 12513  			"repos_url": "r"
 12514  		},
 12515  		"installation": {
 12516  			"id": 1,
 12517  			"node_id": "nid",
 12518  			"app_id": 1,
 12519  			"app_slug": "as",
 12520  			"target_id": 1,
 12521  			"account": {
 12522  				"login": "l",
 12523  				"id": 1,
 12524  				"avatar_url": "a",
 12525  				"gravatar_id": "g",
 12526  				"name": "n",
 12527  				"company": "c",
 12528  				"blog": "b",
 12529  				"location": "l",
 12530  				"email": "e",
 12531  				"hireable": true,
 12532  				"bio": "b",
 12533  				"twitter_username": "t",
 12534  				"public_repos": 1,
 12535  				"followers": 1,
 12536  				"following": 1,
 12537  				"created_at": ` + referenceTimeStr + `,
 12538  				"suspended_at": ` + referenceTimeStr + `,
 12539  				"url": "u"
 12540  			},
 12541  			"access_tokens_url": "atu",
 12542  			"repositories_url": "ru",
 12543  			"html_url": "hu",
 12544  			"target_type": "tt",
 12545  			"single_file_name": "sfn",
 12546  			"repository_selection": "rs",
 12547  			"events": [
 12548  				"e"
 12549  			],
 12550  			"single_file_paths": [
 12551  				"s"
 12552  			],
 12553  			"permissions": {
 12554  				"actions": "a",
 12555  				"administration": "ad",
 12556  				"checks": "c",
 12557  				"contents": "co",
 12558  				"content_references": "cr",
 12559  				"deployments": "d",
 12560  				"environments": "e",
 12561  				"issues": "i",
 12562  				"metadata": "md",
 12563  				"members": "m",
 12564  				"organization_administration": "oa",
 12565  				"organization_hooks": "oh",
 12566  				"organization_plan": "op",
 12567  				"organization_pre_receive_hooks": "opr",
 12568  				"organization_projects": "op",
 12569  				"organization_secrets": "os",
 12570  				"organization_self_hosted_runners": "osh",
 12571  				"organization_user_blocking": "oub",
 12572  				"packages": "pkg",
 12573  				"pages": "pg",
 12574  				"pull_requests": "pr",
 12575  				"repository_hooks": "rh",
 12576  				"repository_projects": "rp",
 12577  				"repository_pre_receive_hooks": "rprh",
 12578  				"secrets": "s",
 12579  				"secret_scanning_alerts": "ssa",
 12580  				"security_events": "se",
 12581  				"single_file": "sf",
 12582  				"statuses": "s",
 12583  				"team_discussions": "td",
 12584  				"vulnerability_alerts": "va",
 12585  				"workflows": "w"
 12586  			},
 12587  			"created_at": ` + referenceTimeStr + `,
 12588  			"updated_at": ` + referenceTimeStr + `,
 12589  			"has_multiple_single_files": false,
 12590  			"suspended_by": {
 12591  				"login": "l",
 12592  				"id": 1,
 12593  				"avatar_url": "a",
 12594  				"gravatar_id": "g",
 12595  				"name": "n",
 12596  				"company": "c",
 12597  				"blog": "b",
 12598  				"location": "l",
 12599  				"email": "e",
 12600  				"hireable": true,
 12601  				"bio": "b",
 12602  				"twitter_username": "t",
 12603  				"public_repos": 1,
 12604  				"followers": 1,
 12605  				"following": 1,
 12606  				"created_at": ` + referenceTimeStr + `,
 12607  				"suspended_at": ` + referenceTimeStr + `,
 12608  				"url": "u"
 12609  			},
 12610  			"suspended_at": ` + referenceTimeStr + `
 12611  		}
 12612  	}`
 12613  
 12614  	testJSONMarshal(t, u, want)
 12615  }
 12616  
 12617  func TestHeadCommit_Marshal(t *testing.T) {
 12618  	testJSONMarshal(t, &HeadCommit{}, "{}")
 12619  
 12620  	u := &HeadCommit{
 12621  		Message: String("m"),
 12622  		Author: &CommitAuthor{
 12623  			Date:  &Timestamp{referenceTime},
 12624  			Name:  String("n"),
 12625  			Email: String("e"),
 12626  			Login: String("u"),
 12627  		},
 12628  		URL:       String("u"),
 12629  		Distinct:  Bool(true),
 12630  		SHA:       String("s"),
 12631  		ID:        String("id"),
 12632  		TreeID:    String("tid"),
 12633  		Timestamp: &Timestamp{referenceTime},
 12634  		Committer: &CommitAuthor{
 12635  			Date:  &Timestamp{referenceTime},
 12636  			Name:  String("n"),
 12637  			Email: String("e"),
 12638  			Login: String("u"),
 12639  		},
 12640  		Added:    []string{"a"},
 12641  		Removed:  []string{"r"},
 12642  		Modified: []string{"m"},
 12643  	}
 12644  
 12645  	want := `{
 12646  		"message": "m",
 12647  		"author": {
 12648  			"date": ` + referenceTimeStr + `,
 12649  			"name": "n",
 12650  			"email": "e",
 12651  			"username": "u"
 12652  		},
 12653  		"url": "u",
 12654  		"distinct": true,
 12655  		"sha": "s",
 12656  		"id": "id",
 12657  		"tree_id": "tid",
 12658  		"timestamp": ` + referenceTimeStr + `,
 12659  		"committer": {
 12660  			"date": ` + referenceTimeStr + `,
 12661  			"name": "n",
 12662  			"email": "e",
 12663  			"username": "u"
 12664  		},
 12665  		"added": [
 12666  			"a"
 12667  		],
 12668  		"removed":  [
 12669  			"r"
 12670  		],
 12671  		"modified":  [
 12672  			"m"
 12673  		]
 12674  	}`
 12675  
 12676  	testJSONMarshal(t, u, want)
 12677  }
 12678  
 12679  func TestPushEventRepository_Marshal(t *testing.T) {
 12680  	testJSONMarshal(t, &PushEventRepository{}, "{}")
 12681  
 12682  	u := &PushEventRepository{
 12683  		ID:       Int64(1),
 12684  		NodeID:   String("nid"),
 12685  		Name:     String("n"),
 12686  		FullName: String("fn"),
 12687  		Owner: &User{
 12688  			Login:       String("l"),
 12689  			ID:          Int64(1),
 12690  			AvatarURL:   String("a"),
 12691  			GravatarID:  String("g"),
 12692  			Name:        String("n"),
 12693  			Company:     String("c"),
 12694  			Blog:        String("b"),
 12695  			Location:    String("l"),
 12696  			Email:       String("e"),
 12697  			Hireable:    Bool(true),
 12698  			PublicRepos: Int(1),
 12699  			Followers:   Int(1),
 12700  			Following:   Int(1),
 12701  			CreatedAt:   &Timestamp{referenceTime},
 12702  			URL:         String("u"),
 12703  		},
 12704  		Private:         Bool(true),
 12705  		Description:     String("d"),
 12706  		Fork:            Bool(true),
 12707  		CreatedAt:       &Timestamp{referenceTime},
 12708  		PushedAt:        &Timestamp{referenceTime},
 12709  		UpdatedAt:       &Timestamp{referenceTime},
 12710  		Homepage:        String("h"),
 12711  		PullsURL:        String("p"),
 12712  		Size:            Int(1),
 12713  		StargazersCount: Int(1),
 12714  		WatchersCount:   Int(1),
 12715  		Language:        String("l"),
 12716  		HasIssues:       Bool(true),
 12717  		HasDownloads:    Bool(true),
 12718  		HasWiki:         Bool(true),
 12719  		HasPages:        Bool(true),
 12720  		ForksCount:      Int(1),
 12721  		Archived:        Bool(true),
 12722  		Disabled:        Bool(true),
 12723  		OpenIssuesCount: Int(1),
 12724  		DefaultBranch:   String("d"),
 12725  		MasterBranch:    String("m"),
 12726  		Organization:    String("o"),
 12727  		URL:             String("u"),
 12728  		ArchiveURL:      String("a"),
 12729  		HTMLURL:         String("h"),
 12730  		StatusesURL:     String("s"),
 12731  		GitURL:          String("g"),
 12732  		SSHURL:          String("s"),
 12733  		CloneURL:        String("c"),
 12734  		SVNURL:          String("s"),
 12735  		Topics:          []string{"octocat", "api"},
 12736  	}
 12737  
 12738  	want := `{
 12739  		"id": 1,
 12740  		"node_id": "nid",
 12741  		"name": "n",
 12742  		"full_name": "fn",
 12743  		"owner": {
 12744  			"login": "l",
 12745  			"id": 1,
 12746  			"avatar_url": "a",
 12747  			"gravatar_id": "g",
 12748  			"name": "n",
 12749  			"company": "c",
 12750  			"blog": "b",
 12751  			"location": "l",
 12752  			"email": "e",
 12753  			"hireable": true,
 12754  			"public_repos": 1,
 12755  			"followers": 1,
 12756  			"following": 1,
 12757  			"created_at": ` + referenceTimeStr + `,
 12758  			"url": "u"
 12759  		},
 12760  		"private": true,
 12761  		"description": "d",
 12762  		"fork": true,
 12763  		"created_at": ` + referenceTimeStr + `,
 12764  		"pushed_at": ` + referenceTimeStr + `,
 12765  		"updated_at": ` + referenceTimeStr + `,
 12766  		"homepage": "h",
 12767  		"pulls_url": "p",
 12768  		"size": 1,
 12769  		"stargazers_count": 1,
 12770  		"watchers_count": 1,
 12771  		"language": "l",
 12772  		"has_issues": true,
 12773  		"has_downloads": true,
 12774  		"has_wiki": true,
 12775  		"has_pages": true,
 12776  		"forks_count": 1,
 12777  		"archived": true,
 12778  		"disabled": true,
 12779  		"open_issues_count": 1,
 12780  		"default_branch": "d",
 12781  		"master_branch": "m",
 12782  		"organization": "o",
 12783  		"url": "u",
 12784  		"archive_url": "a",
 12785  		"html_url": "h",
 12786  		"statuses_url": "s",
 12787  		"git_url": "g",
 12788  		"ssh_url": "s",
 12789  		"clone_url": "c",
 12790  		"svn_url": "s",
 12791  		"topics": ["octocat","api"]
 12792      }`
 12793  
 12794  	testJSONMarshal(t, u, want)
 12795  }
 12796  
 12797  func TestPushEventRepoOwner_Marshal(t *testing.T) {
 12798  	testJSONMarshal(t, &PushEventRepoOwner{}, "{}")
 12799  
 12800  	u := &PushEventRepoOwner{
 12801  		Name:  String("n"),
 12802  		Email: String("e"),
 12803  	}
 12804  
 12805  	want := `{
 12806  		"name": "n",
 12807  		"email": "e"
 12808  	}`
 12809  
 12810  	testJSONMarshal(t, u, want)
 12811  }
 12812  
 12813  func TestProjectEvent_Marshal(t *testing.T) {
 12814  	testJSONMarshal(t, &ProjectEvent{}, "{}")
 12815  
 12816  	u := &ProjectEvent{
 12817  		Project: &Project{ID: Int64(1)},
 12818  		Action:  String("a"),
 12819  		Changes: &ProjectChange{
 12820  			Name: &ProjectName{From: String("NameFrom")},
 12821  			Body: &ProjectBody{From: String("BodyFrom")},
 12822  		},
 12823  		Repo: &Repository{
 12824  			ID:   Int64(1),
 12825  			URL:  String("s"),
 12826  			Name: String("n"),
 12827  		},
 12828  		Org: &Organization{
 12829  			BillingEmail:                         String("be"),
 12830  			Blog:                                 String("b"),
 12831  			Company:                              String("c"),
 12832  			Email:                                String("e"),
 12833  			TwitterUsername:                      String("tu"),
 12834  			Location:                             String("loc"),
 12835  			Name:                                 String("n"),
 12836  			Description:                          String("d"),
 12837  			IsVerified:                           Bool(true),
 12838  			HasOrganizationProjects:              Bool(true),
 12839  			HasRepositoryProjects:                Bool(true),
 12840  			DefaultRepoPermission:                String("drp"),
 12841  			MembersCanCreateRepos:                Bool(true),
 12842  			MembersCanCreateInternalRepos:        Bool(true),
 12843  			MembersCanCreatePrivateRepos:         Bool(true),
 12844  			MembersCanCreatePublicRepos:          Bool(false),
 12845  			MembersAllowedRepositoryCreationType: String("marct"),
 12846  			MembersCanCreatePages:                Bool(true),
 12847  			MembersCanCreatePublicPages:          Bool(false),
 12848  			MembersCanCreatePrivatePages:         Bool(true),
 12849  		},
 12850  		Sender: &User{
 12851  			Login:     String("l"),
 12852  			ID:        Int64(1),
 12853  			NodeID:    String("n"),
 12854  			URL:       String("u"),
 12855  			ReposURL:  String("r"),
 12856  			EventsURL: String("e"),
 12857  			AvatarURL: String("a"),
 12858  		},
 12859  		Installation: &Installation{
 12860  			ID:       Int64(1),
 12861  			NodeID:   String("nid"),
 12862  			AppID:    Int64(1),
 12863  			AppSlug:  String("as"),
 12864  			TargetID: Int64(1),
 12865  			Account: &User{
 12866  				Login:           String("l"),
 12867  				ID:              Int64(1),
 12868  				URL:             String("u"),
 12869  				AvatarURL:       String("a"),
 12870  				GravatarID:      String("g"),
 12871  				Name:            String("n"),
 12872  				Company:         String("c"),
 12873  				Blog:            String("b"),
 12874  				Location:        String("l"),
 12875  				Email:           String("e"),
 12876  				Hireable:        Bool(true),
 12877  				Bio:             String("b"),
 12878  				TwitterUsername: String("t"),
 12879  				PublicRepos:     Int(1),
 12880  				Followers:       Int(1),
 12881  				Following:       Int(1),
 12882  				CreatedAt:       &Timestamp{referenceTime},
 12883  				SuspendedAt:     &Timestamp{referenceTime},
 12884  			},
 12885  			AccessTokensURL:     String("atu"),
 12886  			RepositoriesURL:     String("ru"),
 12887  			HTMLURL:             String("hu"),
 12888  			TargetType:          String("tt"),
 12889  			SingleFileName:      String("sfn"),
 12890  			RepositorySelection: String("rs"),
 12891  			Events:              []string{"e"},
 12892  			SingleFilePaths:     []string{"s"},
 12893  			Permissions: &InstallationPermissions{
 12894  				Actions:                       String("a"),
 12895  				Administration:                String("ad"),
 12896  				Checks:                        String("c"),
 12897  				Contents:                      String("co"),
 12898  				ContentReferences:             String("cr"),
 12899  				Deployments:                   String("d"),
 12900  				Environments:                  String("e"),
 12901  				Issues:                        String("i"),
 12902  				Metadata:                      String("md"),
 12903  				Members:                       String("m"),
 12904  				OrganizationAdministration:    String("oa"),
 12905  				OrganizationHooks:             String("oh"),
 12906  				OrganizationPlan:              String("op"),
 12907  				OrganizationPreReceiveHooks:   String("opr"),
 12908  				OrganizationProjects:          String("op"),
 12909  				OrganizationSecrets:           String("os"),
 12910  				OrganizationSelfHostedRunners: String("osh"),
 12911  				OrganizationUserBlocking:      String("oub"),
 12912  				Packages:                      String("pkg"),
 12913  				Pages:                         String("pg"),
 12914  				PullRequests:                  String("pr"),
 12915  				RepositoryHooks:               String("rh"),
 12916  				RepositoryProjects:            String("rp"),
 12917  				RepositoryPreReceiveHooks:     String("rprh"),
 12918  				Secrets:                       String("s"),
 12919  				SecretScanningAlerts:          String("ssa"),
 12920  				SecurityEvents:                String("se"),
 12921  				SingleFile:                    String("sf"),
 12922  				Statuses:                      String("s"),
 12923  				TeamDiscussions:               String("td"),
 12924  				VulnerabilityAlerts:           String("va"),
 12925  				Workflows:                     String("w"),
 12926  			},
 12927  			CreatedAt:              &Timestamp{referenceTime},
 12928  			UpdatedAt:              &Timestamp{referenceTime},
 12929  			HasMultipleSingleFiles: Bool(false),
 12930  			SuspendedBy: &User{
 12931  				Login:           String("l"),
 12932  				ID:              Int64(1),
 12933  				URL:             String("u"),
 12934  				AvatarURL:       String("a"),
 12935  				GravatarID:      String("g"),
 12936  				Name:            String("n"),
 12937  				Company:         String("c"),
 12938  				Blog:            String("b"),
 12939  				Location:        String("l"),
 12940  				Email:           String("e"),
 12941  				Hireable:        Bool(true),
 12942  				Bio:             String("b"),
 12943  				TwitterUsername: String("t"),
 12944  				PublicRepos:     Int(1),
 12945  				Followers:       Int(1),
 12946  				Following:       Int(1),
 12947  				CreatedAt:       &Timestamp{referenceTime},
 12948  				SuspendedAt:     &Timestamp{referenceTime},
 12949  			},
 12950  			SuspendedAt: &Timestamp{referenceTime},
 12951  		},
 12952  	}
 12953  
 12954  	want := `{
 12955  		"action": "a",
 12956  		"changes": {
 12957  			"name": {
 12958  				"from": "NameFrom"
 12959  			},
 12960  			"body": {
 12961  				"from": "BodyFrom"
 12962  			}
 12963  		},
 12964  		"project": {
 12965  			"id": 1
 12966  		},
 12967  		"repository": {
 12968  			"id": 1,
 12969  			"name": "n",
 12970  			"url": "s"
 12971  		},
 12972  		"organization": {
 12973  			"name": "n",
 12974  			"company": "c",
 12975  			"blog": "b",
 12976  			"location": "loc",
 12977  			"email": "e",
 12978  			"twitter_username": "tu",
 12979  			"description": "d",
 12980  			"billing_email": "be",
 12981  			"is_verified": true,
 12982  			"has_organization_projects": true,
 12983  			"has_repository_projects": true,
 12984  			"default_repository_permission": "drp",
 12985  			"members_can_create_repositories": true,
 12986  			"members_can_create_public_repositories": false,
 12987  			"members_can_create_private_repositories": true,
 12988  			"members_can_create_internal_repositories": true,
 12989  			"members_allowed_repository_creation_type": "marct",
 12990  			"members_can_create_pages": true,
 12991  			"members_can_create_public_pages": false,
 12992  			"members_can_create_private_pages": true
 12993  		},
 12994  		"sender": {
 12995  			"login": "l",
 12996  			"id": 1,
 12997  			"node_id": "n",
 12998  			"avatar_url": "a",
 12999  			"url": "u",
 13000  			"events_url": "e",
 13001  			"repos_url": "r"
 13002  		},
 13003  		"installation": {
 13004  			"id": 1,
 13005  			"node_id": "nid",
 13006  			"app_id": 1,
 13007  			"app_slug": "as",
 13008  			"target_id": 1,
 13009  			"account": {
 13010  				"login": "l",
 13011  				"id": 1,
 13012  				"avatar_url": "a",
 13013  				"gravatar_id": "g",
 13014  				"name": "n",
 13015  				"company": "c",
 13016  				"blog": "b",
 13017  				"location": "l",
 13018  				"email": "e",
 13019  				"hireable": true,
 13020  				"bio": "b",
 13021  				"twitter_username": "t",
 13022  				"public_repos": 1,
 13023  				"followers": 1,
 13024  				"following": 1,
 13025  				"created_at": ` + referenceTimeStr + `,
 13026  				"suspended_at": ` + referenceTimeStr + `,
 13027  				"url": "u"
 13028  			},
 13029  			"access_tokens_url": "atu",
 13030  			"repositories_url": "ru",
 13031  			"html_url": "hu",
 13032  			"target_type": "tt",
 13033  			"single_file_name": "sfn",
 13034  			"repository_selection": "rs",
 13035  			"events": [
 13036  				"e"
 13037  			],
 13038  			"single_file_paths": [
 13039  				"s"
 13040  			],
 13041  			"permissions": {
 13042  				"actions": "a",
 13043  				"administration": "ad",
 13044  				"checks": "c",
 13045  				"contents": "co",
 13046  				"content_references": "cr",
 13047  				"deployments": "d",
 13048  				"environments": "e",
 13049  				"issues": "i",
 13050  				"metadata": "md",
 13051  				"members": "m",
 13052  				"organization_administration": "oa",
 13053  				"organization_hooks": "oh",
 13054  				"organization_plan": "op",
 13055  				"organization_pre_receive_hooks": "opr",
 13056  				"organization_projects": "op",
 13057  				"organization_secrets": "os",
 13058  				"organization_self_hosted_runners": "osh",
 13059  				"organization_user_blocking": "oub",
 13060  				"packages": "pkg",
 13061  				"pages": "pg",
 13062  				"pull_requests": "pr",
 13063  				"repository_hooks": "rh",
 13064  				"repository_projects": "rp",
 13065  				"repository_pre_receive_hooks": "rprh",
 13066  				"secrets": "s",
 13067  				"secret_scanning_alerts": "ssa",
 13068  				"security_events": "se",
 13069  				"single_file": "sf",
 13070  				"statuses": "s",
 13071  				"team_discussions": "td",
 13072  				"vulnerability_alerts": "va",
 13073  				"workflows": "w"
 13074  			},
 13075  			"created_at": ` + referenceTimeStr + `,
 13076  			"updated_at": ` + referenceTimeStr + `,
 13077  			"has_multiple_single_files": false,
 13078  			"suspended_by": {
 13079  				"login": "l",
 13080  				"id": 1,
 13081  				"avatar_url": "a",
 13082  				"gravatar_id": "g",
 13083  				"name": "n",
 13084  				"company": "c",
 13085  				"blog": "b",
 13086  				"location": "l",
 13087  				"email": "e",
 13088  				"hireable": true,
 13089  				"bio": "b",
 13090  				"twitter_username": "t",
 13091  				"public_repos": 1,
 13092  				"followers": 1,
 13093  				"following": 1,
 13094  				"created_at": ` + referenceTimeStr + `,
 13095  				"suspended_at": ` + referenceTimeStr + `,
 13096  				"url": "u"
 13097  			},
 13098  			"suspended_at": ` + referenceTimeStr + `
 13099  		}
 13100  	}`
 13101  
 13102  	testJSONMarshal(t, u, want)
 13103  }
 13104  
 13105  func TestProjectCardEvent_Marshal(t *testing.T) {
 13106  	testJSONMarshal(t, &ProjectCardEvent{}, "{}")
 13107  
 13108  	u := &ProjectCardEvent{
 13109  		Action: String("a"),
 13110  		Changes: &ProjectCardChange{
 13111  			Note: &ProjectCardNote{From: String("NoteFrom")},
 13112  		},
 13113  		AfterID:     Int64(1),
 13114  		ProjectCard: &ProjectCard{ID: Int64(1)},
 13115  		Repo: &Repository{
 13116  			ID:   Int64(1),
 13117  			URL:  String("s"),
 13118  			Name: String("n"),
 13119  		},
 13120  		Org: &Organization{
 13121  			BillingEmail:                         String("be"),
 13122  			Blog:                                 String("b"),
 13123  			Company:                              String("c"),
 13124  			Email:                                String("e"),
 13125  			TwitterUsername:                      String("tu"),
 13126  			Location:                             String("loc"),
 13127  			Name:                                 String("n"),
 13128  			Description:                          String("d"),
 13129  			IsVerified:                           Bool(true),
 13130  			HasOrganizationProjects:              Bool(true),
 13131  			HasRepositoryProjects:                Bool(true),
 13132  			DefaultRepoPermission:                String("drp"),
 13133  			MembersCanCreateRepos:                Bool(true),
 13134  			MembersCanCreateInternalRepos:        Bool(true),
 13135  			MembersCanCreatePrivateRepos:         Bool(true),
 13136  			MembersCanCreatePublicRepos:          Bool(false),
 13137  			MembersAllowedRepositoryCreationType: String("marct"),
 13138  			MembersCanCreatePages:                Bool(true),
 13139  			MembersCanCreatePublicPages:          Bool(false),
 13140  			MembersCanCreatePrivatePages:         Bool(true),
 13141  		},
 13142  		Sender: &User{
 13143  			Login:     String("l"),
 13144  			ID:        Int64(1),
 13145  			NodeID:    String("n"),
 13146  			URL:       String("u"),
 13147  			ReposURL:  String("r"),
 13148  			EventsURL: String("e"),
 13149  			AvatarURL: String("a"),
 13150  		},
 13151  		Installation: &Installation{
 13152  			ID:       Int64(1),
 13153  			NodeID:   String("nid"),
 13154  			AppID:    Int64(1),
 13155  			AppSlug:  String("as"),
 13156  			TargetID: Int64(1),
 13157  			Account: &User{
 13158  				Login:           String("l"),
 13159  				ID:              Int64(1),
 13160  				URL:             String("u"),
 13161  				AvatarURL:       String("a"),
 13162  				GravatarID:      String("g"),
 13163  				Name:            String("n"),
 13164  				Company:         String("c"),
 13165  				Blog:            String("b"),
 13166  				Location:        String("l"),
 13167  				Email:           String("e"),
 13168  				Hireable:        Bool(true),
 13169  				Bio:             String("b"),
 13170  				TwitterUsername: String("t"),
 13171  				PublicRepos:     Int(1),
 13172  				Followers:       Int(1),
 13173  				Following:       Int(1),
 13174  				CreatedAt:       &Timestamp{referenceTime},
 13175  				SuspendedAt:     &Timestamp{referenceTime},
 13176  			},
 13177  			AccessTokensURL:     String("atu"),
 13178  			RepositoriesURL:     String("ru"),
 13179  			HTMLURL:             String("hu"),
 13180  			TargetType:          String("tt"),
 13181  			SingleFileName:      String("sfn"),
 13182  			RepositorySelection: String("rs"),
 13183  			Events:              []string{"e"},
 13184  			SingleFilePaths:     []string{"s"},
 13185  			Permissions: &InstallationPermissions{
 13186  				Actions:                       String("a"),
 13187  				Administration:                String("ad"),
 13188  				Checks:                        String("c"),
 13189  				Contents:                      String("co"),
 13190  				ContentReferences:             String("cr"),
 13191  				Deployments:                   String("d"),
 13192  				Environments:                  String("e"),
 13193  				Issues:                        String("i"),
 13194  				Metadata:                      String("md"),
 13195  				Members:                       String("m"),
 13196  				OrganizationAdministration:    String("oa"),
 13197  				OrganizationHooks:             String("oh"),
 13198  				OrganizationPlan:              String("op"),
 13199  				OrganizationPreReceiveHooks:   String("opr"),
 13200  				OrganizationProjects:          String("op"),
 13201  				OrganizationSecrets:           String("os"),
 13202  				OrganizationSelfHostedRunners: String("osh"),
 13203  				OrganizationUserBlocking:      String("oub"),
 13204  				Packages:                      String("pkg"),
 13205  				Pages:                         String("pg"),
 13206  				PullRequests:                  String("pr"),
 13207  				RepositoryHooks:               String("rh"),
 13208  				RepositoryProjects:            String("rp"),
 13209  				RepositoryPreReceiveHooks:     String("rprh"),
 13210  				Secrets:                       String("s"),
 13211  				SecretScanningAlerts:          String("ssa"),
 13212  				SecurityEvents:                String("se"),
 13213  				SingleFile:                    String("sf"),
 13214  				Statuses:                      String("s"),
 13215  				TeamDiscussions:               String("td"),
 13216  				VulnerabilityAlerts:           String("va"),
 13217  				Workflows:                     String("w"),
 13218  			},
 13219  			CreatedAt:              &Timestamp{referenceTime},
 13220  			UpdatedAt:              &Timestamp{referenceTime},
 13221  			HasMultipleSingleFiles: Bool(false),
 13222  			SuspendedBy: &User{
 13223  				Login:           String("l"),
 13224  				ID:              Int64(1),
 13225  				URL:             String("u"),
 13226  				AvatarURL:       String("a"),
 13227  				GravatarID:      String("g"),
 13228  				Name:            String("n"),
 13229  				Company:         String("c"),
 13230  				Blog:            String("b"),
 13231  				Location:        String("l"),
 13232  				Email:           String("e"),
 13233  				Hireable:        Bool(true),
 13234  				Bio:             String("b"),
 13235  				TwitterUsername: String("t"),
 13236  				PublicRepos:     Int(1),
 13237  				Followers:       Int(1),
 13238  				Following:       Int(1),
 13239  				CreatedAt:       &Timestamp{referenceTime},
 13240  				SuspendedAt:     &Timestamp{referenceTime},
 13241  			},
 13242  			SuspendedAt: &Timestamp{referenceTime},
 13243  		},
 13244  	}
 13245  
 13246  	want := `{
 13247  		"action": "a",
 13248  		"changes": {
 13249  			"note": {
 13250  				"from": "NoteFrom"
 13251  			}
 13252  		},
 13253  		"after_id": 1,
 13254  		"project_card": {
 13255  			"id": 1
 13256  		},
 13257  		"repository": {
 13258  			"id": 1,
 13259  			"name": "n",
 13260  			"url": "s"
 13261  		},
 13262  		"organization": {
 13263  			"name": "n",
 13264  			"company": "c",
 13265  			"blog": "b",
 13266  			"location": "loc",
 13267  			"email": "e",
 13268  			"twitter_username": "tu",
 13269  			"description": "d",
 13270  			"billing_email": "be",
 13271  			"is_verified": true,
 13272  			"has_organization_projects": true,
 13273  			"has_repository_projects": true,
 13274  			"default_repository_permission": "drp",
 13275  			"members_can_create_repositories": true,
 13276  			"members_can_create_public_repositories": false,
 13277  			"members_can_create_private_repositories": true,
 13278  			"members_can_create_internal_repositories": true,
 13279  			"members_allowed_repository_creation_type": "marct",
 13280  			"members_can_create_pages": true,
 13281  			"members_can_create_public_pages": false,
 13282  			"members_can_create_private_pages": true
 13283  		},
 13284  		"sender": {
 13285  			"login": "l",
 13286  			"id": 1,
 13287  			"node_id": "n",
 13288  			"avatar_url": "a",
 13289  			"url": "u",
 13290  			"events_url": "e",
 13291  			"repos_url": "r"
 13292  		},
 13293  		"installation": {
 13294  			"id": 1,
 13295  			"node_id": "nid",
 13296  			"app_id": 1,
 13297  			"app_slug": "as",
 13298  			"target_id": 1,
 13299  			"account": {
 13300  				"login": "l",
 13301  				"id": 1,
 13302  				"avatar_url": "a",
 13303  				"gravatar_id": "g",
 13304  				"name": "n",
 13305  				"company": "c",
 13306  				"blog": "b",
 13307  				"location": "l",
 13308  				"email": "e",
 13309  				"hireable": true,
 13310  				"bio": "b",
 13311  				"twitter_username": "t",
 13312  				"public_repos": 1,
 13313  				"followers": 1,
 13314  				"following": 1,
 13315  				"created_at": ` + referenceTimeStr + `,
 13316  				"suspended_at": ` + referenceTimeStr + `,
 13317  				"url": "u"
 13318  			},
 13319  			"access_tokens_url": "atu",
 13320  			"repositories_url": "ru",
 13321  			"html_url": "hu",
 13322  			"target_type": "tt",
 13323  			"single_file_name": "sfn",
 13324  			"repository_selection": "rs",
 13325  			"events": [
 13326  				"e"
 13327  			],
 13328  			"single_file_paths": [
 13329  				"s"
 13330  			],
 13331  			"permissions": {
 13332  				"actions": "a",
 13333  				"administration": "ad",
 13334  				"checks": "c",
 13335  				"contents": "co",
 13336  				"content_references": "cr",
 13337  				"deployments": "d",
 13338  				"environments": "e",
 13339  				"issues": "i",
 13340  				"metadata": "md",
 13341  				"members": "m",
 13342  				"organization_administration": "oa",
 13343  				"organization_hooks": "oh",
 13344  				"organization_plan": "op",
 13345  				"organization_pre_receive_hooks": "opr",
 13346  				"organization_projects": "op",
 13347  				"organization_secrets": "os",
 13348  				"organization_self_hosted_runners": "osh",
 13349  				"organization_user_blocking": "oub",
 13350  				"packages": "pkg",
 13351  				"pages": "pg",
 13352  				"pull_requests": "pr",
 13353  				"repository_hooks": "rh",
 13354  				"repository_projects": "rp",
 13355  				"repository_pre_receive_hooks": "rprh",
 13356  				"secrets": "s",
 13357  				"secret_scanning_alerts": "ssa",
 13358  				"security_events": "se",
 13359  				"single_file": "sf",
 13360  				"statuses": "s",
 13361  				"team_discussions": "td",
 13362  				"vulnerability_alerts": "va",
 13363  				"workflows": "w"
 13364  			},
 13365  			"created_at": ` + referenceTimeStr + `,
 13366  			"updated_at": ` + referenceTimeStr + `,
 13367  			"has_multiple_single_files": false,
 13368  			"suspended_by": {
 13369  				"login": "l",
 13370  				"id": 1,
 13371  				"avatar_url": "a",
 13372  				"gravatar_id": "g",
 13373  				"name": "n",
 13374  				"company": "c",
 13375  				"blog": "b",
 13376  				"location": "l",
 13377  				"email": "e",
 13378  				"hireable": true,
 13379  				"bio": "b",
 13380  				"twitter_username": "t",
 13381  				"public_repos": 1,
 13382  				"followers": 1,
 13383  				"following": 1,
 13384  				"created_at": ` + referenceTimeStr + `,
 13385  				"suspended_at": ` + referenceTimeStr + `,
 13386  				"url": "u"
 13387  			},
 13388  			"suspended_at": ` + referenceTimeStr + `
 13389  		}
 13390  	}`
 13391  
 13392  	testJSONMarshal(t, u, want)
 13393  }
 13394  
 13395  func TestProjectColumnEvent_Marshal(t *testing.T) {
 13396  	testJSONMarshal(t, &ProjectColumnEvent{}, "{}")
 13397  
 13398  	u := &ProjectColumnEvent{
 13399  		Action: String("a"),
 13400  		Changes: &ProjectColumnChange{
 13401  			Name: &ProjectColumnName{From: String("NameFrom")},
 13402  		},
 13403  		AfterID:       Int64(1),
 13404  		ProjectColumn: &ProjectColumn{ID: Int64(1)},
 13405  		Repo: &Repository{
 13406  			ID:   Int64(1),
 13407  			URL:  String("s"),
 13408  			Name: String("n"),
 13409  		},
 13410  		Org: &Organization{
 13411  			BillingEmail:                         String("be"),
 13412  			Blog:                                 String("b"),
 13413  			Company:                              String("c"),
 13414  			Email:                                String("e"),
 13415  			TwitterUsername:                      String("tu"),
 13416  			Location:                             String("loc"),
 13417  			Name:                                 String("n"),
 13418  			Description:                          String("d"),
 13419  			IsVerified:                           Bool(true),
 13420  			HasOrganizationProjects:              Bool(true),
 13421  			HasRepositoryProjects:                Bool(true),
 13422  			DefaultRepoPermission:                String("drp"),
 13423  			MembersCanCreateRepos:                Bool(true),
 13424  			MembersCanCreateInternalRepos:        Bool(true),
 13425  			MembersCanCreatePrivateRepos:         Bool(true),
 13426  			MembersCanCreatePublicRepos:          Bool(false),
 13427  			MembersAllowedRepositoryCreationType: String("marct"),
 13428  			MembersCanCreatePages:                Bool(true),
 13429  			MembersCanCreatePublicPages:          Bool(false),
 13430  			MembersCanCreatePrivatePages:         Bool(true),
 13431  		},
 13432  		Sender: &User{
 13433  			Login:     String("l"),
 13434  			ID:        Int64(1),
 13435  			NodeID:    String("n"),
 13436  			URL:       String("u"),
 13437  			ReposURL:  String("r"),
 13438  			EventsURL: String("e"),
 13439  			AvatarURL: String("a"),
 13440  		},
 13441  		Installation: &Installation{
 13442  			ID:       Int64(1),
 13443  			NodeID:   String("nid"),
 13444  			AppID:    Int64(1),
 13445  			AppSlug:  String("as"),
 13446  			TargetID: Int64(1),
 13447  			Account: &User{
 13448  				Login:           String("l"),
 13449  				ID:              Int64(1),
 13450  				URL:             String("u"),
 13451  				AvatarURL:       String("a"),
 13452  				GravatarID:      String("g"),
 13453  				Name:            String("n"),
 13454  				Company:         String("c"),
 13455  				Blog:            String("b"),
 13456  				Location:        String("l"),
 13457  				Email:           String("e"),
 13458  				Hireable:        Bool(true),
 13459  				Bio:             String("b"),
 13460  				TwitterUsername: String("t"),
 13461  				PublicRepos:     Int(1),
 13462  				Followers:       Int(1),
 13463  				Following:       Int(1),
 13464  				CreatedAt:       &Timestamp{referenceTime},
 13465  				SuspendedAt:     &Timestamp{referenceTime},
 13466  			},
 13467  			AccessTokensURL:     String("atu"),
 13468  			RepositoriesURL:     String("ru"),
 13469  			HTMLURL:             String("hu"),
 13470  			TargetType:          String("tt"),
 13471  			SingleFileName:      String("sfn"),
 13472  			RepositorySelection: String("rs"),
 13473  			Events:              []string{"e"},
 13474  			SingleFilePaths:     []string{"s"},
 13475  			Permissions: &InstallationPermissions{
 13476  				Actions:                       String("a"),
 13477  				Administration:                String("ad"),
 13478  				Checks:                        String("c"),
 13479  				Contents:                      String("co"),
 13480  				ContentReferences:             String("cr"),
 13481  				Deployments:                   String("d"),
 13482  				Environments:                  String("e"),
 13483  				Issues:                        String("i"),
 13484  				Metadata:                      String("md"),
 13485  				Members:                       String("m"),
 13486  				OrganizationAdministration:    String("oa"),
 13487  				OrganizationHooks:             String("oh"),
 13488  				OrganizationPlan:              String("op"),
 13489  				OrganizationPreReceiveHooks:   String("opr"),
 13490  				OrganizationProjects:          String("op"),
 13491  				OrganizationSecrets:           String("os"),
 13492  				OrganizationSelfHostedRunners: String("osh"),
 13493  				OrganizationUserBlocking:      String("oub"),
 13494  				Packages:                      String("pkg"),
 13495  				Pages:                         String("pg"),
 13496  				PullRequests:                  String("pr"),
 13497  				RepositoryHooks:               String("rh"),
 13498  				RepositoryProjects:            String("rp"),
 13499  				RepositoryPreReceiveHooks:     String("rprh"),
 13500  				Secrets:                       String("s"),
 13501  				SecretScanningAlerts:          String("ssa"),
 13502  				SecurityEvents:                String("se"),
 13503  				SingleFile:                    String("sf"),
 13504  				Statuses:                      String("s"),
 13505  				TeamDiscussions:               String("td"),
 13506  				VulnerabilityAlerts:           String("va"),
 13507  				Workflows:                     String("w"),
 13508  			},
 13509  			CreatedAt:              &Timestamp{referenceTime},
 13510  			UpdatedAt:              &Timestamp{referenceTime},
 13511  			HasMultipleSingleFiles: Bool(false),
 13512  			SuspendedBy: &User{
 13513  				Login:           String("l"),
 13514  				ID:              Int64(1),
 13515  				URL:             String("u"),
 13516  				AvatarURL:       String("a"),
 13517  				GravatarID:      String("g"),
 13518  				Name:            String("n"),
 13519  				Company:         String("c"),
 13520  				Blog:            String("b"),
 13521  				Location:        String("l"),
 13522  				Email:           String("e"),
 13523  				Hireable:        Bool(true),
 13524  				Bio:             String("b"),
 13525  				TwitterUsername: String("t"),
 13526  				PublicRepos:     Int(1),
 13527  				Followers:       Int(1),
 13528  				Following:       Int(1),
 13529  				CreatedAt:       &Timestamp{referenceTime},
 13530  				SuspendedAt:     &Timestamp{referenceTime},
 13531  			},
 13532  			SuspendedAt: &Timestamp{referenceTime},
 13533  		},
 13534  	}
 13535  
 13536  	want := `{
 13537  		"action": "a",
 13538  		"changes": {
 13539  			"name": {
 13540  				"from": "NameFrom"
 13541  			}
 13542  		},
 13543  		"after_id": 1,
 13544  		"project_column": {
 13545  			"id": 1
 13546  		},
 13547  		"repository": {
 13548  			"id": 1,
 13549  			"name": "n",
 13550  			"url": "s"
 13551  		},
 13552  		"organization": {
 13553  			"name": "n",
 13554  			"company": "c",
 13555  			"blog": "b",
 13556  			"location": "loc",
 13557  			"email": "e",
 13558  			"twitter_username": "tu",
 13559  			"description": "d",
 13560  			"billing_email": "be",
 13561  			"is_verified": true,
 13562  			"has_organization_projects": true,
 13563  			"has_repository_projects": true,
 13564  			"default_repository_permission": "drp",
 13565  			"members_can_create_repositories": true,
 13566  			"members_can_create_public_repositories": false,
 13567  			"members_can_create_private_repositories": true,
 13568  			"members_can_create_internal_repositories": true,
 13569  			"members_allowed_repository_creation_type": "marct",
 13570  			"members_can_create_pages": true,
 13571  			"members_can_create_public_pages": false,
 13572  			"members_can_create_private_pages": true
 13573  		},
 13574  		"sender": {
 13575  			"login": "l",
 13576  			"id": 1,
 13577  			"node_id": "n",
 13578  			"avatar_url": "a",
 13579  			"url": "u",
 13580  			"events_url": "e",
 13581  			"repos_url": "r"
 13582  		},
 13583  		"installation": {
 13584  			"id": 1,
 13585  			"node_id": "nid",
 13586  			"app_id": 1,
 13587  			"app_slug": "as",
 13588  			"target_id": 1,
 13589  			"account": {
 13590  				"login": "l",
 13591  				"id": 1,
 13592  				"avatar_url": "a",
 13593  				"gravatar_id": "g",
 13594  				"name": "n",
 13595  				"company": "c",
 13596  				"blog": "b",
 13597  				"location": "l",
 13598  				"email": "e",
 13599  				"hireable": true,
 13600  				"bio": "b",
 13601  				"twitter_username": "t",
 13602  				"public_repos": 1,
 13603  				"followers": 1,
 13604  				"following": 1,
 13605  				"created_at": ` + referenceTimeStr + `,
 13606  				"suspended_at": ` + referenceTimeStr + `,
 13607  				"url": "u"
 13608  			},
 13609  			"access_tokens_url": "atu",
 13610  			"repositories_url": "ru",
 13611  			"html_url": "hu",
 13612  			"target_type": "tt",
 13613  			"single_file_name": "sfn",
 13614  			"repository_selection": "rs",
 13615  			"events": [
 13616  				"e"
 13617  			],
 13618  			"single_file_paths": [
 13619  				"s"
 13620  			],
 13621  			"permissions": {
 13622  				"actions": "a",
 13623  				"administration": "ad",
 13624  				"checks": "c",
 13625  				"contents": "co",
 13626  				"content_references": "cr",
 13627  				"deployments": "d",
 13628  				"environments": "e",
 13629  				"issues": "i",
 13630  				"metadata": "md",
 13631  				"members": "m",
 13632  				"organization_administration": "oa",
 13633  				"organization_hooks": "oh",
 13634  				"organization_plan": "op",
 13635  				"organization_pre_receive_hooks": "opr",
 13636  				"organization_projects": "op",
 13637  				"organization_secrets": "os",
 13638  				"organization_self_hosted_runners": "osh",
 13639  				"organization_user_blocking": "oub",
 13640  				"packages": "pkg",
 13641  				"pages": "pg",
 13642  				"pull_requests": "pr",
 13643  				"repository_hooks": "rh",
 13644  				"repository_projects": "rp",
 13645  				"repository_pre_receive_hooks": "rprh",
 13646  				"secrets": "s",
 13647  				"secret_scanning_alerts": "ssa",
 13648  				"security_events": "se",
 13649  				"single_file": "sf",
 13650  				"statuses": "s",
 13651  				"team_discussions": "td",
 13652  				"vulnerability_alerts": "va",
 13653  				"workflows": "w"
 13654  			},
 13655  			"created_at": ` + referenceTimeStr + `,
 13656  			"updated_at": ` + referenceTimeStr + `,
 13657  			"has_multiple_single_files": false,
 13658  			"suspended_by": {
 13659  				"login": "l",
 13660  				"id": 1,
 13661  				"avatar_url": "a",
 13662  				"gravatar_id": "g",
 13663  				"name": "n",
 13664  				"company": "c",
 13665  				"blog": "b",
 13666  				"location": "l",
 13667  				"email": "e",
 13668  				"hireable": true,
 13669  				"bio": "b",
 13670  				"twitter_username": "t",
 13671  				"public_repos": 1,
 13672  				"followers": 1,
 13673  				"following": 1,
 13674  				"created_at": ` + referenceTimeStr + `,
 13675  				"suspended_at": ` + referenceTimeStr + `,
 13676  				"url": "u"
 13677  			},
 13678  			"suspended_at": ` + referenceTimeStr + `
 13679  		}
 13680  	}`
 13681  
 13682  	testJSONMarshal(t, u, want)
 13683  }
 13684  
 13685  func TestPullRequestEvent_Marshal(t *testing.T) {
 13686  	testJSONMarshal(t, &PullRequestEvent{}, "{}")
 13687  
 13688  	u := &PullRequestEvent{
 13689  		Action: String("a"),
 13690  		Assignee: &User{
 13691  			Login:     String("l"),
 13692  			ID:        Int64(1),
 13693  			NodeID:    String("n"),
 13694  			URL:       String("u"),
 13695  			ReposURL:  String("r"),
 13696  			EventsURL: String("e"),
 13697  			AvatarURL: String("a"),
 13698  		},
 13699  		Number:      Int(1),
 13700  		PullRequest: &PullRequest{ID: Int64(1)},
 13701  		Changes: &EditChange{
 13702  			Title: &EditTitle{
 13703  				From: String("TitleFrom"),
 13704  			},
 13705  			Body: &EditBody{
 13706  				From: String("BodyFrom"),
 13707  			},
 13708  			Base: &EditBase{
 13709  				Ref: &EditRef{
 13710  					From: String("BaseRefFrom"),
 13711  				},
 13712  				SHA: &EditSHA{
 13713  					From: String("BaseSHAFrom"),
 13714  				},
 13715  			},
 13716  		},
 13717  		RequestedReviewer: &User{
 13718  			Login:     String("l"),
 13719  			ID:        Int64(1),
 13720  			NodeID:    String("n"),
 13721  			URL:       String("u"),
 13722  			ReposURL:  String("r"),
 13723  			EventsURL: String("e"),
 13724  			AvatarURL: String("a"),
 13725  		},
 13726  		RequestedTeam: &Team{ID: Int64(1)},
 13727  		Label:         &Label{ID: Int64(1)},
 13728  		Before:        String("before"),
 13729  		After:         String("after"),
 13730  		Repo: &Repository{
 13731  			ID:   Int64(1),
 13732  			URL:  String("s"),
 13733  			Name: String("n"),
 13734  		},
 13735  		Organization: &Organization{
 13736  			BillingEmail:                         String("be"),
 13737  			Blog:                                 String("b"),
 13738  			Company:                              String("c"),
 13739  			Email:                                String("e"),
 13740  			TwitterUsername:                      String("tu"),
 13741  			Location:                             String("loc"),
 13742  			Name:                                 String("n"),
 13743  			Description:                          String("d"),
 13744  			IsVerified:                           Bool(true),
 13745  			HasOrganizationProjects:              Bool(true),
 13746  			HasRepositoryProjects:                Bool(true),
 13747  			DefaultRepoPermission:                String("drp"),
 13748  			MembersCanCreateRepos:                Bool(true),
 13749  			MembersCanCreateInternalRepos:        Bool(true),
 13750  			MembersCanCreatePrivateRepos:         Bool(true),
 13751  			MembersCanCreatePublicRepos:          Bool(false),
 13752  			MembersAllowedRepositoryCreationType: String("marct"),
 13753  			MembersCanCreatePages:                Bool(true),
 13754  			MembersCanCreatePublicPages:          Bool(false),
 13755  			MembersCanCreatePrivatePages:         Bool(true),
 13756  		},
 13757  		Sender: &User{
 13758  			Login:     String("l"),
 13759  			ID:        Int64(1),
 13760  			NodeID:    String("n"),
 13761  			URL:       String("u"),
 13762  			ReposURL:  String("r"),
 13763  			EventsURL: String("e"),
 13764  			AvatarURL: String("a"),
 13765  		},
 13766  		Installation: &Installation{
 13767  			ID:       Int64(1),
 13768  			NodeID:   String("nid"),
 13769  			AppID:    Int64(1),
 13770  			AppSlug:  String("as"),
 13771  			TargetID: Int64(1),
 13772  			Account: &User{
 13773  				Login:           String("l"),
 13774  				ID:              Int64(1),
 13775  				URL:             String("u"),
 13776  				AvatarURL:       String("a"),
 13777  				GravatarID:      String("g"),
 13778  				Name:            String("n"),
 13779  				Company:         String("c"),
 13780  				Blog:            String("b"),
 13781  				Location:        String("l"),
 13782  				Email:           String("e"),
 13783  				Hireable:        Bool(true),
 13784  				Bio:             String("b"),
 13785  				TwitterUsername: String("t"),
 13786  				PublicRepos:     Int(1),
 13787  				Followers:       Int(1),
 13788  				Following:       Int(1),
 13789  				CreatedAt:       &Timestamp{referenceTime},
 13790  				SuspendedAt:     &Timestamp{referenceTime},
 13791  			},
 13792  			AccessTokensURL:     String("atu"),
 13793  			RepositoriesURL:     String("ru"),
 13794  			HTMLURL:             String("hu"),
 13795  			TargetType:          String("tt"),
 13796  			SingleFileName:      String("sfn"),
 13797  			RepositorySelection: String("rs"),
 13798  			Events:              []string{"e"},
 13799  			SingleFilePaths:     []string{"s"},
 13800  			Permissions: &InstallationPermissions{
 13801  				Actions:                       String("a"),
 13802  				Administration:                String("ad"),
 13803  				Checks:                        String("c"),
 13804  				Contents:                      String("co"),
 13805  				ContentReferences:             String("cr"),
 13806  				Deployments:                   String("d"),
 13807  				Environments:                  String("e"),
 13808  				Issues:                        String("i"),
 13809  				Metadata:                      String("md"),
 13810  				Members:                       String("m"),
 13811  				OrganizationAdministration:    String("oa"),
 13812  				OrganizationHooks:             String("oh"),
 13813  				OrganizationPlan:              String("op"),
 13814  				OrganizationPreReceiveHooks:   String("opr"),
 13815  				OrganizationProjects:          String("op"),
 13816  				OrganizationSecrets:           String("os"),
 13817  				OrganizationSelfHostedRunners: String("osh"),
 13818  				OrganizationUserBlocking:      String("oub"),
 13819  				Packages:                      String("pkg"),
 13820  				Pages:                         String("pg"),
 13821  				PullRequests:                  String("pr"),
 13822  				RepositoryHooks:               String("rh"),
 13823  				RepositoryProjects:            String("rp"),
 13824  				RepositoryPreReceiveHooks:     String("rprh"),
 13825  				Secrets:                       String("s"),
 13826  				SecretScanningAlerts:          String("ssa"),
 13827  				SecurityEvents:                String("se"),
 13828  				SingleFile:                    String("sf"),
 13829  				Statuses:                      String("s"),
 13830  				TeamDiscussions:               String("td"),
 13831  				VulnerabilityAlerts:           String("va"),
 13832  				Workflows:                     String("w"),
 13833  			},
 13834  			CreatedAt:              &Timestamp{referenceTime},
 13835  			UpdatedAt:              &Timestamp{referenceTime},
 13836  			HasMultipleSingleFiles: Bool(false),
 13837  			SuspendedBy: &User{
 13838  				Login:           String("l"),
 13839  				ID:              Int64(1),
 13840  				URL:             String("u"),
 13841  				AvatarURL:       String("a"),
 13842  				GravatarID:      String("g"),
 13843  				Name:            String("n"),
 13844  				Company:         String("c"),
 13845  				Blog:            String("b"),
 13846  				Location:        String("l"),
 13847  				Email:           String("e"),
 13848  				Hireable:        Bool(true),
 13849  				Bio:             String("b"),
 13850  				TwitterUsername: String("t"),
 13851  				PublicRepos:     Int(1),
 13852  				Followers:       Int(1),
 13853  				Following:       Int(1),
 13854  				CreatedAt:       &Timestamp{referenceTime},
 13855  				SuspendedAt:     &Timestamp{referenceTime},
 13856  			},
 13857  			SuspendedAt: &Timestamp{referenceTime},
 13858  		},
 13859  	}
 13860  
 13861  	want := `{
 13862  		"action": "a",
 13863  		"assignee": {
 13864  			"login": "l",
 13865  			"id": 1,
 13866  			"node_id": "n",
 13867  			"avatar_url": "a",
 13868  			"url": "u",
 13869  			"events_url": "e",
 13870  			"repos_url": "r"
 13871  		},
 13872  		"number": 1,
 13873  		"pull_request": {
 13874  			"id": 1
 13875  		},
 13876  		"changes": {
 13877  			"title": {
 13878  				"from": "TitleFrom"
 13879  			},
 13880  			"body": {
 13881  				"from": "BodyFrom"
 13882  			},
 13883  			"base": {
 13884  				"ref": {
 13885  					"from": "BaseRefFrom"
 13886  				},
 13887  				"sha": {
 13888  					"from": "BaseSHAFrom"
 13889  				}
 13890  			}
 13891  		},
 13892  		"requested_reviewer": {
 13893  			"login": "l",
 13894  			"id": 1,
 13895  			"node_id": "n",
 13896  			"avatar_url": "a",
 13897  			"url": "u",
 13898  			"events_url": "e",
 13899  			"repos_url": "r"
 13900  		},
 13901  		"requested_team": {
 13902  			"id": 1
 13903  		},
 13904  		"repository": {
 13905  			"id": 1,
 13906  			"name": "n",
 13907  			"url": "s"
 13908  		},
 13909  		"sender": {
 13910  			"login": "l",
 13911  			"id": 1,
 13912  			"node_id": "n",
 13913  			"avatar_url": "a",
 13914  			"url": "u",
 13915  			"events_url": "e",
 13916  			"repos_url": "r"
 13917  		},
 13918  		"installation": {
 13919  			"id": 1,
 13920  			"node_id": "nid",
 13921  			"app_id": 1,
 13922  			"app_slug": "as",
 13923  			"target_id": 1,
 13924  			"account": {
 13925  				"login": "l",
 13926  				"id": 1,
 13927  				"avatar_url": "a",
 13928  				"gravatar_id": "g",
 13929  				"name": "n",
 13930  				"company": "c",
 13931  				"blog": "b",
 13932  				"location": "l",
 13933  				"email": "e",
 13934  				"hireable": true,
 13935  				"bio": "b",
 13936  				"twitter_username": "t",
 13937  				"public_repos": 1,
 13938  				"followers": 1,
 13939  				"following": 1,
 13940  				"created_at": ` + referenceTimeStr + `,
 13941  				"suspended_at": ` + referenceTimeStr + `,
 13942  				"url": "u"
 13943  			},
 13944  			"access_tokens_url": "atu",
 13945  			"repositories_url": "ru",
 13946  			"html_url": "hu",
 13947  			"target_type": "tt",
 13948  			"single_file_name": "sfn",
 13949  			"repository_selection": "rs",
 13950  			"events": [
 13951  				"e"
 13952  			],
 13953  			"single_file_paths": [
 13954  				"s"
 13955  			],
 13956  			"permissions": {
 13957  				"actions": "a",
 13958  				"administration": "ad",
 13959  				"checks": "c",
 13960  				"contents": "co",
 13961  				"content_references": "cr",
 13962  				"deployments": "d",
 13963  				"environments": "e",
 13964  				"issues": "i",
 13965  				"metadata": "md",
 13966  				"members": "m",
 13967  				"organization_administration": "oa",
 13968  				"organization_hooks": "oh",
 13969  				"organization_plan": "op",
 13970  				"organization_pre_receive_hooks": "opr",
 13971  				"organization_projects": "op",
 13972  				"organization_secrets": "os",
 13973  				"organization_self_hosted_runners": "osh",
 13974  				"organization_user_blocking": "oub",
 13975  				"packages": "pkg",
 13976  				"pages": "pg",
 13977  				"pull_requests": "pr",
 13978  				"repository_hooks": "rh",
 13979  				"repository_projects": "rp",
 13980  				"repository_pre_receive_hooks": "rprh",
 13981  				"secrets": "s",
 13982  				"secret_scanning_alerts": "ssa",
 13983  				"security_events": "se",
 13984  				"single_file": "sf",
 13985  				"statuses": "s",
 13986  				"team_discussions": "td",
 13987  				"vulnerability_alerts": "va",
 13988  				"workflows": "w"
 13989  			},
 13990  			"created_at": ` + referenceTimeStr + `,
 13991  			"updated_at": ` + referenceTimeStr + `,
 13992  			"has_multiple_single_files": false,
 13993  			"suspended_by": {
 13994  				"login": "l",
 13995  				"id": 1,
 13996  				"avatar_url": "a",
 13997  				"gravatar_id": "g",
 13998  				"name": "n",
 13999  				"company": "c",
 14000  				"blog": "b",
 14001  				"location": "l",
 14002  				"email": "e",
 14003  				"hireable": true,
 14004  				"bio": "b",
 14005  				"twitter_username": "t",
 14006  				"public_repos": 1,
 14007  				"followers": 1,
 14008  				"following": 1,
 14009  				"created_at": ` + referenceTimeStr + `,
 14010  				"suspended_at": ` + referenceTimeStr + `,
 14011  				"url": "u"
 14012  			},
 14013  			"suspended_at": ` + referenceTimeStr + `
 14014  		},
 14015  		"label": {
 14016  			"id": 1
 14017  		},
 14018  		"organization": {
 14019  			"name": "n",
 14020  			"company": "c",
 14021  			"blog": "b",
 14022  			"location": "loc",
 14023  			"email": "e",
 14024  			"twitter_username": "tu",
 14025  			"description": "d",
 14026  			"billing_email": "be",
 14027  			"is_verified": true,
 14028  			"has_organization_projects": true,
 14029  			"has_repository_projects": true,
 14030  			"default_repository_permission": "drp",
 14031  			"members_can_create_repositories": true,
 14032  			"members_can_create_public_repositories": false,
 14033  			"members_can_create_private_repositories": true,
 14034  			"members_can_create_internal_repositories": true,
 14035  			"members_allowed_repository_creation_type": "marct",
 14036  			"members_can_create_pages": true,
 14037  			"members_can_create_public_pages": false,
 14038  			"members_can_create_private_pages": true
 14039  		},
 14040  		"before": "before",
 14041  		"after": "after"
 14042  	}`
 14043  
 14044  	testJSONMarshal(t, u, want)
 14045  }
 14046  
 14047  func TestPullRequestReviewCommentEvent_Marshal(t *testing.T) {
 14048  	testJSONMarshal(t, &PullRequestReviewCommentEvent{}, "{}")
 14049  
 14050  	u := &PullRequestReviewCommentEvent{
 14051  		Action:      String("a"),
 14052  		PullRequest: &PullRequest{ID: Int64(1)},
 14053  		Comment:     &PullRequestComment{ID: Int64(1)},
 14054  		Changes: &EditChange{
 14055  			Title: &EditTitle{
 14056  				From: String("TitleFrom"),
 14057  			},
 14058  			Body: &EditBody{
 14059  				From: String("BodyFrom"),
 14060  			},
 14061  			Base: &EditBase{
 14062  				Ref: &EditRef{
 14063  					From: String("BaseRefFrom"),
 14064  				},
 14065  				SHA: &EditSHA{
 14066  					From: String("BaseSHAFrom"),
 14067  				},
 14068  			},
 14069  		},
 14070  		Repo: &Repository{
 14071  			ID:   Int64(1),
 14072  			URL:  String("s"),
 14073  			Name: String("n"),
 14074  		},
 14075  		Sender: &User{
 14076  			Login:     String("l"),
 14077  			ID:        Int64(1),
 14078  			NodeID:    String("n"),
 14079  			URL:       String("u"),
 14080  			ReposURL:  String("r"),
 14081  			EventsURL: String("e"),
 14082  			AvatarURL: String("a"),
 14083  		},
 14084  		Installation: &Installation{
 14085  			ID:       Int64(1),
 14086  			NodeID:   String("nid"),
 14087  			AppID:    Int64(1),
 14088  			AppSlug:  String("as"),
 14089  			TargetID: Int64(1),
 14090  			Account: &User{
 14091  				Login:           String("l"),
 14092  				ID:              Int64(1),
 14093  				URL:             String("u"),
 14094  				AvatarURL:       String("a"),
 14095  				GravatarID:      String("g"),
 14096  				Name:            String("n"),
 14097  				Company:         String("c"),
 14098  				Blog:            String("b"),
 14099  				Location:        String("l"),
 14100  				Email:           String("e"),
 14101  				Hireable:        Bool(true),
 14102  				Bio:             String("b"),
 14103  				TwitterUsername: String("t"),
 14104  				PublicRepos:     Int(1),
 14105  				Followers:       Int(1),
 14106  				Following:       Int(1),
 14107  				CreatedAt:       &Timestamp{referenceTime},
 14108  				SuspendedAt:     &Timestamp{referenceTime},
 14109  			},
 14110  			AccessTokensURL:     String("atu"),
 14111  			RepositoriesURL:     String("ru"),
 14112  			HTMLURL:             String("hu"),
 14113  			TargetType:          String("tt"),
 14114  			SingleFileName:      String("sfn"),
 14115  			RepositorySelection: String("rs"),
 14116  			Events:              []string{"e"},
 14117  			SingleFilePaths:     []string{"s"},
 14118  			Permissions: &InstallationPermissions{
 14119  				Actions:                       String("a"),
 14120  				Administration:                String("ad"),
 14121  				Checks:                        String("c"),
 14122  				Contents:                      String("co"),
 14123  				ContentReferences:             String("cr"),
 14124  				Deployments:                   String("d"),
 14125  				Environments:                  String("e"),
 14126  				Issues:                        String("i"),
 14127  				Metadata:                      String("md"),
 14128  				Members:                       String("m"),
 14129  				OrganizationAdministration:    String("oa"),
 14130  				OrganizationHooks:             String("oh"),
 14131  				OrganizationPlan:              String("op"),
 14132  				OrganizationPreReceiveHooks:   String("opr"),
 14133  				OrganizationProjects:          String("op"),
 14134  				OrganizationSecrets:           String("os"),
 14135  				OrganizationSelfHostedRunners: String("osh"),
 14136  				OrganizationUserBlocking:      String("oub"),
 14137  				Packages:                      String("pkg"),
 14138  				Pages:                         String("pg"),
 14139  				PullRequests:                  String("pr"),
 14140  				RepositoryHooks:               String("rh"),
 14141  				RepositoryProjects:            String("rp"),
 14142  				RepositoryPreReceiveHooks:     String("rprh"),
 14143  				Secrets:                       String("s"),
 14144  				SecretScanningAlerts:          String("ssa"),
 14145  				SecurityEvents:                String("se"),
 14146  				SingleFile:                    String("sf"),
 14147  				Statuses:                      String("s"),
 14148  				TeamDiscussions:               String("td"),
 14149  				VulnerabilityAlerts:           String("va"),
 14150  				Workflows:                     String("w"),
 14151  			},
 14152  			CreatedAt:              &Timestamp{referenceTime},
 14153  			UpdatedAt:              &Timestamp{referenceTime},
 14154  			HasMultipleSingleFiles: Bool(false),
 14155  			SuspendedBy: &User{
 14156  				Login:           String("l"),
 14157  				ID:              Int64(1),
 14158  				URL:             String("u"),
 14159  				AvatarURL:       String("a"),
 14160  				GravatarID:      String("g"),
 14161  				Name:            String("n"),
 14162  				Company:         String("c"),
 14163  				Blog:            String("b"),
 14164  				Location:        String("l"),
 14165  				Email:           String("e"),
 14166  				Hireable:        Bool(true),
 14167  				Bio:             String("b"),
 14168  				TwitterUsername: String("t"),
 14169  				PublicRepos:     Int(1),
 14170  				Followers:       Int(1),
 14171  				Following:       Int(1),
 14172  				CreatedAt:       &Timestamp{referenceTime},
 14173  				SuspendedAt:     &Timestamp{referenceTime},
 14174  			},
 14175  			SuspendedAt: &Timestamp{referenceTime},
 14176  		},
 14177  	}
 14178  
 14179  	want := `{
 14180  		"action": "a",
 14181  		"pull_request": {
 14182  			"id": 1
 14183  		},
 14184  		"comment": {
 14185  			"id": 1
 14186  		},
 14187  		"changes": {
 14188  			"title": {
 14189  				"from": "TitleFrom"
 14190  			},
 14191  			"body": {
 14192  				"from": "BodyFrom"
 14193  			},
 14194  			"base": {
 14195  				"ref": {
 14196  					"from": "BaseRefFrom"
 14197  				},
 14198  				"sha": {
 14199  					"from": "BaseSHAFrom"
 14200  				}
 14201  			}
 14202  		},
 14203  		"repository": {
 14204  			"id": 1,
 14205  			"name": "n",
 14206  			"url": "s"
 14207  		},
 14208  		"sender": {
 14209  			"login": "l",
 14210  			"id": 1,
 14211  			"node_id": "n",
 14212  			"avatar_url": "a",
 14213  			"url": "u",
 14214  			"events_url": "e",
 14215  			"repos_url": "r"
 14216  		},
 14217  		"installation": {
 14218  			"id": 1,
 14219  			"node_id": "nid",
 14220  			"app_id": 1,
 14221  			"app_slug": "as",
 14222  			"target_id": 1,
 14223  			"account": {
 14224  				"login": "l",
 14225  				"id": 1,
 14226  				"avatar_url": "a",
 14227  				"gravatar_id": "g",
 14228  				"name": "n",
 14229  				"company": "c",
 14230  				"blog": "b",
 14231  				"location": "l",
 14232  				"email": "e",
 14233  				"hireable": true,
 14234  				"bio": "b",
 14235  				"twitter_username": "t",
 14236  				"public_repos": 1,
 14237  				"followers": 1,
 14238  				"following": 1,
 14239  				"created_at": ` + referenceTimeStr + `,
 14240  				"suspended_at": ` + referenceTimeStr + `,
 14241  				"url": "u"
 14242  			},
 14243  			"access_tokens_url": "atu",
 14244  			"repositories_url": "ru",
 14245  			"html_url": "hu",
 14246  			"target_type": "tt",
 14247  			"single_file_name": "sfn",
 14248  			"repository_selection": "rs",
 14249  			"events": [
 14250  				"e"
 14251  			],
 14252  			"single_file_paths": [
 14253  				"s"
 14254  			],
 14255  			"permissions": {
 14256  				"actions": "a",
 14257  				"administration": "ad",
 14258  				"checks": "c",
 14259  				"contents": "co",
 14260  				"content_references": "cr",
 14261  				"deployments": "d",
 14262  				"environments": "e",
 14263  				"issues": "i",
 14264  				"metadata": "md",
 14265  				"members": "m",
 14266  				"organization_administration": "oa",
 14267  				"organization_hooks": "oh",
 14268  				"organization_plan": "op",
 14269  				"organization_pre_receive_hooks": "opr",
 14270  				"organization_projects": "op",
 14271  				"organization_secrets": "os",
 14272  				"organization_self_hosted_runners": "osh",
 14273  				"organization_user_blocking": "oub",
 14274  				"packages": "pkg",
 14275  				"pages": "pg",
 14276  				"pull_requests": "pr",
 14277  				"repository_hooks": "rh",
 14278  				"repository_projects": "rp",
 14279  				"repository_pre_receive_hooks": "rprh",
 14280  				"secrets": "s",
 14281  				"secret_scanning_alerts": "ssa",
 14282  				"security_events": "se",
 14283  				"single_file": "sf",
 14284  				"statuses": "s",
 14285  				"team_discussions": "td",
 14286  				"vulnerability_alerts": "va",
 14287  				"workflows": "w"
 14288  			},
 14289  			"created_at": ` + referenceTimeStr + `,
 14290  			"updated_at": ` + referenceTimeStr + `,
 14291  			"has_multiple_single_files": false,
 14292  			"suspended_by": {
 14293  				"login": "l",
 14294  				"id": 1,
 14295  				"avatar_url": "a",
 14296  				"gravatar_id": "g",
 14297  				"name": "n",
 14298  				"company": "c",
 14299  				"blog": "b",
 14300  				"location": "l",
 14301  				"email": "e",
 14302  				"hireable": true,
 14303  				"bio": "b",
 14304  				"twitter_username": "t",
 14305  				"public_repos": 1,
 14306  				"followers": 1,
 14307  				"following": 1,
 14308  				"created_at": ` + referenceTimeStr + `,
 14309  				"suspended_at": ` + referenceTimeStr + `,
 14310  				"url": "u"
 14311  			},
 14312  			"suspended_at": ` + referenceTimeStr + `
 14313  		}
 14314  	}`
 14315  
 14316  	testJSONMarshal(t, u, want)
 14317  }
 14318  
 14319  func TestPullRequestReviewThreadEvent_Marshal(t *testing.T) {
 14320  	testJSONMarshal(t, &PullRequestReviewThreadEvent{}, "{}")
 14321  
 14322  	u := &PullRequestReviewThreadEvent{
 14323  		Action:      String("a"),
 14324  		PullRequest: &PullRequest{ID: Int64(1)},
 14325  		Thread: &PullRequestThread{
 14326  			Comments: []*PullRequestComment{{ID: Int64(1)}, {ID: Int64(2)}},
 14327  		},
 14328  		Repo: &Repository{
 14329  			ID:   Int64(1),
 14330  			URL:  String("s"),
 14331  			Name: String("n"),
 14332  		},
 14333  		Sender: &User{
 14334  			Login:     String("l"),
 14335  			ID:        Int64(1),
 14336  			NodeID:    String("n"),
 14337  			URL:       String("u"),
 14338  			ReposURL:  String("r"),
 14339  			EventsURL: String("e"),
 14340  			AvatarURL: String("a"),
 14341  		},
 14342  		Installation: &Installation{
 14343  			ID:       Int64(1),
 14344  			NodeID:   String("nid"),
 14345  			AppID:    Int64(1),
 14346  			AppSlug:  String("as"),
 14347  			TargetID: Int64(1),
 14348  			Account: &User{
 14349  				Login:           String("l"),
 14350  				ID:              Int64(1),
 14351  				URL:             String("u"),
 14352  				AvatarURL:       String("a"),
 14353  				GravatarID:      String("g"),
 14354  				Name:            String("n"),
 14355  				Company:         String("c"),
 14356  				Blog:            String("b"),
 14357  				Location:        String("l"),
 14358  				Email:           String("e"),
 14359  				Hireable:        Bool(true),
 14360  				Bio:             String("b"),
 14361  				TwitterUsername: String("t"),
 14362  				PublicRepos:     Int(1),
 14363  				Followers:       Int(1),
 14364  				Following:       Int(1),
 14365  				CreatedAt:       &Timestamp{referenceTime},
 14366  				SuspendedAt:     &Timestamp{referenceTime},
 14367  			},
 14368  			AccessTokensURL:     String("atu"),
 14369  			RepositoriesURL:     String("ru"),
 14370  			HTMLURL:             String("hu"),
 14371  			TargetType:          String("tt"),
 14372  			SingleFileName:      String("sfn"),
 14373  			RepositorySelection: String("rs"),
 14374  			Events:              []string{"e"},
 14375  			SingleFilePaths:     []string{"s"},
 14376  			Permissions: &InstallationPermissions{
 14377  				Actions:                       String("a"),
 14378  				Administration:                String("ad"),
 14379  				Checks:                        String("c"),
 14380  				Contents:                      String("co"),
 14381  				ContentReferences:             String("cr"),
 14382  				Deployments:                   String("d"),
 14383  				Environments:                  String("e"),
 14384  				Issues:                        String("i"),
 14385  				Metadata:                      String("md"),
 14386  				Members:                       String("m"),
 14387  				OrganizationAdministration:    String("oa"),
 14388  				OrganizationHooks:             String("oh"),
 14389  				OrganizationPlan:              String("op"),
 14390  				OrganizationPreReceiveHooks:   String("opr"),
 14391  				OrganizationProjects:          String("op"),
 14392  				OrganizationSecrets:           String("os"),
 14393  				OrganizationSelfHostedRunners: String("osh"),
 14394  				OrganizationUserBlocking:      String("oub"),
 14395  				Packages:                      String("pkg"),
 14396  				Pages:                         String("pg"),
 14397  				PullRequests:                  String("pr"),
 14398  				RepositoryHooks:               String("rh"),
 14399  				RepositoryProjects:            String("rp"),
 14400  				RepositoryPreReceiveHooks:     String("rprh"),
 14401  				Secrets:                       String("s"),
 14402  				SecretScanningAlerts:          String("ssa"),
 14403  				SecurityEvents:                String("se"),
 14404  				SingleFile:                    String("sf"),
 14405  				Statuses:                      String("s"),
 14406  				TeamDiscussions:               String("td"),
 14407  				VulnerabilityAlerts:           String("va"),
 14408  				Workflows:                     String("w"),
 14409  			},
 14410  			CreatedAt:              &Timestamp{referenceTime},
 14411  			UpdatedAt:              &Timestamp{referenceTime},
 14412  			HasMultipleSingleFiles: Bool(false),
 14413  			SuspendedBy: &User{
 14414  				Login:           String("l"),
 14415  				ID:              Int64(1),
 14416  				URL:             String("u"),
 14417  				AvatarURL:       String("a"),
 14418  				GravatarID:      String("g"),
 14419  				Name:            String("n"),
 14420  				Company:         String("c"),
 14421  				Blog:            String("b"),
 14422  				Location:        String("l"),
 14423  				Email:           String("e"),
 14424  				Hireable:        Bool(true),
 14425  				Bio:             String("b"),
 14426  				TwitterUsername: String("t"),
 14427  				PublicRepos:     Int(1),
 14428  				Followers:       Int(1),
 14429  				Following:       Int(1),
 14430  				CreatedAt:       &Timestamp{referenceTime},
 14431  				SuspendedAt:     &Timestamp{referenceTime},
 14432  			},
 14433  			SuspendedAt: &Timestamp{referenceTime},
 14434  		},
 14435  	}
 14436  
 14437  	want := `{
 14438  		"action": "a",
 14439  		"pull_request": {
 14440  			"id": 1
 14441  		},
 14442  		"thread": {
 14443  			"comments": [
 14444  				{
 14445  					"id": 1
 14446  				},
 14447  				{
 14448  					"id": 2
 14449  				}
 14450  			]
 14451  		},
 14452  		"repository": {
 14453  			"id": 1,
 14454  			"name": "n",
 14455  			"url": "s"
 14456  		},
 14457  		"sender": {
 14458  			"login": "l",
 14459  			"id": 1,
 14460  			"node_id": "n",
 14461  			"avatar_url": "a",
 14462  			"url": "u",
 14463  			"events_url": "e",
 14464  			"repos_url": "r"
 14465  		},
 14466  		"installation": {
 14467  			"id": 1,
 14468  			"node_id": "nid",
 14469  			"app_id": 1,
 14470  			"app_slug": "as",
 14471  			"target_id": 1,
 14472  			"account": {
 14473  				"login": "l",
 14474  				"id": 1,
 14475  				"avatar_url": "a",
 14476  				"gravatar_id": "g",
 14477  				"name": "n",
 14478  				"company": "c",
 14479  				"blog": "b",
 14480  				"location": "l",
 14481  				"email": "e",
 14482  				"hireable": true,
 14483  				"bio": "b",
 14484  				"twitter_username": "t",
 14485  				"public_repos": 1,
 14486  				"followers": 1,
 14487  				"following": 1,
 14488  				"created_at": ` + referenceTimeStr + `,
 14489  				"suspended_at": ` + referenceTimeStr + `,
 14490  				"url": "u"
 14491  			},
 14492  			"access_tokens_url": "atu",
 14493  			"repositories_url": "ru",
 14494  			"html_url": "hu",
 14495  			"target_type": "tt",
 14496  			"single_file_name": "sfn",
 14497  			"repository_selection": "rs",
 14498  			"events": [
 14499  				"e"
 14500  			],
 14501  			"single_file_paths": [
 14502  				"s"
 14503  			],
 14504  			"permissions": {
 14505  				"actions": "a",
 14506  				"administration": "ad",
 14507  				"checks": "c",
 14508  				"contents": "co",
 14509  				"content_references": "cr",
 14510  				"deployments": "d",
 14511  				"environments": "e",
 14512  				"issues": "i",
 14513  				"metadata": "md",
 14514  				"members": "m",
 14515  				"organization_administration": "oa",
 14516  				"organization_hooks": "oh",
 14517  				"organization_plan": "op",
 14518  				"organization_pre_receive_hooks": "opr",
 14519  				"organization_projects": "op",
 14520  				"organization_secrets": "os",
 14521  				"organization_self_hosted_runners": "osh",
 14522  				"organization_user_blocking": "oub",
 14523  				"packages": "pkg",
 14524  				"pages": "pg",
 14525  				"pull_requests": "pr",
 14526  				"repository_hooks": "rh",
 14527  				"repository_projects": "rp",
 14528  				"repository_pre_receive_hooks": "rprh",
 14529  				"secrets": "s",
 14530  				"secret_scanning_alerts": "ssa",
 14531  				"security_events": "se",
 14532  				"single_file": "sf",
 14533  				"statuses": "s",
 14534  				"team_discussions": "td",
 14535  				"vulnerability_alerts": "va",
 14536  				"workflows": "w"
 14537  			},
 14538  			"created_at": ` + referenceTimeStr + `,
 14539  			"updated_at": ` + referenceTimeStr + `,
 14540  			"has_multiple_single_files": false,
 14541  			"suspended_by": {
 14542  				"login": "l",
 14543  				"id": 1,
 14544  				"avatar_url": "a",
 14545  				"gravatar_id": "g",
 14546  				"name": "n",
 14547  				"company": "c",
 14548  				"blog": "b",
 14549  				"location": "l",
 14550  				"email": "e",
 14551  				"hireable": true,
 14552  				"bio": "b",
 14553  				"twitter_username": "t",
 14554  				"public_repos": 1,
 14555  				"followers": 1,
 14556  				"following": 1,
 14557  				"created_at": ` + referenceTimeStr + `,
 14558  				"suspended_at": ` + referenceTimeStr + `,
 14559  				"url": "u"
 14560  			},
 14561  			"suspended_at": ` + referenceTimeStr + `
 14562  		}
 14563  	}`
 14564  
 14565  	testJSONMarshal(t, u, want)
 14566  }
 14567  
 14568  func TestPullRequestTargetEvent_Marshal(t *testing.T) {
 14569  	testJSONMarshal(t, &PullRequestTargetEvent{}, "{}")
 14570  
 14571  	u := &PullRequestTargetEvent{
 14572  		Action: String("a"),
 14573  		Assignee: &User{
 14574  			Login:     String("l"),
 14575  			ID:        Int64(1),
 14576  			NodeID:    String("n"),
 14577  			URL:       String("u"),
 14578  			ReposURL:  String("r"),
 14579  			EventsURL: String("e"),
 14580  			AvatarURL: String("a"),
 14581  		},
 14582  		Number:      Int(1),
 14583  		PullRequest: &PullRequest{ID: Int64(1)},
 14584  		Changes: &EditChange{
 14585  			Title: &EditTitle{
 14586  				From: String("TitleFrom"),
 14587  			},
 14588  			Body: &EditBody{
 14589  				From: String("BodyFrom"),
 14590  			},
 14591  			Base: &EditBase{
 14592  				Ref: &EditRef{
 14593  					From: String("BaseRefFrom"),
 14594  				},
 14595  				SHA: &EditSHA{
 14596  					From: String("BaseSHAFrom"),
 14597  				},
 14598  			},
 14599  		},
 14600  		RequestedReviewer: &User{
 14601  			Login:     String("l"),
 14602  			ID:        Int64(1),
 14603  			NodeID:    String("n"),
 14604  			URL:       String("u"),
 14605  			ReposURL:  String("r"),
 14606  			EventsURL: String("e"),
 14607  			AvatarURL: String("a"),
 14608  		},
 14609  		RequestedTeam: &Team{ID: Int64(1)},
 14610  		Label:         &Label{ID: Int64(1)},
 14611  		Before:        String("before"),
 14612  		After:         String("after"),
 14613  		Repo: &Repository{
 14614  			ID:   Int64(1),
 14615  			URL:  String("s"),
 14616  			Name: String("n"),
 14617  		},
 14618  		Organization: &Organization{
 14619  			BillingEmail:                         String("be"),
 14620  			Blog:                                 String("b"),
 14621  			Company:                              String("c"),
 14622  			Email:                                String("e"),
 14623  			TwitterUsername:                      String("tu"),
 14624  			Location:                             String("loc"),
 14625  			Name:                                 String("n"),
 14626  			Description:                          String("d"),
 14627  			IsVerified:                           Bool(true),
 14628  			HasOrganizationProjects:              Bool(true),
 14629  			HasRepositoryProjects:                Bool(true),
 14630  			DefaultRepoPermission:                String("drp"),
 14631  			MembersCanCreateRepos:                Bool(true),
 14632  			MembersCanCreateInternalRepos:        Bool(true),
 14633  			MembersCanCreatePrivateRepos:         Bool(true),
 14634  			MembersCanCreatePublicRepos:          Bool(false),
 14635  			MembersAllowedRepositoryCreationType: String("marct"),
 14636  			MembersCanCreatePages:                Bool(true),
 14637  			MembersCanCreatePublicPages:          Bool(false),
 14638  			MembersCanCreatePrivatePages:         Bool(true),
 14639  		},
 14640  		Sender: &User{
 14641  			Login:     String("l"),
 14642  			ID:        Int64(1),
 14643  			NodeID:    String("n"),
 14644  			URL:       String("u"),
 14645  			ReposURL:  String("r"),
 14646  			EventsURL: String("e"),
 14647  			AvatarURL: String("a"),
 14648  		},
 14649  		Installation: &Installation{
 14650  			ID:       Int64(1),
 14651  			NodeID:   String("nid"),
 14652  			AppID:    Int64(1),
 14653  			AppSlug:  String("as"),
 14654  			TargetID: Int64(1),
 14655  			Account: &User{
 14656  				Login:           String("l"),
 14657  				ID:              Int64(1),
 14658  				URL:             String("u"),
 14659  				AvatarURL:       String("a"),
 14660  				GravatarID:      String("g"),
 14661  				Name:            String("n"),
 14662  				Company:         String("c"),
 14663  				Blog:            String("b"),
 14664  				Location:        String("l"),
 14665  				Email:           String("e"),
 14666  				Hireable:        Bool(true),
 14667  				Bio:             String("b"),
 14668  				TwitterUsername: String("t"),
 14669  				PublicRepos:     Int(1),
 14670  				Followers:       Int(1),
 14671  				Following:       Int(1),
 14672  				CreatedAt:       &Timestamp{referenceTime},
 14673  				SuspendedAt:     &Timestamp{referenceTime},
 14674  			},
 14675  			AccessTokensURL:     String("atu"),
 14676  			RepositoriesURL:     String("ru"),
 14677  			HTMLURL:             String("hu"),
 14678  			TargetType:          String("tt"),
 14679  			SingleFileName:      String("sfn"),
 14680  			RepositorySelection: String("rs"),
 14681  			Events:              []string{"e"},
 14682  			SingleFilePaths:     []string{"s"},
 14683  			Permissions: &InstallationPermissions{
 14684  				Actions:                       String("a"),
 14685  				Administration:                String("ad"),
 14686  				Checks:                        String("c"),
 14687  				Contents:                      String("co"),
 14688  				ContentReferences:             String("cr"),
 14689  				Deployments:                   String("d"),
 14690  				Environments:                  String("e"),
 14691  				Issues:                        String("i"),
 14692  				Metadata:                      String("md"),
 14693  				Members:                       String("m"),
 14694  				OrganizationAdministration:    String("oa"),
 14695  				OrganizationHooks:             String("oh"),
 14696  				OrganizationPlan:              String("op"),
 14697  				OrganizationPreReceiveHooks:   String("opr"),
 14698  				OrganizationProjects:          String("op"),
 14699  				OrganizationSecrets:           String("os"),
 14700  				OrganizationSelfHostedRunners: String("osh"),
 14701  				OrganizationUserBlocking:      String("oub"),
 14702  				Packages:                      String("pkg"),
 14703  				Pages:                         String("pg"),
 14704  				PullRequests:                  String("pr"),
 14705  				RepositoryHooks:               String("rh"),
 14706  				RepositoryProjects:            String("rp"),
 14707  				RepositoryPreReceiveHooks:     String("rprh"),
 14708  				Secrets:                       String("s"),
 14709  				SecretScanningAlerts:          String("ssa"),
 14710  				SecurityEvents:                String("se"),
 14711  				SingleFile:                    String("sf"),
 14712  				Statuses:                      String("s"),
 14713  				TeamDiscussions:               String("td"),
 14714  				VulnerabilityAlerts:           String("va"),
 14715  				Workflows:                     String("w"),
 14716  			},
 14717  			CreatedAt:              &Timestamp{referenceTime},
 14718  			UpdatedAt:              &Timestamp{referenceTime},
 14719  			HasMultipleSingleFiles: Bool(false),
 14720  			SuspendedBy: &User{
 14721  				Login:           String("l"),
 14722  				ID:              Int64(1),
 14723  				URL:             String("u"),
 14724  				AvatarURL:       String("a"),
 14725  				GravatarID:      String("g"),
 14726  				Name:            String("n"),
 14727  				Company:         String("c"),
 14728  				Blog:            String("b"),
 14729  				Location:        String("l"),
 14730  				Email:           String("e"),
 14731  				Hireable:        Bool(true),
 14732  				Bio:             String("b"),
 14733  				TwitterUsername: String("t"),
 14734  				PublicRepos:     Int(1),
 14735  				Followers:       Int(1),
 14736  				Following:       Int(1),
 14737  				CreatedAt:       &Timestamp{referenceTime},
 14738  				SuspendedAt:     &Timestamp{referenceTime},
 14739  			},
 14740  			SuspendedAt: &Timestamp{referenceTime},
 14741  		},
 14742  	}
 14743  
 14744  	want := `{
 14745  		"action": "a",
 14746  		"assignee": {
 14747  			"login": "l",
 14748  			"id": 1,
 14749  			"node_id": "n",
 14750  			"avatar_url": "a",
 14751  			"url": "u",
 14752  			"events_url": "e",
 14753  			"repos_url": "r"
 14754  		},
 14755  		"number": 1,
 14756  		"pull_request": {
 14757  			"id": 1
 14758  		},
 14759  		"changes": {
 14760  			"title": {
 14761  				"from": "TitleFrom"
 14762  			},
 14763  			"body": {
 14764  				"from": "BodyFrom"
 14765  			},
 14766  			"base": {
 14767  				"ref": {
 14768  					"from": "BaseRefFrom"
 14769  				},
 14770  				"sha": {
 14771  					"from": "BaseSHAFrom"
 14772  				}
 14773  			}
 14774  		},
 14775  		"requested_reviewer": {
 14776  			"login": "l",
 14777  			"id": 1,
 14778  			"node_id": "n",
 14779  			"avatar_url": "a",
 14780  			"url": "u",
 14781  			"events_url": "e",
 14782  			"repos_url": "r"
 14783  		},
 14784  		"requested_team": {
 14785  			"id": 1
 14786  		},
 14787  		"repository": {
 14788  			"id": 1,
 14789  			"name": "n",
 14790  			"url": "s"
 14791  		},
 14792  		"sender": {
 14793  			"login": "l",
 14794  			"id": 1,
 14795  			"node_id": "n",
 14796  			"avatar_url": "a",
 14797  			"url": "u",
 14798  			"events_url": "e",
 14799  			"repos_url": "r"
 14800  		},
 14801  		"installation": {
 14802  			"id": 1,
 14803  			"node_id": "nid",
 14804  			"app_id": 1,
 14805  			"app_slug": "as",
 14806  			"target_id": 1,
 14807  			"account": {
 14808  				"login": "l",
 14809  				"id": 1,
 14810  				"avatar_url": "a",
 14811  				"gravatar_id": "g",
 14812  				"name": "n",
 14813  				"company": "c",
 14814  				"blog": "b",
 14815  				"location": "l",
 14816  				"email": "e",
 14817  				"hireable": true,
 14818  				"bio": "b",
 14819  				"twitter_username": "t",
 14820  				"public_repos": 1,
 14821  				"followers": 1,
 14822  				"following": 1,
 14823  				"created_at": ` + referenceTimeStr + `,
 14824  				"suspended_at": ` + referenceTimeStr + `,
 14825  				"url": "u"
 14826  			},
 14827  			"access_tokens_url": "atu",
 14828  			"repositories_url": "ru",
 14829  			"html_url": "hu",
 14830  			"target_type": "tt",
 14831  			"single_file_name": "sfn",
 14832  			"repository_selection": "rs",
 14833  			"events": [
 14834  				"e"
 14835  			],
 14836  			"single_file_paths": [
 14837  				"s"
 14838  			],
 14839  			"permissions": {
 14840  				"actions": "a",
 14841  				"administration": "ad",
 14842  				"checks": "c",
 14843  				"contents": "co",
 14844  				"content_references": "cr",
 14845  				"deployments": "d",
 14846  				"environments": "e",
 14847  				"issues": "i",
 14848  				"metadata": "md",
 14849  				"members": "m",
 14850  				"organization_administration": "oa",
 14851  				"organization_hooks": "oh",
 14852  				"organization_plan": "op",
 14853  				"organization_pre_receive_hooks": "opr",
 14854  				"organization_projects": "op",
 14855  				"organization_secrets": "os",
 14856  				"organization_self_hosted_runners": "osh",
 14857  				"organization_user_blocking": "oub",
 14858  				"packages": "pkg",
 14859  				"pages": "pg",
 14860  				"pull_requests": "pr",
 14861  				"repository_hooks": "rh",
 14862  				"repository_projects": "rp",
 14863  				"repository_pre_receive_hooks": "rprh",
 14864  				"secrets": "s",
 14865  				"secret_scanning_alerts": "ssa",
 14866  				"security_events": "se",
 14867  				"single_file": "sf",
 14868  				"statuses": "s",
 14869  				"team_discussions": "td",
 14870  				"vulnerability_alerts": "va",
 14871  				"workflows": "w"
 14872  			},
 14873  			"created_at": ` + referenceTimeStr + `,
 14874  			"updated_at": ` + referenceTimeStr + `,
 14875  			"has_multiple_single_files": false,
 14876  			"suspended_by": {
 14877  				"login": "l",
 14878  				"id": 1,
 14879  				"avatar_url": "a",
 14880  				"gravatar_id": "g",
 14881  				"name": "n",
 14882  				"company": "c",
 14883  				"blog": "b",
 14884  				"location": "l",
 14885  				"email": "e",
 14886  				"hireable": true,
 14887  				"bio": "b",
 14888  				"twitter_username": "t",
 14889  				"public_repos": 1,
 14890  				"followers": 1,
 14891  				"following": 1,
 14892  				"created_at": ` + referenceTimeStr + `,
 14893  				"suspended_at": ` + referenceTimeStr + `,
 14894  				"url": "u"
 14895  			},
 14896  			"suspended_at": ` + referenceTimeStr + `
 14897  		},
 14898  		"label": {
 14899  			"id": 1
 14900  		},
 14901  		"organization": {
 14902  			"name": "n",
 14903  			"company": "c",
 14904  			"blog": "b",
 14905  			"location": "loc",
 14906  			"email": "e",
 14907  			"twitter_username": "tu",
 14908  			"description": "d",
 14909  			"billing_email": "be",
 14910  			"is_verified": true,
 14911  			"has_organization_projects": true,
 14912  			"has_repository_projects": true,
 14913  			"default_repository_permission": "drp",
 14914  			"members_can_create_repositories": true,
 14915  			"members_can_create_public_repositories": false,
 14916  			"members_can_create_private_repositories": true,
 14917  			"members_can_create_internal_repositories": true,
 14918  			"members_allowed_repository_creation_type": "marct",
 14919  			"members_can_create_pages": true,
 14920  			"members_can_create_public_pages": false,
 14921  			"members_can_create_private_pages": true
 14922  		},
 14923  		"before": "before",
 14924  		"after": "after"
 14925  	}`
 14926  
 14927  	testJSONMarshal(t, u, want)
 14928  }
 14929  
 14930  func TestRepositoryVulnerabilityAlertEvent_Marshal(t *testing.T) {
 14931  	testJSONMarshal(t, &RepositoryVulnerabilityAlertEvent{}, "{}")
 14932  
 14933  	u := &RepositoryVulnerabilityAlertEvent{
 14934  		Action: String("a"),
 14935  		Alert: &RepositoryVulnerabilityAlert{
 14936  			ID:                  Int64(1),
 14937  			AffectedRange:       String("ar"),
 14938  			AffectedPackageName: String("apn"),
 14939  			ExternalReference:   String("er"),
 14940  			ExternalIdentifier:  String("ei"),
 14941  			FixedIn:             String("fi"),
 14942  			Dismisser: &User{
 14943  				Login:     String("l"),
 14944  				ID:        Int64(1),
 14945  				NodeID:    String("n"),
 14946  				URL:       String("u"),
 14947  				ReposURL:  String("r"),
 14948  				EventsURL: String("e"),
 14949  				AvatarURL: String("a"),
 14950  			},
 14951  			DismissReason: String("dr"),
 14952  			DismissedAt:   &Timestamp{referenceTime},
 14953  		},
 14954  		Repository: &Repository{
 14955  			ID:   Int64(1),
 14956  			URL:  String("s"),
 14957  			Name: String("n"),
 14958  		},
 14959  	}
 14960  
 14961  	want := `{
 14962  		"action": "a",
 14963  		"alert": {
 14964  			"id": 1,
 14965  			"affected_range": "ar",
 14966  			"affected_package_name": "apn",
 14967  			"external_reference": "er",
 14968  			"external_identifier": "ei",
 14969  			"fixed_in": "fi",
 14970  			"dismisser": {
 14971  				"login": "l",
 14972  				"id": 1,
 14973  				"node_id": "n",
 14974  				"avatar_url": "a",
 14975  				"url": "u",
 14976  				"events_url": "e",
 14977  				"repos_url": "r"
 14978  			},
 14979  			"dismiss_reason": "dr",
 14980  			"dismissed_at": ` + referenceTimeStr + `
 14981  		},
 14982  		"repository": {
 14983  			"id": 1,
 14984  			"name": "n",
 14985  			"url": "s"
 14986  		}
 14987  	}`
 14988  
 14989  	testJSONMarshal(t, u, want)
 14990  }
 14991  
 14992  func TestSecretScanningAlertEvent_Marshal(t *testing.T) {
 14993  	testJSONMarshal(t, &SecretScanningAlertEvent{}, "{}")
 14994  
 14995  	u := &SecretScanningAlertEvent{
 14996  		Action: String("a"),
 14997  		Alert: &SecretScanningAlert{
 14998  			Number:     Int(1),
 14999  			SecretType: String("t"),
 15000  			Resolution: String("r"),
 15001  			ResolvedBy: &User{
 15002  				Login:     String("l"),
 15003  				ID:        Int64(1),
 15004  				NodeID:    String("n"),
 15005  				URL:       String("u"),
 15006  				ReposURL:  String("r"),
 15007  				EventsURL: String("e"),
 15008  				AvatarURL: String("a"),
 15009  			},
 15010  			ResolvedAt: &Timestamp{referenceTime},
 15011  		},
 15012  		Repo: &Repository{
 15013  			ID:   Int64(1),
 15014  			URL:  String("s"),
 15015  			Name: String("n"),
 15016  		},
 15017  		Organization: &Organization{
 15018  			BillingEmail:                         String("be"),
 15019  			Blog:                                 String("b"),
 15020  			Company:                              String("c"),
 15021  			Email:                                String("e"),
 15022  			TwitterUsername:                      String("tu"),
 15023  			Location:                             String("loc"),
 15024  			Name:                                 String("n"),
 15025  			Description:                          String("d"),
 15026  			IsVerified:                           Bool(true),
 15027  			HasOrganizationProjects:              Bool(true),
 15028  			HasRepositoryProjects:                Bool(true),
 15029  			DefaultRepoPermission:                String("drp"),
 15030  			MembersCanCreateRepos:                Bool(true),
 15031  			MembersCanCreateInternalRepos:        Bool(true),
 15032  			MembersCanCreatePrivateRepos:         Bool(true),
 15033  			MembersCanCreatePublicRepos:          Bool(false),
 15034  			MembersAllowedRepositoryCreationType: String("marct"),
 15035  			MembersCanCreatePages:                Bool(true),
 15036  			MembersCanCreatePublicPages:          Bool(false),
 15037  			MembersCanCreatePrivatePages:         Bool(true),
 15038  		},
 15039  		Enterprise: &Enterprise{
 15040  			ID:          Int(1),
 15041  			Slug:        String("s"),
 15042  			Name:        String("n"),
 15043  			NodeID:      String("nid"),
 15044  			AvatarURL:   String("au"),
 15045  			Description: String("d"),
 15046  			WebsiteURL:  String("wu"),
 15047  			HTMLURL:     String("hu"),
 15048  			CreatedAt:   &Timestamp{referenceTime},
 15049  			UpdatedAt:   &Timestamp{referenceTime},
 15050  		},
 15051  		Sender: &User{
 15052  			Login:     String("l"),
 15053  			ID:        Int64(1),
 15054  			NodeID:    String("n"),
 15055  			URL:       String("u"),
 15056  			ReposURL:  String("r"),
 15057  			EventsURL: String("e"),
 15058  			AvatarURL: String("a"),
 15059  		},
 15060  		Installation: &Installation{
 15061  			ID:       Int64(1),
 15062  			NodeID:   String("nid"),
 15063  			AppID:    Int64(1),
 15064  			AppSlug:  String("as"),
 15065  			TargetID: Int64(1),
 15066  			Account: &User{
 15067  				Login:           String("l"),
 15068  				ID:              Int64(1),
 15069  				URL:             String("u"),
 15070  				AvatarURL:       String("a"),
 15071  				GravatarID:      String("g"),
 15072  				Name:            String("n"),
 15073  				Company:         String("c"),
 15074  				Blog:            String("b"),
 15075  				Location:        String("l"),
 15076  				Email:           String("e"),
 15077  				Hireable:        Bool(true),
 15078  				Bio:             String("b"),
 15079  				TwitterUsername: String("t"),
 15080  				PublicRepos:     Int(1),
 15081  				Followers:       Int(1),
 15082  				Following:       Int(1),
 15083  				CreatedAt:       &Timestamp{referenceTime},
 15084  				SuspendedAt:     &Timestamp{referenceTime},
 15085  			},
 15086  			AccessTokensURL:     String("atu"),
 15087  			RepositoriesURL:     String("ru"),
 15088  			HTMLURL:             String("hu"),
 15089  			TargetType:          String("tt"),
 15090  			SingleFileName:      String("sfn"),
 15091  			RepositorySelection: String("rs"),
 15092  			Events:              []string{"e"},
 15093  			SingleFilePaths:     []string{"s"},
 15094  			Permissions: &InstallationPermissions{
 15095  				Actions:                       String("a"),
 15096  				Administration:                String("ad"),
 15097  				Checks:                        String("c"),
 15098  				Contents:                      String("co"),
 15099  				ContentReferences:             String("cr"),
 15100  				Deployments:                   String("d"),
 15101  				Environments:                  String("e"),
 15102  				Issues:                        String("i"),
 15103  				Metadata:                      String("md"),
 15104  				Members:                       String("m"),
 15105  				OrganizationAdministration:    String("oa"),
 15106  				OrganizationHooks:             String("oh"),
 15107  				OrganizationPlan:              String("op"),
 15108  				OrganizationPreReceiveHooks:   String("opr"),
 15109  				OrganizationProjects:          String("op"),
 15110  				OrganizationSecrets:           String("os"),
 15111  				OrganizationSelfHostedRunners: String("osh"),
 15112  				OrganizationUserBlocking:      String("oub"),
 15113  				Packages:                      String("pkg"),
 15114  				Pages:                         String("pg"),
 15115  				PullRequests:                  String("pr"),
 15116  				RepositoryHooks:               String("rh"),
 15117  				RepositoryProjects:            String("rp"),
 15118  				RepositoryPreReceiveHooks:     String("rprh"),
 15119  				Secrets:                       String("s"),
 15120  				SecretScanningAlerts:          String("ssa"),
 15121  				SecurityEvents:                String("se"),
 15122  				SingleFile:                    String("sf"),
 15123  				Statuses:                      String("s"),
 15124  				TeamDiscussions:               String("td"),
 15125  				VulnerabilityAlerts:           String("va"),
 15126  				Workflows:                     String("w"),
 15127  			},
 15128  			CreatedAt:              &Timestamp{referenceTime},
 15129  			UpdatedAt:              &Timestamp{referenceTime},
 15130  			HasMultipleSingleFiles: Bool(false),
 15131  			SuspendedBy: &User{
 15132  				Login:           String("l"),
 15133  				ID:              Int64(1),
 15134  				URL:             String("u"),
 15135  				AvatarURL:       String("a"),
 15136  				GravatarID:      String("g"),
 15137  				Name:            String("n"),
 15138  				Company:         String("c"),
 15139  				Blog:            String("b"),
 15140  				Location:        String("l"),
 15141  				Email:           String("e"),
 15142  				Hireable:        Bool(true),
 15143  				Bio:             String("b"),
 15144  				TwitterUsername: String("t"),
 15145  				PublicRepos:     Int(1),
 15146  				Followers:       Int(1),
 15147  				Following:       Int(1),
 15148  				CreatedAt:       &Timestamp{referenceTime},
 15149  				SuspendedAt:     &Timestamp{referenceTime},
 15150  			},
 15151  			SuspendedAt: &Timestamp{referenceTime},
 15152  		},
 15153  	}
 15154  
 15155  	want := `{
 15156  		"action": "a",
 15157  		"alert": {
 15158  			"number": 1,
 15159  			"secret_type": "t",
 15160  			"resolution": "r",
 15161  			"resolved_by": {
 15162  				"login": "l",
 15163  				"id": 1,
 15164  				"node_id": "n",
 15165  				"avatar_url": "a",
 15166  				"url": "u",
 15167  				"events_url": "e",
 15168  				"repos_url": "r"
 15169  			},
 15170  			"resolved_at": ` + referenceTimeStr + `
 15171  		},
 15172  		"repository": {
 15173  			"id": 1,
 15174  			"name": "n",
 15175  			"url": "s"
 15176  		},
 15177          "organization": {
 15178  			"name": "n",
 15179  			"company": "c",
 15180  			"blog": "b",
 15181  			"location": "loc",
 15182  			"email": "e",
 15183  			"twitter_username": "tu",
 15184  			"description": "d",
 15185  			"billing_email": "be",
 15186  			"is_verified": true,
 15187  			"has_organization_projects": true,
 15188  			"has_repository_projects": true,
 15189  			"default_repository_permission": "drp",
 15190  			"members_can_create_repositories": true,
 15191  			"members_can_create_public_repositories": false,
 15192  			"members_can_create_private_repositories": true,
 15193  			"members_can_create_internal_repositories": true,
 15194  			"members_allowed_repository_creation_type": "marct",
 15195  			"members_can_create_pages": true,
 15196  			"members_can_create_public_pages": false,
 15197  			"members_can_create_private_pages": true
 15198  		},
 15199          "enterprise": {
 15200  			"id": 1,
 15201  			"slug": "s",
 15202  			"name": "n",
 15203  			"node_id": "nid",
 15204  			"avatar_url": "au",
 15205  			"description": "d",
 15206  			"website_url": "wu",
 15207  			"html_url": "hu",
 15208  			"created_at": ` + referenceTimeStr + `,
 15209  			"updated_at": ` + referenceTimeStr + `
 15210  		},
 15211  		"sender": {
 15212  			"login": "l",
 15213  			"id": 1,
 15214  			"node_id": "n",
 15215  			"avatar_url": "a",
 15216  			"url": "u",
 15217  			"events_url": "e",
 15218  			"repos_url": "r"
 15219  		},
 15220          "installation": {
 15221  			"id": 1,
 15222  			"node_id": "nid",
 15223  			"app_id": 1,
 15224  			"app_slug": "as",
 15225  			"target_id": 1,
 15226  			"account": {
 15227  				"login": "l",
 15228  				"id": 1,
 15229  				"avatar_url": "a",
 15230  				"gravatar_id": "g",
 15231  				"name": "n",
 15232  				"company": "c",
 15233  				"blog": "b",
 15234  				"location": "l",
 15235  				"email": "e",
 15236  				"hireable": true,
 15237  				"bio": "b",
 15238  				"twitter_username": "t",
 15239  				"public_repos": 1,
 15240  				"followers": 1,
 15241  				"following": 1,
 15242  				"created_at": ` + referenceTimeStr + `,
 15243  				"suspended_at": ` + referenceTimeStr + `,
 15244  				"url": "u"
 15245  			},
 15246  			"access_tokens_url": "atu",
 15247  			"repositories_url": "ru",
 15248  			"html_url": "hu",
 15249  			"target_type": "tt",
 15250  			"single_file_name": "sfn",
 15251  			"repository_selection": "rs",
 15252  			"events": [
 15253  				"e"
 15254  			],
 15255  			"single_file_paths": [
 15256  				"s"
 15257  			],
 15258  			"permissions": {
 15259  				"actions": "a",
 15260  				"administration": "ad",
 15261  				"checks": "c",
 15262  				"contents": "co",
 15263  				"content_references": "cr",
 15264  				"deployments": "d",
 15265  				"environments": "e",
 15266  				"issues": "i",
 15267  				"metadata": "md",
 15268  				"members": "m",
 15269  				"organization_administration": "oa",
 15270  				"organization_hooks": "oh",
 15271  				"organization_plan": "op",
 15272  				"organization_pre_receive_hooks": "opr",
 15273  				"organization_projects": "op",
 15274  				"organization_secrets": "os",
 15275  				"organization_self_hosted_runners": "osh",
 15276  				"organization_user_blocking": "oub",
 15277  				"packages": "pkg",
 15278  				"pages": "pg",
 15279  				"pull_requests": "pr",
 15280  				"repository_hooks": "rh",
 15281  				"repository_projects": "rp",
 15282  				"repository_pre_receive_hooks": "rprh",
 15283  				"secrets": "s",
 15284  				"secret_scanning_alerts": "ssa",
 15285  				"security_events": "se",
 15286  				"single_file": "sf",
 15287  				"statuses": "s",
 15288  				"team_discussions": "td",
 15289  				"vulnerability_alerts": "va",
 15290  				"workflows": "w"
 15291  			},
 15292  			"created_at": ` + referenceTimeStr + `,
 15293  			"updated_at": ` + referenceTimeStr + `,
 15294  			"has_multiple_single_files": false,
 15295  			"suspended_by": {
 15296  				"login": "l",
 15297  				"id": 1,
 15298  				"avatar_url": "a",
 15299  				"gravatar_id": "g",
 15300  				"name": "n",
 15301  				"company": "c",
 15302  				"blog": "b",
 15303  				"location": "l",
 15304  				"email": "e",
 15305  				"hireable": true,
 15306  				"bio": "b",
 15307  				"twitter_username": "t",
 15308  				"public_repos": 1,
 15309  				"followers": 1,
 15310  				"following": 1,
 15311  				"created_at": ` + referenceTimeStr + `,
 15312  				"suspended_at": ` + referenceTimeStr + `,
 15313  				"url": "u"
 15314  			},
 15315  			"suspended_at": ` + referenceTimeStr + `
 15316  		}
 15317  	}`
 15318  
 15319  	testJSONMarshal(t, u, want)
 15320  }
 15321  
 15322  func TestSecurityAdvisoryEvent_Marshal(t *testing.T) {
 15323  	testJSONMarshal(t, &SecurityAdvisoryEvent{}, "{}")
 15324  	u := &SecurityAdvisoryEvent{
 15325  		Action: String("published"),
 15326  		SecurityAdvisory: &SecurityAdvisory{
 15327  			GHSAID:      String("GHSA-rf4j-j272-some"),
 15328  			Summary:     String("Siuuuuuuuuu"),
 15329  			Description: String("desc"),
 15330  			Severity:    String("moderate"),
 15331  			Identifiers: []*AdvisoryIdentifier{
 15332  				{
 15333  					Value: String("GHSA-rf4j-j272-some"),
 15334  					Type:  String("GHSA"),
 15335  				},
 15336  			},
 15337  			References: []*AdvisoryReference{
 15338  				{
 15339  					URL: String("https://some-url"),
 15340  				},
 15341  			},
 15342  			PublishedAt: &Timestamp{referenceTime},
 15343  			UpdatedAt:   &Timestamp{referenceTime},
 15344  			WithdrawnAt: nil,
 15345  			Vulnerabilities: []*AdvisoryVulnerability{
 15346  				{
 15347  					Package: &VulnerabilityPackage{
 15348  						Ecosystem: String("ucl"),
 15349  						Name:      String("penaldo"),
 15350  					},
 15351  					Severity:               String("moderate"),
 15352  					VulnerableVersionRange: String(">= 2.0.0, < 2.0.2"),
 15353  					FirstPatchedVersion: &FirstPatchedVersion{
 15354  						Identifier: String("2.0.2"),
 15355  					},
 15356  				},
 15357  			},
 15358  		},
 15359  	}
 15360  
 15361  	want := `{
 15362  		"action": "published",
 15363  		"security_advisory": {
 15364  		  "ghsa_id": "GHSA-rf4j-j272-some",
 15365  		  "summary": "Siuuuuuuuuu",
 15366  		  "description": "desc",
 15367  		  "severity": "moderate",
 15368  		  "identifiers": [
 15369  			{
 15370  			  "value": "GHSA-rf4j-j272-some",
 15371  			  "type": "GHSA"
 15372  			}
 15373  		  ],
 15374  		  "references": [
 15375  			{
 15376  			  "url": "https://some-url"
 15377  			}
 15378  		  ],
 15379  		  "published_at": ` + referenceTimeStr + `,
 15380  		  "updated_at": ` + referenceTimeStr + `,
 15381  		  "withdrawn_at": null,
 15382  		  "vulnerabilities": [
 15383  			{
 15384  			  "package": {
 15385  				"ecosystem": "ucl",
 15386  				"name": "penaldo"
 15387  			  },
 15388  			  "severity": "moderate",
 15389  			  "vulnerable_version_range": ">= 2.0.0, < 2.0.2",
 15390  			  "first_patched_version": {
 15391  				"identifier": "2.0.2"
 15392  			  }
 15393  			}
 15394  		  ]
 15395  		}
 15396  	  }`
 15397  
 15398  	testJSONMarshal(t, u, want)
 15399  }
 15400  
 15401  func TestCodeScanningAlertEvent_Marshal(t *testing.T) {
 15402  	testJSONMarshal(t, &CodeScanningAlertEvent{}, "{}")
 15403  
 15404  	u := &CodeScanningAlertEvent{
 15405  		Action: String("reopened"),
 15406  		Alert: &Alert{
 15407  			Number: Int(10),
 15408  			Rule: &Rule{
 15409  				ID:              String("Style/FrozenStringLiteralComment"),
 15410  				Severity:        String("note"),
 15411  				Description:     String("desc"),
 15412  				FullDescription: String("full desc"),
 15413  				Tags:            []string{"style"},
 15414  				Help:            String("help"),
 15415  			},
 15416  			Tool: &Tool{
 15417  				Name:    String("Rubocop"),
 15418  				Version: nil,
 15419  			},
 15420  			CreatedAt: &Timestamp{referenceTime},
 15421  			UpdatedAt: &Timestamp{referenceTime},
 15422  			FixedAt:   nil,
 15423  			State:     String("open"),
 15424  			URL:       String("a"),
 15425  			HTMLURL:   String("a"),
 15426  			Instances: []*MostRecentInstance{
 15427  				{
 15428  					Ref:         String("refs/heads/main"),
 15429  					AnalysisKey: String(".github/workflows/workflow.yml:upload"),
 15430  					Environment: String("{}"),
 15431  					State:       String("open"),
 15432  				},
 15433  			},
 15434  			DismissedBy:     nil,
 15435  			DismissedAt:     nil,
 15436  			DismissedReason: nil,
 15437  		},
 15438  		Ref:       String("refs/heads/main"),
 15439  		CommitOID: String("d6e4c75c141dbacecc279b721b8bsomeSHA"),
 15440  		Repo: &Repository{
 15441  			ID:     Int64(1234234535),
 15442  			NodeID: String("MDEwOlJlcG9zaXRvcnkxODY4NT=="),
 15443  			Owner: &User{
 15444  				Login:             String("Codertocat"),
 15445  				ID:                Int64(21031067),
 15446  				NodeID:            String("MDQ6VXNlcjIxMDMxMDY3"),
 15447  				AvatarURL:         String("a"),
 15448  				GravatarID:        String(""),
 15449  				URL:               String("a"),
 15450  				HTMLURL:           String("a"),
 15451  				Type:              String("User"),
 15452  				SiteAdmin:         Bool(false),
 15453  				FollowersURL:      String("a"),
 15454  				FollowingURL:      String("a"),
 15455  				EventsURL:         String("a"),
 15456  				GistsURL:          String("a"),
 15457  				OrganizationsURL:  String("a"),
 15458  				ReceivedEventsURL: String("a"),
 15459  				ReposURL:          String("a"),
 15460  				StarredURL:        String("a"),
 15461  				SubscriptionsURL:  String("a"),
 15462  			},
 15463  			HTMLURL:          String("a"),
 15464  			Name:             String("Hello-World"),
 15465  			FullName:         String("Codertocat/Hello-World"),
 15466  			Description:      nil,
 15467  			Fork:             Bool(false),
 15468  			Homepage:         nil,
 15469  			DefaultBranch:    String("main"),
 15470  			CreatedAt:        &Timestamp{referenceTime},
 15471  			PushedAt:         &Timestamp{referenceTime},
 15472  			UpdatedAt:        &Timestamp{referenceTime},
 15473  			CloneURL:         String("a"),
 15474  			GitURL:           String("a"),
 15475  			MirrorURL:        nil,
 15476  			SSHURL:           String("a"),
 15477  			SVNURL:           String("a"),
 15478  			Language:         nil,
 15479  			ForksCount:       Int(0),
 15480  			OpenIssuesCount:  Int(2),
 15481  			OpenIssues:       Int(2),
 15482  			StargazersCount:  Int(0),
 15483  			WatchersCount:    Int(0),
 15484  			Watchers:         Int(0),
 15485  			Size:             Int(0),
 15486  			Archived:         Bool(false),
 15487  			Disabled:         Bool(false),
 15488  			License:          nil,
 15489  			Private:          Bool(false),
 15490  			HasIssues:        Bool(true),
 15491  			HasWiki:          Bool(true),
 15492  			HasPages:         Bool(true),
 15493  			HasProjects:      Bool(true),
 15494  			HasDownloads:     Bool(true),
 15495  			URL:              String("a"),
 15496  			ArchiveURL:       String("a"),
 15497  			AssigneesURL:     String("a"),
 15498  			BlobsURL:         String("a"),
 15499  			BranchesURL:      String("a"),
 15500  			CollaboratorsURL: String("a"),
 15501  			CommentsURL:      String("a"),
 15502  			CommitsURL:       String("a"),
 15503  			CompareURL:       String("a"),
 15504  			ContentsURL:      String("a"),
 15505  			ContributorsURL:  String("a"),
 15506  			DeploymentsURL:   String("a"),
 15507  			DownloadsURL:     String("a"),
 15508  			EventsURL:        String("a"),
 15509  			ForksURL:         String("a"),
 15510  			GitCommitsURL:    String("a"),
 15511  			GitRefsURL:       String("a"),
 15512  			GitTagsURL:       String("a"),
 15513  			HooksURL:         String("a"),
 15514  			IssueCommentURL:  String("a"),
 15515  			IssueEventsURL:   String("a"),
 15516  			IssuesURL:        String("a"),
 15517  			KeysURL:          String("a"),
 15518  			LabelsURL:        String("a"),
 15519  			LanguagesURL:     String("a"),
 15520  			MergesURL:        String("a"),
 15521  			MilestonesURL:    String("a"),
 15522  			NotificationsURL: String("a"),
 15523  			PullsURL:         String("a"),
 15524  			ReleasesURL:      String("a"),
 15525  			StargazersURL:    String("a"),
 15526  			StatusesURL:      String("a"),
 15527  			SubscribersURL:   String("a"),
 15528  			SubscriptionURL:  String("a"),
 15529  			TagsURL:          String("a"),
 15530  			TreesURL:         String("a"),
 15531  			TeamsURL:         String("a"),
 15532  		},
 15533  		Org: &Organization{
 15534  			Login:            String("Octocoders"),
 15535  			ID:               Int64(6),
 15536  			NodeID:           String("MDEyOk9yZ2FuaXphdGlvbjY="),
 15537  			AvatarURL:        String("a"),
 15538  			Description:      String(""),
 15539  			URL:              String("a"),
 15540  			EventsURL:        String("a"),
 15541  			HooksURL:         String("a"),
 15542  			IssuesURL:        String("a"),
 15543  			MembersURL:       String("a"),
 15544  			PublicMembersURL: String("a"),
 15545  			ReposURL:         String("a"),
 15546  		},
 15547  		Sender: &User{
 15548  			Login:             String("github"),
 15549  			ID:                Int64(9919),
 15550  			NodeID:            String("MDEyOk9yZ2FuaXphdGlvbjk5MTk="),
 15551  			AvatarURL:         String("a"),
 15552  			HTMLURL:           String("a"),
 15553  			GravatarID:        String(""),
 15554  			Type:              String("Organization"),
 15555  			SiteAdmin:         Bool(false),
 15556  			URL:               String("a"),
 15557  			EventsURL:         String("a"),
 15558  			FollowingURL:      String("a"),
 15559  			FollowersURL:      String("a"),
 15560  			GistsURL:          String("a"),
 15561  			OrganizationsURL:  String("a"),
 15562  			ReceivedEventsURL: String("a"),
 15563  			ReposURL:          String("a"),
 15564  			StarredURL:        String("a"),
 15565  			SubscriptionsURL:  String("a"),
 15566  		},
 15567  	}
 15568  
 15569  	want := `{
 15570  		"action": "reopened",
 15571  		"alert": {
 15572  		  "number": 10,
 15573  		  "created_at": ` + referenceTimeStr + `,
 15574  		  "updated_at": ` + referenceTimeStr + `,
 15575  		  "url": "a",
 15576  		  "html_url": "a",
 15577  		  "instances": [
 15578  			{
 15579  			  "ref": "refs/heads/main",
 15580  			  "analysis_key": ".github/workflows/workflow.yml:upload",
 15581  			  "environment": "{}",
 15582  			  "state": "open"
 15583  			}
 15584  		  ],
 15585  		  "state": "open",
 15586  		  "fixed_at": null,
 15587  		  "dismissed_by": null,
 15588  		  "dismissed_at": null,
 15589  		  "dismissed_reason": null,
 15590  		  "rule": {
 15591  			"id": "Style/FrozenStringLiteralComment",
 15592  			"severity": "note",
 15593  			"description": "desc",
 15594  			"full_description": "full desc",
 15595  			"tags": [
 15596  			  "style"
 15597  			],
 15598  			"help": "help"
 15599  		  },
 15600  		  "tool": {
 15601  			"name": "Rubocop",
 15602  			"version": null
 15603  		  }
 15604  		},
 15605  		"ref": "refs/heads/main",
 15606  		"commit_oid": "d6e4c75c141dbacecc279b721b8bsomeSHA",
 15607  		"repository": {
 15608  		  "id": 1234234535,
 15609  		  "node_id": "MDEwOlJlcG9zaXRvcnkxODY4NT==",
 15610  		  "name": "Hello-World",
 15611  		  "full_name": "Codertocat/Hello-World",
 15612  		  "private": false,
 15613  		  "owner": {
 15614  			"login": "Codertocat",
 15615  			"id": 21031067,
 15616  			"node_id": "MDQ6VXNlcjIxMDMxMDY3",
 15617  			"avatar_url": "a",
 15618  			"gravatar_id": "",
 15619  			"url": "a",
 15620  			"html_url": "a",
 15621  			"followers_url": "a",
 15622  			"following_url": "a",
 15623  			"gists_url": "a",
 15624  			"starred_url": "a",
 15625  			"subscriptions_url": "a",
 15626  			"organizations_url": "a",
 15627  			"repos_url": "a",
 15628  			"events_url": "a",
 15629  			"received_events_url": "a",
 15630  			"type": "User",
 15631  			"site_admin": false
 15632  		  },
 15633  		  "html_url": "a",
 15634  		  "description": null,
 15635  		  "fork": false,
 15636  		  "url": "a",
 15637  		  "forks_url": "a",
 15638  		  "keys_url": "a",
 15639  		  "collaborators_url": "a",
 15640  		  "teams_url": "a",
 15641  		  "hooks_url": "a",
 15642  		  "issue_events_url": "a",
 15643  		  "events_url": "a",
 15644  		  "assignees_url": "a",
 15645  		  "branches_url": "a",
 15646  		  "tags_url": "a",
 15647  		  "blobs_url": "a",
 15648  		  "git_tags_url": "a",
 15649  		  "git_refs_url": "a",
 15650  		  "trees_url": "a",
 15651  		  "statuses_url": "a",
 15652  		  "languages_url": "a",
 15653  		  "stargazers_url": "a",
 15654  		  "contributors_url": "a",
 15655  		  "subscribers_url": "a",
 15656  		  "subscription_url": "a",
 15657  		  "commits_url": "a",
 15658  		  "git_commits_url": "a",
 15659  		  "comments_url": "a",
 15660  		  "issue_comment_url": "a",
 15661  		  "contents_url": "a",
 15662  		  "compare_url": "a",
 15663  		  "merges_url": "a",
 15664  		  "archive_url": "a",
 15665  		  "downloads_url": "a",
 15666  		  "issues_url": "a",
 15667  		  "pulls_url": "a",
 15668  		  "milestones_url": "a",
 15669  		  "notifications_url": "a",
 15670  		  "labels_url": "a",
 15671  		  "releases_url": "a",
 15672  		  "deployments_url": "a",
 15673  		  "created_at": ` + referenceTimeStr + `,
 15674  		  "updated_at": ` + referenceTimeStr + `,
 15675  		  "pushed_at": ` + referenceTimeStr + `,
 15676  		  "git_url": "a",
 15677  		  "ssh_url": "a",
 15678  		  "clone_url": "a",
 15679  		  "svn_url": "a",
 15680  		  "homepage": null,
 15681  		  "size": 0,
 15682  		  "stargazers_count": 0,
 15683  		  "watchers_count": 0,
 15684  		  "language": null,
 15685  		  "has_issues": true,
 15686  		  "has_projects": true,
 15687  		  "has_downloads": true,
 15688  		  "has_wiki": true,
 15689  		  "has_pages": true,
 15690  		  "forks_count": 0,
 15691  		  "mirror_url": null,
 15692  		  "archived": false,
 15693  		  "disabled": false,
 15694  		  "open_issues_count": 2,
 15695  		  "license": null,
 15696  		  "forks": 0,
 15697  		  "open_issues": 2,
 15698  		  "watchers": 0,
 15699  		  "default_branch": "main"
 15700  		},
 15701  		"organization": {
 15702  		  "login": "Octocoders",
 15703  		  "id": 6,
 15704  		  "node_id": "MDEyOk9yZ2FuaXphdGlvbjY=",
 15705  		  "url": "a",
 15706  		  "repos_url": "a",
 15707  		  "events_url": "a",
 15708  		  "hooks_url": "a",
 15709  		  "issues_url": "a",
 15710  		  "members_url": "a",
 15711  		  "public_members_url": "a",
 15712  		  "avatar_url": "a",
 15713  		  "description": ""
 15714  		},
 15715  		"sender": {
 15716  		  "login": "github",
 15717  		  "id": 9919,
 15718  		  "node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
 15719  		  "avatar_url": "a",
 15720  		  "gravatar_id": "",
 15721  		  "url": "a",
 15722  		  "html_url": "a",
 15723  		  "followers_url": "a",
 15724  		  "following_url": "a",
 15725  		  "gists_url": "a",
 15726  		  "starred_url": "a",
 15727  		  "subscriptions_url": "a",
 15728  		  "organizations_url": "a",
 15729  		  "repos_url": "a",
 15730  		  "events_url": "a",
 15731  		  "received_events_url": "a",
 15732  		  "type": "Organization",
 15733  		  "site_admin": false
 15734  		}
 15735  	  }`
 15736  
 15737  	testJSONMarshal(t, u, want)
 15738  }