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

package ark

import (
	"github.com/volcengine/volcengine-go-sdk/volcengine"
	"github.com/volcengine/volcengine-go-sdk/volcengine/request"
	"github.com/volcengine/volcengine-go-sdk/volcengine/response"
	"github.com/volcengine/volcengine-go-sdk/volcengine/volcengineutil"
)

const opTerminateModelCustomizationJobCommon = "TerminateModelCustomizationJob"

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

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

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

	req.HTTPRequest.Header.Set("Content-Type", "application/json; charset=utf-8")

	return
}

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

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

const opTerminateModelCustomizationJob = "TerminateModelCustomizationJob"

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

	if input == nil {
		input = &TerminateModelCustomizationJobInput{}
	}

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

	req.HTTPRequest.Header.Set("Content-Type", "application/json; charset=utf-8")

	return
}

// TerminateModelCustomizationJob API operation for ARK.
//
// 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 ARK's
// API operation TerminateModelCustomizationJob for usage and error information.
func (c *ARK) TerminateModelCustomizationJob(input *TerminateModelCustomizationJobInput) (*TerminateModelCustomizationJobOutput, error) {
	req, out := c.TerminateModelCustomizationJobRequest(input)
	return out, req.Send()
}

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

type TerminateModelCustomizationJobInput struct {
	_ struct{} `type:"structure" json:",omitempty"`

	// Id is a required field
	Id *string `type:"string" json:",omitempty" required:"true"`
}

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

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

// Validate inspects the fields of the type to determine if they are valid.
func (s *TerminateModelCustomizationJobInput) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "TerminateModelCustomizationJobInput"}
	if s.Id == nil {
		invalidParams.Add(request.NewErrParamRequired("Id"))
	}

	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}

// SetId sets the Id field's value.
func (s *TerminateModelCustomizationJobInput) SetId(v string) *TerminateModelCustomizationJobInput {
	s.Id = &v
	return s
}

type TerminateModelCustomizationJobOutput struct {
	_ struct{} `type:"structure" json:",omitempty"`

	Metadata *response.ResponseMetadata
}

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

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