// setCreated sets the GCE instance as created in the datastore if it isn't already.
427818
func setCreated(c context.Context, id, url string, at time.Time) error {
	vm := &model.VM{
		ID: id,
	}
	return datastore.RunInTransaction(c, func(c context.Context) error {
		if err := datastore.Get(c, vm); err != nil {
			return errors.Annotate(err, "failed to fetch VM").Err()
		}
		if vm.URL != "" {
			// Already created.
			return nil
		}
		vm.Created = at.Unix()
		vm.URL = url
		if err := datastore.Put(c, vm); err != nil {
			return errors.Annotate(err, "failed to store VM").Err()
		}
		return nil
	}, nil)
}
1344324
func (s *Permission) SetCreatedAt(v time.Time) *Permission {
	s.CreatedAt = &v
	return s
}
1154342
func (s *AssessmentTemplate) SetCreatedAt(v time.Time) *AssessmentTemplate {
	s.CreatedAt = &v
	return s
}
491051
func (s *Task) SetCreatedAt(v time.Time) *Task {
	s.CreatedAt = &v
	return s
}
221719
func (s *Role) SetCreateDate(v time.Time) *Role {
	s.CreateDate = &v
	return s
}
712660
func (s *ActionRevision) SetCreated(v time.Time) *ActionRevision {
	s.Created = &v
	return s
}
688689
func (s *ApplicationDescription) SetDateCreated(v time.Time) *ApplicationDescription {
	s.DateCreated = &v
	return s
}
858242
func (s *LifecyclePolicy) SetDateCreated(v time.Time) *LifecyclePolicy {
	s.DateCreated = &v
	return s
}
227110
func (s *PlatformDescription) SetDateCreated(v time.Time) *PlatformDescription {
	s.DateCreated = &v
	return s
}
402994
func (s *Evaluation) SetCreatedAt(v time.Time) *Evaluation {
	s.CreatedAt = &v
	return s
}
396522
func (s *UserDetail) SetCreateDate(v time.Time) *UserDetail {
	s.CreateDate = &v
	return s
}
834248
func (s *UpdateConfigurationResponse) SetCreated(v time.Time) *UpdateConfigurationResponse {
	s.Created = &v
	return s
}
102586
func (s *ServiceSummary) SetCreateDate(v time.Time) *ServiceSummary {
	s.CreateDate = &v
	return s
}
436154
func (s *Instance) SetCreatedAt(v string) *Instance {
	s.CreatedAt = &v
	return s
}
221099
func (s *ApplicationVersionDescription) SetDateCreated(v time.Time) *ApplicationVersionDescription {
	s.DateCreated = &v
	return s
}
1015737
func (s *Run) SetCreated(v time.Time) *Run {
	s.Created = &v
	return s
}
728243
func (s *Upload) SetCreated(v time.Time) *Upload {
	s.Created = &v
	return s
}