Switch to using the dep tool and update all the dependencies
This commit is contained in:
+3693
File diff suppressed because it is too large
Load Diff
+144
@@ -0,0 +1,144 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package cloudhsmiface provides an interface to enable mocking the Amazon CloudHSM 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.
|
||||
package cloudhsmiface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/cloudhsm"
|
||||
)
|
||||
|
||||
// CloudHSMAPI provides an interface to enable mocking the
|
||||
// cloudhsm.CloudHSM service client's API operation,
|
||||
// paginators, and waiters. This make unit testing your code that calls out
|
||||
// to the SDK's service client's calls easier.
|
||||
//
|
||||
// The best way to use this interface is so the SDK's service client's calls
|
||||
// can be stubbed out for unit testing your code with the SDK without needing
|
||||
// to inject custom request handlers into the the SDK's request pipeline.
|
||||
//
|
||||
// // myFunc uses an SDK service client to make a request to
|
||||
// // Amazon CloudHSM.
|
||||
// func myFunc(svc cloudhsmiface.CloudHSMAPI) bool {
|
||||
// // Make svc.AddTagsToResource request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := cloudhsm.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockCloudHSMClient struct {
|
||||
// cloudhsmiface.CloudHSMAPI
|
||||
// }
|
||||
// func (m *mockCloudHSMClient) AddTagsToResource(input *cloudhsm.AddTagsToResourceInput) (*cloudhsm.AddTagsToResourceOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockCloudHSMClient{}
|
||||
//
|
||||
// myfunc(mockSvc)
|
||||
//
|
||||
// // Verify myFunc's functionality
|
||||
// }
|
||||
//
|
||||
// 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. Its suggested to use the pattern above for testing, or using
|
||||
// tooling to generate mocks to satisfy the interfaces.
|
||||
type CloudHSMAPI interface {
|
||||
AddTagsToResource(*cloudhsm.AddTagsToResourceInput) (*cloudhsm.AddTagsToResourceOutput, error)
|
||||
AddTagsToResourceWithContext(aws.Context, *cloudhsm.AddTagsToResourceInput, ...request.Option) (*cloudhsm.AddTagsToResourceOutput, error)
|
||||
AddTagsToResourceRequest(*cloudhsm.AddTagsToResourceInput) (*request.Request, *cloudhsm.AddTagsToResourceOutput)
|
||||
|
||||
CreateHapg(*cloudhsm.CreateHapgInput) (*cloudhsm.CreateHapgOutput, error)
|
||||
CreateHapgWithContext(aws.Context, *cloudhsm.CreateHapgInput, ...request.Option) (*cloudhsm.CreateHapgOutput, error)
|
||||
CreateHapgRequest(*cloudhsm.CreateHapgInput) (*request.Request, *cloudhsm.CreateHapgOutput)
|
||||
|
||||
CreateHsm(*cloudhsm.CreateHsmInput) (*cloudhsm.CreateHsmOutput, error)
|
||||
CreateHsmWithContext(aws.Context, *cloudhsm.CreateHsmInput, ...request.Option) (*cloudhsm.CreateHsmOutput, error)
|
||||
CreateHsmRequest(*cloudhsm.CreateHsmInput) (*request.Request, *cloudhsm.CreateHsmOutput)
|
||||
|
||||
CreateLunaClient(*cloudhsm.CreateLunaClientInput) (*cloudhsm.CreateLunaClientOutput, error)
|
||||
CreateLunaClientWithContext(aws.Context, *cloudhsm.CreateLunaClientInput, ...request.Option) (*cloudhsm.CreateLunaClientOutput, error)
|
||||
CreateLunaClientRequest(*cloudhsm.CreateLunaClientInput) (*request.Request, *cloudhsm.CreateLunaClientOutput)
|
||||
|
||||
DeleteHapg(*cloudhsm.DeleteHapgInput) (*cloudhsm.DeleteHapgOutput, error)
|
||||
DeleteHapgWithContext(aws.Context, *cloudhsm.DeleteHapgInput, ...request.Option) (*cloudhsm.DeleteHapgOutput, error)
|
||||
DeleteHapgRequest(*cloudhsm.DeleteHapgInput) (*request.Request, *cloudhsm.DeleteHapgOutput)
|
||||
|
||||
DeleteHsm(*cloudhsm.DeleteHsmInput) (*cloudhsm.DeleteHsmOutput, error)
|
||||
DeleteHsmWithContext(aws.Context, *cloudhsm.DeleteHsmInput, ...request.Option) (*cloudhsm.DeleteHsmOutput, error)
|
||||
DeleteHsmRequest(*cloudhsm.DeleteHsmInput) (*request.Request, *cloudhsm.DeleteHsmOutput)
|
||||
|
||||
DeleteLunaClient(*cloudhsm.DeleteLunaClientInput) (*cloudhsm.DeleteLunaClientOutput, error)
|
||||
DeleteLunaClientWithContext(aws.Context, *cloudhsm.DeleteLunaClientInput, ...request.Option) (*cloudhsm.DeleteLunaClientOutput, error)
|
||||
DeleteLunaClientRequest(*cloudhsm.DeleteLunaClientInput) (*request.Request, *cloudhsm.DeleteLunaClientOutput)
|
||||
|
||||
DescribeHapg(*cloudhsm.DescribeHapgInput) (*cloudhsm.DescribeHapgOutput, error)
|
||||
DescribeHapgWithContext(aws.Context, *cloudhsm.DescribeHapgInput, ...request.Option) (*cloudhsm.DescribeHapgOutput, error)
|
||||
DescribeHapgRequest(*cloudhsm.DescribeHapgInput) (*request.Request, *cloudhsm.DescribeHapgOutput)
|
||||
|
||||
DescribeHsm(*cloudhsm.DescribeHsmInput) (*cloudhsm.DescribeHsmOutput, error)
|
||||
DescribeHsmWithContext(aws.Context, *cloudhsm.DescribeHsmInput, ...request.Option) (*cloudhsm.DescribeHsmOutput, error)
|
||||
DescribeHsmRequest(*cloudhsm.DescribeHsmInput) (*request.Request, *cloudhsm.DescribeHsmOutput)
|
||||
|
||||
DescribeLunaClient(*cloudhsm.DescribeLunaClientInput) (*cloudhsm.DescribeLunaClientOutput, error)
|
||||
DescribeLunaClientWithContext(aws.Context, *cloudhsm.DescribeLunaClientInput, ...request.Option) (*cloudhsm.DescribeLunaClientOutput, error)
|
||||
DescribeLunaClientRequest(*cloudhsm.DescribeLunaClientInput) (*request.Request, *cloudhsm.DescribeLunaClientOutput)
|
||||
|
||||
GetConfig(*cloudhsm.GetConfigInput) (*cloudhsm.GetConfigOutput, error)
|
||||
GetConfigWithContext(aws.Context, *cloudhsm.GetConfigInput, ...request.Option) (*cloudhsm.GetConfigOutput, error)
|
||||
GetConfigRequest(*cloudhsm.GetConfigInput) (*request.Request, *cloudhsm.GetConfigOutput)
|
||||
|
||||
ListAvailableZones(*cloudhsm.ListAvailableZonesInput) (*cloudhsm.ListAvailableZonesOutput, error)
|
||||
ListAvailableZonesWithContext(aws.Context, *cloudhsm.ListAvailableZonesInput, ...request.Option) (*cloudhsm.ListAvailableZonesOutput, error)
|
||||
ListAvailableZonesRequest(*cloudhsm.ListAvailableZonesInput) (*request.Request, *cloudhsm.ListAvailableZonesOutput)
|
||||
|
||||
ListHapgs(*cloudhsm.ListHapgsInput) (*cloudhsm.ListHapgsOutput, error)
|
||||
ListHapgsWithContext(aws.Context, *cloudhsm.ListHapgsInput, ...request.Option) (*cloudhsm.ListHapgsOutput, error)
|
||||
ListHapgsRequest(*cloudhsm.ListHapgsInput) (*request.Request, *cloudhsm.ListHapgsOutput)
|
||||
|
||||
ListHsms(*cloudhsm.ListHsmsInput) (*cloudhsm.ListHsmsOutput, error)
|
||||
ListHsmsWithContext(aws.Context, *cloudhsm.ListHsmsInput, ...request.Option) (*cloudhsm.ListHsmsOutput, error)
|
||||
ListHsmsRequest(*cloudhsm.ListHsmsInput) (*request.Request, *cloudhsm.ListHsmsOutput)
|
||||
|
||||
ListLunaClients(*cloudhsm.ListLunaClientsInput) (*cloudhsm.ListLunaClientsOutput, error)
|
||||
ListLunaClientsWithContext(aws.Context, *cloudhsm.ListLunaClientsInput, ...request.Option) (*cloudhsm.ListLunaClientsOutput, error)
|
||||
ListLunaClientsRequest(*cloudhsm.ListLunaClientsInput) (*request.Request, *cloudhsm.ListLunaClientsOutput)
|
||||
|
||||
ListTagsForResource(*cloudhsm.ListTagsForResourceInput) (*cloudhsm.ListTagsForResourceOutput, error)
|
||||
ListTagsForResourceWithContext(aws.Context, *cloudhsm.ListTagsForResourceInput, ...request.Option) (*cloudhsm.ListTagsForResourceOutput, error)
|
||||
ListTagsForResourceRequest(*cloudhsm.ListTagsForResourceInput) (*request.Request, *cloudhsm.ListTagsForResourceOutput)
|
||||
|
||||
ModifyHapg(*cloudhsm.ModifyHapgInput) (*cloudhsm.ModifyHapgOutput, error)
|
||||
ModifyHapgWithContext(aws.Context, *cloudhsm.ModifyHapgInput, ...request.Option) (*cloudhsm.ModifyHapgOutput, error)
|
||||
ModifyHapgRequest(*cloudhsm.ModifyHapgInput) (*request.Request, *cloudhsm.ModifyHapgOutput)
|
||||
|
||||
ModifyHsm(*cloudhsm.ModifyHsmInput) (*cloudhsm.ModifyHsmOutput, error)
|
||||
ModifyHsmWithContext(aws.Context, *cloudhsm.ModifyHsmInput, ...request.Option) (*cloudhsm.ModifyHsmOutput, error)
|
||||
ModifyHsmRequest(*cloudhsm.ModifyHsmInput) (*request.Request, *cloudhsm.ModifyHsmOutput)
|
||||
|
||||
ModifyLunaClient(*cloudhsm.ModifyLunaClientInput) (*cloudhsm.ModifyLunaClientOutput, error)
|
||||
ModifyLunaClientWithContext(aws.Context, *cloudhsm.ModifyLunaClientInput, ...request.Option) (*cloudhsm.ModifyLunaClientOutput, error)
|
||||
ModifyLunaClientRequest(*cloudhsm.ModifyLunaClientInput) (*request.Request, *cloudhsm.ModifyLunaClientOutput)
|
||||
|
||||
RemoveTagsFromResource(*cloudhsm.RemoveTagsFromResourceInput) (*cloudhsm.RemoveTagsFromResourceOutput, error)
|
||||
RemoveTagsFromResourceWithContext(aws.Context, *cloudhsm.RemoveTagsFromResourceInput, ...request.Option) (*cloudhsm.RemoveTagsFromResourceOutput, error)
|
||||
RemoveTagsFromResourceRequest(*cloudhsm.RemoveTagsFromResourceInput) (*request.Request, *cloudhsm.RemoveTagsFromResourceOutput)
|
||||
}
|
||||
|
||||
var _ CloudHSMAPI = (*cloudhsm.CloudHSM)(nil)
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package cloudhsm provides the client and types for making API
|
||||
// requests to Amazon CloudHSM.
|
||||
//
|
||||
// AWS CloudHSM Service
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/cloudhsm-2014-05-30 for more information on this service.
|
||||
//
|
||||
// See cloudhsm package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/cloudhsm/
|
||||
//
|
||||
// Using the Client
|
||||
//
|
||||
// To use the client for Amazon CloudHSM you will first need
|
||||
// to create a new instance of it.
|
||||
//
|
||||
// When creating a client for an AWS service you'll first need to have a Session
|
||||
// already created. The Session provides configuration that can be shared
|
||||
// between multiple service clients. Additional configuration can be applied to
|
||||
// the Session and service's client when they are constructed. The aws package's
|
||||
// Config type contains several fields such as Region for the AWS Region the
|
||||
// client should make API requests too. The optional Config value can be provided
|
||||
// as the variadic argument for Sessions and client creation.
|
||||
//
|
||||
// Once the service's client is created you can use it to make API requests the
|
||||
// AWS service. These clients are safe to use concurrently.
|
||||
//
|
||||
// // Create a session to share configuration, and load external configuration.
|
||||
// sess := session.Must(session.NewSession())
|
||||
//
|
||||
// // Create the service's client with the session.
|
||||
// svc := cloudhsm.New(sess)
|
||||
//
|
||||
// See the SDK's documentation for more information on how to use service clients.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/
|
||||
//
|
||||
// See aws package's Config type for more information on configuration options.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
|
||||
//
|
||||
// See the Amazon CloudHSM client CloudHSM for more
|
||||
// information on creating the service's client.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/cloudhsm/#New
|
||||
//
|
||||
// Once the client is created you can make an API request to the service.
|
||||
// Each API method takes a input parameter, and returns the service response
|
||||
// and an error.
|
||||
//
|
||||
// The API method will document which error codes the service can be returned
|
||||
// by the operation if the service models the API operation's errors. These
|
||||
// errors will also be available as const strings prefixed with "ErrCode".
|
||||
//
|
||||
// result, err := svc.AddTagsToResource(params)
|
||||
// if err != nil {
|
||||
// // Cast err to awserr.Error to handle specific error codes.
|
||||
// aerr, ok := err.(awserr.Error)
|
||||
// if ok && aerr.Code() == <error code to check for> {
|
||||
// // Specific error code handling
|
||||
// }
|
||||
// return err
|
||||
// }
|
||||
//
|
||||
// fmt.Println("AddTagsToResource result:")
|
||||
// fmt.Println(result)
|
||||
//
|
||||
// Using the Client with Context
|
||||
//
|
||||
// The service's client also provides methods to make API requests with a Context
|
||||
// value. This allows you to control the timeout, and cancellation of pending
|
||||
// requests. These methods also take request Option as variadic parameter to apply
|
||||
// additional configuration to the API request.
|
||||
//
|
||||
// ctx := context.Background()
|
||||
//
|
||||
// result, err := svc.AddTagsToResourceWithContext(ctx, params)
|
||||
//
|
||||
// See the request package documentation for more information on using Context pattern
|
||||
// with the SDK.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/aws/request/
|
||||
package cloudhsm
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package cloudhsm
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeCloudHsmInternalException for service response error code
|
||||
// "CloudHsmInternalException".
|
||||
//
|
||||
// Indicates that an internal error occurred.
|
||||
ErrCodeCloudHsmInternalException = "CloudHsmInternalException"
|
||||
|
||||
// ErrCodeCloudHsmServiceException for service response error code
|
||||
// "CloudHsmServiceException".
|
||||
//
|
||||
// Indicates that an exception occurred in the AWS CloudHSM service.
|
||||
ErrCodeCloudHsmServiceException = "CloudHsmServiceException"
|
||||
|
||||
// ErrCodeInvalidRequestException for service response error code
|
||||
// "InvalidRequestException".
|
||||
//
|
||||
// Indicates that one or more of the request parameters are not valid.
|
||||
ErrCodeInvalidRequestException = "InvalidRequestException"
|
||||
)
|
||||
+471
@@ -0,0 +1,471 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package cloudhsm_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
"github.com/aws/aws-sdk-go/service/cloudhsm"
|
||||
)
|
||||
|
||||
var _ time.Duration
|
||||
var _ bytes.Buffer
|
||||
|
||||
func ExampleCloudHSM_AddTagsToResource() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudhsm.New(sess)
|
||||
|
||||
params := &cloudhsm.AddTagsToResourceInput{
|
||||
ResourceArn: aws.String("String"), // Required
|
||||
TagList: []*cloudhsm.Tag{ // Required
|
||||
{ // Required
|
||||
Key: aws.String("TagKey"), // Required
|
||||
Value: aws.String("TagValue"), // Required
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.AddTagsToResource(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudHSM_CreateHapg() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudhsm.New(sess)
|
||||
|
||||
params := &cloudhsm.CreateHapgInput{
|
||||
Label: aws.String("Label"), // Required
|
||||
}
|
||||
resp, err := svc.CreateHapg(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudHSM_CreateHsm() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudhsm.New(sess)
|
||||
|
||||
params := &cloudhsm.CreateHsmInput{
|
||||
IamRoleArn: aws.String("IamRoleArn"), // Required
|
||||
SshKey: aws.String("SshKey"), // Required
|
||||
SubnetId: aws.String("SubnetId"), // Required
|
||||
SubscriptionType: aws.String("SubscriptionType"), // Required
|
||||
ClientToken: aws.String("ClientToken"),
|
||||
EniIp: aws.String("IpAddress"),
|
||||
ExternalId: aws.String("ExternalId"),
|
||||
SyslogIp: aws.String("IpAddress"),
|
||||
}
|
||||
resp, err := svc.CreateHsm(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudHSM_CreateLunaClient() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudhsm.New(sess)
|
||||
|
||||
params := &cloudhsm.CreateLunaClientInput{
|
||||
Certificate: aws.String("Certificate"), // Required
|
||||
Label: aws.String("ClientLabel"),
|
||||
}
|
||||
resp, err := svc.CreateLunaClient(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudHSM_DeleteHapg() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudhsm.New(sess)
|
||||
|
||||
params := &cloudhsm.DeleteHapgInput{
|
||||
HapgArn: aws.String("HapgArn"), // Required
|
||||
}
|
||||
resp, err := svc.DeleteHapg(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudHSM_DeleteHsm() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudhsm.New(sess)
|
||||
|
||||
params := &cloudhsm.DeleteHsmInput{
|
||||
HsmArn: aws.String("HsmArn"), // Required
|
||||
}
|
||||
resp, err := svc.DeleteHsm(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudHSM_DeleteLunaClient() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudhsm.New(sess)
|
||||
|
||||
params := &cloudhsm.DeleteLunaClientInput{
|
||||
ClientArn: aws.String("ClientArn"), // Required
|
||||
}
|
||||
resp, err := svc.DeleteLunaClient(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudHSM_DescribeHapg() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudhsm.New(sess)
|
||||
|
||||
params := &cloudhsm.DescribeHapgInput{
|
||||
HapgArn: aws.String("HapgArn"), // Required
|
||||
}
|
||||
resp, err := svc.DescribeHapg(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudHSM_DescribeHsm() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudhsm.New(sess)
|
||||
|
||||
params := &cloudhsm.DescribeHsmInput{
|
||||
HsmArn: aws.String("HsmArn"),
|
||||
HsmSerialNumber: aws.String("HsmSerialNumber"),
|
||||
}
|
||||
resp, err := svc.DescribeHsm(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudHSM_DescribeLunaClient() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudhsm.New(sess)
|
||||
|
||||
params := &cloudhsm.DescribeLunaClientInput{
|
||||
CertificateFingerprint: aws.String("CertificateFingerprint"),
|
||||
ClientArn: aws.String("ClientArn"),
|
||||
}
|
||||
resp, err := svc.DescribeLunaClient(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudHSM_GetConfig() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudhsm.New(sess)
|
||||
|
||||
params := &cloudhsm.GetConfigInput{
|
||||
ClientArn: aws.String("ClientArn"), // Required
|
||||
ClientVersion: aws.String("ClientVersion"), // Required
|
||||
HapgList: []*string{ // Required
|
||||
aws.String("HapgArn"), // Required
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.GetConfig(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudHSM_ListAvailableZones() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudhsm.New(sess)
|
||||
|
||||
var params *cloudhsm.ListAvailableZonesInput
|
||||
resp, err := svc.ListAvailableZones(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudHSM_ListHapgs() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudhsm.New(sess)
|
||||
|
||||
params := &cloudhsm.ListHapgsInput{
|
||||
NextToken: aws.String("PaginationToken"),
|
||||
}
|
||||
resp, err := svc.ListHapgs(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudHSM_ListHsms() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudhsm.New(sess)
|
||||
|
||||
params := &cloudhsm.ListHsmsInput{
|
||||
NextToken: aws.String("PaginationToken"),
|
||||
}
|
||||
resp, err := svc.ListHsms(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudHSM_ListLunaClients() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudhsm.New(sess)
|
||||
|
||||
params := &cloudhsm.ListLunaClientsInput{
|
||||
NextToken: aws.String("PaginationToken"),
|
||||
}
|
||||
resp, err := svc.ListLunaClients(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudHSM_ListTagsForResource() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudhsm.New(sess)
|
||||
|
||||
params := &cloudhsm.ListTagsForResourceInput{
|
||||
ResourceArn: aws.String("String"), // Required
|
||||
}
|
||||
resp, err := svc.ListTagsForResource(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudHSM_ModifyHapg() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudhsm.New(sess)
|
||||
|
||||
params := &cloudhsm.ModifyHapgInput{
|
||||
HapgArn: aws.String("HapgArn"), // Required
|
||||
Label: aws.String("Label"),
|
||||
PartitionSerialList: []*string{
|
||||
aws.String("PartitionSerial"), // Required
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.ModifyHapg(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudHSM_ModifyHsm() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudhsm.New(sess)
|
||||
|
||||
params := &cloudhsm.ModifyHsmInput{
|
||||
HsmArn: aws.String("HsmArn"), // Required
|
||||
EniIp: aws.String("IpAddress"),
|
||||
ExternalId: aws.String("ExternalId"),
|
||||
IamRoleArn: aws.String("IamRoleArn"),
|
||||
SubnetId: aws.String("SubnetId"),
|
||||
SyslogIp: aws.String("IpAddress"),
|
||||
}
|
||||
resp, err := svc.ModifyHsm(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudHSM_ModifyLunaClient() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudhsm.New(sess)
|
||||
|
||||
params := &cloudhsm.ModifyLunaClientInput{
|
||||
Certificate: aws.String("Certificate"), // Required
|
||||
ClientArn: aws.String("ClientArn"), // Required
|
||||
}
|
||||
resp, err := svc.ModifyLunaClient(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleCloudHSM_RemoveTagsFromResource() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := cloudhsm.New(sess)
|
||||
|
||||
params := &cloudhsm.RemoveTagsFromResourceInput{
|
||||
ResourceArn: aws.String("String"), // Required
|
||||
TagKeyList: []*string{ // Required
|
||||
aws.String("TagKey"), // Required
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.RemoveTagsFromResource(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package cloudhsm
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/client"
|
||||
"github.com/aws/aws-sdk-go/aws/client/metadata"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/aws/signer/v4"
|
||||
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
|
||||
)
|
||||
|
||||
// CloudHSM provides the API operation methods for making requests to
|
||||
// Amazon CloudHSM. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// CloudHSM methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type CloudHSM struct {
|
||||
*client.Client
|
||||
}
|
||||
|
||||
// Used for custom client initialization logic
|
||||
var initClient func(*client.Client)
|
||||
|
||||
// Used for custom request initialization logic
|
||||
var initRequest func(*request.Request)
|
||||
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "cloudhsm" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
|
||||
// New creates a new instance of the CloudHSM client with a session.
|
||||
// If additional configuration is needed for the client instance use the optional
|
||||
// aws.Config parameter to add your extra config.
|
||||
//
|
||||
// Example:
|
||||
// // Create a CloudHSM client from just a session.
|
||||
// svc := cloudhsm.New(mySession)
|
||||
//
|
||||
// // Create a CloudHSM client with additional configuration
|
||||
// svc := cloudhsm.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *CloudHSM {
|
||||
c := p.ClientConfig(EndpointsID, cfgs...)
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *CloudHSM {
|
||||
svc := &CloudHSM{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2014-05-30",
|
||||
JSONVersion: "1.1",
|
||||
TargetPrefix: "CloudHsmFrontendService",
|
||||
},
|
||||
handlers,
|
||||
),
|
||||
}
|
||||
|
||||
// Handlers
|
||||
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
|
||||
svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
|
||||
svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
|
||||
svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
|
||||
svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
|
||||
|
||||
// Run custom client initialization if present
|
||||
if initClient != nil {
|
||||
initClient(svc.Client)
|
||||
}
|
||||
|
||||
return svc
|
||||
}
|
||||
|
||||
// newRequest creates a new request for a CloudHSM operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *CloudHSM) newRequest(op *request.Operation, params, data interface{}) *request.Request {
|
||||
req := c.NewRequest(op, params, data)
|
||||
|
||||
// Run custom request initialization if present
|
||||
if initRequest != nil {
|
||||
initRequest(req)
|
||||
}
|
||||
|
||||
return req
|
||||
}
|
||||
Reference in New Issue
Block a user