Skip to content

Commit

Permalink
regen #2
Browse files Browse the repository at this point in the history
  • Loading branch information
mbfrahry committed Nov 10, 2021
1 parent 25ec095 commit 8d26048
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 102 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,23 @@ const (

func PossibleValuesForExpressRouteAuthorizationProvisioningState() []string {
return []string{
"Failed",
"Succeeded",
"Updating",
string(ExpressRouteAuthorizationProvisioningStateFailed),
string(ExpressRouteAuthorizationProvisioningStateSucceeded),
string(ExpressRouteAuthorizationProvisioningStateUpdating),
}
}

func parseExpressRouteAuthorizationProvisioningState(input string) (*ExpressRouteAuthorizationProvisioningState, error) {
vals := map[string]ExpressRouteAuthorizationProvisioningState{
"failed": "Failed",
"succeeded": "Succeeded",
"updating": "Updating",
"failed": ExpressRouteAuthorizationProvisioningStateFailed,
"succeeded": ExpressRouteAuthorizationProvisioningStateSucceeded,
"updating": ExpressRouteAuthorizationProvisioningStateUpdating,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

// it could be a new value - best effort convert this
v := input

out := ExpressRouteAuthorizationProvisioningState(v)
// otherwise presume it's an undefined value and best-effort it
out := ExpressRouteAuthorizationProvisioningState(input)
return &out, nil
}
26 changes: 12 additions & 14 deletions internal/services/vmware/sdk/2020-03-20/clusters/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,27 @@ const (

func PossibleValuesForClusterProvisioningState() []string {
return []string{
"Cancelled",
"Deleting",
"Failed",
"Succeeded",
"Updating",
string(ClusterProvisioningStateCancelled),
string(ClusterProvisioningStateDeleting),
string(ClusterProvisioningStateFailed),
string(ClusterProvisioningStateSucceeded),
string(ClusterProvisioningStateUpdating),
}
}

func parseClusterProvisioningState(input string) (*ClusterProvisioningState, error) {
vals := map[string]ClusterProvisioningState{
"cancelled": "Cancelled",
"deleting": "Deleting",
"failed": "Failed",
"succeeded": "Succeeded",
"updating": "Updating",
"cancelled": ClusterProvisioningStateCancelled,
"deleting": ClusterProvisioningStateDeleting,
"failed": ClusterProvisioningStateFailed,
"succeeded": ClusterProvisioningStateSucceeded,
"updating": ClusterProvisioningStateUpdating,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

// it could be a new value - best effort convert this
v := input

out := ClusterProvisioningState(v)
// otherwise presume it's an undefined value and best-effort it
out := ClusterProvisioningState(input)
return &out, nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,25 @@ const (

func PossibleValuesForHcxEnterpriseSiteStatus() []string {
return []string{
"Available",
"Consumed",
"Deactivated",
"Deleted",
string(HcxEnterpriseSiteStatusAvailable),
string(HcxEnterpriseSiteStatusConsumed),
string(HcxEnterpriseSiteStatusDeactivated),
string(HcxEnterpriseSiteStatusDeleted),
}
}

func parseHcxEnterpriseSiteStatus(input string) (*HcxEnterpriseSiteStatus, error) {
vals := map[string]HcxEnterpriseSiteStatus{
"available": "Available",
"consumed": "Consumed",
"deactivated": "Deactivated",
"deleted": "Deleted",
"available": HcxEnterpriseSiteStatusAvailable,
"consumed": HcxEnterpriseSiteStatusConsumed,
"deactivated": HcxEnterpriseSiteStatusDeactivated,
"deleted": HcxEnterpriseSiteStatusDeleted,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

// it could be a new value - best effort convert this
v := input

out := HcxEnterpriseSiteStatus(v)
// otherwise presume it's an undefined value and best-effort it
out := HcxEnterpriseSiteStatus(input)
return &out, nil
}
32 changes: 14 additions & 18 deletions internal/services/vmware/sdk/2020-03-20/locations/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,22 @@ const (

func PossibleValuesForQuotaEnabled() []string {
return []string{
"Disabled",
"Enabled",
string(QuotaEnabledDisabled),
string(QuotaEnabledEnabled),
}
}

func parseQuotaEnabled(input string) (*QuotaEnabled, error) {
vals := map[string]QuotaEnabled{
"disabled": "Disabled",
"enabled": "Enabled",
"disabled": QuotaEnabledDisabled,
"enabled": QuotaEnabledEnabled,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

// it could be a new value - best effort convert this
v := input

out := QuotaEnabled(v)
// otherwise presume it's an undefined value and best-effort it
out := QuotaEnabled(input)
return &out, nil
}

Expand All @@ -42,25 +40,23 @@ const (

func PossibleValuesForTrialStatus() []string {
return []string{
"TrialAvailable",
"TrialDisabled",
"TrialUsed",
string(TrialStatusTrialAvailable),
string(TrialStatusTrialDisabled),
string(TrialStatusTrialUsed),
}
}

func parseTrialStatus(input string) (*TrialStatus, error) {
vals := map[string]TrialStatus{
"trialavailable": "TrialAvailable",
"trialdisabled": "TrialDisabled",
"trialused": "TrialUsed",
"trialavailable": TrialStatusTrialAvailable,
"trialdisabled": TrialStatusTrialDisabled,
"trialused": TrialStatusTrialUsed,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

// it could be a new value - best effort convert this
v := input

out := TrialStatus(v)
// otherwise presume it's an undefined value and best-effort it
out := TrialStatus(input)
return &out, nil
}
88 changes: 40 additions & 48 deletions internal/services/vmware/sdk/2020-03-20/privateclouds/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,28 @@ const (

func PossibleValuesForClusterProvisioningState() []string {
return []string{
"Cancelled",
"Deleting",
"Failed",
"Succeeded",
"Updating",
string(ClusterProvisioningStateCancelled),
string(ClusterProvisioningStateDeleting),
string(ClusterProvisioningStateFailed),
string(ClusterProvisioningStateSucceeded),
string(ClusterProvisioningStateUpdating),
}
}

func parseClusterProvisioningState(input string) (*ClusterProvisioningState, error) {
vals := map[string]ClusterProvisioningState{
"cancelled": "Cancelled",
"deleting": "Deleting",
"failed": "Failed",
"succeeded": "Succeeded",
"updating": "Updating",
"cancelled": ClusterProvisioningStateCancelled,
"deleting": ClusterProvisioningStateDeleting,
"failed": ClusterProvisioningStateFailed,
"succeeded": ClusterProvisioningStateSucceeded,
"updating": ClusterProvisioningStateUpdating,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

// it could be a new value - best effort convert this
v := input

out := ClusterProvisioningState(v)
// otherwise presume it's an undefined value and best-effort it
out := ClusterProvisioningState(input)
return &out, nil
}

Expand All @@ -50,24 +48,22 @@ const (

func PossibleValuesForInternetEnum() []string {
return []string{
"Disabled",
"Enabled",
string(InternetEnumDisabled),
string(InternetEnumEnabled),
}
}

func parseInternetEnum(input string) (*InternetEnum, error) {
vals := map[string]InternetEnum{
"disabled": "Disabled",
"enabled": "Enabled",
"disabled": InternetEnumDisabled,
"enabled": InternetEnumEnabled,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

// it could be a new value - best effort convert this
v := input

out := InternetEnum(v)
// otherwise presume it's an undefined value and best-effort it
out := InternetEnum(input)
return &out, nil
}

Expand All @@ -85,34 +81,32 @@ const (

func PossibleValuesForPrivateCloudProvisioningState() []string {
return []string{
"Building",
"Cancelled",
"Deleting",
"Failed",
"Pending",
"Succeeded",
"Updating",
string(PrivateCloudProvisioningStateBuilding),
string(PrivateCloudProvisioningStateCancelled),
string(PrivateCloudProvisioningStateDeleting),
string(PrivateCloudProvisioningStateFailed),
string(PrivateCloudProvisioningStatePending),
string(PrivateCloudProvisioningStateSucceeded),
string(PrivateCloudProvisioningStateUpdating),
}
}

func parsePrivateCloudProvisioningState(input string) (*PrivateCloudProvisioningState, error) {
vals := map[string]PrivateCloudProvisioningState{
"building": "Building",
"cancelled": "Cancelled",
"deleting": "Deleting",
"failed": "Failed",
"pending": "Pending",
"succeeded": "Succeeded",
"updating": "Updating",
"building": PrivateCloudProvisioningStateBuilding,
"cancelled": PrivateCloudProvisioningStateCancelled,
"deleting": PrivateCloudProvisioningStateDeleting,
"failed": PrivateCloudProvisioningStateFailed,
"pending": PrivateCloudProvisioningStatePending,
"succeeded": PrivateCloudProvisioningStateSucceeded,
"updating": PrivateCloudProvisioningStateUpdating,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

// it could be a new value - best effort convert this
v := input

out := PrivateCloudProvisioningState(v)
// otherwise presume it's an undefined value and best-effort it
out := PrivateCloudProvisioningState(input)
return &out, nil
}

Expand All @@ -125,23 +119,21 @@ const (

func PossibleValuesForSslEnum() []string {
return []string{
"Disabled",
"Enabled",
string(SslEnumDisabled),
string(SslEnumEnabled),
}
}

func parseSslEnum(input string) (*SslEnum, error) {
vals := map[string]SslEnum{
"disabled": "Disabled",
"enabled": "Enabled",
"disabled": SslEnumDisabled,
"enabled": SslEnumEnabled,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

// it could be a new value - best effort convert this
v := input

out := SslEnum(v)
// otherwise presume it's an undefined value and best-effort it
out := SslEnum(input)
return &out, nil
}

0 comments on commit 8d26048

Please sign in to comment.