// PerformAssignmentsInstanceGroups populates InstanceGroups with default values
498738
func PerformAssignmentsInstanceGroups(groups []*InstanceGroup) error {
	names := map[string]bool{}
	for _, group := range groups {
		names[group.ObjectMeta.Name] = true
	}

	for _, group := range groups {
		// We want to give them a stable Name as soon as possible
		if group.ObjectMeta.Name == "" {
			// Loop to find the first unassigned name like `nodes-%d`
			i := 0
			for {
				key := fmt.Sprintf("nodes-%d", i)
				if !names[key] {
					group.ObjectMeta.Name = key
					names[key] = true
					break
				}
				i++
			}
		}
	}

	return nil
}
1374594
func (gce *Cloud) RemoveInstancesFromInstanceGroup(name string, zone string, instanceNames []string) error {
	if len(instanceNames) == 0 {
		return nil
	}
	instances := []*compute.InstanceReference{}
	for _, ins := range instanceNames {
		instanceLink := makeHostURL(gce.projectID, zone, ins)
		instances = append(instances, &compute.InstanceReference{Instance: instanceLink})
	}
	op, err := gce.service.InstanceGroups.RemoveInstances(
		gce.projectID, zone, name,
		&compute.InstanceGroupsRemoveInstancesRequest{
			Instances: instances,
		}).Do()

	if err != nil {
		if isHTTPErrorCode(err, http.StatusNotFound) {
			return nil
		}
		return err
	}
	return gce.waitForZoneOp(op, zone)
}
168670
func (gce *Cloud) AddInstancesToInstanceGroup(name string, zone string, instanceNames []string) error {
	if len(instanceNames) == 0 {
		return nil
	}
	// Adding the same instance twice will result in a 4xx error
	instances := []*compute.InstanceReference{}
	for _, ins := range instanceNames {
		instances = append(instances, &compute.InstanceReference{Instance: makeHostURL(gce.projectID, zone, ins)})
	}
	op, err := gce.service.InstanceGroups.AddInstances(
		gce.projectID, zone, name,
		&compute.InstanceGroupsAddInstancesRequest{
			Instances: instances,
		}).Do()

	if err != nil {
		return err
	}
	return gce.waitForZoneOp(op, zone)
}
374269
func (s *JobFlowInstancesDetail) SetInstanceGroups(v []*InstanceGroupDetail) *JobFlowInstancesDetail {
	s.InstanceGroups = v
	return s
}
125731
func (s *LoadBalancerService) AssignCertToLoadBalancer(p *AssignCertToLoadBalancerParams) (*AssignCertToLoadBalancerResponse, error) {
	resp, err := s.cs.newRequest("assignCertToLoadBalancer", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r AssignCertToLoadBalancerResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			if err == AsyncTimeoutErr {
				return &r, err
			}
			return nil, err
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}

	return &r, nil
}
596984
func (s *GetAssignmentOutput) SetAssignment(v *Assignment) *GetAssignmentOutput {
	s.Assignment = v
	return s
}
880450
func (s *ListReviewPolicyResultsForHITOutput) SetAssignmentReviewReport(v *ReviewReport) *ListReviewPolicyResultsForHITOutput {
	s.AssignmentReviewReport = v
	return s
}
133620
func (s *ListAssignmentsForHITInput) SetAssignmentStatuses(v []*string) *ListAssignmentsForHITInput {
	s.AssignmentStatuses = v
	return s
}
414200
func (s *ListReviewPolicyResultsForHITOutput) SetAssignmentReviewPolicy(v *ReviewPolicy) *ListReviewPolicyResultsForHITOutput {
	s.AssignmentReviewPolicy = v
	return s
}
652303
func ResizeInstanceGroup(asg ASG, instanceGroupName string, size int) error {
	request := &autoscaling.UpdateAutoScalingGroupInput{
		AutoScalingGroupName: aws.String(instanceGroupName),
		MinSize:              aws.Int64(int64(size)),
		MaxSize:              aws.Int64(int64(size)),
	}
	if _, err := asg.UpdateAutoScalingGroup(request); err != nil {
		return fmt.Errorf("error resizing AWS autoscaling group: %q", err)
	}
	return nil
}
1009759
func (s *DescribePatchGroupStateOutput) SetInstancesWithInstalledRejectedPatches(v int64) *DescribePatchGroupStateOutput {
	s.InstancesWithInstalledRejectedPatches = &v
	return s
}
1083539
func (s *CreateHITTypeInput) SetAssignmentDurationInSeconds(v int64) *CreateHITTypeInput {
	s.AssignmentDurationInSeconds = &v
	return s
}
700633
func (s *AssessmentRunAgent) SetAutoScalingGroup(v string) *AssessmentRunAgent {
	s.AutoScalingGroup = &v
	return s
}
363285
func (s *CreateDeploymentGroupInput) SetAutoScalingGroups(v []*string) *CreateDeploymentGroupInput {
	s.AutoScalingGroups = v
	return s
}
1134444
func (s *DeploymentGroupInfo) SetAutoScalingGroups(v []*AutoScalingGroup) *DeploymentGroupInfo {
	s.AutoScalingGroups = v
	return s
}
35657
func (s *DistributionConfig) SetOriginGroups(v *OriginGroups) *DistributionConfig {
	s.OriginGroups = v
	return s
}
288570
func (o *Me) ZFBAutoAssignments(info *bambou.FetchingInfo) (ZFBAutoAssignmentsList, *bambou.Error) {

	var list ZFBAutoAssignmentsList
	err := bambou.CurrentSession().FetchChildren(o, ZFBAutoAssignmentIdentity, &list, info)
	return list, err
}