// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT.

package autoscaling

import (
	"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine"
	"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request"
	"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response"
	"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil"
)

const opCreateLifecycleHookCommon = "CreateLifecycleHook"

// CreateLifecycleHookCommonRequest generates a "volcengine/request.Request" representing the
// client's request for the CreateLifecycleHookCommon operation. The "output" return
// value will be populated with the CreateLifecycleHookCommon request's response once the request completes
// successfully.
//
// Use "Send" method on the returned CreateLifecycleHookCommon Request to send the API call to the service.
// the "output" return value is not valid until after CreateLifecycleHookCommon Send returns without error.
//
// See CreateLifecycleHookCommon for more information on using the CreateLifecycleHookCommon
// API call, and error handling.
//
//	// Example sending a request using the CreateLifecycleHookCommonRequest method.
//	req, resp := client.CreateLifecycleHookCommonRequest(params)
//
//	err := req.Send()
//	if err == nil { // resp is now filled
//	    fmt.Println(resp)
//	}
func (c *AUTOSCALING) CreateLifecycleHookCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) {
	op := &request.Operation{
		Name:       opCreateLifecycleHookCommon,
		HTTPMethod: "GET",
		HTTPPath:   "/",
	}

	if input == nil {
		input = &map[string]interface{}{}
	}

	output = &map[string]interface{}{}
	req = c.newRequest(op, input, output)

	return
}

// CreateLifecycleHookCommon API operation for AUTO_SCALING.
//
// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions
// with volcengineerr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the VOLCENGINE API reference guide for AUTO_SCALING's
// API operation CreateLifecycleHookCommon for usage and error information.
func (c *AUTOSCALING) CreateLifecycleHookCommon(input *map[string]interface{}) (*map[string]interface{}, error) {
	req, out := c.CreateLifecycleHookCommonRequest(input)
	return out, req.Send()
}

// CreateLifecycleHookCommonWithContext is the same as CreateLifecycleHookCommon with the addition of
// the ability to pass a context and additional request options.
//
// See CreateLifecycleHookCommon for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur.
// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *AUTOSCALING) CreateLifecycleHookCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) {
	req, out := c.CreateLifecycleHookCommonRequest(input)
	req.SetContext(ctx)
	req.ApplyOptions(opts...)
	return out, req.Send()
}

const opCreateLifecycleHook = "CreateLifecycleHook"

// CreateLifecycleHookRequest generates a "volcengine/request.Request" representing the
// client's request for the CreateLifecycleHook operation. The "output" return
// value will be populated with the CreateLifecycleHookCommon request's response once the request completes
// successfully.
//
// Use "Send" method on the returned CreateLifecycleHookCommon Request to send the API call to the service.
// the "output" return value is not valid until after CreateLifecycleHookCommon Send returns without error.
//
// See CreateLifecycleHook for more information on using the CreateLifecycleHook
// API call, and error handling.
//
//	// Example sending a request using the CreateLifecycleHookRequest method.
//	req, resp := client.CreateLifecycleHookRequest(params)
//
//	err := req.Send()
//	if err == nil { // resp is now filled
//	    fmt.Println(resp)
//	}
func (c *AUTOSCALING) CreateLifecycleHookRequest(input *CreateLifecycleHookInput) (req *request.Request, output *CreateLifecycleHookOutput) {
	op := &request.Operation{
		Name:       opCreateLifecycleHook,
		HTTPMethod: "GET",
		HTTPPath:   "/",
	}

	if input == nil {
		input = &CreateLifecycleHookInput{}
	}

	output = &CreateLifecycleHookOutput{}
	req = c.newRequest(op, input, output)

	return
}

// CreateLifecycleHook API operation for AUTO_SCALING.
//
// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions
// with volcengineerr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the VOLCENGINE API reference guide for AUTO_SCALING's
// API operation CreateLifecycleHook for usage and error information.
func (c *AUTOSCALING) CreateLifecycleHook(input *CreateLifecycleHookInput) (*CreateLifecycleHookOutput, error) {
	req, out := c.CreateLifecycleHookRequest(input)
	return out, req.Send()
}

// CreateLifecycleHookWithContext is the same as CreateLifecycleHook with the addition of
// the ability to pass a context and additional request options.
//
// See CreateLifecycleHook for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. Ifthe context is nil a panic will occur.
// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *AUTOSCALING) CreateLifecycleHookWithContext(ctx volcengine.Context, input *CreateLifecycleHookInput, opts ...request.Option) (*CreateLifecycleHookOutput, error) {
	req, out := c.CreateLifecycleHookRequest(input)
	req.SetContext(ctx)
	req.ApplyOptions(opts...)
	return out, req.Send()
}

type CreateLifecycleHookInput struct {
	_ struct{} `type:"structure"`

	LifecycleHookName *string `type:"string"`

	LifecycleHookPolicy *string `type:"string"`

	LifecycleHookTimeout *int32 `type:"int32"`

	LifecycleHookType *string `type:"string"`

	ScalingGroupId *string `type:"string"`
}

// String returns the string representation
func (s CreateLifecycleHookInput) String() string {
	return volcengineutil.Prettify(s)
}

// GoString returns the string representation
func (s CreateLifecycleHookInput) GoString() string {
	return s.String()
}

// SetLifecycleHookName sets the LifecycleHookName field's value.
func (s *CreateLifecycleHookInput) SetLifecycleHookName(v string) *CreateLifecycleHookInput {
	s.LifecycleHookName = &v
	return s
}

// SetLifecycleHookPolicy sets the LifecycleHookPolicy field's value.
func (s *CreateLifecycleHookInput) SetLifecycleHookPolicy(v string) *CreateLifecycleHookInput {
	s.LifecycleHookPolicy = &v
	return s
}

// SetLifecycleHookTimeout sets the LifecycleHookTimeout field's value.
func (s *CreateLifecycleHookInput) SetLifecycleHookTimeout(v int32) *CreateLifecycleHookInput {
	s.LifecycleHookTimeout = &v
	return s
}

// SetLifecycleHookType sets the LifecycleHookType field's value.
func (s *CreateLifecycleHookInput) SetLifecycleHookType(v string) *CreateLifecycleHookInput {
	s.LifecycleHookType = &v
	return s
}

// SetScalingGroupId sets the ScalingGroupId field's value.
func (s *CreateLifecycleHookInput) SetScalingGroupId(v string) *CreateLifecycleHookInput {
	s.ScalingGroupId = &v
	return s
}

type CreateLifecycleHookOutput struct {
	_ struct{} `type:"structure"`

	Metadata *response.ResponseMetadata

	LifecycleHookId *string `type:"string"`
}

// String returns the string representation
func (s CreateLifecycleHookOutput) String() string {
	return volcengineutil.Prettify(s)
}

// GoString returns the string representation
func (s CreateLifecycleHookOutput) GoString() string {
	return s.String()
}

// SetLifecycleHookId sets the LifecycleHookId field's value.
func (s *CreateLifecycleHookOutput) SetLifecycleHookId(v string) *CreateLifecycleHookOutput {
	s.LifecycleHookId = &v
	return s
}
