// ByType returns resources of a given resource type (ie. "image").
162470
func (r Resources) ByType(tp string) Resources {
	var filtered Resources

	for _, resource := range r {
		if resource.ResourceType() == tp {
			filtered = append(filtered, resource)
		}
	}
	return filtered
}
926983
func (s *Domain) SetResourceType(v string) *Domain {
	s.ResourceType = &v
	return s
}
1278075
func (s *Operation) SetResourceType(v string) *Operation {
	s.ResourceType = &v
	return s
}
263717
func (s *ReservationResourceSpecification) SetResourceType(v string) *ReservationResourceSpecification {
	s.ResourceType = &v
	return s
}
1054284
func (s *DescribeProtectedResourceOutput) SetResourceType(v string) *DescribeProtectedResourceOutput {
	s.ResourceType = &v
	return s
}
1084838
func ByType(processes api.PodsList) api.PodTypes {
	var pts api.PodTypes

	for _, process := range processes {
		exists := false
		// Is processtype for process already exists, append to it.
		for i, pt := range pts {
			if pt.Type == process.Type {
				exists = true
				pts[i].PodsList = append(pts[i].PodsList, process)
				break
			}
		}

		// Is processtype for process doesn't exist, create a new one
		if !exists {
			pts = append(pts, api.PodType{
				Type:     process.Type,
				PodsList: api.PodsList{process},
			})
		}
	}

	// Sort the pods alphabetically by name.
	for _, pt := range pts {
		sort.Sort(pt.PodsList)
	}

	// Sort ProcessTypes alphabetically by process name
	sort.Sort(pts)

	return pts
}
761948
func (s *PolicySummary) SetResourceType(v string) *PolicySummary {
	s.ResourceType = &v
	return s
}
580487
func (s *ListTagsForResourceInput) SetResourceType(v string) *ListTagsForResourceInput {
	s.ResourceType = &v
	return s
}
914778
func (s *TaskSubmittedEventDetails) SetResourceType(v string) *TaskSubmittedEventDetails {
	s.ResourceType = &v
	return s
}
616426
func (s *ListTagsForResourcesInput) SetResourceType(v string) *ListTagsForResourcesInput {
	s.ResourceType = &v
	return s
}
342219
func (s *AddTagsToResourceInput) SetResourceType(v string) *AddTagsToResourceInput {
	s.ResourceType = &v
	return s
}
1084888
func (s *ListAggregateDiscoveredResourcesInput) SetResourceType(v string) *ListAggregateDiscoveredResourcesInput {
	s.ResourceType = &v
	return s
}
95156
func (s *ManagedResourceSummary) SetResourceType(v string) *ManagedResourceSummary {
	s.ResourceType = &v
	return s
}
149246
func (s *TaskScheduledEventDetails) SetResourceType(v string) *TaskScheduledEventDetails {
	s.ResourceType = &v
	return s
}
72975
func (s *ListReservationsInput) SetResourceType(v string) *ListReservationsInput {
	s.ResourceType = &v
	return s
}
367235
func (r *Resource) getResourceType(resourceTypes map[string]ResourceType) (*ResourceType, error) {
	// check if it's specify a resource type to inherit
	if r.Type == nil || r.Type.Name == "" {
		return nil, nil
	}

	// get resource type from array of resource type map
	for k, rt := range resourceTypes {
		if k == r.Type.Name {
			return &rt, nil
		}
	}
	return nil, fmt.Errorf("can't find resource type named :%v", r.Type.Name)
}
749408
func (s *GetResourceConfigHistoryInput) SetResourceType(v string) *GetResourceConfigHistoryInput {
	s.ResourceType = &v
	return s
}