-
-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathaws_service.go
33 lines (28 loc) · 889 Bytes
/
aws_service.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package awsworkflow
import "github.com/aws/aws-sdk-go-v2/aws"
type AwsService struct {
Id string `yaml:"id"`
Name string `yaml:"name"`
ShortName string `yaml:"short_name"`
Description string `yaml:"description"`
Url string `yaml:"url"`
HomeID string `yaml:"home_id"`
ExtraSearchTerms []string `yaml:"extra_search_terms"`
SubServices []AwsService `yaml:"sub_services"`
HasGlobalRegion bool `yaml:"has_global_region"`
}
func (s *AwsService) GetName() string {
if s.ShortName != "" {
return s.ShortName + " – " + s.Name
}
return s.Name
}
func (s *AwsService) GetRegion(cfg aws.Config) string {
if s.HasGlobalRegion {
return ""
}
return cfg.Region
}
func (s *AwsService) HasSubServices() bool {
return s.SubServices != nil && len(s.SubServices) > 0
}