Skip to content

Commit

Permalink
Updating based on e9396a8dd
Browse files Browse the repository at this point in the history
  • Loading branch information
hc-github-team-tf-azure committed Jan 10, 2024
1 parent 12b0d58 commit b589014
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,44 +201,44 @@ func (r KubernetesClusterTrustedAccessRoleBindingResource) Update() sdk.Resource
}
}

func (r KubernetesClusterTrustedAccessRoleBindingResource) mapKubernetesClusterTrustedAccessRoleBindingResourceSchemaToTrustedAccessRoleBindingProperties(input KubernetesClusterTrustedAccessRoleBindingResourceSchema, output *trustedaccess.TrustedAccessRoleBindingProperties) error {
func (r KubernetesClusterTrustedAccessRoleBindingResource) mapKubernetesClusterTrustedAccessRoleBindingResourceSchemaToTrustedAccessRoleBinding(input KubernetesClusterTrustedAccessRoleBindingResourceSchema, output *trustedaccess.TrustedAccessRoleBinding) error {

roles := make([]string, 0)
for _, v := range input.Roles {
roles = append(roles, v)
if err := r.mapKubernetesClusterTrustedAccessRoleBindingResourceSchemaToTrustedAccessRoleBindingProperties(input, &output.Properties); err != nil {
return fmt.Errorf("mapping Schema to SDK Field %q / Model %q: %+v", "TrustedAccessRoleBindingProperties", "Properties", err)
}
output.Roles = roles

output.SourceResourceId = input.SourceResourceId
return nil
}

func (r KubernetesClusterTrustedAccessRoleBindingResource) mapTrustedAccessRoleBindingPropertiesToKubernetesClusterTrustedAccessRoleBindingResourceSchema(input trustedaccess.TrustedAccessRoleBindingProperties, output *KubernetesClusterTrustedAccessRoleBindingResourceSchema) error {
func (r KubernetesClusterTrustedAccessRoleBindingResource) mapTrustedAccessRoleBindingToKubernetesClusterTrustedAccessRoleBindingResourceSchema(input trustedaccess.TrustedAccessRoleBinding, output *KubernetesClusterTrustedAccessRoleBindingResourceSchema) error {

roles := make([]string, 0)
for _, v := range input.Roles {
roles = append(roles, v)
if err := r.mapTrustedAccessRoleBindingPropertiesToKubernetesClusterTrustedAccessRoleBindingResourceSchema(input.Properties, output); err != nil {
return fmt.Errorf("mapping SDK Field %q / Model %q to Schema: %+v", "TrustedAccessRoleBindingProperties", "Properties", err)
}
output.Roles = roles

output.SourceResourceId = input.SourceResourceId
return nil
}

func (r KubernetesClusterTrustedAccessRoleBindingResource) mapKubernetesClusterTrustedAccessRoleBindingResourceSchemaToTrustedAccessRoleBinding(input KubernetesClusterTrustedAccessRoleBindingResourceSchema, output *trustedaccess.TrustedAccessRoleBinding) error {
func (r KubernetesClusterTrustedAccessRoleBindingResource) mapKubernetesClusterTrustedAccessRoleBindingResourceSchemaToTrustedAccessRoleBindingProperties(input KubernetesClusterTrustedAccessRoleBindingResourceSchema, output *trustedaccess.TrustedAccessRoleBindingProperties) error {

if err := r.mapKubernetesClusterTrustedAccessRoleBindingResourceSchemaToTrustedAccessRoleBindingProperties(input, &output.Properties); err != nil {
return fmt.Errorf("mapping Schema to SDK Field %q / Model %q: %+v", "TrustedAccessRoleBindingProperties", "Properties", err)
roles := make([]string, 0)
for _, v := range input.Roles {
roles = append(roles, v)
}
output.Roles = roles

output.SourceResourceId = input.SourceResourceId
return nil
}

func (r KubernetesClusterTrustedAccessRoleBindingResource) mapTrustedAccessRoleBindingToKubernetesClusterTrustedAccessRoleBindingResourceSchema(input trustedaccess.TrustedAccessRoleBinding, output *KubernetesClusterTrustedAccessRoleBindingResourceSchema) error {
func (r KubernetesClusterTrustedAccessRoleBindingResource) mapTrustedAccessRoleBindingPropertiesToKubernetesClusterTrustedAccessRoleBindingResourceSchema(input trustedaccess.TrustedAccessRoleBindingProperties, output *KubernetesClusterTrustedAccessRoleBindingResourceSchema) error {

if err := r.mapTrustedAccessRoleBindingPropertiesToKubernetesClusterTrustedAccessRoleBindingResourceSchema(input.Properties, output); err != nil {
return fmt.Errorf("mapping SDK Field %q / Model %q to Schema: %+v", "TrustedAccessRoleBindingProperties", "Properties", err)
roles := make([]string, 0)
for _, v := range input.Roles {
roles = append(roles, v)
}
output.Roles = roles

output.SourceResourceId = input.SourceResourceId
return nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -225,23 +225,27 @@ func (r KubernetesFleetManagerResource) mapFleetHubProfileToKubernetesFleetManag
return nil
}

func (r KubernetesFleetManagerResource) mapKubernetesFleetManagerResourceSchemaToFleetProperties(input KubernetesFleetManagerResourceSchema, output *fleets.FleetProperties) error {
if len(input.HubProfile) > 0 {
if err := r.mapKubernetesFleetManagerResourceFleetHubProfileSchemaToFleetProperties(input.HubProfile[0], output); err != nil {
return err
}
func (r KubernetesFleetManagerResource) mapKubernetesFleetManagerResourceFleetHubProfileSchemaToFleetProperties(input KubernetesFleetManagerResourceFleetHubProfileSchema, output *fleets.FleetProperties) error {

if output.HubProfile == nil {
output.HubProfile = &fleets.FleetHubProfile{}
}
if err := r.mapKubernetesFleetManagerResourceFleetHubProfileSchemaToFleetHubProfile(input, output.HubProfile); err != nil {
return fmt.Errorf("mapping Schema to SDK Field %q / Model %q: %+v", "FleetHubProfile", "HubProfile", err)
}

return nil
}

func (r KubernetesFleetManagerResource) mapFleetPropertiesToKubernetesFleetManagerResourceSchema(input fleets.FleetProperties, output *KubernetesFleetManagerResourceSchema) error {
tmpHubProfile := &KubernetesFleetManagerResourceFleetHubProfileSchema{}
if err := r.mapFleetPropertiesToKubernetesFleetManagerResourceFleetHubProfileSchema(input, tmpHubProfile); err != nil {
return err
} else {
output.HubProfile = make([]KubernetesFleetManagerResourceFleetHubProfileSchema, 0)
output.HubProfile = append(output.HubProfile, *tmpHubProfile)
func (r KubernetesFleetManagerResource) mapFleetPropertiesToKubernetesFleetManagerResourceFleetHubProfileSchema(input fleets.FleetProperties, output *KubernetesFleetManagerResourceFleetHubProfileSchema) error {

if input.HubProfile == nil {
input.HubProfile = &fleets.FleetHubProfile{}
}
if err := r.mapFleetHubProfileToKubernetesFleetManagerResourceFleetHubProfileSchema(*input.HubProfile, output); err != nil {
return fmt.Errorf("mapping SDK Field %q / Model %q to Schema: %+v", "FleetHubProfile", "HubProfile", err)
}

return nil
}

Expand Down Expand Up @@ -273,26 +277,22 @@ func (r KubernetesFleetManagerResource) mapFleetToKubernetesFleetManagerResource
return nil
}

func (r KubernetesFleetManagerResource) mapKubernetesFleetManagerResourceFleetHubProfileSchemaToFleetProperties(input KubernetesFleetManagerResourceFleetHubProfileSchema, output *fleets.FleetProperties) error {

if output.HubProfile == nil {
output.HubProfile = &fleets.FleetHubProfile{}
}
if err := r.mapKubernetesFleetManagerResourceFleetHubProfileSchemaToFleetHubProfile(input, output.HubProfile); err != nil {
return fmt.Errorf("mapping Schema to SDK Field %q / Model %q: %+v", "FleetHubProfile", "HubProfile", err)
func (r KubernetesFleetManagerResource) mapKubernetesFleetManagerResourceSchemaToFleetProperties(input KubernetesFleetManagerResourceSchema, output *fleets.FleetProperties) error {
if len(input.HubProfile) > 0 {
if err := r.mapKubernetesFleetManagerResourceFleetHubProfileSchemaToFleetProperties(input.HubProfile[0], output); err != nil {
return err
}
}

return nil
}

func (r KubernetesFleetManagerResource) mapFleetPropertiesToKubernetesFleetManagerResourceFleetHubProfileSchema(input fleets.FleetProperties, output *KubernetesFleetManagerResourceFleetHubProfileSchema) error {

if input.HubProfile == nil {
input.HubProfile = &fleets.FleetHubProfile{}
}
if err := r.mapFleetHubProfileToKubernetesFleetManagerResourceFleetHubProfileSchema(*input.HubProfile, output); err != nil {
return fmt.Errorf("mapping SDK Field %q / Model %q to Schema: %+v", "FleetHubProfile", "HubProfile", err)
func (r KubernetesFleetManagerResource) mapFleetPropertiesToKubernetesFleetManagerResourceSchema(input fleets.FleetProperties, output *KubernetesFleetManagerResourceSchema) error {
tmpHubProfile := &KubernetesFleetManagerResourceFleetHubProfileSchema{}
if err := r.mapFleetPropertiesToKubernetesFleetManagerResourceFleetHubProfileSchema(input, tmpHubProfile); err != nil {
return err
} else {
output.HubProfile = make([]KubernetesFleetManagerResourceFleetHubProfileSchema, 0)
output.HubProfile = append(output.HubProfile, *tmpHubProfile)
}

return nil
}
36 changes: 18 additions & 18 deletions internal/services/devcenter/dev_center_project_resource_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,22 +198,6 @@ func (r DevCenterProjectResource) Update() sdk.ResourceFunc {
}
}

func (r DevCenterProjectResource) mapDevCenterProjectResourceSchemaToProjectProperties(input DevCenterProjectResourceSchema, output *projects.ProjectProperties) error {
output.Description = &input.Description
output.DevCenterId = input.DevCenterId

output.MaxDevBoxesPerUser = &input.MaximumDevBoxesPerUser
return nil
}

func (r DevCenterProjectResource) mapProjectPropertiesToDevCenterProjectResourceSchema(input projects.ProjectProperties, output *DevCenterProjectResourceSchema) error {
output.Description = pointer.From(input.Description)
output.DevCenterId = input.DevCenterId
output.DevCenterUri = pointer.From(input.DevCenterUri)
output.MaximumDevBoxesPerUser = pointer.From(input.MaxDevBoxesPerUser)
return nil
}

func (r DevCenterProjectResource) mapDevCenterProjectResourceSchemaToProject(input DevCenterProjectResourceSchema, output *projects.Project) error {
output.Location = location.Normalize(input.Location)
output.Tags = tags.Expand(input.Tags)
Expand Down Expand Up @@ -242,12 +226,18 @@ func (r DevCenterProjectResource) mapProjectToDevCenterProjectResourceSchema(inp
return nil
}

func (r DevCenterProjectResource) mapDevCenterProjectResourceSchemaToProjectUpdateProperties(input DevCenterProjectResourceSchema, output *projects.ProjectUpdateProperties) error {
func (r DevCenterProjectResource) mapDevCenterProjectResourceSchemaToProjectProperties(input DevCenterProjectResourceSchema, output *projects.ProjectProperties) error {
output.Description = &input.Description
output.DevCenterId = input.DevCenterId

output.MaxDevBoxesPerUser = &input.MaximumDevBoxesPerUser
return nil
}

func (r DevCenterProjectResource) mapProjectUpdatePropertiesToDevCenterProjectResourceSchema(input projects.ProjectUpdateProperties, output *DevCenterProjectResourceSchema) error {
func (r DevCenterProjectResource) mapProjectPropertiesToDevCenterProjectResourceSchema(input projects.ProjectProperties, output *DevCenterProjectResourceSchema) error {
output.Description = pointer.From(input.Description)
output.DevCenterId = input.DevCenterId
output.DevCenterUri = pointer.From(input.DevCenterUri)
output.MaximumDevBoxesPerUser = pointer.From(input.MaxDevBoxesPerUser)
return nil
}
Expand Down Expand Up @@ -277,3 +267,13 @@ func (r DevCenterProjectResource) mapProjectUpdateToDevCenterProjectResourceSche

return nil
}

func (r DevCenterProjectResource) mapDevCenterProjectResourceSchemaToProjectUpdateProperties(input DevCenterProjectResourceSchema, output *projects.ProjectUpdateProperties) error {
output.MaxDevBoxesPerUser = &input.MaximumDevBoxesPerUser
return nil
}

func (r DevCenterProjectResource) mapProjectUpdatePropertiesToDevCenterProjectResourceSchema(input projects.ProjectUpdateProperties, output *DevCenterProjectResourceSchema) error {
output.MaximumDevBoxesPerUser = pointer.From(input.MaxDevBoxesPerUser)
return nil
}
20 changes: 10 additions & 10 deletions internal/services/devcenter/dev_center_resource_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,6 @@ func (r DevCenterResource) Update() sdk.ResourceFunc {
}
}

func (r DevCenterResource) mapDevCenterResourceSchemaToDevCenterProperties(input DevCenterResourceSchema, output *devcenters.DevCenterProperties) error {

return nil
}

func (r DevCenterResource) mapDevCenterPropertiesToDevCenterResourceSchema(input devcenters.DevCenterProperties, output *DevCenterResourceSchema) error {
output.DevCenterUri = pointer.From(input.DevCenterUri)
return nil
}

func (r DevCenterResource) mapDevCenterResourceSchemaToDevCenter(input DevCenterResourceSchema, output *devcenters.DevCenter) error {

identity, err := identity.ExpandSystemAndUserAssignedMapFromModel(input.Identity)
Expand Down Expand Up @@ -243,3 +233,13 @@ func (r DevCenterResource) mapDevCenterToDevCenterResourceSchema(input devcenter

return nil
}

func (r DevCenterResource) mapDevCenterResourceSchemaToDevCenterProperties(input DevCenterResourceSchema, output *devcenters.DevCenterProperties) error {

return nil
}

func (r DevCenterResource) mapDevCenterPropertiesToDevCenterResourceSchema(input devcenters.DevCenterProperties, output *DevCenterResourceSchema) error {
output.DevCenterUri = pointer.From(input.DevCenterUri)
return nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -192,18 +192,6 @@ func (r UserAssignedIdentityResource) Update() sdk.ResourceFunc {
}
}

func (r UserAssignedIdentityResource) mapUserAssignedIdentityResourceSchemaToUserAssignedIdentityProperties(input UserAssignedIdentityResourceSchema, output *managedidentities.UserAssignedIdentityProperties) error {

return nil
}

func (r UserAssignedIdentityResource) mapUserAssignedIdentityPropertiesToUserAssignedIdentityResourceSchema(input managedidentities.UserAssignedIdentityProperties, output *UserAssignedIdentityResourceSchema) error {
output.ClientId = pointer.From(input.ClientId)
output.PrincipalId = pointer.From(input.PrincipalId)
output.TenantId = pointer.From(input.TenantId)
return nil
}

func (r UserAssignedIdentityResource) mapUserAssignedIdentityResourceSchemaToIdentity(input UserAssignedIdentityResourceSchema, output *managedidentities.Identity) error {
output.Location = location.Normalize(input.Location)
output.Tags = tags.Expand(input.Tags)
Expand Down Expand Up @@ -257,3 +245,15 @@ func (r UserAssignedIdentityResource) mapIdentityUpdateToUserAssignedIdentityRes

return nil
}

func (r UserAssignedIdentityResource) mapUserAssignedIdentityResourceSchemaToUserAssignedIdentityProperties(input UserAssignedIdentityResourceSchema, output *managedidentities.UserAssignedIdentityProperties) error {

return nil
}

func (r UserAssignedIdentityResource) mapUserAssignedIdentityPropertiesToUserAssignedIdentityResourceSchema(input managedidentities.UserAssignedIdentityProperties, output *UserAssignedIdentityResourceSchema) error {
output.ClientId = pointer.From(input.ClientId)
output.PrincipalId = pointer.From(input.PrincipalId)
output.TenantId = pointer.From(input.TenantId)
return nil
}

0 comments on commit b589014

Please sign in to comment.