@@ -4709,241 +4709,6 @@ func GetRepoAlertDependabot(ctx context.Context, d *plugin.QueryData, _ *plugin.
47094709
47104710// ========================== END: RepoAlertDependabot =============================
47114711
4712- // ========================== START: RepoDeployment =============================
4713-
4714- type RepoDeployment struct {
4715- ResourceID string `json:"resource_id"`
4716- PlatformID string `json:"platform_id"`
4717- Description github.RepoDeploymentDescription `json:"Description"`
4718- Metadata github.Metadata `json:"metadata"`
4719- DescribedBy string `json:"described_by"`
4720- ResourceType string `json:"resource_type"`
4721- IntegrationType string `json:"integration_type"`
4722- IntegrationID string `json:"integration_id"`
4723- }
4724-
4725- type RepoDeploymentHit struct {
4726- ID string `json:"_id"`
4727- Score float64 `json:"_score"`
4728- Index string `json:"_index"`
4729- Type string `json:"_type"`
4730- Version int64 `json:"_version,omitempty"`
4731- Source RepoDeployment `json:"_source"`
4732- Sort []interface {} `json:"sort"`
4733- }
4734-
4735- type RepoDeploymentHits struct {
4736- Total essdk.SearchTotal `json:"total"`
4737- Hits []RepoDeploymentHit `json:"hits"`
4738- }
4739-
4740- type RepoDeploymentSearchResponse struct {
4741- PitID string `json:"pit_id"`
4742- Hits RepoDeploymentHits `json:"hits"`
4743- }
4744-
4745- type RepoDeploymentPaginator struct {
4746- paginator * essdk.BaseESPaginator
4747- }
4748-
4749- func (k Client ) NewRepoDeploymentPaginator (filters []essdk.BoolFilter , limit * int64 ) (RepoDeploymentPaginator , error ) {
4750- paginator , err := essdk .NewPaginator (k .ES (), "github_repository_deployment" , filters , limit )
4751- if err != nil {
4752- return RepoDeploymentPaginator {}, err
4753- }
4754-
4755- p := RepoDeploymentPaginator {
4756- paginator : paginator ,
4757- }
4758-
4759- return p , nil
4760- }
4761-
4762- func (p RepoDeploymentPaginator ) HasNext () bool {
4763- return ! p .paginator .Done ()
4764- }
4765-
4766- func (p RepoDeploymentPaginator ) Close (ctx context.Context ) error {
4767- return p .paginator .Deallocate (ctx )
4768- }
4769-
4770- func (p RepoDeploymentPaginator ) NextPage (ctx context.Context ) ([]RepoDeployment , error ) {
4771- var response RepoDeploymentSearchResponse
4772- err := p .paginator .Search (ctx , & response )
4773- if err != nil {
4774- return nil , err
4775- }
4776-
4777- var values []RepoDeployment
4778- for _ , hit := range response .Hits .Hits {
4779- values = append (values , hit .Source )
4780- }
4781-
4782- hits := int64 (len (response .Hits .Hits ))
4783- if hits > 0 {
4784- p .paginator .UpdateState (hits , response .Hits .Hits [hits - 1 ].Sort , response .PitID )
4785- } else {
4786- p .paginator .UpdateState (hits , nil , "" )
4787- }
4788-
4789- return values , nil
4790- }
4791-
4792- var listRepoDeploymentFilters = map [string ]string {
4793- "commit_sha" : "Description.CommitSha" ,
4794- "creator" : "Description.Creator" ,
4795- "description" : "Description.Description" ,
4796- "environment" : "Description.Environment" ,
4797- "id" : "Description.Id" ,
4798- "latest_environment" : "Description.LatestEnvironment" ,
4799- "latest_status" : "Description.LatestStatus" ,
4800- "node_id" : "Description.NodeId" ,
4801- "organization_id" : "Description.OrganizationID" ,
4802- "original_environment" : "Description.OriginalEnvironment" ,
4803- "payload" : "Description.Payload" ,
4804- "ref" : "Description.Ref" ,
4805- "repository_full_name" : "Description.RepoFullName" ,
4806- "repository_id" : "Description.RepositoryID" ,
4807- "repository_name" : "Description.RepositoryName" ,
4808- "state" : "Description.State" ,
4809- "task" : "Description.Task" ,
4810- }
4811-
4812- func ListRepoDeployment (ctx context.Context , d * plugin.QueryData , _ * plugin.HydrateData ) (interface {}, error ) {
4813- plugin .Logger (ctx ).Trace ("ListRepoDeployment" )
4814- runtime .GC ()
4815-
4816- // create service
4817- cfg := essdk .GetConfig (d .Connection )
4818- ke , err := essdk .NewClientCached (cfg , d .ConnectionCache , ctx )
4819- if err != nil {
4820- plugin .Logger (ctx ).Error ("ListRepoDeployment NewClientCached" , "error" , err )
4821- return nil , err
4822- }
4823- k := Client {Client : ke }
4824-
4825- sc , err := steampipesdk .NewSelfClientCached (ctx , d .ConnectionCache )
4826- if err != nil {
4827- plugin .Logger (ctx ).Error ("ListRepoDeployment NewSelfClientCached" , "error" , err )
4828- return nil , err
4829- }
4830- integrationId , err := sc .GetConfigTableValueOrNil (ctx , steampipesdk .OpenGovernanceConfigKeyIntegrationID )
4831- if err != nil {
4832- plugin .Logger (ctx ).Error ("ListRepoDeployment GetConfigTableValueOrNil for OpenGovernanceConfigKeyIntegrationID" , "error" , err )
4833- return nil , err
4834- }
4835- encodedResourceCollectionFilters , err := sc .GetConfigTableValueOrNil (ctx , steampipesdk .OpenGovernanceConfigKeyResourceCollectionFilters )
4836- if err != nil {
4837- plugin .Logger (ctx ).Error ("ListRepoDeployment GetConfigTableValueOrNil for OpenGovernanceConfigKeyResourceCollectionFilters" , "error" , err )
4838- return nil , err
4839- }
4840- clientType , err := sc .GetConfigTableValueOrNil (ctx , steampipesdk .OpenGovernanceConfigKeyClientType )
4841- if err != nil {
4842- plugin .Logger (ctx ).Error ("ListRepoDeployment GetConfigTableValueOrNil for OpenGovernanceConfigKeyClientType" , "error" , err )
4843- return nil , err
4844- }
4845-
4846- paginator , err := k .NewRepoDeploymentPaginator (essdk .BuildFilter (ctx , d .QueryContext , listRepoDeploymentFilters , integrationId , encodedResourceCollectionFilters , clientType ), d .QueryContext .Limit )
4847- if err != nil {
4848- plugin .Logger (ctx ).Error ("ListRepoDeployment NewRepoDeploymentPaginator" , "error" , err )
4849- return nil , err
4850- }
4851-
4852- for paginator .HasNext () {
4853- page , err := paginator .NextPage (ctx )
4854- if err != nil {
4855- plugin .Logger (ctx ).Error ("ListRepoDeployment paginator.NextPage" , "error" , err )
4856- return nil , err
4857- }
4858-
4859- for _ , v := range page {
4860- d .StreamListItem (ctx , v )
4861- }
4862- }
4863-
4864- err = paginator .Close (ctx )
4865- if err != nil {
4866- return nil , err
4867- }
4868-
4869- return nil , nil
4870- }
4871-
4872- var getRepoDeploymentFilters = map [string ]string {
4873- "commit_sha" : "Description.CommitSha" ,
4874- "creator" : "Description.Creator" ,
4875- "description" : "Description.Description" ,
4876- "environment" : "Description.Environment" ,
4877- "id" : "Description.Id" ,
4878- "latest_environment" : "Description.LatestEnvironment" ,
4879- "latest_status" : "Description.LatestStatus" ,
4880- "node_id" : "Description.NodeId" ,
4881- "organization_id" : "Description.OrganizationID" ,
4882- "original_environment" : "Description.OriginalEnvironment" ,
4883- "payload" : "Description.Payload" ,
4884- "ref" : "Description.Ref" ,
4885- "repository_full_name" : "Description.RepoFullName" ,
4886- "repository_id" : "Description.RepositoryID" ,
4887- "repository_name" : "Description.RepositoryName" ,
4888- "state" : "Description.State" ,
4889- "task" : "Description.Task" ,
4890- }
4891-
4892- func GetRepoDeployment (ctx context.Context , d * plugin.QueryData , _ * plugin.HydrateData ) (interface {}, error ) {
4893- plugin .Logger (ctx ).Trace ("GetRepoDeployment" )
4894- runtime .GC ()
4895- // create service
4896- cfg := essdk .GetConfig (d .Connection )
4897- ke , err := essdk .NewClientCached (cfg , d .ConnectionCache , ctx )
4898- if err != nil {
4899- return nil , err
4900- }
4901- k := Client {Client : ke }
4902-
4903- sc , err := steampipesdk .NewSelfClientCached (ctx , d .ConnectionCache )
4904- if err != nil {
4905- return nil , err
4906- }
4907- integrationId , err := sc .GetConfigTableValueOrNil (ctx , steampipesdk .OpenGovernanceConfigKeyIntegrationID )
4908- if err != nil {
4909- return nil , err
4910- }
4911- encodedResourceCollectionFilters , err := sc .GetConfigTableValueOrNil (ctx , steampipesdk .OpenGovernanceConfigKeyResourceCollectionFilters )
4912- if err != nil {
4913- return nil , err
4914- }
4915- clientType , err := sc .GetConfigTableValueOrNil (ctx , steampipesdk .OpenGovernanceConfigKeyClientType )
4916- if err != nil {
4917- return nil , err
4918- }
4919-
4920- limit := int64 (1 )
4921- paginator , err := k .NewRepoDeploymentPaginator (essdk .BuildFilter (ctx , d .QueryContext , getRepoDeploymentFilters , integrationId , encodedResourceCollectionFilters , clientType ), & limit )
4922- if err != nil {
4923- return nil , err
4924- }
4925-
4926- for paginator .HasNext () {
4927- page , err := paginator .NextPage (ctx )
4928- if err != nil {
4929- return nil , err
4930- }
4931-
4932- for _ , v := range page {
4933- return v , nil
4934- }
4935- }
4936-
4937- err = paginator .Close (ctx )
4938- if err != nil {
4939- return nil , err
4940- }
4941-
4942- return nil , nil
4943- }
4944-
4945- // ========================== END: RepoDeployment =============================
4946-
49474712// ========================== START: RepoEnvironment =============================
49484713
49494714type RepoEnvironment struct {
@@ -6139,23 +5904,7 @@ func (p TeamPaginator) NextPage(ctx context.Context) ([]Team, error) {
61395904 return values , nil
61405905}
61415906
6142- var listTeamFilters = map [string ]string {
6143- "description" : "Description.Description" ,
6144- "html_url" : "Description.HTMLURL" ,
6145- "id" : "Description.ID" ,
6146- "members_count" : "Description.MembersCount" ,
6147- "name" : "Description.Name" ,
6148- "node_id" : "Description.NodeID" ,
6149- "notification_setting" : "Description.NotificationSetting" ,
6150- "organization_id" : "Description.OrganizationID" ,
6151- "parent_team_id" : "Description.ParentTeamID" ,
6152- "permission" : "Description.Permission" ,
6153- "privacy" : "Description.Privacy" ,
6154- "repos_count" : "Description.ReposCount" ,
6155- "slug" : "Description.Slug" ,
6156- "team_sync" : "Description.TeamSync" ,
6157- "url" : "Description.URL" ,
6158- }
5907+ var listTeamFilters = map [string ]string {}
61595908
61605909func ListTeam (ctx context.Context , d * plugin.QueryData , _ * plugin.HydrateData ) (interface {}, error ) {
61615910 plugin .Logger (ctx ).Trace ("ListTeam" )
@@ -6217,23 +5966,7 @@ func ListTeam(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (
62175966 return nil , nil
62185967}
62195968
6220- var getTeamFilters = map [string ]string {
6221- "description" : "Description.Description" ,
6222- "html_url" : "Description.HTMLURL" ,
6223- "id" : "Description.ID" ,
6224- "members_count" : "Description.MembersCount" ,
6225- "name" : "Description.Name" ,
6226- "node_id" : "Description.NodeID" ,
6227- "notification_setting" : "Description.NotificationSetting" ,
6228- "organization_id" : "Description.OrganizationID" ,
6229- "parent_team_id" : "Description.ParentTeamID" ,
6230- "permission" : "Description.Permission" ,
6231- "privacy" : "Description.Privacy" ,
6232- "repos_count" : "Description.ReposCount" ,
6233- "slug" : "Description.Slug" ,
6234- "team_sync" : "Description.TeamSync" ,
6235- "url" : "Description.URL" ,
6236- }
5969+ var getTeamFilters = map [string ]string {}
62375970
62385971func GetTeam (ctx context.Context , d * plugin.QueryData , _ * plugin.HydrateData ) (interface {}, error ) {
62395972 plugin .Logger (ctx ).Trace ("GetTeam" )
0 commit comments