Skip to content

Commit

Permalink
Merge pull request #229 from ChaseFreeman17/freemanc/apigateway4
Browse files Browse the repository at this point in the history
  • Loading branch information
ekristen authored Jul 22, 2024
2 parents 9ddf574 + d8e2279 commit 093dcca
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
26 changes: 15 additions & 11 deletions resources/apigateway-restapis.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package resources

import (
"context"
"time"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/apigateway"
Expand All @@ -26,11 +27,12 @@ func init() {
type APIGatewayRestAPILister struct{}

type APIGatewayRestAPI struct {
svc *apigateway.APIGateway
restAPIID *string
name *string
version *string
tags map[string]*string
svc *apigateway.APIGateway
restAPIID *string
name *string
version *string
createdDate *time.Time
tags map[string]*string
}

func (l *APIGatewayRestAPILister) List(_ context.Context, o interface{}) ([]resource.Resource, error) {
Expand All @@ -51,11 +53,12 @@ func (l *APIGatewayRestAPILister) List(_ context.Context, o interface{}) ([]reso

for _, item := range output.Items {
resources = append(resources, &APIGatewayRestAPI{
svc: svc,
restAPIID: item.Id,
name: item.Name,
version: item.Version,
tags: item.Tags,
svc: svc,
restAPIID: item.Id,
name: item.Name,
version: item.Version,
createdDate: item.CreatedDate,
tags: item.Tags,
})
}

Expand Down Expand Up @@ -89,6 +92,7 @@ func (f *APIGatewayRestAPI) Properties() types.Properties {
properties.
Set("APIID", f.restAPIID).
Set("Name", f.name).
Set("Version", f.version)
Set("Version", f.version).
Set("CreatedDate", f.createdDate.Format(time.RFC3339))
return properties
}
6 changes: 5 additions & 1 deletion resources/apigatewayv2-apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package resources

import (
"context"
"time"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/apigatewayv2"
Expand Down Expand Up @@ -47,6 +48,7 @@ func (l *APIGatewayV2APILister) List(_ context.Context, o interface{}) ([]resour
name: item.Name,
protocolType: item.ProtocolType,
version: item.Version,
createdDate: item.CreatedDate,
tags: item.Tags,
})
}
Expand All @@ -67,6 +69,7 @@ type APIGatewayV2API struct {
name *string
protocolType *string
version *string
createdDate *time.Time
tags map[string]*string
}

Expand All @@ -91,6 +94,7 @@ func (f *APIGatewayV2API) Properties() types.Properties {
Set("APIID", f.v2APIID).
Set("Name", f.name).
Set("ProtocolType", f.protocolType).
Set("Version", f.version)
Set("Version", f.version).
Set("CreatedDate", f.createdDate.Format(time.RFC3339))
return properties
}

0 comments on commit 093dcca

Please sign in to comment.