// 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 opDescribeImageSharePermissionCommon = "DescribeImageSharePermission"

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

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

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

	return
}

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

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

const opDescribeImageSharePermission = "DescribeImageSharePermission"

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

	if input == nil {
		input = &DescribeImageSharePermissionInput{}
	}

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

	return
}

// DescribeImageSharePermission 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 DescribeImageSharePermission for usage and error information.
func (c *ECS) DescribeImageSharePermission(input *DescribeImageSharePermissionInput) (*DescribeImageSharePermissionOutput, error) {
	req, out := c.DescribeImageSharePermissionRequest(input)
	return out, req.Send()
}

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

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

	AccountId *string `type:"string"`
}

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

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

// SetAccountId sets the AccountId field's value.
func (s *AccountForDescribeImageSharePermissionOutput) SetAccountId(v string) *AccountForDescribeImageSharePermissionOutput {
	s.AccountId = &v
	return s
}

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

	ImageId *string `type:"string"`

	MaxResults *int32 `type:"int32"`

	NextToken *string `type:"string"`
}

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

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

// SetImageId sets the ImageId field's value.
func (s *DescribeImageSharePermissionInput) SetImageId(v string) *DescribeImageSharePermissionInput {
	s.ImageId = &v
	return s
}

// SetMaxResults sets the MaxResults field's value.
func (s *DescribeImageSharePermissionInput) SetMaxResults(v int32) *DescribeImageSharePermissionInput {
	s.MaxResults = &v
	return s
}

// SetNextToken sets the NextToken field's value.
func (s *DescribeImageSharePermissionInput) SetNextToken(v string) *DescribeImageSharePermissionInput {
	s.NextToken = &v
	return s
}

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

	Metadata *response.ResponseMetadata

	Accounts []*AccountForDescribeImageSharePermissionOutput `type:"list"`

	ImageId *string `type:"string"`

	NextToken *string `type:"string"`

	TotalCount *int32 `type:"int32"`
}

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

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

// SetAccounts sets the Accounts field's value.
func (s *DescribeImageSharePermissionOutput) SetAccounts(v []*AccountForDescribeImageSharePermissionOutput) *DescribeImageSharePermissionOutput {
	s.Accounts = v
	return s
}

// SetImageId sets the ImageId field's value.
func (s *DescribeImageSharePermissionOutput) SetImageId(v string) *DescribeImageSharePermissionOutput {
	s.ImageId = &v
	return s
}

// SetNextToken sets the NextToken field's value.
func (s *DescribeImageSharePermissionOutput) SetNextToken(v string) *DescribeImageSharePermissionOutput {
	s.NextToken = &v
	return s
}

// SetTotalCount sets the TotalCount field's value.
func (s *DescribeImageSharePermissionOutput) SetTotalCount(v int32) *DescribeImageSharePermissionOutput {
	s.TotalCount = &v
	return s
}
