sts

package
v1.0.147 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package stsiface provides an interface to enable mocking the STS service client for testing your code.

It is important to note that this interface will have breaking changes when the service model is updated and adds new API operations, paginators, and waiters.

Index

Constants

View Source
const (
	ServiceName = "sts"       // Name of service.
	EndpointsID = ServiceName // ID to lookup a service endpoint with.
	ServiceID   = "sts"       // ServiceID is a unique identifer of a specific service.
)

Service information constants

Variables

This section is empty.

Functions

This section is empty.

Types

type AssumeRoleInput

type AssumeRoleInput struct {
	DurationSeconds *int32 `type:"int32"`

	Policy *string `type:"string"`

	// RoleSessionName is a required field
	RoleSessionName *string `type:"string" required:"true"`

	// RoleTrn is a required field
	RoleTrn *string `type:"string" required:"true"`

	Tags []*TagForAssumeRoleInput `type:"list"`
	// contains filtered or unexported fields
}

func (AssumeRoleInput) GoString

func (s AssumeRoleInput) GoString() string

GoString returns the string representation

func (*AssumeRoleInput) SetDurationSeconds

func (s *AssumeRoleInput) SetDurationSeconds(v int32) *AssumeRoleInput

SetDurationSeconds sets the DurationSeconds field's value.

func (*AssumeRoleInput) SetPolicy

func (s *AssumeRoleInput) SetPolicy(v string) *AssumeRoleInput

SetPolicy sets the Policy field's value.

func (*AssumeRoleInput) SetRoleSessionName

func (s *AssumeRoleInput) SetRoleSessionName(v string) *AssumeRoleInput

SetRoleSessionName sets the RoleSessionName field's value.

func (*AssumeRoleInput) SetRoleTrn

func (s *AssumeRoleInput) SetRoleTrn(v string) *AssumeRoleInput

SetRoleTrn sets the RoleTrn field's value.

func (*AssumeRoleInput) SetTags

SetTags sets the Tags field's value.

func (AssumeRoleInput) String

func (s AssumeRoleInput) String() string

String returns the string representation

func (*AssumeRoleInput) Validate

func (s *AssumeRoleInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type AssumeRoleOutput

type AssumeRoleOutput struct {
	Metadata *response.ResponseMetadata

	AssumedRoleUser *AssumedRoleUserForAssumeRoleOutput `type:"structure"`

	Credentials *CredentialsForAssumeRoleOutput `type:"structure"`
	// contains filtered or unexported fields
}

func (AssumeRoleOutput) GoString

func (s AssumeRoleOutput) GoString() string

GoString returns the string representation

func (*AssumeRoleOutput) SetAssumedRoleUser

SetAssumedRoleUser sets the AssumedRoleUser field's value.

func (*AssumeRoleOutput) SetCredentials

SetCredentials sets the Credentials field's value.

func (AssumeRoleOutput) String

func (s AssumeRoleOutput) String() string

String returns the string representation

type AssumedRoleUserForAssumeRoleOutput

type AssumedRoleUserForAssumeRoleOutput struct {
	AssumedRoleId *string `type:"string"`

	Trn *string `type:"string"`
	// contains filtered or unexported fields
}

func (AssumedRoleUserForAssumeRoleOutput) GoString

GoString returns the string representation

func (*AssumedRoleUserForAssumeRoleOutput) SetAssumedRoleId

SetAssumedRoleId sets the AssumedRoleId field's value.

func (*AssumedRoleUserForAssumeRoleOutput) SetTrn

SetTrn sets the Trn field's value.

func (AssumedRoleUserForAssumeRoleOutput) String

String returns the string representation

type CredentialsForAssumeRoleOutput

type CredentialsForAssumeRoleOutput struct {
	AccessKeyId *string `type:"string"`

	CurrentTime *string `type:"string"`

	ExpiredTime *string `type:"string"`

	SecretAccessKey *string `type:"string"`

	SessionToken *string `type:"string"`
	// contains filtered or unexported fields
}

func (CredentialsForAssumeRoleOutput) GoString

GoString returns the string representation

func (*CredentialsForAssumeRoleOutput) SetAccessKeyId

SetAccessKeyId sets the AccessKeyId field's value.

func (*CredentialsForAssumeRoleOutput) SetCurrentTime

SetCurrentTime sets the CurrentTime field's value.

func (*CredentialsForAssumeRoleOutput) SetExpiredTime

SetExpiredTime sets the ExpiredTime field's value.

func (*CredentialsForAssumeRoleOutput) SetSecretAccessKey

SetSecretAccessKey sets the SecretAccessKey field's value.

func (*CredentialsForAssumeRoleOutput) SetSessionToken

SetSessionToken sets the SessionToken field's value.

func (CredentialsForAssumeRoleOutput) String

String returns the string representation

type STS

type STS struct {
	*client.Client
}

STS provides the API operation methods for making requests to STS. See this package's package overview docs for details on the service.

STS methods are safe to use concurrently. It is not safe to modify mutate any of the struct's properties though.

func New

func New(p client.ConfigProvider, cfgs ...*volcengine.Config) *STS

New create int can support ssl or region locate set

func (*STS) AssumeRole

func (c *STS) AssumeRole(input *AssumeRoleInput) (*AssumeRoleOutput, error)

AssumeRole API operation for STS.

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 STS's API operation AssumeRole for usage and error information.

func (*STS) AssumeRoleCommon

func (c *STS) AssumeRoleCommon(input *map[string]interface{}) (*map[string]interface{}, error)

AssumeRoleCommon API operation for STS.

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 STS's API operation AssumeRoleCommon for usage and error information.

func (*STS) AssumeRoleCommonRequest

func (c *STS) AssumeRoleCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{})

AssumeRoleCommonRequest generates a "volcengine/request.Request" representing the client's request for the AssumeRoleCommon operation. The "output" return value will be populated with the AssumeRoleCommon request's response once the request completes successfully.

Use "Send" method on the returned AssumeRoleCommon Request to send the API call to the service. the "output" return value is not valid until after AssumeRoleCommon Send returns without error.

See AssumeRoleCommon for more information on using the AssumeRoleCommon API call, and error handling.

// Example sending a request using the AssumeRoleCommonRequest method.
req, resp := client.AssumeRoleCommonRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*STS) AssumeRoleCommonWithContext

func (c *STS) AssumeRoleCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error)

AssumeRoleCommonWithContext is the same as AssumeRoleCommon with the addition of the ability to pass a context and additional request options.

See AssumeRoleCommon 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 (*STS) AssumeRoleRequest

func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, output *AssumeRoleOutput)

AssumeRoleRequest generates a "volcengine/request.Request" representing the client's request for the AssumeRole operation. The "output" return value will be populated with the AssumeRoleCommon request's response once the request completes successfully.

Use "Send" method on the returned AssumeRoleCommon Request to send the API call to the service. the "output" return value is not valid until after AssumeRoleCommon Send returns without error.

See AssumeRole for more information on using the AssumeRole API call, and error handling.

// Example sending a request using the AssumeRoleRequest method.
req, resp := client.AssumeRoleRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*STS) AssumeRoleWithContext

func (c *STS) AssumeRoleWithContext(ctx volcengine.Context, input *AssumeRoleInput, opts ...request.Option) (*AssumeRoleOutput, error)

AssumeRoleWithContext is the same as AssumeRole with the addition of the ability to pass a context and additional request options.

See AssumeRole 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.

type STSAPI

type STSAPI interface {
	AssumeRoleCommon(*map[string]interface{}) (*map[string]interface{}, error)
	AssumeRoleCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error)
	AssumeRoleCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{})

	AssumeRole(*AssumeRoleInput) (*AssumeRoleOutput, error)
	AssumeRoleWithContext(volcengine.Context, *AssumeRoleInput, ...request.Option) (*AssumeRoleOutput, error)
	AssumeRoleRequest(*AssumeRoleInput) (*request.Request, *AssumeRoleOutput)
}

STSAPI provides an interface to enable mocking the sts.STS service client's API operation,

// volcengine sdk func uses an SDK service client to make a request to
// STS.
func myFunc(svc STSAPI) bool {
    // Make svc.AssumeRole request
}

func main() {
    sess := session.New()
    svc := sts.New(sess)

    myFunc(svc)
}

type TagForAssumeRoleInput

type TagForAssumeRoleInput struct {
	Key *string `type:"string"`

	Value *string `type:"string"`
	// contains filtered or unexported fields
}

func (TagForAssumeRoleInput) GoString

func (s TagForAssumeRoleInput) GoString() string

GoString returns the string representation

func (*TagForAssumeRoleInput) SetKey

SetKey sets the Key field's value.

func (*TagForAssumeRoleInput) SetValue

SetValue sets the Value field's value.

func (TagForAssumeRoleInput) String

func (s TagForAssumeRoleInput) String() string

String returns the string representation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL