diff --git a/steampipe-plugin-github/github/tag_utils.go b/steampipe-plugin-github/github/tag_utils.go deleted file mode 100644 index 16ee5610..00000000 --- a/steampipe-plugin-github/github/tag_utils.go +++ /dev/null @@ -1,71 +0,0 @@ -package github - -import ( - "context" - "fmt" - "slices" - - "github.com/shurcooL/githubv4" - "github.com/turbot/steampipe-plugin-sdk/v5/plugin" -) - -func extractTagFromHydrateItem(h *plugin.HydrateData) (tagRow, error) { - if tag, ok := h.Item.(tagRow); ok { - return tag, nil - } else { - return tagRow{}, fmt.Errorf("unable to parse hydrate item %v as an Tag", h.Item) - } -} - -func appendTagColumnIncludes(m *map[string]interface{}, cols []string) { - (*m)["includeTagTarget"] = githubv4.Boolean(slices.Contains(cols, "tagger_date") || slices.Contains(cols, "tagger_name") || slices.Contains(cols, "tagger_login") || slices.Contains(cols, "message") || slices.Contains(cols, "commit")) - (*m)["includeTagName"] = githubv4.Boolean(slices.Contains(cols, "name")) -} - -func tagHydrateName(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - tag, err := extractTagFromHydrateItem(h) - if err != nil { - return nil, err - } - return tag.Name, nil -} - -func tagHydrateTaggerName(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - tag, err := extractTagFromHydrateItem(h) - if err != nil { - return nil, err - } - return tag.TaggerName, nil -} - -func tagHydrateTaggerDate(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - tag, err := extractTagFromHydrateItem(h) - if err != nil { - return nil, err - } - return tag.TaggerDate, nil -} - -func tagHydrateTaggerLogin(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - tag, err := extractTagFromHydrateItem(h) - if err != nil { - return nil, err - } - return tag.TaggerLogin, nil -} - -func tagHydrateMessage(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - tag, err := extractTagFromHydrateItem(h) - if err != nil { - return nil, err - } - return tag.Message, nil -} - -func tagHydrateCommit(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - tag, err := extractTagFromHydrateItem(h) - if err != nil { - return nil, err - } - return tag.Commit, nil -} \ No newline at end of file diff --git a/steampipe-plugin-github/github/team_utils.go b/steampipe-plugin-github/github/team_utils.go deleted file mode 100644 index 1e544f5f..00000000 --- a/steampipe-plugin-github/github/team_utils.go +++ /dev/null @@ -1,238 +0,0 @@ -package github - -import ( - "context" - "fmt" - "slices" - - "github.com/opengovern/og-describer-github/steampipe-plugin-github/github/models" - "github.com/shurcooL/githubv4" - "github.com/turbot/steampipe-plugin-sdk/v5/plugin" -) - -func extractTeamFromHydrateItem(h *plugin.HydrateData) (models.TeamWithCounts, error) { - if team, ok := h.Item.(models.TeamWithCounts); ok { - return team, nil - } else { - return models.TeamWithCounts{}, fmt.Errorf("unable to parse hydrate item %v as an Team", h.Item) - } -} - -func appendTeamColumnIncludes(m *map[string]interface{}, cols []string) { - (*m)["includeTeamAvatarUrl"] = githubv4.Boolean(slices.Contains(cols, "avatar_url")) - (*m)["includeTeamCombinedSlug"] = githubv4.Boolean(slices.Contains(cols, "combined_slug")) - (*m)["includeTeamCreatedAt"] = githubv4.Boolean(slices.Contains(cols, "created_at")) - (*m)["includeTeamDescription"] = githubv4.Boolean(slices.Contains(cols, "description")) - (*m)["includeTeamDiscussionsUrl"] = githubv4.Boolean(slices.Contains(cols, "discussions_url")) - (*m)["includeTeamEditTeamUrl"] = githubv4.Boolean(slices.Contains(cols, "edit_team_url")) - (*m)["includeTeamMembersUrl"] = githubv4.Boolean(slices.Contains(cols, "members_url")) - (*m)["includeTeamNewTeamUrl"] = githubv4.Boolean(slices.Contains(cols, "new_team_url")) - (*m)["includeTeamParentTeam"] = githubv4.Boolean(slices.Contains(cols, "parent_team")) - (*m)["includeTeamPrivacy"] = githubv4.Boolean(slices.Contains(cols, "privacy")) - (*m)["includeTeamRepositoriesUrl"] = githubv4.Boolean(slices.Contains(cols, "repositories_url")) - (*m)["includeTeamTeamsUrl"] = githubv4.Boolean(slices.Contains(cols, "teams_url")) - (*m)["includeTeamUpdatedAt"] = githubv4.Boolean(slices.Contains(cols, "updated_at")) - (*m)["includeTeamUrl"] = githubv4.Boolean(slices.Contains(cols, "url")) - (*m)["includeTeamCanAdminister"] = githubv4.Boolean(slices.Contains(cols, "can_administer")) - (*m)["includeTeamCanSubscribe"] = githubv4.Boolean(slices.Contains(cols, "can_subscribe")) - (*m)["includeTeamSubscription"] = githubv4.Boolean(slices.Contains(cols, "subscription")) - (*m)["includeTeamAncestors"] = githubv4.Boolean(slices.Contains(cols, "ancestors_total_count")) - (*m)["includeTeamChildTeams"] = githubv4.Boolean(slices.Contains(cols, "child_teams_total_count")) - (*m)["includeTeamDiscussions"] = githubv4.Boolean(slices.Contains(cols, "discussions_total_count")) - (*m)["includeTeamInvitations"] = githubv4.Boolean(slices.Contains(cols, "invitations_total_count")) - (*m)["includeTeamMembers"] = githubv4.Boolean(slices.Contains(cols, "members_total_count")) - (*m)["includeTeamProjectsV2"] = githubv4.Boolean(slices.Contains(cols, "projects_v2_total_count")) - (*m)["includeTeamRepositories"] = githubv4.Boolean(slices.Contains(cols, "repositories_total_count")) -} - -func teamHydrateAvatarUrl(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - team, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return team.AvatarUrl, nil -} - -func teamHydrateCombinedSlug(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - team, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return team.CombinedSlug, nil -} - -func teamHydrateCreatedAt(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - team, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return team.CreatedAt, nil -} - -func teamHydrateDescription(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - team, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return team.Description, nil -} - -func teamHydrateDiscussionsUrl(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - team, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return team.DiscussionsUrl, nil -} - -func teamHydrateEditTeamUrl(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - team, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return team.EditTeamUrl, nil -} - -func teamHydrateMembersUrl(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - team, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return team.MembersUrl, nil -} - -func teamHydrateNewTeamUrl(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - team, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return team.NewTeamUrl, nil -} - -func teamHydrateParentTeam(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - team, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return team.ParentTeam, nil -} - -func teamHydratePrivacy(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - team, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return team.Privacy, nil -} - -func teamHydrateRepositoriesUrl(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - team, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return team.RepositoriesUrl, nil -} - -func teamHydrateTeamsUrl(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - team, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return team.TeamsUrl, nil -} - -func teamHydrateUpdatedAt(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - team, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return team.UpdatedAt, nil -} - -func teamHydrateUrl(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - team, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return team.Url, nil -} - -func teamHydrateCanAdminister(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - team, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return team.CanAdminister, nil -} - -func teamHydrateCanSubscribe(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - team, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return team.CanSubscribe, nil -} - -func teamHydrateSubscription(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - team, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return team.Subscription, nil -} - -func teamHydrateAncestorsTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - teamWithCounts, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return teamWithCounts.Ancestors.TotalCount, nil -} - -func teamHydrateChildTeamsTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - teamWithCounts, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return teamWithCounts.ChildTeams.TotalCount, nil -} - -func teamHydrateDiscussionsTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - teamWithCounts, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return teamWithCounts.Discussions.TotalCount, nil -} - -func teamHydrateInvitationsTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - teamWithCounts, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return teamWithCounts.Invitations.TotalCount, nil -} - -func teamHydrateMembersTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - teamWithCounts, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return teamWithCounts.Members.TotalCount, nil -} - -func teamHydrateProjectsV2TotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - teamWithCounts, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return teamWithCounts.ProjectsV2.TotalCount, nil -} - -func teamHydrateRepositoriesTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - teamWithCounts, err := extractTeamFromHydrateItem(h) - if err != nil { - return nil, err - } - return teamWithCounts.Repositories.TotalCount, nil -} diff --git a/steampipe-plugin-github/github/user_utils.go b/steampipe-plugin-github/github/user_utils.go deleted file mode 100644 index 2304974e..00000000 --- a/steampipe-plugin-github/github/user_utils.go +++ /dev/null @@ -1,512 +0,0 @@ -package github - -import ( - "context" - "fmt" - "slices" - - "github.com/opengovern/og-describer-github/steampipe-plugin-github/github/models" - "github.com/shurcooL/githubv4" - "github.com/turbot/steampipe-plugin-sdk/v5/plugin" -) - -func extractUserFromHydrateItem(h *plugin.HydrateData) (models.UserWithCounts, error) { - if user, ok := h.Item.(models.UserWithCounts); ok { - return user, nil - } else if teamMember, ok := h.Item.(models.TeamMemberWithRole); ok { - return models.UserWithCounts{User: teamMember.Node}, nil - } else if orgMember, ok := h.Item.(memberWithRole); ok { - return models.UserWithCounts{User: orgMember.Node}, nil - } else { - return models.UserWithCounts{}, fmt.Errorf("unable to parse hydrate item %v as an User", h.Item) - } -} - -func appendUserColumnIncludes(m *map[string]interface{}, cols []string) { - (*m)["includeUserAnyPinnableItems"] = githubv4.Boolean(slices.Contains(cols, "any_pinnable_items")) - (*m)["includeUserAvatarUrl"] = githubv4.Boolean(slices.Contains(cols, "avatar_url")) - (*m)["includeUserBio"] = githubv4.Boolean(slices.Contains(cols, "bio")) - (*m)["includeUserCompany"] = githubv4.Boolean(slices.Contains(cols, "company")) - (*m)["includeUserEstimatedNextSponsorsPayoutInCents"] = githubv4.Boolean(slices.Contains(cols, "estimated_next_sponsors_payout_in_cents")) - (*m)["includeUserHasSponsorsListing"] = githubv4.Boolean(slices.Contains(cols, "has_sponsors_listing")) - (*m)["includeUserInteractionAbility"] = githubv4.Boolean(slices.Contains(cols, "interaction_ability")) - (*m)["includeUserIsBountyHunter"] = githubv4.Boolean(slices.Contains(cols, "is_bounty_hunter")) - (*m)["includeUserIsCampusExpert"] = githubv4.Boolean(slices.Contains(cols, "is_campus_expert")) - (*m)["includeUserIsDeveloperProgramMember"] = githubv4.Boolean(slices.Contains(cols, "is_developer_program_member")) - (*m)["includeUserIsEmployee"] = githubv4.Boolean(slices.Contains(cols, "is_employee")) - (*m)["includeUserIsFollowingYou"] = githubv4.Boolean(slices.Contains(cols, "is_following_you")) - (*m)["includeUserIsGitHubStar"] = githubv4.Boolean(slices.Contains(cols, "is_github_star")) - (*m)["includeUserIsHireable"] = githubv4.Boolean(slices.Contains(cols, "is_hireable")) - (*m)["includeUserIsSiteAdmin"] = githubv4.Boolean(slices.Contains(cols, "is_site_admin")) - (*m)["includeUserIsSponsoringYou"] = githubv4.Boolean(slices.Contains(cols, "is_sponsoring_you")) - (*m)["includeUserIsYou"] = githubv4.Boolean(slices.Contains(cols, "is_you")) - (*m)["includeUserLocation"] = githubv4.Boolean(slices.Contains(cols, "location")) - (*m)["includeUserMonthlyEstimatedSponsorsIncomeInCents"] = githubv4.Boolean(slices.Contains(cols, "monthly_estimated_sponsors_income_in_cents")) - (*m)["includeUserPinnedItemsRemaining"] = githubv4.Boolean(slices.Contains(cols, "pinned_items_remaining")) - (*m)["includeUserProjectsUrl"] = githubv4.Boolean(slices.Contains(cols, "projects_url")) - (*m)["includeUserPronouns"] = githubv4.Boolean(slices.Contains(cols, "pronouns")) - (*m)["includeUserSponsorsListing"] = githubv4.Boolean(slices.Contains(cols, "sponsors_listing")) - (*m)["includeUserStatus"] = githubv4.Boolean(slices.Contains(cols, "status")) - (*m)["includeUserTwitterUsername"] = githubv4.Boolean(slices.Contains(cols, "twitter_username")) - (*m)["includeUserCanChangedPinnedItems"] = githubv4.Boolean(slices.Contains(cols, "can_changed_pinned_items")) - (*m)["includeUserCanCreateProjects"] = githubv4.Boolean(slices.Contains(cols, "can_create_projects")) - (*m)["includeUserCanFollow"] = githubv4.Boolean(slices.Contains(cols, "can_follow")) - (*m)["includeUserCanSponsor"] = githubv4.Boolean(slices.Contains(cols, "can_sponsor")) - (*m)["includeUserIsFollowing"] = githubv4.Boolean(slices.Contains(cols, "is_following")) - (*m)["includeUserIsSponsoring"] = githubv4.Boolean(slices.Contains(cols, "is_sponsoring")) - (*m)["includeUserWebsiteUrl"] = githubv4.Boolean(slices.Contains(cols, "website_url")) -} - -func appendUserWithCountColumnIncludes(m *map[string]interface{}, cols []string) { - (*m)["includeUserAnyPinnableItems"] = githubv4.Boolean(slices.Contains(cols, "any_pinnable_items")) - (*m)["includeUserAvatarUrl"] = githubv4.Boolean(slices.Contains(cols, "avatar_url")) - (*m)["includeUserBio"] = githubv4.Boolean(slices.Contains(cols, "bio")) - (*m)["includeUserCompany"] = githubv4.Boolean(slices.Contains(cols, "company")) - (*m)["includeUserEstimatedNextSponsorsPayoutInCents"] = githubv4.Boolean(slices.Contains(cols, "estimated_next_sponsors_payout_in_cents")) - (*m)["includeUserHasSponsorsListing"] = githubv4.Boolean(slices.Contains(cols, "has_sponsors_listing")) - (*m)["includeUserInteractionAbility"] = githubv4.Boolean(slices.Contains(cols, "interaction_ability")) - (*m)["includeUserIsBountyHunter"] = githubv4.Boolean(slices.Contains(cols, "is_bounty_hunter")) - (*m)["includeUserIsCampusExpert"] = githubv4.Boolean(slices.Contains(cols, "is_campus_expert")) - (*m)["includeUserIsDeveloperProgramMember"] = githubv4.Boolean(slices.Contains(cols, "is_developer_program_member")) - (*m)["includeUserIsEmployee"] = githubv4.Boolean(slices.Contains(cols, "is_employee")) - (*m)["includeUserIsFollowingYou"] = githubv4.Boolean(slices.Contains(cols, "is_following_you")) - (*m)["includeUserIsGitHubStar"] = githubv4.Boolean(slices.Contains(cols, "is_github_star")) - (*m)["includeUserIsHireable"] = githubv4.Boolean(slices.Contains(cols, "is_hireable")) - (*m)["includeUserIsSiteAdmin"] = githubv4.Boolean(slices.Contains(cols, "is_site_admin")) - (*m)["includeUserIsSponsoringYou"] = githubv4.Boolean(slices.Contains(cols, "is_sponsoring_you")) - (*m)["includeUserIsYou"] = githubv4.Boolean(slices.Contains(cols, "is_you")) - (*m)["includeUserLocation"] = githubv4.Boolean(slices.Contains(cols, "location")) - (*m)["includeUserMonthlyEstimatedSponsorsIncomeInCents"] = githubv4.Boolean(slices.Contains(cols, "monthly_estimated_sponsors_income_in_cents")) - (*m)["includeUserPinnedItemsRemaining"] = githubv4.Boolean(slices.Contains(cols, "pinned_items_remaining")) - (*m)["includeUserProjectsUrl"] = githubv4.Boolean(slices.Contains(cols, "projects_url")) - (*m)["includeUserPronouns"] = githubv4.Boolean(slices.Contains(cols, "pronouns")) - (*m)["includeUserSponsorsListing"] = githubv4.Boolean(slices.Contains(cols, "sponsors_listing")) - (*m)["includeUserStatus"] = githubv4.Boolean(slices.Contains(cols, "status")) - (*m)["includeUserTwitterUsername"] = githubv4.Boolean(slices.Contains(cols, "twitter_username")) - (*m)["includeUserCanChangedPinnedItems"] = githubv4.Boolean(slices.Contains(cols, "can_changed_pinned_items")) - (*m)["includeUserCanCreateProjects"] = githubv4.Boolean(slices.Contains(cols, "can_create_projects")) - (*m)["includeUserCanFollow"] = githubv4.Boolean(slices.Contains(cols, "can_follow")) - (*m)["includeUserCanSponsor"] = githubv4.Boolean(slices.Contains(cols, "can_sponsor")) - (*m)["includeUserIsFollowing"] = githubv4.Boolean(slices.Contains(cols, "is_following")) - (*m)["includeUserIsSponsoring"] = githubv4.Boolean(slices.Contains(cols, "is_sponsoring")) - (*m)["includeUserWebsiteUrl"] = githubv4.Boolean(slices.Contains(cols, "website_url")) - - (*m)["includeUserRepositories"] = githubv4.Boolean(slices.Contains(cols, "repositories_total_disk_usage")) - (*m)["includeUserFollowers"] = githubv4.Boolean(slices.Contains(cols, "followers_total_count")) - (*m)["includeUserFollowing"] = githubv4.Boolean(slices.Contains(cols, "following_total_count")) - (*m)["includeUserPublicRepositories"] = githubv4.Boolean(slices.Contains(cols, "public_repositories_total_count")) - (*m)["includeUserPrivateRepositories"] = githubv4.Boolean(slices.Contains(cols, "private_repositories_total_count")) - (*m)["includeUserPublicGists"] = githubv4.Boolean(slices.Contains(cols, "public_gists_total_count")) - (*m)["includeUserIssues"] = githubv4.Boolean(slices.Contains(cols, "issues_total_count")) - (*m)["includeUserOrganizations"] = githubv4.Boolean(slices.Contains(cols, "organizations_total_count")) - (*m)["includeUserPublicKeys"] = githubv4.Boolean(slices.Contains(cols, "public_keys_total_count")) - (*m)["includeUserOpenPullRequests"] = githubv4.Boolean(slices.Contains(cols, "open_pull_requests_total_count")) - (*m)["includeUserMergedPullRequests"] = githubv4.Boolean(slices.Contains(cols, "merged_pull_requests_total_count")) - (*m)["includeUserClosedPullRequests"] = githubv4.Boolean(slices.Contains(cols, "closed_pull_requests_total_count")) - (*m)["includeUserPackages"] = githubv4.Boolean(slices.Contains(cols, "packages_total_count")) - (*m)["includeUserPinnedItems"] = githubv4.Boolean(slices.Contains(cols, "pinned_items_total_count")) - (*m)["includeUserSponsoring"] = githubv4.Boolean(slices.Contains(cols, "sponsoring_total_count")) - (*m)["includeUserSponsors"] = githubv4.Boolean(slices.Contains(cols, "sponsors_total_count")) - (*m)["includeUserStarredRepositories"] = githubv4.Boolean(slices.Contains(cols, "starred_repositories_total_count")) - (*m)["includeUserWatching"] = githubv4.Boolean(slices.Contains(cols, "watching_total_count")) -} - -func userHydrateAnyPinnableItems(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.AnyPinnableItems, nil -} - -func userHydrateAvatarUrl(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.AvatarUrl, nil -} - -func userHydrateBio(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.Bio, nil -} - -func userHydrateCompany(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.Company, nil -} - -func userHydrateEstimatedNextSponsorsPayoutInCents(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.EstimatedNextSponsorsPayoutInCents, nil -} - -func userHydrateHasSponsorsListing(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.HasSponsorsListing, nil -} - -func userHydrateInteractionAbility(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.InteractionAbility, nil -} - -func userHydrateIsBountyHunter(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.IsBountyHunter, nil -} - -func userHydrateIsCampusExpert(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.IsCampusExpert, nil -} - -func userHydrateIsDeveloperProgramMember(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.IsDeveloperProgramMember, nil -} - -func userHydrateIsEmployee(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.IsEmployee, nil -} - -func userHydrateIsFollowingYou(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.IsFollowingYou, nil -} - -func userHydrateIsGitHubStar(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.IsGitHubStar, nil -} - -func userHydrateIsHireable(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.IsHireable, nil -} - -func userHydrateIsSiteAdmin(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.IsSiteAdmin, nil -} - -func userHydrateIsSponsoringYou(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.IsSponsoringYou, nil -} - -func userHydrateIsYou(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.IsYou, nil -} - -func userHydrateLocation(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.Location, nil -} - -func userHydrateMonthlyEstimatedSponsorsIncomeInCents(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.MonthlyEstimatedSponsorsIncomeInCents, nil -} - -func userHydratePinnedItemsRemaining(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.PinnedItemsRemaining, nil -} - -func userHydrateProjectsUrl(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.ProjectsUrl, nil -} - -func userHydratePronouns(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.Pronouns, nil -} - -func userHydrateSponsorsListing(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.SponsorsListing, nil -} - -func userHydrateStatus(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.Status, nil -} - -func userHydrateTwitterUsername(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.TwitterUsername, nil -} - -func userHydrateCanChangedPinnedItems(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.CanChangedPinnedItems, nil -} - -func userHydrateCanCreateProjects(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.CanCreateProjects, nil -} - -func userHydrateCanFollow(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.CanFollow, nil -} - -func userHydrateCanSponsor(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.CanSponsor, nil -} - -func userHydrateIsFollowing(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.IsFollowing, nil -} - -func userHydrateIsSponsoring(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.IsSponsoring, nil -} - -func userHydrateWebsiteUrl(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.WebsiteUrl, nil -} - -func userHydrateRepositoriesTotalDiskUsage(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.Repositories.TotalDiskUsage, nil -} - -func userHydrateFollowersTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.Followers.TotalCount, nil -} - -func userHydrateFollowingTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.Following.TotalCount, nil -} - -func userHydratePublicRepositoriesTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.PublicRepositories.TotalCount, nil -} - -func userHydratePrivateRepositoriesTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.PrivateRepositories.TotalCount, nil -} - -func userHydratePublicGistsTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.PublicGists.TotalCount, nil -} - -func userHydrateIssuesTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.Issues.TotalCount, nil -} - -func userHydrateOrganizationsTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.Organizations.TotalCount, nil -} - -func userHydratePublicKeysTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.PublicKeys.TotalCount, nil -} - -func userHydrateOpenPullRequestsTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.OpenPullRequests.TotalCount, nil -} - -func userHydrateMergedPullRequestsTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.MergedPullRequests.TotalCount, nil -} - -func userHydrateClosedPullRequestsTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.ClosedPullRequests.TotalCount, nil -} - -func userHydratePackagesTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.Packages.TotalCount, nil -} - -func userHydratePinnedItemsTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.PinnedItems.TotalCount, nil -} - -func userHydrateSponsoringTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.Sponsoring.TotalCount, nil -} - -func userHydrateSponsorsTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.Sponsors.TotalCount, nil -} - -func userHydrateStarredRepositoriesTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.StarredRepositories.TotalCount, nil -} - -func userHydrateWatchingTotalCount(_ context.Context, _ *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - user, err := extractUserFromHydrateItem(h) - if err != nil { - return nil, err - } - return user.Watching.TotalCount, nil -}