// getResourceType extracts the resource type associated with the
// given resource url.
180263
func getResourceType(url *url.URL) string {
	// The resource type is main part of resource's url
	regex := regexp.MustCompile("^/([a-zA-Z0-9._-]+)/?")
	resourceType := regex.FindStringSubmatch(url.String())[1]
	logger.Log.WithFields(
		logrus.Fields{"url": url, "resource type": resourceType}).Debug("getResourceType")
	return resourceType
}
772532
func (s *ConsumedLicenseSummary) SetResourceType(v string) *ConsumedLicenseSummary {
	s.ResourceType = &v
	return s
}
749408
func (s *GetResourceConfigHistoryInput) SetResourceType(v string) *GetResourceConfigHistoryInput {
	s.ResourceType = &v
	return s
}
635869
func (s *CloudFormationStackRecord) SetResourceType(v string) *CloudFormationStackRecord {
	s.ResourceType = &v
	return s
}
304769
func (s *GetImportOutput) SetResourceType(v string) *GetImportOutput {
	s.ResourceType = &v
	return s
}
1307345
func (s *DescribeComplianceByResourceInput) SetResourceType(v string) *DescribeComplianceByResourceInput {
	s.ResourceType = &v
	return s
}
1281823
func (s *DeleteTagsOutput) SetResourceType(v string) *DeleteTagsOutput {
	s.ResourceType = &v
	return s
}
794800
func (d *DNS) GetResourcesByType(domainID int, res_type string) ([]*Resource, error) {
	resources, err := d.GetDomainResources(domainID)
	if err != nil {
		return nil, err
	}

	list := []*Resource{}
	for _, r := range resources {
		if strings.EqualFold(r.Type, res_type) {
			list = append(list, r)
		}
	}

	return list, nil
}
63875
func (s *RelationalDatabase) SetResourceType(v string) *RelationalDatabase {
	s.ResourceType = &v
	return s
}
57479
func (s *ListResourcesForTagOptionInput) SetResourceType(v string) *ListResourcesForTagOptionInput {
	s.ResourceType = &v
	return s
}
728256
func (s *RelationalDatabaseSnapshot) SetResourceType(v string) *RelationalDatabaseSnapshot {
	s.ResourceType = &v
	return s
}
220635
func (p Protos) GetResource(resourceID string) (*resource.Resource, error) {
	url := p.createURL("resource/" + resourceID)
	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		return nil, err
	}

	res, err := p.makeRequest(req)
	if err != nil {
		return nil, err
	}

	rsc := resource.Resource{}
	err = json.Unmarshal(res, &rsc)
	if err != nil {
		return nil, err
	}
	return &rsc, nil
}
868956
func (s *LoadBalancerTlsCertificate) SetResourceType(v string) *LoadBalancerTlsCertificate {
	s.ResourceType = &v
	return s
}
881824
func (s *DescribeTagsOutput) SetResourceType(v string) *DescribeTagsOutput {
	s.ResourceType = &v
	return s
}
1314636
func (s *DeleteTagsInput) SetResourceType(v string) *DeleteTagsInput {
	s.ResourceType = &v
	return s
}
1063918
func (s *StartRestoreJobInput) SetResourceType(v string) *StartRestoreJobInput {
	s.ResourceType = &v
	return s
}
764012
func (s *StackResourceDrift) SetResourceType(v string) *StackResourceDrift {
	s.ResourceType = &v
	return s
}