Skip to content

Commit

Permalink
rename enums with clunky pluralization
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismarget-j committed Oct 22, 2024
1 parent 2ebaa87 commit 1fba4c3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions apstra/enum/enums.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ var (
PolicyRuleProtocolUdp = PolicyRuleProtocol{Value: "UDP"}
)

type RemoteGatewayRouteTypes oenum.Member[string]
type RemoteGatewayRouteType oenum.Member[string]

var (
RemoteGatewayRouteTypesAll = RemoteGatewayRouteTypes{Value: "all"}
RemoteGatewayRouteTypesFiveOnly = RemoteGatewayRouteTypes{Value: "type5_only"}
RemoteGatewayRouteTypeAll = RemoteGatewayRouteType{Value: "all"}
RemoteGatewayRouteTypeFiveOnly = RemoteGatewayRouteType{Value: "type5_only"}
)

type TcpStateQualifier oenum.Member[string]
Expand Down
16 changes: 8 additions & 8 deletions apstra/enum/generated_enums.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ func (o *PortRole) FromString(s string) error {
return nil
}

var _ enum = (*RemoteGatewayRouteTypes)(nil)
var _ enum = (*RemoteGatewayRouteType)(nil)

func (o RemoteGatewayRouteTypes) String() string {
func (o RemoteGatewayRouteType) String() string {
return o.Value
}

func (o *RemoteGatewayRouteTypes) FromString(s string) error {
if RemoteGatewayRouteTypess.Parse(s) == nil {
func (o *RemoteGatewayRouteType) FromString(s string) error {
if RemoteGatewayRouteTypes.Parse(s) == nil {
return newEnumParseError(o, s)
}
o.Value = s
Expand Down Expand Up @@ -380,10 +380,10 @@ var (
PortRoleUnused,
)

_ enum = new(RemoteGatewayRouteTypes)
RemoteGatewayRouteTypess = oenum.New(
RemoteGatewayRouteTypesAll,
RemoteGatewayRouteTypesFiveOnly,
_ enum = new(RemoteGatewayRouteType)
RemoteGatewayRouteTypes = oenum.New(
RemoteGatewayRouteTypeAll,
RemoteGatewayRouteTypeFiveOnly,
)

_ enum = new(RenderedConfigType)
Expand Down
2 changes: 1 addition & 1 deletion apstra/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func featureSwitchEnumFromStringPtr(in *string) *enum.FeatureSwitch {
if in == nil {
return nil
}
return enum.FeatureSwitches.Parse(*in)
return enum.FeatureSwitchs.Parse(*in)
}

func isv4(ip net.IP) bool {
Expand Down
4 changes: 2 additions & 2 deletions apstra/two_stage_l3_clos_remote_gateways.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type rawRemoteGatewayResponse struct {
}

func (o *rawRemoteGatewayResponse) polish() (*RemoteGateway, error) {
routeTypes := enum.RemoteGatewayRouteTypesEnum.Parse(o.RouteTypes)
routeTypes := enum.RemoteGatewayRouteTypes.Parse(o.RouteTypes)
if routeTypes == nil {
return nil, fmt.Errorf("failed parsing remote gateway route types: %q", o.RouteTypes)
}
Expand Down Expand Up @@ -77,7 +77,7 @@ func (o *rawRemoteGatewayResponse) polish() (*RemoteGateway, error) {
}

type RemoteGatewayData struct {
RouteTypes enum.RemoteGatewayRouteTypes
RouteTypes enum.RemoteGatewayRouteType
LocalGwNodes []ObjectId
GwAsn uint32
GwIp net.IP
Expand Down

0 comments on commit 1fba4c3

Please sign in to comment.