Struct: kms.GetKeyPolicyInput

import "../ibm-cos-sdk-go/service/kms"

Implemented Interfaces

s3crypto.Cipher, s3manager.ReadSeekerWriteTo, request.Validator, s3manager.WriterReadFrom

Structure Field Summary collapse

Service Operations collapse

Structure Field Details

KeyId *string `min:"1" type:"string" required:"true"`

Gets the key policy for the specified KMS key.

Specify the key ID or key ARN of the KMS key.

For example:

  • Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab

  • Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab

To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey.

KeyId is a required field

PolicyName *string `min:"1" type:"string" required:"true"`

Specifies the name of the key policy. The only valid name is default. To get the names of key policies, use ListKeyPolicies.

PolicyName is a required field

_ struct{} `type:"structure"`

Method Details

func (s GetKeyPolicyInput) GoString() string

GoString returns the string representation.

API parameter values that are decorated as “sensitive” in the API will not be included in the string output. The member name will be present, but the value will be replaced with “sensitive”.



12337
12338
12339
// File 'service/kms/api.go', line 12337

func (s GetKeyPolicyInput) GoString() string { return s.String() }

func (s *GetKeyPolicyInput) SetKeyId(v string) *GetKeyPolicyInput

SetKeyId sets the KeyId field's value.



12364
12365
12366
12367
// File 'service/kms/api.go', line 12364

func (s *GetKeyPolicyInput) SetKeyId(v string) *GetKeyPolicyInput { s.KeyId = &v return s }

func (s *GetKeyPolicyInput) SetPolicyName(v string) *GetKeyPolicyInput

SetPolicyName sets the PolicyName field's value.



12370
12371
12372
12373
// File 'service/kms/api.go', line 12370

func (s *GetKeyPolicyInput) SetPolicyName(v string) *GetKeyPolicyInput { s.PolicyName = &v return s }

func (s GetKeyPolicyInput) String() string

String returns the string representation.

API parameter values that are decorated as “sensitive” in the API will not be included in the string output. The member name will be present, but the value will be replaced with “sensitive”.



12328
12329
12330
// File 'service/kms/api.go', line 12328

func (s GetKeyPolicyInput) String() string { return awsutil.Prettify(s) }

func (s *GetKeyPolicyInput) Validate() error

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



12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
// File 'service/kms/api.go', line 12342

func (s *GetKeyPolicyInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "GetKeyPolicyInput"} if s.KeyId == nil { invalidParams.Add(request.NewErrParamRequired("KeyId")) } if s.KeyId != nil && len(*s.KeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) } if s.PolicyName == nil { invalidParams.Add(request.NewErrParamRequired("PolicyName")) } if s.PolicyName != nil && len(*s.PolicyName) < 1 { invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil }