// 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 opGetEndpointCommon = "GetEndpoint"

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

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

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

const opGetEndpoint = "GetEndpoint"

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

	if input == nil {
		input = &GetEndpointInput{}
	}

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

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

	return
}

// GetEndpoint 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 GetEndpoint for usage and error information.
func (c *ARK) GetEndpoint(input *GetEndpointInput) (*GetEndpointOutput, error) {
	req, out := c.GetEndpointRequest(input)
	return out, req.Send()
}

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

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

	ModelVersion *string `type:"string" json:",omitempty"`

	Name *string `type:"string" json:",omitempty"`
}

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

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

// SetModelVersion sets the ModelVersion field's value.
func (s *FoundationModelForGetEndpointOutput) SetModelVersion(v string) *FoundationModelForGetEndpointOutput {
	s.ModelVersion = &v
	return s
}

// SetName sets the Name field's value.
func (s *FoundationModelForGetEndpointOutput) SetName(v string) *FoundationModelForGetEndpointOutput {
	s.Name = &v
	return s
}

type GetEndpointInput 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 GetEndpointInput) String() string {
	return volcengineutil.Prettify(s)
}

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

// Validate inspects the fields of the type to determine if they are valid.
func (s *GetEndpointInput) Validate() error {
	invalidParams := request.ErrInvalidParams{Context: "GetEndpointInput"}
	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 *GetEndpointInput) SetId(v string) *GetEndpointInput {
	s.Id = &v
	return s
}

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

	Metadata *response.ResponseMetadata

	BatchOnly *bool `type:"boolean" json:",omitempty"`

	CreateTime *string `type:"string" json:",omitempty"`

	Description *string `type:"string" json:",omitempty"`

	EndpointModelType *string `type:"string" json:",omitempty"`

	Id *string `type:"string" json:",omitempty"`

	ModelReference *ModelReferenceForGetEndpointOutput `type:"structure" json:",omitempty"`

	ModelUnitId *string `type:"string" json:",omitempty"`

	Moderation *ModerationForGetEndpointOutput `type:"structure" json:",omitempty"`

	Name *string `type:"string" json:",omitempty"`

	ProjectName *string `type:"string" json:",omitempty"`

	RateLimit *RateLimitForGetEndpointOutput `type:"structure" json:",omitempty"`

	RollingId *string `type:"string" json:",omitempty"`

	ScaleTierId *string `type:"string" json:",omitempty"`

	Status *string `type:"string" json:",omitempty"`

	StatusReason *string `type:"string" json:",omitempty"`

	SupportRolling *bool `type:"boolean" json:",omitempty"`

	SupportScaleTier *bool `type:"boolean" json:",omitempty"`

	Tags []*TagForGetEndpointOutput `type:"list" json:",omitempty"`

	UpdateTime *string `type:"string" json:",omitempty"`
}

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

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

// SetBatchOnly sets the BatchOnly field's value.
func (s *GetEndpointOutput) SetBatchOnly(v bool) *GetEndpointOutput {
	s.BatchOnly = &v
	return s
}

// SetCreateTime sets the CreateTime field's value.
func (s *GetEndpointOutput) SetCreateTime(v string) *GetEndpointOutput {
	s.CreateTime = &v
	return s
}

// SetDescription sets the Description field's value.
func (s *GetEndpointOutput) SetDescription(v string) *GetEndpointOutput {
	s.Description = &v
	return s
}

// SetEndpointModelType sets the EndpointModelType field's value.
func (s *GetEndpointOutput) SetEndpointModelType(v string) *GetEndpointOutput {
	s.EndpointModelType = &v
	return s
}

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

// SetModelReference sets the ModelReference field's value.
func (s *GetEndpointOutput) SetModelReference(v *ModelReferenceForGetEndpointOutput) *GetEndpointOutput {
	s.ModelReference = v
	return s
}

// SetModelUnitId sets the ModelUnitId field's value.
func (s *GetEndpointOutput) SetModelUnitId(v string) *GetEndpointOutput {
	s.ModelUnitId = &v
	return s
}

// SetModeration sets the Moderation field's value.
func (s *GetEndpointOutput) SetModeration(v *ModerationForGetEndpointOutput) *GetEndpointOutput {
	s.Moderation = v
	return s
}

// SetName sets the Name field's value.
func (s *GetEndpointOutput) SetName(v string) *GetEndpointOutput {
	s.Name = &v
	return s
}

// SetProjectName sets the ProjectName field's value.
func (s *GetEndpointOutput) SetProjectName(v string) *GetEndpointOutput {
	s.ProjectName = &v
	return s
}

// SetRateLimit sets the RateLimit field's value.
func (s *GetEndpointOutput) SetRateLimit(v *RateLimitForGetEndpointOutput) *GetEndpointOutput {
	s.RateLimit = v
	return s
}

// SetRollingId sets the RollingId field's value.
func (s *GetEndpointOutput) SetRollingId(v string) *GetEndpointOutput {
	s.RollingId = &v
	return s
}

// SetScaleTierId sets the ScaleTierId field's value.
func (s *GetEndpointOutput) SetScaleTierId(v string) *GetEndpointOutput {
	s.ScaleTierId = &v
	return s
}

// SetStatus sets the Status field's value.
func (s *GetEndpointOutput) SetStatus(v string) *GetEndpointOutput {
	s.Status = &v
	return s
}

// SetStatusReason sets the StatusReason field's value.
func (s *GetEndpointOutput) SetStatusReason(v string) *GetEndpointOutput {
	s.StatusReason = &v
	return s
}

// SetSupportRolling sets the SupportRolling field's value.
func (s *GetEndpointOutput) SetSupportRolling(v bool) *GetEndpointOutput {
	s.SupportRolling = &v
	return s
}

// SetSupportScaleTier sets the SupportScaleTier field's value.
func (s *GetEndpointOutput) SetSupportScaleTier(v bool) *GetEndpointOutput {
	s.SupportScaleTier = &v
	return s
}

// SetTags sets the Tags field's value.
func (s *GetEndpointOutput) SetTags(v []*TagForGetEndpointOutput) *GetEndpointOutput {
	s.Tags = v
	return s
}

// SetUpdateTime sets the UpdateTime field's value.
func (s *GetEndpointOutput) SetUpdateTime(v string) *GetEndpointOutput {
	s.UpdateTime = &v
	return s
}

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

	CustomModelId *string `type:"string" json:",omitempty"`

	FoundationModel *FoundationModelForGetEndpointOutput `type:"structure" json:",omitempty"`
}

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

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

// SetCustomModelId sets the CustomModelId field's value.
func (s *ModelReferenceForGetEndpointOutput) SetCustomModelId(v string) *ModelReferenceForGetEndpointOutput {
	s.CustomModelId = &v
	return s
}

// SetFoundationModel sets the FoundationModel field's value.
func (s *ModelReferenceForGetEndpointOutput) SetFoundationModel(v *FoundationModelForGetEndpointOutput) *ModelReferenceForGetEndpointOutput {
	s.FoundationModel = v
	return s
}

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

	Strategy *string `type:"string" json:",omitempty"`
}

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

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

// SetStrategy sets the Strategy field's value.
func (s *ModerationForGetEndpointOutput) SetStrategy(v string) *ModerationForGetEndpointOutput {
	s.Strategy = &v
	return s
}

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

	Rpm *int32 `type:"int32" json:",omitempty"`

	Tpm *int32 `type:"int32" json:",omitempty"`
}

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

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

// SetRpm sets the Rpm field's value.
func (s *RateLimitForGetEndpointOutput) SetRpm(v int32) *RateLimitForGetEndpointOutput {
	s.Rpm = &v
	return s
}

// SetTpm sets the Tpm field's value.
func (s *RateLimitForGetEndpointOutput) SetTpm(v int32) *RateLimitForGetEndpointOutput {
	s.Tpm = &v
	return s
}

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

	Key *string `type:"string" json:",omitempty"`

	Value *string `type:"string" json:",omitempty"`
}

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

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

// SetKey sets the Key field's value.
func (s *TagForGetEndpointOutput) SetKey(v string) *TagForGetEndpointOutput {
	s.Key = &v
	return s
}

// SetValue sets the Value field's value.
func (s *TagForGetEndpointOutput) SetValue(v string) *TagForGetEndpointOutput {
	s.Value = &v
	return s
}
