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

package ecs

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 opStopInstancesCommon = "StopInstances"

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

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

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

	return
}

// StopInstancesCommon API operation for ECS.
//
// 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 ECS's
// API operation StopInstancesCommon for usage and error information.
func (c *ECS) StopInstancesCommon(input *map[string]interface{}) (*map[string]interface{}, error) {
	req, out := c.StopInstancesCommonRequest(input)
	return out, req.Send()
}

// StopInstancesCommonWithContext is the same as StopInstancesCommon with the addition of
// the ability to pass a context and additional request options.
//
// See StopInstancesCommon 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 *ECS) StopInstancesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) {
	req, out := c.StopInstancesCommonRequest(input)
	req.SetContext(ctx)
	req.ApplyOptions(opts...)
	return out, req.Send()
}

const opStopInstances = "StopInstances"

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

	if input == nil {
		input = &StopInstancesInput{}
	}

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

	return
}

// StopInstances API operation for ECS.
//
// 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 ECS's
// API operation StopInstances for usage and error information.
func (c *ECS) StopInstances(input *StopInstancesInput) (*StopInstancesOutput, error) {
	req, out := c.StopInstancesRequest(input)
	return out, req.Send()
}

// StopInstancesWithContext is the same as StopInstances with the addition of
// the ability to pass a context and additional request options.
//
// See StopInstances 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 *ECS) StopInstancesWithContext(ctx volcengine.Context, input *StopInstancesInput, opts ...request.Option) (*StopInstancesOutput, error) {
	req, out := c.StopInstancesRequest(input)
	req.SetContext(ctx)
	req.ApplyOptions(opts...)
	return out, req.Send()
}

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

	Code *string `type:"string"`

	Message *string `type:"string"`
}

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

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

// SetCode sets the Code field's value.
func (s *ErrorForStopInstancesOutput) SetCode(v string) *ErrorForStopInstancesOutput {
	s.Code = &v
	return s
}

// SetMessage sets the Message field's value.
func (s *ErrorForStopInstancesOutput) SetMessage(v string) *ErrorForStopInstancesOutput {
	s.Message = &v
	return s
}

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

	Error *ErrorForStopInstancesOutput `type:"structure"`

	InstanceId *string `type:"string"`
}

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

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

// SetError sets the Error field's value.
func (s *OperationDetailForStopInstancesOutput) SetError(v *ErrorForStopInstancesOutput) *OperationDetailForStopInstancesOutput {
	s.Error = v
	return s
}

// SetInstanceId sets the InstanceId field's value.
func (s *OperationDetailForStopInstancesOutput) SetInstanceId(v string) *OperationDetailForStopInstancesOutput {
	s.InstanceId = &v
	return s
}

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

	ForceStop *bool `type:"boolean"`

	InstanceIds []*string `type:"list"`

	StoppedMode *string `type:"string"`
}

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

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

// SetForceStop sets the ForceStop field's value.
func (s *StopInstancesInput) SetForceStop(v bool) *StopInstancesInput {
	s.ForceStop = &v
	return s
}

// SetInstanceIds sets the InstanceIds field's value.
func (s *StopInstancesInput) SetInstanceIds(v []*string) *StopInstancesInput {
	s.InstanceIds = v
	return s
}

// SetStoppedMode sets the StoppedMode field's value.
func (s *StopInstancesInput) SetStoppedMode(v string) *StopInstancesInput {
	s.StoppedMode = &v
	return s
}

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

	Metadata *response.ResponseMetadata

	OperationDetails []*OperationDetailForStopInstancesOutput `type:"list"`
}

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

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

// SetOperationDetails sets the OperationDetails field's value.
func (s *StopInstancesOutput) SetOperationDetails(v []*OperationDetailForStopInstancesOutput) *StopInstancesOutput {
	s.OperationDetails = v
	return s
}
