Skip to content

Commit

Permalink
fix: fix misspel
Browse files Browse the repository at this point in the history
  • Loading branch information
artaasadi committed Nov 7, 2024
1 parent 7716081 commit 98e5540
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pkg/describer/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func GetResources(
logger *zap.Logger,
resourceType string,
triggerType enums.DescribeTriggerType,
cfg configs.IntegrationConfig,
cfg configs.IntegrationCredentials,
additionalParameters map[string]string,
stream *model.StreamSender,
) error {
Expand All @@ -60,7 +60,7 @@ func GetResources(
return nil
}

func describe(ctx context.Context, logger *zap.Logger, accountCfg configs.IntegrationConfig, resourceType string, triggerType enums.DescribeTriggerType, additionalParameters map[string]string, stream *model.StreamSender) ([]model.Resource, error) {
func describe(ctx context.Context, logger *zap.Logger, accountCfg configs.IntegrationCredentials, resourceType string, triggerType enums.DescribeTriggerType, additionalParameters map[string]string, stream *model.StreamSender) ([]model.Resource, error) {
resourceTypeObject, ok := provider.ResourceTypes[resourceType]
if !ok {
return nil, fmt.Errorf("unsupported resource type: %s", resourceType)
Expand Down
4 changes: 2 additions & 2 deletions pkg/sdk/models/resource_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
)

// any types are used to load your provider configuration.
type ResourceDescriber func(context.Context, configs.IntegrationConfig, enums.DescribeTriggerType, map[string]string, *StreamSender) ([]Resource, error)
type SingleResourceDescriber func(context.Context, configs.IntegrationConfig, enums.DescribeTriggerType, map[string]string) (*Resource, error)
type ResourceDescriber func(context.Context, configs.IntegrationCredentials, enums.DescribeTriggerType, map[string]string, *StreamSender) ([]Resource, error)
type SingleResourceDescriber func(context.Context, configs.IntegrationCredentials, enums.DescribeTriggerType, map[string]string) (*Resource, error)

type ResourceType struct {
IntegrationType integration.Type
Expand Down
10 changes: 5 additions & 5 deletions provider/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ import (
"github.com/opengovern/og-util/pkg/describe"
)

// AccountCredentialsFromMap TODO: converts a map to an configs.IntegrationConfig.
func AccountCredentialsFromMap(m map[string]any) (configs.IntegrationConfig, error) {
// AccountCredentialsFromMap TODO: converts a map to an configs.IntegrationCredentials.
func AccountCredentialsFromMap(m map[string]any) (configs.IntegrationCredentials, error) {
mj, err := json.Marshal(m)
if err != nil {
return configs.IntegrationConfig{}, err
return configs.IntegrationCredentials{}, err
}

var c configs.IntegrationConfig
var c configs.IntegrationCredentials
err = json.Unmarshal(mj, &c)
if err != nil {
return configs.IntegrationConfig{}, err
return configs.IntegrationCredentials{}, err
}

return c, nil
Expand Down
4 changes: 2 additions & 2 deletions provider/describer_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
)

// DescribeByIntegration TODO: implement a wrapper to pass integration authorization to describer functions
func DescribeByIntegration(describe func(context.Context, *configs.IntegrationConfig, string, *model.StreamSender) ([]model.Resource, error)) model.ResourceDescriber {
return func(ctx context.Context, cfg configs.IntegrationConfig, triggerType enums.DescribeTriggerType, additionalParameters map[string]string, stream *model.StreamSender) ([]model.Resource, error) {
func DescribeByIntegration(describe func(context.Context, *configs.IntegrationCredentials, string, *model.StreamSender) ([]model.Resource, error)) model.ResourceDescriber {
return func(ctx context.Context, cfg configs.IntegrationCredentials, triggerType enums.DescribeTriggerType, additionalParameters map[string]string, stream *model.StreamSender) ([]model.Resource, error) {

var values []model.Resource

Expand Down

0 comments on commit 98e5540

Please sign in to comment.