code: func (c *fabricCAAdapter) AddAffiliation(key core.Key, cert []byte, request *api.AffiliationRequest) (*api.AffiliationResponse, error) {
  	logger.Debugf("Add affiliation [%s]", request.Name)
  
  	req := caapi.AddAffiliationRequest{
  		CAName: request.CAName,
  		Name:   request.Name,
  		Force:  request.Force,
  	}
  
  	registrar, err := c.newIdentity(key, cert)
  	if err != nil {
  		return nil, errors.Wrap(err, "failed to create CA signing identity")
  	}
  
  	r, err := registrar.AddAffiliation(&req)
  	if err != nil {
  		return nil, errors.Wrap(err, "failed to add affiliation")
  	}
  
  	resp := &api.AffiliationResponse{CAName: r.CAName, AffiliationInfo: api.AffiliationInfo{}}
  	err = fillAffiliationInfo(&resp.AffiliationInfo, r.Name, r.Affiliations, r.Identities)
  
  	return resp, err
  }
docs: // AddAffiliation add new affiliation