@@ -34,14 +34,13 @@ var (
3434// Model contains the ACK model for the generator to process and apply
3535// templates against.
3636type Model struct {
37- SDKAPI * SDKAPI
38- servicePackage string
39- serviceAlias string
40- apiVersion string
41- crds []* CRD
42- typeDefs []* TypeDef
43- typeImports map [string ]string
44- typeRenames map [string ]string
37+ SDKAPI * SDKAPI
38+ serviceAlias string
39+ apiVersion string
40+ crds []* CRD
41+ typeDefs []* TypeDef
42+ typeImports map [string ]string
43+ typeRenames map [string ]string
4544 // Instructions to the code generator how to handle the API and its
4645 // resources
4746 cfg * ackgenconfig.Config
@@ -52,10 +51,10 @@ type Model struct {
5251func (m * Model ) MetaVars () templateset.MetaVars {
5352 return templateset.MetaVars {
5453 ServiceAlias : m .serviceAlias ,
55- ServiceIDClean : m .ServiceIDClean (),
56- APIGroup : m .APIGroup (),
54+ ServiceID : m .SDKAPI .ServiceID (),
55+ ServiceIDClean : m .SDKAPI .ServiceIDClean (),
56+ APIGroup : m .SDKAPI .APIGroup (),
5757 APIVersion : m .apiVersion ,
58- AWSSDKModelServiceID : m .SDKAPI .AWSSDKModelServiceID (),
5958 SDKAPIInterfaceTypeName : m .SDKAPI .SDKAPIInterfaceTypeName (),
6059 CRDNames : m .crdNames (),
6160 }
@@ -692,29 +691,11 @@ func (m *Model) GetConfig() *ackgenconfig.Config {
692691 return m .cfg
693692}
694693
695- // APIGroup returns the normalized Kubernetes APIGroup for the AWS service API,
696- // e.g. "sns.services.k8s.aws"
697- func (m * Model ) APIGroup () string {
698- serviceID := m .servicePackage
699- suffix := "services.k8s.aws"
700- if m .SDKAPI .apiGroupSuffix != "" {
701- suffix = m .SDKAPI .apiGroupSuffix
702- }
703- return fmt .Sprintf ("%s.%s" , serviceID , suffix )
704- }
705-
706- // ServiceIDClean returns a lowercased, whitespace-stripped ServiceID
707- func (m * Model ) ServiceIDClean () string {
708- serviceID := strings .ToLower (m .servicePackage )
709- return strings .Replace (serviceID , " " , "" , - 1 )
710- }
711-
712694// New returns a new Model struct for a supplied API model.
713695// Optionally, pass a file path to a generator config file that can be used to
714696// instruct the code generator how to handle the API properly
715697func New (
716698 SDKAPI * SDKAPI ,
717- servicePackage string ,
718699 apiVersion string ,
719700 configPath string ,
720701 defaultConfig ackgenconfig.Config ,
@@ -724,11 +705,12 @@ func New(
724705 return nil , err
725706 }
726707 m := & Model {
727- SDKAPI : SDKAPI ,
728- servicePackage : servicePackage ,
729- serviceAlias : SDKAPI .AWSSDKModelServiceID (),
730- apiVersion : apiVersion ,
731- cfg : & cfg ,
708+ SDKAPI : SDKAPI ,
709+ // TODO(jaypipes): Handle cases where service alias and service ID
710+ // don't match (Step Functions)
711+ serviceAlias : SDKAPI .ServiceID (),
712+ apiVersion : apiVersion ,
713+ cfg : & cfg ,
732714 }
733715 m .ApplyShapeIgnoreRules ()
734716 return m , nil
0 commit comments