func (m *MembershipsClient) List(ctx context.Context, orgID *identity.ID,
	teamID *identity.ID, ownerID *identity.ID) ([]envelope.Unsigned, error) {

	query := &url.Values{}
	if orgID != nil {
		query.Set("org_id", orgID.String())
	}
	if teamID != nil {
		query.Set("team_id", teamID.String())
	}
	if ownerID != nil {
		query.Set("owner_id", ownerID.String())
	}

	req, err := m.client.NewRequest("GET", "/memberships", query, nil)
	if err != nil {
		log.Printf("could not build GET /memberships request: %s", err)
		return nil, err
	}

	memberships := []envelope.Unsigned{}
	_, err = m.client.Do(ctx, req, &memberships)
	if err != nil {
		log.Printf("could not perform GET /memberships: %s", err)
		return nil, err
	}

	return memberships, nil
}
// List returns all memberships for a given organization, team, or user/machine
List returns all memberships for a given organization, team, or user/machine
// List returns all memberships for a given organization team or user / machine
func (m *MembershipsClient) List(ctx context.Context, orgID *identity.ID,
	teamID *identity.ID, ownerID *identity.ID) ([]envelope.Unsigned, error) {
	query := &url.Values{}
	if orgID != nil {
		query.Set("org_id", orgID.String())
	}
	if teamID != nil {
		query.Set("team_id", teamID.String())
	}
	if ownerID != nil {
		query.Set("owner_id", ownerID.String())
	}
	req, err := m.client.NewRequest("GET", "/memberships", query, nil)
	if err != nil {
		log.Printf("could not build GET /memberships request: %s", err)
		return nil, err
	}
	memberships := []envelope.Unsigned{}
	_, err = m.client.Do(ctx, req, &memberships)
	if err != nil {
		log.Printf("could not perform GET /memberships: %s", err)
		return nil, err
	}
	return memberships, nil
}
func ( m * MembershipsClient ) List ( ctx context . Context , orgID * identity . ID , teamID * identity . ID , ownerID * identity . ID ) ( [ ] envelope . Unsigned , error ) { query := & url . Values { } if orgID != nil { query . Set ( " " , orgID . String ( ) ) } if teamID != nil { query . Set ( " " , teamID . String ( ) ) } if ownerID != nil { query . Set ( " " , ownerID . String ( ) ) } req , err := m . client . NewRequest ( " " , " " , query , nil ) if err != nil { log . Printf ( " " , err ) return nil , err } memberships := [ ] envelope . Unsigned { } _ , err = m . client . Do ( ctx , req , & memberships ) if err != nil { log . Printf ( " " , err ) return nil , err } return memberships , nil }
List returns all memberships for a given organization, team, or user/machine
List returns all memberships for a given organization team or user / machine