// WithStatusCode adds the status to the get Id default response
485586
func (o *GetIDDefault) WithStatusCode(code int) *GetIDDefault {
	o._statusCode = code
	return o
}
644729
func (s *UpdateMethodResponseInput) SetStatusCode(v string) *UpdateMethodResponseInput {
	s.StatusCode = &v
	return s
}
294828
func (o *GetItemsDefault) WithStatusCode(code int) *GetItemsDefault {
	o._statusCode = code
	return o
}
597938
func (r Result) StatusCode(statusCode *int) Result {
	*statusCode = r.statusCode
	return r
}
1297891
func GetWithStatusError(address string) (resp *http.Response, err error) {
	if resp, err = http.Get(address); err != nil {
		if uerr, ok := err.(*url.Error); ok {
			if derr, ok := uerr.Err.(*net.DNSError); ok && !derr.IsTimeout {
				return nil, errdefs.NotFound(err)
			}
		}
		return nil, errdefs.System(err)
	}
	if resp.StatusCode < 400 {
		return resp, nil
	}
	msg := fmt.Sprintf("failed to GET %s with status %s", address, resp.Status)
	body, err := ioutil.ReadAll(resp.Body)
	resp.Body.Close()
	if err != nil {
		return nil, errdefs.System(errors.New(msg + ": error reading body"))
	}

	msg += ": " + string(bytes.TrimSpace(body))
	switch resp.StatusCode {
	case http.StatusNotFound:
		return nil, errdefs.NotFound(errors.New(msg))
	case http.StatusBadRequest:
		return nil, errdefs.InvalidParameter(errors.New(msg))
	case http.StatusUnauthorized:
		return nil, errdefs.Unauthorized(errors.New(msg))
	case http.StatusForbidden:
		return nil, errdefs.Forbidden(errors.New(msg))
	}
	return nil, errdefs.Unknown(errors.New(msg))
}
772640
func StatusCode(err error) int {
	switch t := err.(type) {
	case util.HTTPError:
		return t.Code
	case *util.HTTPError:
		return t.Code
	case *oauth.Error:
		return t.Code
	default:
		return http.StatusInternalServerError
	}
}
291584
func (o *Oauth2TokenParams) WithCode(code *string) *Oauth2TokenParams {
	o.SetCode(code)
	return o
}
231697
func (o *DestroyOneDefault) WithStatusCode(code int) *DestroyOneDefault {
	o._statusCode = code
	return o
}
555823
func IsStatusCode(err interface{}, code int) bool {
	switch e := err.(type) {
	case *http.Response:
		return e.StatusCode == code
	case *Error:
		return e.Status == code
	case Error:
		return e.Status == code
	case int:
		return e == code
	}
	return false
}
81077
func (s *InvokeOutput) SetStatusCode(v int64) *InvokeOutput {
	s.StatusCode = &v
	return s
}
997145
func GetStatusCode(err error, default_code int) int {
	rv := errors.GetData(err, statusCode)
	sc, ok := rv.(int)
	if ok {
		return sc
	}
	return default_code
}
907253
func (o *CreateUsersWithListInputDefault) WithStatusCode(code int) *CreateUsersWithListInputDefault {
	o._statusCode = code
	return o
}
1104589
func getHTTPStatusCode(status *tokenStatus, err error) *tokenStatus {
	if err == nil {
		status.status = http.StatusOK
	} else {
		if obj, ok := err.(SFXAPIError); ok {
			status.status = obj.StatusCode
		}
	}
	return status
}
313750
func (o *ListTasksDefault) WithStatusCode(code int) *ListTasksDefault {
	o._statusCode = code
	return o
}
725165
func (o *GetLoginDefault) WithStatusCode(code int) *GetLoginDefault {
	o._statusCode = code
	return o
}
425268
func (e *Error) StatusCode() int {
	code, ok := errorTypeToStatusCodeMap[e.Type]
	if !ok || code == 0 {
		return 500
	}

	return code
}
885268
func (o *GetTaskCommentsDefault) WithStatusCode(code int) *GetTaskCommentsDefault {
	o._statusCode = code
	return o
}