ca/cac/codegen_client.go
func (loc *PatternLocator) Create(months string, name string, operation string, type_ string, value float64, years string, options rsapi.APIParams) (*PatternLocator, error) {
	var res *PatternLocator
	if months == "" {
		return res, fmt.Errorf("months is required")
	}
	if name == "" {
		return res, fmt.Errorf("name is required")
	}
	if operation == "" {
		return res, fmt.Errorf("operation is required")
	}
	if type_ == "" {
		return res, fmt.Errorf("type_ is required")
	}
	if years == "" {
		return res, fmt.Errorf("years 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{
		"months":    months,
		"name":      name,
		"operation": operation,
		"type":      type_,
		"value":     value,
		"years":     years,
	}
	var summaryOpt = options["summary"]
	if summaryOpt != nil {
		p["summary"] = summaryOpt
	}
	uri, err := loc.ActionPath("Pattern", "create")
	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)
	}
	location := resp.Header.Get("Location")
	if len(location) == 0 {
		return res, fmt.Errorf("Missing location header in response")
	} else {
		return &PatternLocator{Href(location), loc.api}, nil
	}
}
func (loc *PatternLocator) Create(months string, name string, operation string, type_ string, value float64, years string, options rsapi.APIParams) (*PatternLocator, error) {
	var res *PatternLocator
	if months == "" {
		return res, fmt.Errorf("months is required")
	}
	if name == "" {
		return res, fmt.Errorf("name is required")
	}
	if operation == "" {
		return res, fmt.Errorf("operation is required")
	}
	if type_ == "" {
		return res, fmt.Errorf("type_ is required")
	}
	if years == "" {
		return res, fmt.Errorf("years 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{
		"months":    months,
		"name":      name,
		"operation": operation,
		"type":      type_,
		"value":     value,
		"years":     years,
	}
	var summaryOpt = options["summary"]
	if summaryOpt != nil {
		p["summary"] = summaryOpt
	}
	uri, err := loc.ActionPath("Pattern", "create")
	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)
	}
	location := resp.Header.Get("Location")
	if len(location) == 0 {
		return res, fmt.Errorf("Missing location header in response")
	} else {
		return &PatternLocator{Href(location), loc.api}, nil
	}
}
//===== Actions
// POST /api/patterns
//
// Create a new Pattern.