ca/cac/codegen_client.go
func (loc *CurrentUserLocator) CloudAccounts(awsAccessKeyId string, awsAccountNumber string, awsSecretAccessKey string, cloudVendorName string) error {
	if awsAccessKeyId == "" {
		return fmt.Errorf("awsAccessKeyId is required")
	}
	if awsAccountNumber == "" {
		return fmt.Errorf("awsAccountNumber is required")
	}
	if awsSecretAccessKey == "" {
		return fmt.Errorf("awsSecretAccessKey is required")
	}
	if cloudVendorName == "" {
		return fmt.Errorf("cloudVendorName is required")
	}
	var params rsapi.APIParams
	var p rsapi.APIParams
	p = rsapi.APIParams{
		"aws_access_key_id":     awsAccessKeyId,
		"aws_account_number":    awsAccountNumber,
		"aws_secret_access_key": awsSecretAccessKey,
		"cloud_vendor_name":     cloudVendorName,
	}
	uri, err := loc.ActionPath("CurrentUser", "cloud_accounts")
	if err != nil {
		return err
	}
	req, err := loc.api.BuildHTTPRequest(uri.HTTPMethod, uri.Path, APIVersion, params, p)
	if err != nil {
		return err
	}
	resp, err := loc.api.PerformRequest(req)
	if err != nil {
		return 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 fmt.Errorf("invalid response %s%s", resp.Status, sr)
	}
	return nil
}
func (loc *CurrentUserLocator) CloudAccounts(awsAccessKeyId string, awsAccountNumber string, awsSecretAccessKey string, cloudVendorName string) error {
	if awsAccessKeyId == "" {
		return fmt.Errorf("awsAccessKeyId is required")
	}
	if awsAccountNumber == "" {
		return fmt.Errorf("awsAccountNumber is required")
	}
	if awsSecretAccessKey == "" {
		return fmt.Errorf("awsSecretAccessKey is required")
	}
	if cloudVendorName == "" {
		return fmt.Errorf("cloudVendorName is required")
	}
	var params rsapi.APIParams
	var p rsapi.APIParams
	p = rsapi.APIParams{
		"aws_access_key_id":     awsAccessKeyId,
		"aws_account_number":    awsAccountNumber,
		"aws_secret_access_key": awsSecretAccessKey,
		"cloud_vendor_name":     cloudVendorName,
	}
	uri, err := loc.ActionPath("CurrentUser", "cloud_accounts")
	if err != nil {
		return err
	}
	req, err := loc.api.BuildHTTPRequest(uri.HTTPMethod, uri.Path, APIVersion, params, p)
	if err != nil {
		return err
	}
	resp, err := loc.api.PerformRequest(req)
	if err != nil {
		return 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 fmt.Errorf("invalid response %s%s", resp.Status, sr)
	}
	return nil
}
// POST /api/current_user/actions/cloud_accounts
//
// Creates a cloud account in the first available child account,
// or the account used to login if there are no available child accounts.