// GetCurrentUserConnection gets team current user connection by Team ID.
//
// API doc: https://developers.miro.com/reference#get-team-current-user-connection
GetCurrentUserConnection gets team current user connection by Team ID.


// GetCurrentUserConnection gets team current user connection by Team ID . // // API doc : https : // developers . miro . com / reference#get - team - current - user - connection
func (s *TeamsService) GetCurrentUserConnection(ctx context.Context, id string) (*TeamUserConnection, error) {
	req, err := s.client.NewGetRequest(fmt.Sprintf("%s/%s/%s/me", teamsPath, id, userConnectionsPath))
	if err != nil {
		return nil, err
	}
	resp, err := s.client.Do(ctx, req)
	if err != nil {
		return nil, err
	}
	if resp.StatusCode != http.StatusOK {
		return nil, fmt.Errorf("status code not expected, got:%d", resp.StatusCode)
	}
	conn := &TeamUserConnection{}
	if err := json.NewDecoder(resp.Body).Decode(conn); err != nil {
		return nil, err
	}
	return conn, nil
}
func ( s * TeamsService ) GetCurrentUserConnection ( ctx context . Context , id string ) ( * TeamUserConnection , error ) { req , err := s . client . NewGetRequest ( fmt . Sprintf ( " " , teamsPath , id , userConnectionsPath ) ) if err != nil { return nil , err } resp , err := s . client . Do ( ctx , req ) if err != nil { return nil , err } if resp . StatusCode != http . StatusOK { return nil , fmt . Errorf ( " " , resp . StatusCode ) } conn := & TeamUserConnection { } if err := json . NewDecoder ( resp . Body ) . Decode ( conn ) ; err != nil { return nil , err } return conn , nil }
GetCurrentUserConnection gets team current user connection by Team ID.
GetCurrentUserConnection gets team current user connection by Team ID .