mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-02 04:50:49 +00:00
Conver to regular Go vendor + dep tool
This commit is contained in:
+3694
File diff suppressed because it is too large
Load Diff
+144
@@ -0,0 +1,144 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. 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)
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. 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 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. 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)
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. 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"
|
||||
)
|
||||
|
||||
// The service client's operations are safe to be used concurrently.
|
||||
// It is not safe to mutate any of the client's properties though.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudhsm-2014-05-30
|
||||
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