| 
									
										
										
										
											2016-06-12 22:39:00 +00:00
										 |  |  | package footballdata | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | type TeamRequest struct { | 
					
						
							|  |  |  | 	request | 
					
						
							|  |  |  | 	id uint64 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-25 21:22:52 +00:00
										 |  |  | // Do executes the request.
 | 
					
						
							| 
									
										
										
										
											2016-06-12 22:39:00 +00:00
										 |  |  | func (r TeamRequest) Do() (s Team, err error) { | 
					
						
							|  |  |  | 	d, _, err := r.doJson("GET") | 
					
						
							|  |  |  | 	if err != nil { | 
					
						
							|  |  |  | 		return | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	err = d.Decode(&s) | 
					
						
							|  |  |  | 	if err != nil { | 
					
						
							|  |  |  | 		// Fill up data not returned by the server
 | 
					
						
							|  |  |  | 		s.Id = r.id | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	return | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-26 10:24:59 +00:00
										 |  |  | // Team prepares a request to fetch a team's information.
 | 
					
						
							| 
									
										
										
										
											2016-06-26 10:57:14 +00:00
										 |  |  | func (c *Client) Team(id uint64) TeamRequest { | 
					
						
							| 
									
										
										
										
											2016-06-13 17:47:09 +00:00
										 |  |  | 	return TeamRequest{c.req("teams/%d", id), id} | 
					
						
							| 
									
										
										
										
											2016-06-12 22:39:00 +00:00
										 |  |  | } |