cm15/codegen_client.go
func (loc *RepositoryLocator) CookbookImport(assetHrefs []string, options rsapi.APIParams) error {
	if len(assetHrefs) == 0 {
		return fmt.Errorf("assetHrefs is required")
	}
	var params rsapi.APIParams
	var p rsapi.APIParams
	p = rsapi.APIParams{
		"asset_hrefs": assetHrefs,
	}
	var followOpt = options["follow"]
	if followOpt != nil {
		p["follow"] = followOpt
	}
	var namespaceOpt = options["namespace"]
	if namespaceOpt != nil {
		p["namespace"] = namespaceOpt
	}
	var repositoryCommitReferenceOpt = options["repository_commit_reference"]
	if repositoryCommitReferenceOpt != nil {
		p["repository_commit_reference"] = repositoryCommitReferenceOpt
	}
	var withDependenciesOpt = options["with_dependencies"]
	if withDependenciesOpt != nil {
		p["with_dependencies"] = withDependenciesOpt
	}
	uri, err := loc.ActionPath("Repository", "cookbook_import")
	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 *RepositoryLocator) CookbookImport(assetHrefs []string, options rsapi.APIParams) error {
	if len(assetHrefs) == 0 {
		return fmt.Errorf("assetHrefs is required")
	}
	var params rsapi.APIParams
	var p rsapi.APIParams
	p = rsapi.APIParams{
		"asset_hrefs": assetHrefs,
	}
	var followOpt = options["follow"]
	if followOpt != nil {
		p["follow"] = followOpt
	}
	var namespaceOpt = options["namespace"]
	if namespaceOpt != nil {
		p["namespace"] = namespaceOpt
	}
	var repositoryCommitReferenceOpt = options["repository_commit_reference"]
	if repositoryCommitReferenceOpt != nil {
		p["repository_commit_reference"] = repositoryCommitReferenceOpt
	}
	var withDependenciesOpt = options["with_dependencies"]
	if withDependenciesOpt != nil {
		p["with_dependencies"] = withDependenciesOpt
	}
	uri, err := loc.ActionPath("Repository", "cookbook_import")
	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
}
//===== Actions
// POST /api/repositories/:id/cookbook_import
//
// Performs a Cookbook import, which allows you to use the specified cookbooks in your design objects.
// Required parameters:
// asset_hrefs: Hrefs of the assets that should be imported.
// Optional parameters:
// follow: A flag indicating whether imported cookbooks should be followed.
// namespace: The namespace to import into.
// repository_commit_reference: Optional commit reference indicating last succeeded commit. Must match the Repository's fetch_status.succeeded_commit attribute or the import will not be performed.
// with_dependencies: A flag indicating whether dependencies should automatically be imported.