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

package sagemaker

import (
	"context"

	"github.com/aws/aws-sdk-go-v2/aws"
	"github.com/aws/aws-sdk-go-v2/internal/awsutil"
	"github.com/aws/aws-sdk-go-v2/private/protocol"
	"github.com/aws/aws-sdk-go-v2/private/protocol/jsonrpc"
)

// Please also see https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteEndpointConfigInput
type DeleteEndpointConfigInput struct {
	_ struct{} `type:"structure"`

	// The name of the endpoint configuration that you want to delete.
	//
	// EndpointConfigName is a required field
	EndpointConfigName *string `type:"string" required:"true"`
}

// String returns the string representation
func (s DeleteEndpointConfigInput) String() string {
	return awsutil.Prettify(s)
}

// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteEndpointConfigInput) Validate() error {
	invalidParams := aws.ErrInvalidParams{Context: "DeleteEndpointConfigInput"}

	if s.EndpointConfigName == nil {
		invalidParams.Add(aws.NewErrParamRequired("EndpointConfigName"))
	}

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

// Please also see https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteEndpointConfigOutput
type DeleteEndpointConfigOutput struct {
	_ struct{} `type:"structure"`
}

// String returns the string representation
func (s DeleteEndpointConfigOutput) String() string {
	return awsutil.Prettify(s)
}

const opDeleteEndpointConfig = "DeleteEndpointConfig"

// DeleteEndpointConfigRequest returns a request value for making API operation for
// Amazon SageMaker Service.
//
// Deletes an endpoint configuration. The DeleteEndpointConfig API deletes only
// the specified configuration. It does not delete endpoints created using the
// configuration.
//
//    // Example sending a request using DeleteEndpointConfigRequest.
//    req := client.DeleteEndpointConfigRequest(params)
//    resp, err := req.Send(context.TODO())
//    if err == nil {
//        fmt.Println(resp)
//    }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteEndpointConfig
func (c *Client) DeleteEndpointConfigRequest(input *DeleteEndpointConfigInput) DeleteEndpointConfigRequest {
	op := &aws.Operation{
		Name:       opDeleteEndpointConfig,
		HTTPMethod: "POST",
		HTTPPath:   "/",
	}

	if input == nil {
		input = &DeleteEndpointConfigInput{}
	}

	req := c.newRequest(op, input, &DeleteEndpointConfigOutput{})
	req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
	req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
	return DeleteEndpointConfigRequest{Request: req, Input: input, Copy: c.DeleteEndpointConfigRequest}
}

// DeleteEndpointConfigRequest is the request type for the
// DeleteEndpointConfig API operation.
type DeleteEndpointConfigRequest struct {
	*aws.Request
	Input *DeleteEndpointConfigInput
	Copy  func(*DeleteEndpointConfigInput) DeleteEndpointConfigRequest
}

// Send marshals and sends the DeleteEndpointConfig API request.
func (r DeleteEndpointConfigRequest) Send(ctx context.Context) (*DeleteEndpointConfigResponse, error) {
	r.Request.SetContext(ctx)
	err := r.Request.Send()
	if err != nil {
		return nil, err
	}

	resp := &DeleteEndpointConfigResponse{
		DeleteEndpointConfigOutput: r.Request.Data.(*DeleteEndpointConfigOutput),
		response:                   &aws.Response{Request: r.Request},
	}

	return resp, nil
}

// DeleteEndpointConfigResponse is the response type for the
// DeleteEndpointConfig API operation.
type DeleteEndpointConfigResponse struct {
	*DeleteEndpointConfigOutput

	response *aws.Response
}

// SDKResponseMetdata returns the response metadata for the
// DeleteEndpointConfig request.
func (r *DeleteEndpointConfigResponse) SDKResponseMetdata() *aws.Response {
	return r.response
}
