ca/cac/codegen_client.go
func (loc *CurrentUserLocator) Update(password string, options rsapi.APIParams) (*CurrentUser, error) {
	var res *CurrentUser
	if password == "" {
		return res, fmt.Errorf("password is required")
	}
	var params rsapi.APIParams
	params = rsapi.APIParams{}
	var viewOpt = options["view"]
	if viewOpt != nil {
		params["view"] = viewOpt
	}
	var p rsapi.APIParams
	p = rsapi.APIParams{
		"password": password,
	}
	var companyOpt = options["company"]
	if companyOpt != nil {
		p["company"] = companyOpt
	}
	var emailOpt = options["email"]
	if emailOpt != nil {
		p["email"] = emailOpt
	}
	var firstNameOpt = options["first_name"]
	if firstNameOpt != nil {
		p["first_name"] = firstNameOpt
	}
	var lastNameOpt = options["last_name"]
	if lastNameOpt != nil {
		p["last_name"] = lastNameOpt
	}
	var newPasswordOpt = options["new_password"]
	if newPasswordOpt != nil {
		p["new_password"] = newPasswordOpt
	}
	var phoneOpt = options["phone"]
	if phoneOpt != nil {
		p["phone"] = phoneOpt
	}
	var timezoneOpt = options["timezone"]
	if timezoneOpt != nil {
		p["timezone"] = timezoneOpt
	}
	uri, err := loc.ActionPath("CurrentUser", "update")
	if err != nil {
		return res, err
	}
	req, err := loc.api.BuildHTTPRequest(uri.HTTPMethod, uri.Path, APIVersion, params, p)
	if err != nil {
		return res, err
	}
	resp, err := loc.api.PerformRequest(req)
	if err != nil {
		return res, err
	}
	defer resp.Body.Close()
	if resp.StatusCode < 200 || resp.StatusCode > 299 {
		respBody, _ := ioutil.ReadAll(resp.Body)
		sr := string(respBody)
		if sr != "" {
			sr = ": " + sr
		}
		return res, fmt.Errorf("invalid response %s%s", resp.Status, sr)
	}
	defer resp.Body.Close()
	respBody, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return res, err
	}
	err = json.Unmarshal(respBody, &res)
	return res, err
}
func (loc *CurrentUserLocator) Update(password string, options rsapi.APIParams) (*CurrentUser, error) {
	var res *CurrentUser
	if password == "" {
		return res, fmt.Errorf("password is required")
	}
	var params rsapi.APIParams
	params = rsapi.APIParams{}
	var viewOpt = options["view"]
	if viewOpt != nil {
		params["view"] = viewOpt
	}
	var p rsapi.APIParams
	p = rsapi.APIParams{
		"password": password,
	}
	var companyOpt = options["company"]
	if companyOpt != nil {
		p["company"] = companyOpt
	}
	var emailOpt = options["email"]
	if emailOpt != nil {
		p["email"] = emailOpt
	}
	var firstNameOpt = options["first_name"]
	if firstNameOpt != nil {
		p["first_name"] = firstNameOpt
	}
	var lastNameOpt = options["last_name"]
	if lastNameOpt != nil {
		p["last_name"] = lastNameOpt
	}
	var newPasswordOpt = options["new_password"]
	if newPasswordOpt != nil {
		p["new_password"] = newPasswordOpt
	}
	var phoneOpt = options["phone"]
	if phoneOpt != nil {
		p["phone"] = phoneOpt
	}
	var timezoneOpt = options["timezone"]
	if timezoneOpt != nil {
		p["timezone"] = timezoneOpt
	}
	uri, err := loc.ActionPath("CurrentUser", "update")
	if err != nil {
		return res, err
	}
	req, err := loc.api.BuildHTTPRequest(uri.HTTPMethod, uri.Path, APIVersion, params, p)
	if err != nil {
		return res, err
	}
	resp, err := loc.api.PerformRequest(req)
	if err != nil {
		return res, err
	}
	defer resp.Body.Close()
	if resp.StatusCode < 200 || resp.StatusCode > 299 {
		respBody, _ := ioutil.ReadAll(resp.Body)
		sr := string(respBody)
		if sr != "" {
			sr = ": " + sr
		}
		return res, fmt.Errorf("invalid response %s%s", resp.Status, sr)
	}
	defer resp.Body.Close()
	respBody, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return res, err
	}
	err = json.Unmarshal(respBody, &res)
	return res, err
}
// PATCH /api/current_user
//
// Update the user's details.