// SetResourceQuery sets the ResourceQuery field's value.
540136
func (s *GroupQuery) SetResourceQuery(v *ResourceQuery) *GroupQuery {
	s.ResourceQuery = v
	return s
}
319070
func (s *TaskStartedEventDetails) SetResource(v string) *TaskStartedEventDetails {
	s.Resource = &v
	return s
}
1068755
func (st resourceState) setResource(pendingID, applicationID, userID string, chRes charmresource.Resource, r io.Reader) (resource.Resource, error) {
	id := newResourceID(applicationID, chRes.Name)

	res := resource.Resource{
		Resource:      chRes,
		ID:            id,
		PendingID:     pendingID,
		ApplicationID: applicationID,
	}
	if r != nil {
		// TODO(ericsnow) Validate the user ID (or use a tag).
		res.Username = userID
		res.Timestamp = st.clock.Now().UTC()
	}

	if err := res.Validate(); err != nil {
		return res, errors.Annotate(err, "bad resource metadata")
	}

	if r == nil {
		if err := st.persist.SetResource(res); err != nil {
			return res, errors.Trace(err)
		}
	} else {
		if err := st.storeResource(res, r); err != nil {
			return res, errors.Trace(err)
		}
	}

	return res, nil
}
1278075
func (s *Operation) SetResourceType(v string) *Operation {
	s.ResourceType = &v
	return s
}
77685
func (s *DescribeBackupJobOutput) SetResourceType(v string) *DescribeBackupJobOutput {
	s.ResourceType = &v
	return s
}
209608
func (s *ResourceChange) SetResourceType(v string) *ResourceChange {
	s.ResourceType = &v
	return s
}
338164
func (s *Disk) SetResourceType(v string) *Disk {
	s.ResourceType = &v
	return s
}
882418
func (s *DiskSnapshot) SetResourceType(v string) *DiskSnapshot {
	s.ResourceType = &v
	return s
}
755592
func (s *ResourceCount) SetResourceType(v string) *ResourceCount {
	s.ResourceType = &v
	return s
}
295282
func (s *ExportSnapshotRecord) SetResourceType(v string) *ExportSnapshotRecord {
	s.ResourceType = &v
	return s
}
1146747
func (s *ResourceInventory) SetResourceId(v string) *ResourceInventory {
	s.ResourceId = &v
	return s
}
832586
func (r *RoleV2) SetResource(kind string, actions []string) {
	if r.Spec.Resources == nil {
		r.Spec.Resources = make(map[string][]string)
	}
	r.Spec.Resources[kind] = actions
}
778405
func (s *ResourceKey) SetResourceType(v string) *ResourceKey {
	s.ResourceType = &v
	return s
}
941084
func (s *UntagResourceInput) SetResource(v string) *UntagResourceInput {
	s.Resource = &v
	return s
}
810975
func (s *StaticIp) SetResourceType(v string) *StaticIp {
	s.ResourceType = &v
	return s
}
1209989
func (s *InstanceInformation) SetResourceType(v string) *InstanceInformation {
	s.ResourceType = &v
	return s
}
1189514
func (s *TaskScheduledEventDetails) SetResource(v string) *TaskScheduledEventDetails {
	s.Resource = &v
	return s
}