code: func (c *CAClientImpl) AddAffiliation(request *api.AffiliationRequest) (*api.AffiliationResponse, error) {
  	if c.adapter == nil {
  		return nil, fmt.Errorf("no CAs configured for organization: %s", c.orgName)
  	}
  
  	if request == nil {
  		return nil, errors.New("must provide affiliation request")
  	}
  
  	// Checke required parameters (Name)
  	if request.Name == "" {
  		return nil, errors.New("Name is required")
  	}
  
  	registrar, err := c.getRegistrar(c.registrar.EnrollID, c.registrar.EnrollSecret)
  	if err != nil {
  		return nil, err
  	}
  
  	return c.adapter.AddAffiliation(registrar.PrivateKey(), registrar.EnrollmentCertificate(), request)
  }
docs: // AddAffiliation adds a new affiliation to the server