// Transfer an existing organization app to another organization.
325282
func (s *Service) OrganizationAppTransferToOrganization(ctx context.Context, organizationAppIdentity string, o OrganizationAppTransferToOrganizationOpts) (*OrganizationApp, error) {
	var organizationApp OrganizationApp
	return &organizationApp, s.Patch(ctx, &organizationApp, fmt.Sprintf("/organizations/apps/%v", organizationAppIdentity), o)
}
422307
func NewTransferFolderArg(SharedFolderId string, ToDropboxId string) *TransferFolderArg {
	s := new(TransferFolderArg)
	s.SharedFolderId = SharedFolderId
	s.ToDropboxId = ToDropboxId
	return s
}
651646
func (s *Service) TeamAppTransferToTeam(ctx context.Context, teamAppIdentity string, o TeamAppTransferToTeamOpts) (*TeamApp, error) {
	var teamApp TeamApp
	return &teamApp, s.Patch(ctx, &teamApp, fmt.Sprintf("/teams/apps/%v", teamAppIdentity), o)
}
560196
func (a *Account) Retract(appID string, username string) error {
	return a.del(a.auth.WithScope(scope.App(appID)), fmt.Sprintf("/api/v2/applications/%s/collaborators/%s", appID, username))
}
968730
func (e *Etcd) Transfer(ctx context.Context, state request.Request) (int, error) {
	return dns.RcodeServerFailure, nil
}
491835
func (api *API) TransferRegistrarDomain(accountID, domainName string) ([]RegistrarDomain, error) {
	uri := fmt.Sprintf("/accounts/%s/registrar/domains/%s/transfer", accountID, domainName)

	res, err := api.makeRequest("POST", uri, nil)
	if err != nil {
		return []RegistrarDomain{}, errors.Wrap(err, errMakeRequestError)
	}

	var r RegistrarDomainsDetailResponse
	err = json.Unmarshal(res, &r)
	if err != nil {
		return []RegistrarDomain{}, errors.Wrap(err, errUnmarshalError)
	}
	return r.Result, nil
}
1337861
func Convert_apps_DeploymentStrategy_To_v1_DeploymentStrategy(in *apps.DeploymentStrategy, out *v1.DeploymentStrategy, s conversion.Scope) error {
	return autoConvert_apps_DeploymentStrategy_To_v1_DeploymentStrategy(in, out, s)
}
267896
func (s *OrganizationsService) UpdateOrganizationAPIKey(label, globalid string, body OrganizationsGlobalidApikeysLabelPutReqBody, headers, queryParams map[string]interface{}) (*http.Response, error) {
	var err error

	resp, err := s.client.doReqWithBody("PUT", s.client.BaseURI+"/organizations/"+globalid+"/apikeys/"+label, &body, headers, queryParams)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()

	return resp, err
}
362327
func (_FIFSRegistrar *FIFSRegistrarRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
	return _FIFSRegistrar.Contract.FIFSRegistrarTransactor.contract.Transfer(opts)
}
282016
func (app *Application) Clone(party router.Party) *Application {
	return newApp(party, app.Dependencies.Clone())
}
1359329
func (k *Kubernetes) Transfer(ctx context.Context, state request.Request) (int, error) {

	if !k.transferAllowed(state) {
		return dns.RcodeRefused, nil
	}

	// Get all services.
	rrs := make(chan dns.RR)
	go k.transfer(rrs, state.Zone)

	records := []dns.RR{}
	for r := range rrs {
		records = append(records, r)
	}

	if len(records) == 0 {
		return dns.RcodeServerFailure, nil
	}

	ch := make(chan *dns.Envelope)
	tr := new(dns.Transfer)

	soa, err := plugin.SOA(ctx, k, state.Zone, state, plugin.Options{})
	if err != nil {
		return dns.RcodeServerFailure, nil
	}

	records = append(soa, records...)
	records = append(records, soa...)
	go func(ch chan *dns.Envelope) {
		j, l := 0, 0
		log.Infof("Outgoing transfer of %d records of zone %s to %s started", len(records), state.Zone, state.IP())
		for i, r := range records {
			l += dns.Len(r)
			if l > transferLength {
				ch <- &dns.Envelope{RR: records[j:i]}
				l = 0
				j = i
			}
		}
		if j < len(records) {
			ch <- &dns.Envelope{RR: records[j:]}
		}
		close(ch)
	}(ch)

	tr.Out(state.W, state.Req, ch)
	// Defer closing to the client
	state.W.Hijack()
	return dns.RcodeSuccess, nil
}
1145852
func (s *OrganizationService) UpdateOrganization(ctx context.Context, id platform.ID, upd platform.OrganizationUpdate) (*platform.Organization, error) {
	return s.UpdateOrganizationF(ctx, id, upd)
}
1011841
func (api UsersAPI) LeaveOrganization(w http.ResponseWriter, r *http.Request) {
	username := mux.Vars(r)["username"]
	organizationGlobalId := mux.Vars(r)["globalid"]
	orgMgr := organizationDb.NewManager(r)
	userMgr := user.NewManager(r)
	oauthMgr := oauthservice.NewManager(r)
	// make sure the last owner can't leave an organization. only valid if this is
	// a top level organization since suborg owners are implicitly extended by the owner
	// of the parent orgs.
	if !strings.Contains(organizationGlobalId, ".") {
		org, err := orgMgr.GetByName(organizationGlobalId)
		// load the org
		if db.IsNotFound(err) {
			writeErrorResponse(w, http.StatusNotFound, "user_not_found")
			return
		}
		if handleServerError(w, "loading organization", err) {
			return
		}
		// if only one owner remains and its the user then don't let them leave
		if len(org.Owners) == 1 && org.Owners[0] == username {
			writeErrorResponse(w, http.StatusConflict, "last_owner_can't_leave")
			return
		}
	}
	err := orgMgr.RemoveUser(organizationGlobalId, username)
	if err == mgo.ErrNotFound {
		writeErrorResponse(w, http.StatusNotFound, "user_not_found")
		return
	} else if handleServerError(w, "removing user from organization", err) {
		return
	}
	err = userMgr.DeleteAuthorization(username, organizationGlobalId)
	if handleServerError(w, "removing authorization", err) {
		return
	}
	err = oauthMgr.RemoveOrganizationScopes(organizationGlobalId, username)
	if handleServerError(w, "removing organization scopes", err) {
		return
	}
	w.WriteHeader(http.StatusNoContent)
}
143150
func (_Chequebook *ChequebookRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
	return _Chequebook.Contract.ChequebookTransactor.contract.Transfer(opts)
}
768483
func Convert_v1_RecreateDeploymentStrategyParams_To_apps_RecreateDeploymentStrategyParams(in *v1.RecreateDeploymentStrategyParams, out *apps.RecreateDeploymentStrategyParams, s conversion.Scope) error {
	return autoConvert_v1_RecreateDeploymentStrategyParams_To_apps_RecreateDeploymentStrategyParams(in, out, s)
}
802906
func (s *Service) OrganizationUpdate(ctx context.Context, organizationIdentity string, o OrganizationUpdateOpts) (*Organization, error) {
	var organization Organization
	return &organization, s.Patch(ctx, &organization, fmt.Sprintf("/organizations/%v", organizationIdentity), o)
}
586418
func Transfer(c *client.Client, appID string, username string) error {
	u := fmt.Sprintf("/v1/apps/%s/", appID)

	req := api.AppUpdateRequest{Owner: username}
	body, err := json.Marshal(req)

	if err != nil {
		return err
	}

	_, err = c.BasicRequest("POST", u, body)
	return err
}