func (tc *TenantCreate) Save(ctx context.Context) (*Tenant, error) {
	if tc.created_at == nil {
		v := tenant.DefaultCreatedAt()
		tc.created_at = &v
	}
	if tc.updated_at == nil {
		v := tenant.DefaultUpdatedAt()
		tc.updated_at = &v
	}
	if tc.name == nil {
		return nil, errors.New("ent: missing required field \"name\"")
	}
	if err := tenant.NameValidator(*tc.name); err != nil {
		return nil, fmt.Errorf("ent: validator failed for field \"name\": %v", err)
	}
	if tc.domains == nil {
		return nil, errors.New("ent: missing required field \"domains\"")
	}
	if tc.networks == nil {
		return nil, errors.New("ent: missing required field \"networks\"")
	}
	if tc.SSOCert == nil {
		v := tenant.DefaultSSOCert
		tc.SSOCert = &v
	}
	if tc.SSOEntryPoint == nil {
		v := tenant.DefaultSSOEntryPoint
		tc.SSOEntryPoint = &v
	}
	if tc.SSOIssuer == nil {
		v := tenant.DefaultSSOIssuer
		tc.SSOIssuer = &v
	}
	return tc.sqlSave(ctx)
}
// Save creates the Tenant in the database.
Save creates the Tenant in the database.
// Save creates the Tenant in the database .
func (tc *TenantCreate) Save(ctx context.Context) (*Tenant, error) {
	if tc.created_at == nil {
		v := tenant.DefaultCreatedAt()
		tc.created_at = &v
	}
	if tc.updated_at == nil {
		v := tenant.DefaultUpdatedAt()
		tc.updated_at = &v
	}
	if tc.name == nil {
		return nil, errors.New("ent: missing required field \"name\"")
	}
	if err := tenant.NameValidator(*tc.name); err != nil {
		return nil, fmt.Errorf("ent: validator failed for field \"name\": %v", err)
	}
	if tc.domains == nil {
		return nil, errors.New("ent: missing required field \"domains\"")
	}
	if tc.networks == nil {
		return nil, errors.New("ent: missing required field \"networks\"")
	}
	if tc.SSOCert == nil {
		v := tenant.DefaultSSOCert
		tc.SSOCert = &v
	}
	if tc.SSOEntryPoint == nil {
		v := tenant.DefaultSSOEntryPoint
		tc.SSOEntryPoint = &v
	}
	if tc.SSOIssuer == nil {
		v := tenant.DefaultSSOIssuer
		tc.SSOIssuer = &v
	}
	return tc.sqlSave(ctx)
}
func ( tc * TenantCreate ) Save ( ctx context . Context ) ( * Tenant , error ) { if tc . created_at == nil { v := tenant . DefaultCreatedAt ( ) tc . created_at = & v } if tc . updated_at == nil { v := tenant . DefaultUpdatedAt ( ) tc . updated_at = & v } if tc . name == nil { return nil , errors . New ( " \" \" " ) } if err := tenant . NameValidator ( * tc . name ) ; err != nil { return nil , fmt . Errorf ( " \" \" " , err ) } if tc . domains == nil { return nil , errors . New ( " \" \" " ) } if tc . networks == nil { return nil , errors . New ( " \" \" " ) } if tc . SSOCert == nil { v := tenant . DefaultSSOCert tc . SSOCert = & v } if tc . SSOEntryPoint == nil { v := tenant . DefaultSSOEntryPoint tc . SSOEntryPoint = & v } if tc . SSOIssuer == nil { v := tenant . DefaultSSOIssuer tc . SSOIssuer = & v } return tc . sqlSave ( ctx ) }
Save creates the Tenant in the database.
Save creates the Tenant in the database .