ss/ssm/codegen_client.go
func (loc *ScheduledActionLocator) Create(action string, executionId string, firstOccurrence *time.Time, options rsapi.APIParams) (*ScheduledActionLocator, error) {
	var res *ScheduledActionLocator
	if action == "" {
		return res, fmt.Errorf("action is required")
	}
	if executionId == "" {
		return res, fmt.Errorf("executionId is required")
	}
	var params rsapi.APIParams
	var p rsapi.APIParams
	p = rsapi.APIParams{
		"action":           action,
		"execution_id":     executionId,
		"first_occurrence": firstOccurrence,
	}
	var nameOpt = options["name"]
	if nameOpt != nil {
		p["name"] = nameOpt
	}
	var operationOpt = options["operation"]
	if operationOpt != nil {
		p["operation"] = operationOpt
	}
	var recurrenceOpt = options["recurrence"]
	if recurrenceOpt != nil {
		p["recurrence"] = recurrenceOpt
	}
	var timezoneOpt = options["timezone"]
	if timezoneOpt != nil {
		p["timezone"] = timezoneOpt
	}
	uri, err := loc.ActionPath("ScheduledAction", "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 &ScheduledActionLocator{Href(location), loc.api}, nil
	}
}
func (loc *ScheduledActionLocator) Create(action string, executionId string, firstOccurrence *time.Time, options rsapi.APIParams) (*ScheduledActionLocator, error) {
	var res *ScheduledActionLocator
	if action == "" {
		return res, fmt.Errorf("action is required")
	}
	if executionId == "" {
		return res, fmt.Errorf("executionId is required")
	}
	var params rsapi.APIParams
	var p rsapi.APIParams
	p = rsapi.APIParams{
		"action":           action,
		"execution_id":     executionId,
		"first_occurrence": firstOccurrence,
	}
	var nameOpt = options["name"]
	if nameOpt != nil {
		p["name"] = nameOpt
	}
	var operationOpt = options["operation"]
	if operationOpt != nil {
		p["operation"] = operationOpt
	}
	var recurrenceOpt = options["recurrence"]
	if recurrenceOpt != nil {
		p["recurrence"] = recurrenceOpt
	}
	var timezoneOpt = options["timezone"]
	if timezoneOpt != nil {
		p["timezone"] = timezoneOpt
	}
	uri, err := loc.ActionPath("ScheduledAction", "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 &ScheduledActionLocator{Href(location), loc.api}, nil
	}
}
// POST /api/manager/projects/:project_id/scheduled_actions
//
// Create a new ScheduledAction resource.