1// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3package cloudhsmv2 4 5import ( 6 "fmt" 7 "time" 8 9 "github.com/aws/aws-sdk-go/aws" 10 "github.com/aws/aws-sdk-go/aws/awsutil" 11 "github.com/aws/aws-sdk-go/aws/request" 12) 13 14const opCreateCluster = "CreateCluster" 15 16// CreateClusterRequest generates a "aws/request.Request" representing the 17// client's request for the CreateCluster operation. The "output" return 18// value will be populated with the request's response once the request complets 19// successfuly. 20// 21// Use "Send" method on the returned Request to send the API call to the service. 22// the "output" return value is not valid until after Send returns without error. 23// 24// See CreateCluster for more information on using the CreateCluster 25// API call, and error handling. 26// 27// This method is useful when you want to inject custom logic or configuration 28// into the SDK's request lifecycle. Such as custom headers, or retry logic. 29// 30// 31// // Example sending a request using the CreateClusterRequest method. 32// req, resp := client.CreateClusterRequest(params) 33// 34// err := req.Send() 35// if err == nil { // resp is now filled 36// fmt.Println(resp) 37// } 38// 39// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/CreateCluster 40func (c *CloudHSMV2) CreateClusterRequest(input *CreateClusterInput) (req *request.Request, output *CreateClusterOutput) { 41 op := &request.Operation{ 42 Name: opCreateCluster, 43 HTTPMethod: "POST", 44 HTTPPath: "/", 45 } 46 47 if input == nil { 48 input = &CreateClusterInput{} 49 } 50 51 output = &CreateClusterOutput{} 52 req = c.newRequest(op, input, output) 53 return 54} 55 56// CreateCluster API operation for AWS CloudHSM V2. 57// 58// Creates a new AWS CloudHSM cluster. 59// 60// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 61// with awserr.Error's Code and Message methods to get detailed information about 62// the error. 63// 64// See the AWS API reference guide for AWS CloudHSM V2's 65// API operation CreateCluster for usage and error information. 66// 67// Returned Error Codes: 68// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" 69// The request was rejected because of an AWS CloudHSM internal failure. The 70// request can be retried. 71// 72// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" 73// The request was rejected because an error occurred. 74// 75// * ErrCodeCloudHsmResourceNotFoundException "CloudHsmResourceNotFoundException" 76// The request was rejected because it refers to a resource that cannot be found. 77// 78// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" 79// The request was rejected because it is not a valid request. 80// 81// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" 82// The request was rejected because the requester does not have permission to 83// perform the requested operation. 84// 85// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/CreateCluster 86func (c *CloudHSMV2) CreateCluster(input *CreateClusterInput) (*CreateClusterOutput, error) { 87 req, out := c.CreateClusterRequest(input) 88 return out, req.Send() 89} 90 91// CreateClusterWithContext is the same as CreateCluster with the addition of 92// the ability to pass a context and additional request options. 93// 94// See CreateCluster for details on how to use this API operation. 95// 96// The context must be non-nil and will be used for request cancellation. If 97// the context is nil a panic will occur. In the future the SDK may create 98// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 99// for more information on using Contexts. 100func (c *CloudHSMV2) CreateClusterWithContext(ctx aws.Context, input *CreateClusterInput, opts ...request.Option) (*CreateClusterOutput, error) { 101 req, out := c.CreateClusterRequest(input) 102 req.SetContext(ctx) 103 req.ApplyOptions(opts...) 104 return out, req.Send() 105} 106 107const opCreateHsm = "CreateHsm" 108 109// CreateHsmRequest generates a "aws/request.Request" representing the 110// client's request for the CreateHsm operation. The "output" return 111// value will be populated with the request's response once the request complets 112// successfuly. 113// 114// Use "Send" method on the returned Request to send the API call to the service. 115// the "output" return value is not valid until after Send returns without error. 116// 117// See CreateHsm for more information on using the CreateHsm 118// API call, and error handling. 119// 120// This method is useful when you want to inject custom logic or configuration 121// into the SDK's request lifecycle. Such as custom headers, or retry logic. 122// 123// 124// // Example sending a request using the CreateHsmRequest method. 125// req, resp := client.CreateHsmRequest(params) 126// 127// err := req.Send() 128// if err == nil { // resp is now filled 129// fmt.Println(resp) 130// } 131// 132// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/CreateHsm 133func (c *CloudHSMV2) CreateHsmRequest(input *CreateHsmInput) (req *request.Request, output *CreateHsmOutput) { 134 op := &request.Operation{ 135 Name: opCreateHsm, 136 HTTPMethod: "POST", 137 HTTPPath: "/", 138 } 139 140 if input == nil { 141 input = &CreateHsmInput{} 142 } 143 144 output = &CreateHsmOutput{} 145 req = c.newRequest(op, input, output) 146 return 147} 148 149// CreateHsm API operation for AWS CloudHSM V2. 150// 151// Creates a new hardware security module (HSM) in the specified AWS CloudHSM 152// cluster. 153// 154// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 155// with awserr.Error's Code and Message methods to get detailed information about 156// the error. 157// 158// See the AWS API reference guide for AWS CloudHSM V2's 159// API operation CreateHsm for usage and error information. 160// 161// Returned Error Codes: 162// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" 163// The request was rejected because of an AWS CloudHSM internal failure. The 164// request can be retried. 165// 166// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" 167// The request was rejected because an error occurred. 168// 169// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" 170// The request was rejected because it is not a valid request. 171// 172// * ErrCodeCloudHsmResourceNotFoundException "CloudHsmResourceNotFoundException" 173// The request was rejected because it refers to a resource that cannot be found. 174// 175// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" 176// The request was rejected because the requester does not have permission to 177// perform the requested operation. 178// 179// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/CreateHsm 180func (c *CloudHSMV2) CreateHsm(input *CreateHsmInput) (*CreateHsmOutput, error) { 181 req, out := c.CreateHsmRequest(input) 182 return out, req.Send() 183} 184 185// CreateHsmWithContext is the same as CreateHsm with the addition of 186// the ability to pass a context and additional request options. 187// 188// See CreateHsm for details on how to use this API operation. 189// 190// The context must be non-nil and will be used for request cancellation. If 191// the context is nil a panic will occur. In the future the SDK may create 192// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 193// for more information on using Contexts. 194func (c *CloudHSMV2) CreateHsmWithContext(ctx aws.Context, input *CreateHsmInput, opts ...request.Option) (*CreateHsmOutput, error) { 195 req, out := c.CreateHsmRequest(input) 196 req.SetContext(ctx) 197 req.ApplyOptions(opts...) 198 return out, req.Send() 199} 200 201const opDeleteCluster = "DeleteCluster" 202 203// DeleteClusterRequest generates a "aws/request.Request" representing the 204// client's request for the DeleteCluster operation. The "output" return 205// value will be populated with the request's response once the request complets 206// successfuly. 207// 208// Use "Send" method on the returned Request to send the API call to the service. 209// the "output" return value is not valid until after Send returns without error. 210// 211// See DeleteCluster for more information on using the DeleteCluster 212// API call, and error handling. 213// 214// This method is useful when you want to inject custom logic or configuration 215// into the SDK's request lifecycle. Such as custom headers, or retry logic. 216// 217// 218// // Example sending a request using the DeleteClusterRequest method. 219// req, resp := client.DeleteClusterRequest(params) 220// 221// err := req.Send() 222// if err == nil { // resp is now filled 223// fmt.Println(resp) 224// } 225// 226// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DeleteCluster 227func (c *CloudHSMV2) DeleteClusterRequest(input *DeleteClusterInput) (req *request.Request, output *DeleteClusterOutput) { 228 op := &request.Operation{ 229 Name: opDeleteCluster, 230 HTTPMethod: "POST", 231 HTTPPath: "/", 232 } 233 234 if input == nil { 235 input = &DeleteClusterInput{} 236 } 237 238 output = &DeleteClusterOutput{} 239 req = c.newRequest(op, input, output) 240 return 241} 242 243// DeleteCluster API operation for AWS CloudHSM V2. 244// 245// Deletes the specified AWS CloudHSM cluster. Before you can delete a cluster, 246// you must delete all HSMs in the cluster. To see if the cluster contains any 247// HSMs, use DescribeClusters. To delete an HSM, use DeleteHsm. 248// 249// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 250// with awserr.Error's Code and Message methods to get detailed information about 251// the error. 252// 253// See the AWS API reference guide for AWS CloudHSM V2's 254// API operation DeleteCluster for usage and error information. 255// 256// Returned Error Codes: 257// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" 258// The request was rejected because of an AWS CloudHSM internal failure. The 259// request can be retried. 260// 261// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" 262// The request was rejected because an error occurred. 263// 264// * ErrCodeCloudHsmResourceNotFoundException "CloudHsmResourceNotFoundException" 265// The request was rejected because it refers to a resource that cannot be found. 266// 267// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" 268// The request was rejected because it is not a valid request. 269// 270// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" 271// The request was rejected because the requester does not have permission to 272// perform the requested operation. 273// 274// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DeleteCluster 275func (c *CloudHSMV2) DeleteCluster(input *DeleteClusterInput) (*DeleteClusterOutput, error) { 276 req, out := c.DeleteClusterRequest(input) 277 return out, req.Send() 278} 279 280// DeleteClusterWithContext is the same as DeleteCluster with the addition of 281// the ability to pass a context and additional request options. 282// 283// See DeleteCluster for details on how to use this API operation. 284// 285// The context must be non-nil and will be used for request cancellation. If 286// the context is nil a panic will occur. In the future the SDK may create 287// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 288// for more information on using Contexts. 289func (c *CloudHSMV2) DeleteClusterWithContext(ctx aws.Context, input *DeleteClusterInput, opts ...request.Option) (*DeleteClusterOutput, error) { 290 req, out := c.DeleteClusterRequest(input) 291 req.SetContext(ctx) 292 req.ApplyOptions(opts...) 293 return out, req.Send() 294} 295 296const opDeleteHsm = "DeleteHsm" 297 298// DeleteHsmRequest generates a "aws/request.Request" representing the 299// client's request for the DeleteHsm operation. The "output" return 300// value will be populated with the request's response once the request complets 301// successfuly. 302// 303// Use "Send" method on the returned Request to send the API call to the service. 304// the "output" return value is not valid until after Send returns without error. 305// 306// See DeleteHsm for more information on using the DeleteHsm 307// API call, and error handling. 308// 309// This method is useful when you want to inject custom logic or configuration 310// into the SDK's request lifecycle. Such as custom headers, or retry logic. 311// 312// 313// // Example sending a request using the DeleteHsmRequest method. 314// req, resp := client.DeleteHsmRequest(params) 315// 316// err := req.Send() 317// if err == nil { // resp is now filled 318// fmt.Println(resp) 319// } 320// 321// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DeleteHsm 322func (c *CloudHSMV2) DeleteHsmRequest(input *DeleteHsmInput) (req *request.Request, output *DeleteHsmOutput) { 323 op := &request.Operation{ 324 Name: opDeleteHsm, 325 HTTPMethod: "POST", 326 HTTPPath: "/", 327 } 328 329 if input == nil { 330 input = &DeleteHsmInput{} 331 } 332 333 output = &DeleteHsmOutput{} 334 req = c.newRequest(op, input, output) 335 return 336} 337 338// DeleteHsm API operation for AWS CloudHSM V2. 339// 340// Deletes the specified HSM. To specify an HSM, you can use its identifier 341// (ID), the IP address of the HSM's elastic network interface (ENI), or the 342// ID of the HSM's ENI. You need to specify only one of these values. To find 343// these values, use DescribeClusters. 344// 345// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 346// with awserr.Error's Code and Message methods to get detailed information about 347// the error. 348// 349// See the AWS API reference guide for AWS CloudHSM V2's 350// API operation DeleteHsm for usage and error information. 351// 352// Returned Error Codes: 353// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" 354// The request was rejected because of an AWS CloudHSM internal failure. The 355// request can be retried. 356// 357// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" 358// The request was rejected because an error occurred. 359// 360// * ErrCodeCloudHsmResourceNotFoundException "CloudHsmResourceNotFoundException" 361// The request was rejected because it refers to a resource that cannot be found. 362// 363// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" 364// The request was rejected because it is not a valid request. 365// 366// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" 367// The request was rejected because the requester does not have permission to 368// perform the requested operation. 369// 370// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DeleteHsm 371func (c *CloudHSMV2) DeleteHsm(input *DeleteHsmInput) (*DeleteHsmOutput, error) { 372 req, out := c.DeleteHsmRequest(input) 373 return out, req.Send() 374} 375 376// DeleteHsmWithContext is the same as DeleteHsm with the addition of 377// the ability to pass a context and additional request options. 378// 379// See DeleteHsm for details on how to use this API operation. 380// 381// The context must be non-nil and will be used for request cancellation. If 382// the context is nil a panic will occur. In the future the SDK may create 383// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 384// for more information on using Contexts. 385func (c *CloudHSMV2) DeleteHsmWithContext(ctx aws.Context, input *DeleteHsmInput, opts ...request.Option) (*DeleteHsmOutput, error) { 386 req, out := c.DeleteHsmRequest(input) 387 req.SetContext(ctx) 388 req.ApplyOptions(opts...) 389 return out, req.Send() 390} 391 392const opDescribeBackups = "DescribeBackups" 393 394// DescribeBackupsRequest generates a "aws/request.Request" representing the 395// client's request for the DescribeBackups operation. The "output" return 396// value will be populated with the request's response once the request complets 397// successfuly. 398// 399// Use "Send" method on the returned Request to send the API call to the service. 400// the "output" return value is not valid until after Send returns without error. 401// 402// See DescribeBackups for more information on using the DescribeBackups 403// API call, and error handling. 404// 405// This method is useful when you want to inject custom logic or configuration 406// into the SDK's request lifecycle. Such as custom headers, or retry logic. 407// 408// 409// // Example sending a request using the DescribeBackupsRequest method. 410// req, resp := client.DescribeBackupsRequest(params) 411// 412// err := req.Send() 413// if err == nil { // resp is now filled 414// fmt.Println(resp) 415// } 416// 417// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DescribeBackups 418func (c *CloudHSMV2) DescribeBackupsRequest(input *DescribeBackupsInput) (req *request.Request, output *DescribeBackupsOutput) { 419 op := &request.Operation{ 420 Name: opDescribeBackups, 421 HTTPMethod: "POST", 422 HTTPPath: "/", 423 Paginator: &request.Paginator{ 424 InputTokens: []string{"NextToken"}, 425 OutputTokens: []string{"NextToken"}, 426 LimitToken: "MaxResults", 427 TruncationToken: "", 428 }, 429 } 430 431 if input == nil { 432 input = &DescribeBackupsInput{} 433 } 434 435 output = &DescribeBackupsOutput{} 436 req = c.newRequest(op, input, output) 437 return 438} 439 440// DescribeBackups API operation for AWS CloudHSM V2. 441// 442// Gets information about backups of AWS CloudHSM clusters. 443// 444// This is a paginated operation, which means that each response might contain 445// only a subset of all the backups. When the response contains only a subset 446// of backups, it includes a NextToken value. Use this value in a subsequent 447// DescribeBackups request to get more backups. When you receive a response 448// with no NextToken (or an empty or null value), that means there are no more 449// backups to get. 450// 451// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 452// with awserr.Error's Code and Message methods to get detailed information about 453// the error. 454// 455// See the AWS API reference guide for AWS CloudHSM V2's 456// API operation DescribeBackups for usage and error information. 457// 458// Returned Error Codes: 459// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" 460// The request was rejected because of an AWS CloudHSM internal failure. The 461// request can be retried. 462// 463// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" 464// The request was rejected because an error occurred. 465// 466// * ErrCodeCloudHsmResourceNotFoundException "CloudHsmResourceNotFoundException" 467// The request was rejected because it refers to a resource that cannot be found. 468// 469// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" 470// The request was rejected because it is not a valid request. 471// 472// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" 473// The request was rejected because the requester does not have permission to 474// perform the requested operation. 475// 476// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DescribeBackups 477func (c *CloudHSMV2) DescribeBackups(input *DescribeBackupsInput) (*DescribeBackupsOutput, error) { 478 req, out := c.DescribeBackupsRequest(input) 479 return out, req.Send() 480} 481 482// DescribeBackupsWithContext is the same as DescribeBackups with the addition of 483// the ability to pass a context and additional request options. 484// 485// See DescribeBackups for details on how to use this API operation. 486// 487// The context must be non-nil and will be used for request cancellation. If 488// the context is nil a panic will occur. In the future the SDK may create 489// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 490// for more information on using Contexts. 491func (c *CloudHSMV2) DescribeBackupsWithContext(ctx aws.Context, input *DescribeBackupsInput, opts ...request.Option) (*DescribeBackupsOutput, error) { 492 req, out := c.DescribeBackupsRequest(input) 493 req.SetContext(ctx) 494 req.ApplyOptions(opts...) 495 return out, req.Send() 496} 497 498// DescribeBackupsPages iterates over the pages of a DescribeBackups operation, 499// calling the "fn" function with the response data for each page. To stop 500// iterating, return false from the fn function. 501// 502// See DescribeBackups method for more information on how to use this operation. 503// 504// Note: This operation can generate multiple requests to a service. 505// 506// // Example iterating over at most 3 pages of a DescribeBackups operation. 507// pageNum := 0 508// err := client.DescribeBackupsPages(params, 509// func(page *DescribeBackupsOutput, lastPage bool) bool { 510// pageNum++ 511// fmt.Println(page) 512// return pageNum <= 3 513// }) 514// 515func (c *CloudHSMV2) DescribeBackupsPages(input *DescribeBackupsInput, fn func(*DescribeBackupsOutput, bool) bool) error { 516 return c.DescribeBackupsPagesWithContext(aws.BackgroundContext(), input, fn) 517} 518 519// DescribeBackupsPagesWithContext same as DescribeBackupsPages except 520// it takes a Context and allows setting request options on the pages. 521// 522// The context must be non-nil and will be used for request cancellation. If 523// the context is nil a panic will occur. In the future the SDK may create 524// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 525// for more information on using Contexts. 526func (c *CloudHSMV2) DescribeBackupsPagesWithContext(ctx aws.Context, input *DescribeBackupsInput, fn func(*DescribeBackupsOutput, bool) bool, opts ...request.Option) error { 527 p := request.Pagination{ 528 NewRequest: func() (*request.Request, error) { 529 var inCpy *DescribeBackupsInput 530 if input != nil { 531 tmp := *input 532 inCpy = &tmp 533 } 534 req, _ := c.DescribeBackupsRequest(inCpy) 535 req.SetContext(ctx) 536 req.ApplyOptions(opts...) 537 return req, nil 538 }, 539 } 540 541 cont := true 542 for p.Next() && cont { 543 cont = fn(p.Page().(*DescribeBackupsOutput), !p.HasNextPage()) 544 } 545 return p.Err() 546} 547 548const opDescribeClusters = "DescribeClusters" 549 550// DescribeClustersRequest generates a "aws/request.Request" representing the 551// client's request for the DescribeClusters operation. The "output" return 552// value will be populated with the request's response once the request complets 553// successfuly. 554// 555// Use "Send" method on the returned Request to send the API call to the service. 556// the "output" return value is not valid until after Send returns without error. 557// 558// See DescribeClusters for more information on using the DescribeClusters 559// API call, and error handling. 560// 561// This method is useful when you want to inject custom logic or configuration 562// into the SDK's request lifecycle. Such as custom headers, or retry logic. 563// 564// 565// // Example sending a request using the DescribeClustersRequest method. 566// req, resp := client.DescribeClustersRequest(params) 567// 568// err := req.Send() 569// if err == nil { // resp is now filled 570// fmt.Println(resp) 571// } 572// 573// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DescribeClusters 574func (c *CloudHSMV2) DescribeClustersRequest(input *DescribeClustersInput) (req *request.Request, output *DescribeClustersOutput) { 575 op := &request.Operation{ 576 Name: opDescribeClusters, 577 HTTPMethod: "POST", 578 HTTPPath: "/", 579 Paginator: &request.Paginator{ 580 InputTokens: []string{"NextToken"}, 581 OutputTokens: []string{"NextToken"}, 582 LimitToken: "MaxResults", 583 TruncationToken: "", 584 }, 585 } 586 587 if input == nil { 588 input = &DescribeClustersInput{} 589 } 590 591 output = &DescribeClustersOutput{} 592 req = c.newRequest(op, input, output) 593 return 594} 595 596// DescribeClusters API operation for AWS CloudHSM V2. 597// 598// Gets information about AWS CloudHSM clusters. 599// 600// This is a paginated operation, which means that each response might contain 601// only a subset of all the clusters. When the response contains only a subset 602// of clusters, it includes a NextToken value. Use this value in a subsequent 603// DescribeClusters request to get more clusters. When you receive a response 604// with no NextToken (or an empty or null value), that means there are no more 605// clusters to get. 606// 607// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 608// with awserr.Error's Code and Message methods to get detailed information about 609// the error. 610// 611// See the AWS API reference guide for AWS CloudHSM V2's 612// API operation DescribeClusters for usage and error information. 613// 614// Returned Error Codes: 615// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" 616// The request was rejected because of an AWS CloudHSM internal failure. The 617// request can be retried. 618// 619// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" 620// The request was rejected because an error occurred. 621// 622// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" 623// The request was rejected because it is not a valid request. 624// 625// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" 626// The request was rejected because the requester does not have permission to 627// perform the requested operation. 628// 629// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DescribeClusters 630func (c *CloudHSMV2) DescribeClusters(input *DescribeClustersInput) (*DescribeClustersOutput, error) { 631 req, out := c.DescribeClustersRequest(input) 632 return out, req.Send() 633} 634 635// DescribeClustersWithContext is the same as DescribeClusters with the addition of 636// the ability to pass a context and additional request options. 637// 638// See DescribeClusters for details on how to use this API operation. 639// 640// The context must be non-nil and will be used for request cancellation. If 641// the context is nil a panic will occur. In the future the SDK may create 642// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 643// for more information on using Contexts. 644func (c *CloudHSMV2) DescribeClustersWithContext(ctx aws.Context, input *DescribeClustersInput, opts ...request.Option) (*DescribeClustersOutput, error) { 645 req, out := c.DescribeClustersRequest(input) 646 req.SetContext(ctx) 647 req.ApplyOptions(opts...) 648 return out, req.Send() 649} 650 651// DescribeClustersPages iterates over the pages of a DescribeClusters operation, 652// calling the "fn" function with the response data for each page. To stop 653// iterating, return false from the fn function. 654// 655// See DescribeClusters method for more information on how to use this operation. 656// 657// Note: This operation can generate multiple requests to a service. 658// 659// // Example iterating over at most 3 pages of a DescribeClusters operation. 660// pageNum := 0 661// err := client.DescribeClustersPages(params, 662// func(page *DescribeClustersOutput, lastPage bool) bool { 663// pageNum++ 664// fmt.Println(page) 665// return pageNum <= 3 666// }) 667// 668func (c *CloudHSMV2) DescribeClustersPages(input *DescribeClustersInput, fn func(*DescribeClustersOutput, bool) bool) error { 669 return c.DescribeClustersPagesWithContext(aws.BackgroundContext(), input, fn) 670} 671 672// DescribeClustersPagesWithContext same as DescribeClustersPages except 673// it takes a Context and allows setting request options on the pages. 674// 675// The context must be non-nil and will be used for request cancellation. If 676// the context is nil a panic will occur. In the future the SDK may create 677// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 678// for more information on using Contexts. 679func (c *CloudHSMV2) DescribeClustersPagesWithContext(ctx aws.Context, input *DescribeClustersInput, fn func(*DescribeClustersOutput, bool) bool, opts ...request.Option) error { 680 p := request.Pagination{ 681 NewRequest: func() (*request.Request, error) { 682 var inCpy *DescribeClustersInput 683 if input != nil { 684 tmp := *input 685 inCpy = &tmp 686 } 687 req, _ := c.DescribeClustersRequest(inCpy) 688 req.SetContext(ctx) 689 req.ApplyOptions(opts...) 690 return req, nil 691 }, 692 } 693 694 cont := true 695 for p.Next() && cont { 696 cont = fn(p.Page().(*DescribeClustersOutput), !p.HasNextPage()) 697 } 698 return p.Err() 699} 700 701const opInitializeCluster = "InitializeCluster" 702 703// InitializeClusterRequest generates a "aws/request.Request" representing the 704// client's request for the InitializeCluster operation. The "output" return 705// value will be populated with the request's response once the request complets 706// successfuly. 707// 708// Use "Send" method on the returned Request to send the API call to the service. 709// the "output" return value is not valid until after Send returns without error. 710// 711// See InitializeCluster for more information on using the InitializeCluster 712// API call, and error handling. 713// 714// This method is useful when you want to inject custom logic or configuration 715// into the SDK's request lifecycle. Such as custom headers, or retry logic. 716// 717// 718// // Example sending a request using the InitializeClusterRequest method. 719// req, resp := client.InitializeClusterRequest(params) 720// 721// err := req.Send() 722// if err == nil { // resp is now filled 723// fmt.Println(resp) 724// } 725// 726// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/InitializeCluster 727func (c *CloudHSMV2) InitializeClusterRequest(input *InitializeClusterInput) (req *request.Request, output *InitializeClusterOutput) { 728 op := &request.Operation{ 729 Name: opInitializeCluster, 730 HTTPMethod: "POST", 731 HTTPPath: "/", 732 } 733 734 if input == nil { 735 input = &InitializeClusterInput{} 736 } 737 738 output = &InitializeClusterOutput{} 739 req = c.newRequest(op, input, output) 740 return 741} 742 743// InitializeCluster API operation for AWS CloudHSM V2. 744// 745// Claims an AWS CloudHSM cluster by submitting the cluster certificate issued 746// by your issuing certificate authority (CA) and the CA's root certificate. 747// Before you can claim a cluster, you must sign the cluster's certificate signing 748// request (CSR) with your issuing CA. To get the cluster's CSR, use DescribeClusters. 749// 750// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 751// with awserr.Error's Code and Message methods to get detailed information about 752// the error. 753// 754// See the AWS API reference guide for AWS CloudHSM V2's 755// API operation InitializeCluster for usage and error information. 756// 757// Returned Error Codes: 758// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" 759// The request was rejected because of an AWS CloudHSM internal failure. The 760// request can be retried. 761// 762// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" 763// The request was rejected because an error occurred. 764// 765// * ErrCodeCloudHsmResourceNotFoundException "CloudHsmResourceNotFoundException" 766// The request was rejected because it refers to a resource that cannot be found. 767// 768// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" 769// The request was rejected because it is not a valid request. 770// 771// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" 772// The request was rejected because the requester does not have permission to 773// perform the requested operation. 774// 775// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/InitializeCluster 776func (c *CloudHSMV2) InitializeCluster(input *InitializeClusterInput) (*InitializeClusterOutput, error) { 777 req, out := c.InitializeClusterRequest(input) 778 return out, req.Send() 779} 780 781// InitializeClusterWithContext is the same as InitializeCluster with the addition of 782// the ability to pass a context and additional request options. 783// 784// See InitializeCluster for details on how to use this API operation. 785// 786// The context must be non-nil and will be used for request cancellation. If 787// the context is nil a panic will occur. In the future the SDK may create 788// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 789// for more information on using Contexts. 790func (c *CloudHSMV2) InitializeClusterWithContext(ctx aws.Context, input *InitializeClusterInput, opts ...request.Option) (*InitializeClusterOutput, error) { 791 req, out := c.InitializeClusterRequest(input) 792 req.SetContext(ctx) 793 req.ApplyOptions(opts...) 794 return out, req.Send() 795} 796 797const opListTags = "ListTags" 798 799// ListTagsRequest generates a "aws/request.Request" representing the 800// client's request for the ListTags operation. The "output" return 801// value will be populated with the request's response once the request complets 802// successfuly. 803// 804// Use "Send" method on the returned Request to send the API call to the service. 805// the "output" return value is not valid until after Send returns without error. 806// 807// See ListTags for more information on using the ListTags 808// API call, and error handling. 809// 810// This method is useful when you want to inject custom logic or configuration 811// into the SDK's request lifecycle. Such as custom headers, or retry logic. 812// 813// 814// // Example sending a request using the ListTagsRequest method. 815// req, resp := client.ListTagsRequest(params) 816// 817// err := req.Send() 818// if err == nil { // resp is now filled 819// fmt.Println(resp) 820// } 821// 822// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/ListTags 823func (c *CloudHSMV2) ListTagsRequest(input *ListTagsInput) (req *request.Request, output *ListTagsOutput) { 824 op := &request.Operation{ 825 Name: opListTags, 826 HTTPMethod: "POST", 827 HTTPPath: "/", 828 Paginator: &request.Paginator{ 829 InputTokens: []string{"NextToken"}, 830 OutputTokens: []string{"NextToken"}, 831 LimitToken: "MaxResults", 832 TruncationToken: "", 833 }, 834 } 835 836 if input == nil { 837 input = &ListTagsInput{} 838 } 839 840 output = &ListTagsOutput{} 841 req = c.newRequest(op, input, output) 842 return 843} 844 845// ListTags API operation for AWS CloudHSM V2. 846// 847// Gets a list of tags for the specified AWS CloudHSM cluster. 848// 849// This is a paginated operation, which means that each response might contain 850// only a subset of all the tags. When the response contains only a subset of 851// tags, it includes a NextToken value. Use this value in a subsequent ListTags 852// request to get more tags. When you receive a response with no NextToken (or 853// an empty or null value), that means there are no more tags to get. 854// 855// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 856// with awserr.Error's Code and Message methods to get detailed information about 857// the error. 858// 859// See the AWS API reference guide for AWS CloudHSM V2's 860// API operation ListTags for usage and error information. 861// 862// Returned Error Codes: 863// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" 864// The request was rejected because of an AWS CloudHSM internal failure. The 865// request can be retried. 866// 867// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" 868// The request was rejected because an error occurred. 869// 870// * ErrCodeCloudHsmResourceNotFoundException "CloudHsmResourceNotFoundException" 871// The request was rejected because it refers to a resource that cannot be found. 872// 873// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" 874// The request was rejected because it is not a valid request. 875// 876// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" 877// The request was rejected because the requester does not have permission to 878// perform the requested operation. 879// 880// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/ListTags 881func (c *CloudHSMV2) ListTags(input *ListTagsInput) (*ListTagsOutput, error) { 882 req, out := c.ListTagsRequest(input) 883 return out, req.Send() 884} 885 886// ListTagsWithContext is the same as ListTags with the addition of 887// the ability to pass a context and additional request options. 888// 889// See ListTags for details on how to use this API operation. 890// 891// The context must be non-nil and will be used for request cancellation. If 892// the context is nil a panic will occur. In the future the SDK may create 893// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 894// for more information on using Contexts. 895func (c *CloudHSMV2) ListTagsWithContext(ctx aws.Context, input *ListTagsInput, opts ...request.Option) (*ListTagsOutput, error) { 896 req, out := c.ListTagsRequest(input) 897 req.SetContext(ctx) 898 req.ApplyOptions(opts...) 899 return out, req.Send() 900} 901 902// ListTagsPages iterates over the pages of a ListTags operation, 903// calling the "fn" function with the response data for each page. To stop 904// iterating, return false from the fn function. 905// 906// See ListTags method for more information on how to use this operation. 907// 908// Note: This operation can generate multiple requests to a service. 909// 910// // Example iterating over at most 3 pages of a ListTags operation. 911// pageNum := 0 912// err := client.ListTagsPages(params, 913// func(page *ListTagsOutput, lastPage bool) bool { 914// pageNum++ 915// fmt.Println(page) 916// return pageNum <= 3 917// }) 918// 919func (c *CloudHSMV2) ListTagsPages(input *ListTagsInput, fn func(*ListTagsOutput, bool) bool) error { 920 return c.ListTagsPagesWithContext(aws.BackgroundContext(), input, fn) 921} 922 923// ListTagsPagesWithContext same as ListTagsPages except 924// it takes a Context and allows setting request options on the pages. 925// 926// The context must be non-nil and will be used for request cancellation. If 927// the context is nil a panic will occur. In the future the SDK may create 928// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 929// for more information on using Contexts. 930func (c *CloudHSMV2) ListTagsPagesWithContext(ctx aws.Context, input *ListTagsInput, fn func(*ListTagsOutput, bool) bool, opts ...request.Option) error { 931 p := request.Pagination{ 932 NewRequest: func() (*request.Request, error) { 933 var inCpy *ListTagsInput 934 if input != nil { 935 tmp := *input 936 inCpy = &tmp 937 } 938 req, _ := c.ListTagsRequest(inCpy) 939 req.SetContext(ctx) 940 req.ApplyOptions(opts...) 941 return req, nil 942 }, 943 } 944 945 cont := true 946 for p.Next() && cont { 947 cont = fn(p.Page().(*ListTagsOutput), !p.HasNextPage()) 948 } 949 return p.Err() 950} 951 952const opTagResource = "TagResource" 953 954// TagResourceRequest generates a "aws/request.Request" representing the 955// client's request for the TagResource operation. The "output" return 956// value will be populated with the request's response once the request complets 957// successfuly. 958// 959// Use "Send" method on the returned Request to send the API call to the service. 960// the "output" return value is not valid until after Send returns without error. 961// 962// See TagResource for more information on using the TagResource 963// API call, and error handling. 964// 965// This method is useful when you want to inject custom logic or configuration 966// into the SDK's request lifecycle. Such as custom headers, or retry logic. 967// 968// 969// // Example sending a request using the TagResourceRequest method. 970// req, resp := client.TagResourceRequest(params) 971// 972// err := req.Send() 973// if err == nil { // resp is now filled 974// fmt.Println(resp) 975// } 976// 977// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/TagResource 978func (c *CloudHSMV2) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { 979 op := &request.Operation{ 980 Name: opTagResource, 981 HTTPMethod: "POST", 982 HTTPPath: "/", 983 } 984 985 if input == nil { 986 input = &TagResourceInput{} 987 } 988 989 output = &TagResourceOutput{} 990 req = c.newRequest(op, input, output) 991 return 992} 993 994// TagResource API operation for AWS CloudHSM V2. 995// 996// Adds or overwrites one or more tags for the specified AWS CloudHSM cluster. 997// 998// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 999// with awserr.Error's Code and Message methods to get detailed information about 1000// the error. 1001// 1002// See the AWS API reference guide for AWS CloudHSM V2's 1003// API operation TagResource for usage and error information. 1004// 1005// Returned Error Codes: 1006// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" 1007// The request was rejected because of an AWS CloudHSM internal failure. The 1008// request can be retried. 1009// 1010// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" 1011// The request was rejected because an error occurred. 1012// 1013// * ErrCodeCloudHsmResourceNotFoundException "CloudHsmResourceNotFoundException" 1014// The request was rejected because it refers to a resource that cannot be found. 1015// 1016// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" 1017// The request was rejected because it is not a valid request. 1018// 1019// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" 1020// The request was rejected because the requester does not have permission to 1021// perform the requested operation. 1022// 1023// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/TagResource 1024func (c *CloudHSMV2) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { 1025 req, out := c.TagResourceRequest(input) 1026 return out, req.Send() 1027} 1028 1029// TagResourceWithContext is the same as TagResource with the addition of 1030// the ability to pass a context and additional request options. 1031// 1032// See TagResource for details on how to use this API operation. 1033// 1034// The context must be non-nil and will be used for request cancellation. If 1035// the context is nil a panic will occur. In the future the SDK may create 1036// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1037// for more information on using Contexts. 1038func (c *CloudHSMV2) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { 1039 req, out := c.TagResourceRequest(input) 1040 req.SetContext(ctx) 1041 req.ApplyOptions(opts...) 1042 return out, req.Send() 1043} 1044 1045const opUntagResource = "UntagResource" 1046 1047// UntagResourceRequest generates a "aws/request.Request" representing the 1048// client's request for the UntagResource operation. The "output" return 1049// value will be populated with the request's response once the request complets 1050// successfuly. 1051// 1052// Use "Send" method on the returned Request to send the API call to the service. 1053// the "output" return value is not valid until after Send returns without error. 1054// 1055// See UntagResource for more information on using the UntagResource 1056// API call, and error handling. 1057// 1058// This method is useful when you want to inject custom logic or configuration 1059// into the SDK's request lifecycle. Such as custom headers, or retry logic. 1060// 1061// 1062// // Example sending a request using the UntagResourceRequest method. 1063// req, resp := client.UntagResourceRequest(params) 1064// 1065// err := req.Send() 1066// if err == nil { // resp is now filled 1067// fmt.Println(resp) 1068// } 1069// 1070// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/UntagResource 1071func (c *CloudHSMV2) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { 1072 op := &request.Operation{ 1073 Name: opUntagResource, 1074 HTTPMethod: "POST", 1075 HTTPPath: "/", 1076 } 1077 1078 if input == nil { 1079 input = &UntagResourceInput{} 1080 } 1081 1082 output = &UntagResourceOutput{} 1083 req = c.newRequest(op, input, output) 1084 return 1085} 1086 1087// UntagResource API operation for AWS CloudHSM V2. 1088// 1089// Removes the specified tag or tags from the specified AWS CloudHSM cluster. 1090// 1091// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 1092// with awserr.Error's Code and Message methods to get detailed information about 1093// the error. 1094// 1095// See the AWS API reference guide for AWS CloudHSM V2's 1096// API operation UntagResource for usage and error information. 1097// 1098// Returned Error Codes: 1099// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" 1100// The request was rejected because of an AWS CloudHSM internal failure. The 1101// request can be retried. 1102// 1103// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" 1104// The request was rejected because an error occurred. 1105// 1106// * ErrCodeCloudHsmResourceNotFoundException "CloudHsmResourceNotFoundException" 1107// The request was rejected because it refers to a resource that cannot be found. 1108// 1109// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" 1110// The request was rejected because it is not a valid request. 1111// 1112// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" 1113// The request was rejected because the requester does not have permission to 1114// perform the requested operation. 1115// 1116// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/UntagResource 1117func (c *CloudHSMV2) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { 1118 req, out := c.UntagResourceRequest(input) 1119 return out, req.Send() 1120} 1121 1122// UntagResourceWithContext is the same as UntagResource with the addition of 1123// the ability to pass a context and additional request options. 1124// 1125// See UntagResource for details on how to use this API operation. 1126// 1127// The context must be non-nil and will be used for request cancellation. If 1128// the context is nil a panic will occur. In the future the SDK may create 1129// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1130// for more information on using Contexts. 1131func (c *CloudHSMV2) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { 1132 req, out := c.UntagResourceRequest(input) 1133 req.SetContext(ctx) 1134 req.ApplyOptions(opts...) 1135 return out, req.Send() 1136} 1137 1138// Contains information about a backup of an AWS CloudHSM cluster. 1139// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/Backup 1140type Backup struct { 1141 _ struct{} `type:"structure"` 1142 1143 // The identifier (ID) of the backup. 1144 // 1145 // BackupId is a required field 1146 BackupId *string `type:"string" required:"true"` 1147 1148 // The state of the backup. 1149 BackupState *string `type:"string" enum:"BackupState"` 1150 1151 // The identifier (ID) of the cluster that was backed up. 1152 ClusterId *string `type:"string"` 1153 1154 // The date and time when the backup was created. 1155 CreateTimestamp *time.Time `type:"timestamp" timestampFormat:"unix"` 1156} 1157 1158// String returns the string representation 1159func (s Backup) String() string { 1160 return awsutil.Prettify(s) 1161} 1162 1163// GoString returns the string representation 1164func (s Backup) GoString() string { 1165 return s.String() 1166} 1167 1168// SetBackupId sets the BackupId field's value. 1169func (s *Backup) SetBackupId(v string) *Backup { 1170 s.BackupId = &v 1171 return s 1172} 1173 1174// SetBackupState sets the BackupState field's value. 1175func (s *Backup) SetBackupState(v string) *Backup { 1176 s.BackupState = &v 1177 return s 1178} 1179 1180// SetClusterId sets the ClusterId field's value. 1181func (s *Backup) SetClusterId(v string) *Backup { 1182 s.ClusterId = &v 1183 return s 1184} 1185 1186// SetCreateTimestamp sets the CreateTimestamp field's value. 1187func (s *Backup) SetCreateTimestamp(v time.Time) *Backup { 1188 s.CreateTimestamp = &v 1189 return s 1190} 1191 1192// Contains one or more certificates or a certificate signing request (CSR). 1193// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/Certificates 1194type Certificates struct { 1195 _ struct{} `type:"structure"` 1196 1197 // The HSM hardware certificate issued (signed) by AWS CloudHSM. 1198 AwsHardwareCertificate *string `type:"string"` 1199 1200 // The cluster certificate issued (signed) by the issuing certificate authority 1201 // (CA) of the cluster's owner. 1202 ClusterCertificate *string `type:"string"` 1203 1204 // The cluster's certificate signing request (CSR). The CSR exists only when 1205 // the cluster's state is UNINITIALIZED. 1206 ClusterCsr *string `type:"string"` 1207 1208 // The HSM certificate issued (signed) by the HSM hardware. 1209 HsmCertificate *string `type:"string"` 1210 1211 // The HSM hardware certificate issued (signed) by the hardware manufacturer. 1212 ManufacturerHardwareCertificate *string `type:"string"` 1213} 1214 1215// String returns the string representation 1216func (s Certificates) String() string { 1217 return awsutil.Prettify(s) 1218} 1219 1220// GoString returns the string representation 1221func (s Certificates) GoString() string { 1222 return s.String() 1223} 1224 1225// SetAwsHardwareCertificate sets the AwsHardwareCertificate field's value. 1226func (s *Certificates) SetAwsHardwareCertificate(v string) *Certificates { 1227 s.AwsHardwareCertificate = &v 1228 return s 1229} 1230 1231// SetClusterCertificate sets the ClusterCertificate field's value. 1232func (s *Certificates) SetClusterCertificate(v string) *Certificates { 1233 s.ClusterCertificate = &v 1234 return s 1235} 1236 1237// SetClusterCsr sets the ClusterCsr field's value. 1238func (s *Certificates) SetClusterCsr(v string) *Certificates { 1239 s.ClusterCsr = &v 1240 return s 1241} 1242 1243// SetHsmCertificate sets the HsmCertificate field's value. 1244func (s *Certificates) SetHsmCertificate(v string) *Certificates { 1245 s.HsmCertificate = &v 1246 return s 1247} 1248 1249// SetManufacturerHardwareCertificate sets the ManufacturerHardwareCertificate field's value. 1250func (s *Certificates) SetManufacturerHardwareCertificate(v string) *Certificates { 1251 s.ManufacturerHardwareCertificate = &v 1252 return s 1253} 1254 1255// Contains information about an AWS CloudHSM cluster. 1256// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/Cluster 1257type Cluster struct { 1258 _ struct{} `type:"structure"` 1259 1260 // The cluster's backup policy. 1261 BackupPolicy *string `type:"string" enum:"BackupPolicy"` 1262 1263 // Contains one or more certificates or a certificate signing request (CSR). 1264 Certificates *Certificates `type:"structure"` 1265 1266 // The cluster's identifier (ID). 1267 ClusterId *string `type:"string"` 1268 1269 // The date and time when the cluster was created. 1270 CreateTimestamp *time.Time `type:"timestamp" timestampFormat:"unix"` 1271 1272 // The type of HSM that the cluster contains. 1273 HsmType *string `type:"string"` 1274 1275 // Contains information about the HSMs in the cluster. 1276 Hsms []*Hsm `type:"list"` 1277 1278 // The default password for the cluster's Pre-Crypto Officer (PRECO) user. 1279 PreCoPassword *string `min:"7" type:"string"` 1280 1281 // The identifier (ID) of the cluster's security group. 1282 SecurityGroup *string `type:"string"` 1283 1284 // The identifier (ID) of the backup used to create the cluster. This value 1285 // exists only when the cluster was created from a backup. 1286 SourceBackupId *string `type:"string"` 1287 1288 // The cluster's state. 1289 State *string `type:"string" enum:"ClusterState"` 1290 1291 // A description of the cluster's state. 1292 StateMessage *string `type:"string"` 1293 1294 // A map of the cluster's subnets and their corresponding Availability Zones. 1295 SubnetMapping map[string]*string `type:"map"` 1296 1297 // The identifier (ID) of the virtual private cloud (VPC) that contains the 1298 // cluster. 1299 VpcId *string `type:"string"` 1300} 1301 1302// String returns the string representation 1303func (s Cluster) String() string { 1304 return awsutil.Prettify(s) 1305} 1306 1307// GoString returns the string representation 1308func (s Cluster) GoString() string { 1309 return s.String() 1310} 1311 1312// SetBackupPolicy sets the BackupPolicy field's value. 1313func (s *Cluster) SetBackupPolicy(v string) *Cluster { 1314 s.BackupPolicy = &v 1315 return s 1316} 1317 1318// SetCertificates sets the Certificates field's value. 1319func (s *Cluster) SetCertificates(v *Certificates) *Cluster { 1320 s.Certificates = v 1321 return s 1322} 1323 1324// SetClusterId sets the ClusterId field's value. 1325func (s *Cluster) SetClusterId(v string) *Cluster { 1326 s.ClusterId = &v 1327 return s 1328} 1329 1330// SetCreateTimestamp sets the CreateTimestamp field's value. 1331func (s *Cluster) SetCreateTimestamp(v time.Time) *Cluster { 1332 s.CreateTimestamp = &v 1333 return s 1334} 1335 1336// SetHsmType sets the HsmType field's value. 1337func (s *Cluster) SetHsmType(v string) *Cluster { 1338 s.HsmType = &v 1339 return s 1340} 1341 1342// SetHsms sets the Hsms field's value. 1343func (s *Cluster) SetHsms(v []*Hsm) *Cluster { 1344 s.Hsms = v 1345 return s 1346} 1347 1348// SetPreCoPassword sets the PreCoPassword field's value. 1349func (s *Cluster) SetPreCoPassword(v string) *Cluster { 1350 s.PreCoPassword = &v 1351 return s 1352} 1353 1354// SetSecurityGroup sets the SecurityGroup field's value. 1355func (s *Cluster) SetSecurityGroup(v string) *Cluster { 1356 s.SecurityGroup = &v 1357 return s 1358} 1359 1360// SetSourceBackupId sets the SourceBackupId field's value. 1361func (s *Cluster) SetSourceBackupId(v string) *Cluster { 1362 s.SourceBackupId = &v 1363 return s 1364} 1365 1366// SetState sets the State field's value. 1367func (s *Cluster) SetState(v string) *Cluster { 1368 s.State = &v 1369 return s 1370} 1371 1372// SetStateMessage sets the StateMessage field's value. 1373func (s *Cluster) SetStateMessage(v string) *Cluster { 1374 s.StateMessage = &v 1375 return s 1376} 1377 1378// SetSubnetMapping sets the SubnetMapping field's value. 1379func (s *Cluster) SetSubnetMapping(v map[string]*string) *Cluster { 1380 s.SubnetMapping = v 1381 return s 1382} 1383 1384// SetVpcId sets the VpcId field's value. 1385func (s *Cluster) SetVpcId(v string) *Cluster { 1386 s.VpcId = &v 1387 return s 1388} 1389 1390// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/CreateClusterRequest 1391type CreateClusterInput struct { 1392 _ struct{} `type:"structure"` 1393 1394 // The type of HSM to use in the cluster. Currently the only allowed value is 1395 // hsm1.medium. 1396 // 1397 // HsmType is a required field 1398 HsmType *string `type:"string" required:"true"` 1399 1400 // The identifier (ID) of the cluster backup to restore. Use this value to restore 1401 // the cluster from a backup instead of creating a new cluster. To find the 1402 // backup ID, use DescribeBackups. 1403 SourceBackupId *string `type:"string"` 1404 1405 // The identifiers (IDs) of the subnets where you are creating the cluster. 1406 // You must specify at least one subnet. If you specify multiple subnets, they 1407 // must meet the following criteria: 1408 // 1409 // * All subnets must be in the same virtual private cloud (VPC). 1410 // 1411 // * You can specify only one subnet per Availability Zone. 1412 // 1413 // SubnetIds is a required field 1414 SubnetIds []*string `min:"1" type:"list" required:"true"` 1415} 1416 1417// String returns the string representation 1418func (s CreateClusterInput) String() string { 1419 return awsutil.Prettify(s) 1420} 1421 1422// GoString returns the string representation 1423func (s CreateClusterInput) GoString() string { 1424 return s.String() 1425} 1426 1427// Validate inspects the fields of the type to determine if they are valid. 1428func (s *CreateClusterInput) Validate() error { 1429 invalidParams := request.ErrInvalidParams{Context: "CreateClusterInput"} 1430 if s.HsmType == nil { 1431 invalidParams.Add(request.NewErrParamRequired("HsmType")) 1432 } 1433 if s.SubnetIds == nil { 1434 invalidParams.Add(request.NewErrParamRequired("SubnetIds")) 1435 } 1436 if s.SubnetIds != nil && len(s.SubnetIds) < 1 { 1437 invalidParams.Add(request.NewErrParamMinLen("SubnetIds", 1)) 1438 } 1439 1440 if invalidParams.Len() > 0 { 1441 return invalidParams 1442 } 1443 return nil 1444} 1445 1446// SetHsmType sets the HsmType field's value. 1447func (s *CreateClusterInput) SetHsmType(v string) *CreateClusterInput { 1448 s.HsmType = &v 1449 return s 1450} 1451 1452// SetSourceBackupId sets the SourceBackupId field's value. 1453func (s *CreateClusterInput) SetSourceBackupId(v string) *CreateClusterInput { 1454 s.SourceBackupId = &v 1455 return s 1456} 1457 1458// SetSubnetIds sets the SubnetIds field's value. 1459func (s *CreateClusterInput) SetSubnetIds(v []*string) *CreateClusterInput { 1460 s.SubnetIds = v 1461 return s 1462} 1463 1464// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/CreateClusterResponse 1465type CreateClusterOutput struct { 1466 _ struct{} `type:"structure"` 1467 1468 // Information about the cluster that was created. 1469 Cluster *Cluster `type:"structure"` 1470} 1471 1472// String returns the string representation 1473func (s CreateClusterOutput) String() string { 1474 return awsutil.Prettify(s) 1475} 1476 1477// GoString returns the string representation 1478func (s CreateClusterOutput) GoString() string { 1479 return s.String() 1480} 1481 1482// SetCluster sets the Cluster field's value. 1483func (s *CreateClusterOutput) SetCluster(v *Cluster) *CreateClusterOutput { 1484 s.Cluster = v 1485 return s 1486} 1487 1488// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/CreateHsmRequest 1489type CreateHsmInput struct { 1490 _ struct{} `type:"structure"` 1491 1492 // The Availability Zone where you are creating the HSM. To find the cluster's 1493 // Availability Zones, use DescribeClusters. 1494 // 1495 // AvailabilityZone is a required field 1496 AvailabilityZone *string `type:"string" required:"true"` 1497 1498 // The identifier (ID) of the HSM's cluster. To find the cluster ID, use DescribeClusters. 1499 // 1500 // ClusterId is a required field 1501 ClusterId *string `type:"string" required:"true"` 1502 1503 // The HSM's IP address. If you specify an IP address, use an available address 1504 // from the subnet that maps to the Availability Zone where you are creating 1505 // the HSM. If you don't specify an IP address, one is chosen for you from that 1506 // subnet. 1507 IpAddress *string `type:"string"` 1508} 1509 1510// String returns the string representation 1511func (s CreateHsmInput) String() string { 1512 return awsutil.Prettify(s) 1513} 1514 1515// GoString returns the string representation 1516func (s CreateHsmInput) GoString() string { 1517 return s.String() 1518} 1519 1520// Validate inspects the fields of the type to determine if they are valid. 1521func (s *CreateHsmInput) Validate() error { 1522 invalidParams := request.ErrInvalidParams{Context: "CreateHsmInput"} 1523 if s.AvailabilityZone == nil { 1524 invalidParams.Add(request.NewErrParamRequired("AvailabilityZone")) 1525 } 1526 if s.ClusterId == nil { 1527 invalidParams.Add(request.NewErrParamRequired("ClusterId")) 1528 } 1529 1530 if invalidParams.Len() > 0 { 1531 return invalidParams 1532 } 1533 return nil 1534} 1535 1536// SetAvailabilityZone sets the AvailabilityZone field's value. 1537func (s *CreateHsmInput) SetAvailabilityZone(v string) *CreateHsmInput { 1538 s.AvailabilityZone = &v 1539 return s 1540} 1541 1542// SetClusterId sets the ClusterId field's value. 1543func (s *CreateHsmInput) SetClusterId(v string) *CreateHsmInput { 1544 s.ClusterId = &v 1545 return s 1546} 1547 1548// SetIpAddress sets the IpAddress field's value. 1549func (s *CreateHsmInput) SetIpAddress(v string) *CreateHsmInput { 1550 s.IpAddress = &v 1551 return s 1552} 1553 1554// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/CreateHsmResponse 1555type CreateHsmOutput struct { 1556 _ struct{} `type:"structure"` 1557 1558 // Information about the HSM that was created. 1559 Hsm *Hsm `type:"structure"` 1560} 1561 1562// String returns the string representation 1563func (s CreateHsmOutput) String() string { 1564 return awsutil.Prettify(s) 1565} 1566 1567// GoString returns the string representation 1568func (s CreateHsmOutput) GoString() string { 1569 return s.String() 1570} 1571 1572// SetHsm sets the Hsm field's value. 1573func (s *CreateHsmOutput) SetHsm(v *Hsm) *CreateHsmOutput { 1574 s.Hsm = v 1575 return s 1576} 1577 1578// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DeleteClusterRequest 1579type DeleteClusterInput struct { 1580 _ struct{} `type:"structure"` 1581 1582 // The identifier (ID) of the cluster that you are deleting. To find the cluster 1583 // ID, use DescribeClusters. 1584 // 1585 // ClusterId is a required field 1586 ClusterId *string `type:"string" required:"true"` 1587} 1588 1589// String returns the string representation 1590func (s DeleteClusterInput) String() string { 1591 return awsutil.Prettify(s) 1592} 1593 1594// GoString returns the string representation 1595func (s DeleteClusterInput) GoString() string { 1596 return s.String() 1597} 1598 1599// Validate inspects the fields of the type to determine if they are valid. 1600func (s *DeleteClusterInput) Validate() error { 1601 invalidParams := request.ErrInvalidParams{Context: "DeleteClusterInput"} 1602 if s.ClusterId == nil { 1603 invalidParams.Add(request.NewErrParamRequired("ClusterId")) 1604 } 1605 1606 if invalidParams.Len() > 0 { 1607 return invalidParams 1608 } 1609 return nil 1610} 1611 1612// SetClusterId sets the ClusterId field's value. 1613func (s *DeleteClusterInput) SetClusterId(v string) *DeleteClusterInput { 1614 s.ClusterId = &v 1615 return s 1616} 1617 1618// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DeleteClusterResponse 1619type DeleteClusterOutput struct { 1620 _ struct{} `type:"structure"` 1621 1622 // Information about the cluster that was deleted. 1623 Cluster *Cluster `type:"structure"` 1624} 1625 1626// String returns the string representation 1627func (s DeleteClusterOutput) String() string { 1628 return awsutil.Prettify(s) 1629} 1630 1631// GoString returns the string representation 1632func (s DeleteClusterOutput) GoString() string { 1633 return s.String() 1634} 1635 1636// SetCluster sets the Cluster field's value. 1637func (s *DeleteClusterOutput) SetCluster(v *Cluster) *DeleteClusterOutput { 1638 s.Cluster = v 1639 return s 1640} 1641 1642// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DeleteHsmRequest 1643type DeleteHsmInput struct { 1644 _ struct{} `type:"structure"` 1645 1646 // The identifier (ID) of the cluster that contains the HSM that you are deleting. 1647 // 1648 // ClusterId is a required field 1649 ClusterId *string `type:"string" required:"true"` 1650 1651 // The identifier (ID) of the elastic network interface (ENI) of the HSM that 1652 // you are deleting. 1653 EniId *string `type:"string"` 1654 1655 // The IP address of the elastic network interface (ENI) of the HSM that you 1656 // are deleting. 1657 EniIp *string `type:"string"` 1658 1659 // The identifier (ID) of the HSM that you are deleting. 1660 HsmId *string `type:"string"` 1661} 1662 1663// String returns the string representation 1664func (s DeleteHsmInput) String() string { 1665 return awsutil.Prettify(s) 1666} 1667 1668// GoString returns the string representation 1669func (s DeleteHsmInput) GoString() string { 1670 return s.String() 1671} 1672 1673// Validate inspects the fields of the type to determine if they are valid. 1674func (s *DeleteHsmInput) Validate() error { 1675 invalidParams := request.ErrInvalidParams{Context: "DeleteHsmInput"} 1676 if s.ClusterId == nil { 1677 invalidParams.Add(request.NewErrParamRequired("ClusterId")) 1678 } 1679 1680 if invalidParams.Len() > 0 { 1681 return invalidParams 1682 } 1683 return nil 1684} 1685 1686// SetClusterId sets the ClusterId field's value. 1687func (s *DeleteHsmInput) SetClusterId(v string) *DeleteHsmInput { 1688 s.ClusterId = &v 1689 return s 1690} 1691 1692// SetEniId sets the EniId field's value. 1693func (s *DeleteHsmInput) SetEniId(v string) *DeleteHsmInput { 1694 s.EniId = &v 1695 return s 1696} 1697 1698// SetEniIp sets the EniIp field's value. 1699func (s *DeleteHsmInput) SetEniIp(v string) *DeleteHsmInput { 1700 s.EniIp = &v 1701 return s 1702} 1703 1704// SetHsmId sets the HsmId field's value. 1705func (s *DeleteHsmInput) SetHsmId(v string) *DeleteHsmInput { 1706 s.HsmId = &v 1707 return s 1708} 1709 1710// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DeleteHsmResponse 1711type DeleteHsmOutput struct { 1712 _ struct{} `type:"structure"` 1713 1714 // The identifier (ID) of the HSM that was deleted. 1715 HsmId *string `type:"string"` 1716} 1717 1718// String returns the string representation 1719func (s DeleteHsmOutput) String() string { 1720 return awsutil.Prettify(s) 1721} 1722 1723// GoString returns the string representation 1724func (s DeleteHsmOutput) GoString() string { 1725 return s.String() 1726} 1727 1728// SetHsmId sets the HsmId field's value. 1729func (s *DeleteHsmOutput) SetHsmId(v string) *DeleteHsmOutput { 1730 s.HsmId = &v 1731 return s 1732} 1733 1734// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DescribeBackupsRequest 1735type DescribeBackupsInput struct { 1736 _ struct{} `type:"structure"` 1737 1738 // One or more filters to limit the items returned in the response. 1739 // 1740 // Use the backupIds filter to return only the specified backups. Specify backups 1741 // by their backup identifier (ID). 1742 // 1743 // Use the clusterIds filter to return only the backups for the specified clusters. 1744 // Specify clusters by their cluster identifier (ID). 1745 // 1746 // Use the states filter to return only backups that match the specified state. 1747 Filters map[string][]*string `type:"map"` 1748 1749 // The maximum number of backups to return in the response. When there are more 1750 // backups than the number you specify, the response contains a NextToken value. 1751 MaxResults *int64 `min:"1" type:"integer"` 1752 1753 // The NextToken value that you received in the previous response. Use this 1754 // value to get more backups. 1755 NextToken *string `type:"string"` 1756} 1757 1758// String returns the string representation 1759func (s DescribeBackupsInput) String() string { 1760 return awsutil.Prettify(s) 1761} 1762 1763// GoString returns the string representation 1764func (s DescribeBackupsInput) GoString() string { 1765 return s.String() 1766} 1767 1768// Validate inspects the fields of the type to determine if they are valid. 1769func (s *DescribeBackupsInput) Validate() error { 1770 invalidParams := request.ErrInvalidParams{Context: "DescribeBackupsInput"} 1771 if s.MaxResults != nil && *s.MaxResults < 1 { 1772 invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) 1773 } 1774 1775 if invalidParams.Len() > 0 { 1776 return invalidParams 1777 } 1778 return nil 1779} 1780 1781// SetFilters sets the Filters field's value. 1782func (s *DescribeBackupsInput) SetFilters(v map[string][]*string) *DescribeBackupsInput { 1783 s.Filters = v 1784 return s 1785} 1786 1787// SetMaxResults sets the MaxResults field's value. 1788func (s *DescribeBackupsInput) SetMaxResults(v int64) *DescribeBackupsInput { 1789 s.MaxResults = &v 1790 return s 1791} 1792 1793// SetNextToken sets the NextToken field's value. 1794func (s *DescribeBackupsInput) SetNextToken(v string) *DescribeBackupsInput { 1795 s.NextToken = &v 1796 return s 1797} 1798 1799// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DescribeBackupsResponse 1800type DescribeBackupsOutput struct { 1801 _ struct{} `type:"structure"` 1802 1803 // A list of backups. 1804 Backups []*Backup `type:"list"` 1805 1806 // An opaque string that indicates that the response contains only a subset 1807 // of backups. Use this value in a subsequent DescribeBackups request to get 1808 // more backups. 1809 NextToken *string `type:"string"` 1810} 1811 1812// String returns the string representation 1813func (s DescribeBackupsOutput) String() string { 1814 return awsutil.Prettify(s) 1815} 1816 1817// GoString returns the string representation 1818func (s DescribeBackupsOutput) GoString() string { 1819 return s.String() 1820} 1821 1822// SetBackups sets the Backups field's value. 1823func (s *DescribeBackupsOutput) SetBackups(v []*Backup) *DescribeBackupsOutput { 1824 s.Backups = v 1825 return s 1826} 1827 1828// SetNextToken sets the NextToken field's value. 1829func (s *DescribeBackupsOutput) SetNextToken(v string) *DescribeBackupsOutput { 1830 s.NextToken = &v 1831 return s 1832} 1833 1834// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DescribeClustersRequest 1835type DescribeClustersInput struct { 1836 _ struct{} `type:"structure"` 1837 1838 // One or more filters to limit the items returned in the response. 1839 // 1840 // Use the clusterIds filter to return only the specified clusters. Specify 1841 // clusters by their cluster identifier (ID). 1842 // 1843 // Use the vpcIds filter to return only the clusters in the specified virtual 1844 // private clouds (VPCs). Specify VPCs by their VPC identifier (ID). 1845 // 1846 // Use the states filter to return only clusters that match the specified state. 1847 Filters map[string][]*string `type:"map"` 1848 1849 // The maximum number of clusters to return in the response. When there are 1850 // more clusters than the number you specify, the response contains a NextToken 1851 // value. 1852 MaxResults *int64 `min:"1" type:"integer"` 1853 1854 // The NextToken value that you received in the previous response. Use this 1855 // value to get more clusters. 1856 NextToken *string `type:"string"` 1857} 1858 1859// String returns the string representation 1860func (s DescribeClustersInput) String() string { 1861 return awsutil.Prettify(s) 1862} 1863 1864// GoString returns the string representation 1865func (s DescribeClustersInput) GoString() string { 1866 return s.String() 1867} 1868 1869// Validate inspects the fields of the type to determine if they are valid. 1870func (s *DescribeClustersInput) Validate() error { 1871 invalidParams := request.ErrInvalidParams{Context: "DescribeClustersInput"} 1872 if s.MaxResults != nil && *s.MaxResults < 1 { 1873 invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) 1874 } 1875 1876 if invalidParams.Len() > 0 { 1877 return invalidParams 1878 } 1879 return nil 1880} 1881 1882// SetFilters sets the Filters field's value. 1883func (s *DescribeClustersInput) SetFilters(v map[string][]*string) *DescribeClustersInput { 1884 s.Filters = v 1885 return s 1886} 1887 1888// SetMaxResults sets the MaxResults field's value. 1889func (s *DescribeClustersInput) SetMaxResults(v int64) *DescribeClustersInput { 1890 s.MaxResults = &v 1891 return s 1892} 1893 1894// SetNextToken sets the NextToken field's value. 1895func (s *DescribeClustersInput) SetNextToken(v string) *DescribeClustersInput { 1896 s.NextToken = &v 1897 return s 1898} 1899 1900// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DescribeClustersResponse 1901type DescribeClustersOutput struct { 1902 _ struct{} `type:"structure"` 1903 1904 // A list of clusters. 1905 Clusters []*Cluster `type:"list"` 1906 1907 // An opaque string that indicates that the response contains only a subset 1908 // of clusters. Use this value in a subsequent DescribeClusters request to get 1909 // more clusters. 1910 NextToken *string `type:"string"` 1911} 1912 1913// String returns the string representation 1914func (s DescribeClustersOutput) String() string { 1915 return awsutil.Prettify(s) 1916} 1917 1918// GoString returns the string representation 1919func (s DescribeClustersOutput) GoString() string { 1920 return s.String() 1921} 1922 1923// SetClusters sets the Clusters field's value. 1924func (s *DescribeClustersOutput) SetClusters(v []*Cluster) *DescribeClustersOutput { 1925 s.Clusters = v 1926 return s 1927} 1928 1929// SetNextToken sets the NextToken field's value. 1930func (s *DescribeClustersOutput) SetNextToken(v string) *DescribeClustersOutput { 1931 s.NextToken = &v 1932 return s 1933} 1934 1935// Contains information about a hardware security module (HSM) in an AWS CloudHSM 1936// cluster. 1937// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/Hsm 1938type Hsm struct { 1939 _ struct{} `type:"structure"` 1940 1941 // The Availability Zone that contains the HSM. 1942 AvailabilityZone *string `type:"string"` 1943 1944 // The identifier (ID) of the cluster that contains the HSM. 1945 ClusterId *string `type:"string"` 1946 1947 // The identifier (ID) of the HSM's elastic network interface (ENI). 1948 EniId *string `type:"string"` 1949 1950 // The IP address of the HSM's elastic network interface (ENI). 1951 EniIp *string `type:"string"` 1952 1953 // The HSM's identifier (ID). 1954 // 1955 // HsmId is a required field 1956 HsmId *string `type:"string" required:"true"` 1957 1958 // The HSM's state. 1959 State *string `type:"string" enum:"HsmState"` 1960 1961 // A description of the HSM's state. 1962 StateMessage *string `type:"string"` 1963 1964 // The subnet that contains the HSM's elastic network interface (ENI). 1965 SubnetId *string `type:"string"` 1966} 1967 1968// String returns the string representation 1969func (s Hsm) String() string { 1970 return awsutil.Prettify(s) 1971} 1972 1973// GoString returns the string representation 1974func (s Hsm) GoString() string { 1975 return s.String() 1976} 1977 1978// SetAvailabilityZone sets the AvailabilityZone field's value. 1979func (s *Hsm) SetAvailabilityZone(v string) *Hsm { 1980 s.AvailabilityZone = &v 1981 return s 1982} 1983 1984// SetClusterId sets the ClusterId field's value. 1985func (s *Hsm) SetClusterId(v string) *Hsm { 1986 s.ClusterId = &v 1987 return s 1988} 1989 1990// SetEniId sets the EniId field's value. 1991func (s *Hsm) SetEniId(v string) *Hsm { 1992 s.EniId = &v 1993 return s 1994} 1995 1996// SetEniIp sets the EniIp field's value. 1997func (s *Hsm) SetEniIp(v string) *Hsm { 1998 s.EniIp = &v 1999 return s 2000} 2001 2002// SetHsmId sets the HsmId field's value. 2003func (s *Hsm) SetHsmId(v string) *Hsm { 2004 s.HsmId = &v 2005 return s 2006} 2007 2008// SetState sets the State field's value. 2009func (s *Hsm) SetState(v string) *Hsm { 2010 s.State = &v 2011 return s 2012} 2013 2014// SetStateMessage sets the StateMessage field's value. 2015func (s *Hsm) SetStateMessage(v string) *Hsm { 2016 s.StateMessage = &v 2017 return s 2018} 2019 2020// SetSubnetId sets the SubnetId field's value. 2021func (s *Hsm) SetSubnetId(v string) *Hsm { 2022 s.SubnetId = &v 2023 return s 2024} 2025 2026// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/InitializeClusterRequest 2027type InitializeClusterInput struct { 2028 _ struct{} `type:"structure"` 2029 2030 // The identifier (ID) of the cluster that you are claiming. To find the cluster 2031 // ID, use DescribeClusters. 2032 // 2033 // ClusterId is a required field 2034 ClusterId *string `type:"string" required:"true"` 2035 2036 // The cluster certificate issued (signed) by your issuing certificate authority 2037 // (CA). The certificate must be in PEM format and can contain a maximum of 2038 // 5000 characters. 2039 // 2040 // SignedCert is a required field 2041 SignedCert *string `type:"string" required:"true"` 2042 2043 // The issuing certificate of the issuing certificate authority (CA) that issued 2044 // (signed) the cluster certificate. This can be a root (self-signed) certificate 2045 // or a certificate chain that begins with the certificate that issued the cluster 2046 // certificate and ends with a root certificate. The certificate or certificate 2047 // chain must be in PEM format and can contain a maximum of 5000 characters. 2048 // 2049 // TrustAnchor is a required field 2050 TrustAnchor *string `type:"string" required:"true"` 2051} 2052 2053// String returns the string representation 2054func (s InitializeClusterInput) String() string { 2055 return awsutil.Prettify(s) 2056} 2057 2058// GoString returns the string representation 2059func (s InitializeClusterInput) GoString() string { 2060 return s.String() 2061} 2062 2063// Validate inspects the fields of the type to determine if they are valid. 2064func (s *InitializeClusterInput) Validate() error { 2065 invalidParams := request.ErrInvalidParams{Context: "InitializeClusterInput"} 2066 if s.ClusterId == nil { 2067 invalidParams.Add(request.NewErrParamRequired("ClusterId")) 2068 } 2069 if s.SignedCert == nil { 2070 invalidParams.Add(request.NewErrParamRequired("SignedCert")) 2071 } 2072 if s.TrustAnchor == nil { 2073 invalidParams.Add(request.NewErrParamRequired("TrustAnchor")) 2074 } 2075 2076 if invalidParams.Len() > 0 { 2077 return invalidParams 2078 } 2079 return nil 2080} 2081 2082// SetClusterId sets the ClusterId field's value. 2083func (s *InitializeClusterInput) SetClusterId(v string) *InitializeClusterInput { 2084 s.ClusterId = &v 2085 return s 2086} 2087 2088// SetSignedCert sets the SignedCert field's value. 2089func (s *InitializeClusterInput) SetSignedCert(v string) *InitializeClusterInput { 2090 s.SignedCert = &v 2091 return s 2092} 2093 2094// SetTrustAnchor sets the TrustAnchor field's value. 2095func (s *InitializeClusterInput) SetTrustAnchor(v string) *InitializeClusterInput { 2096 s.TrustAnchor = &v 2097 return s 2098} 2099 2100// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/InitializeClusterResponse 2101type InitializeClusterOutput struct { 2102 _ struct{} `type:"structure"` 2103 2104 // The cluster's state. 2105 State *string `type:"string" enum:"ClusterState"` 2106 2107 // A description of the cluster's state. 2108 StateMessage *string `type:"string"` 2109} 2110 2111// String returns the string representation 2112func (s InitializeClusterOutput) String() string { 2113 return awsutil.Prettify(s) 2114} 2115 2116// GoString returns the string representation 2117func (s InitializeClusterOutput) GoString() string { 2118 return s.String() 2119} 2120 2121// SetState sets the State field's value. 2122func (s *InitializeClusterOutput) SetState(v string) *InitializeClusterOutput { 2123 s.State = &v 2124 return s 2125} 2126 2127// SetStateMessage sets the StateMessage field's value. 2128func (s *InitializeClusterOutput) SetStateMessage(v string) *InitializeClusterOutput { 2129 s.StateMessage = &v 2130 return s 2131} 2132 2133// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/ListTagsRequest 2134type ListTagsInput struct { 2135 _ struct{} `type:"structure"` 2136 2137 // The maximum number of tags to return in the response. When there are more 2138 // tags than the number you specify, the response contains a NextToken value. 2139 MaxResults *int64 `min:"1" type:"integer"` 2140 2141 // The NextToken value that you received in the previous response. Use this 2142 // value to get more tags. 2143 NextToken *string `type:"string"` 2144 2145 // The cluster identifier (ID) for the cluster whose tags you are getting. To 2146 // find the cluster ID, use DescribeClusters. 2147 // 2148 // ResourceId is a required field 2149 ResourceId *string `type:"string" required:"true"` 2150} 2151 2152// String returns the string representation 2153func (s ListTagsInput) String() string { 2154 return awsutil.Prettify(s) 2155} 2156 2157// GoString returns the string representation 2158func (s ListTagsInput) GoString() string { 2159 return s.String() 2160} 2161 2162// Validate inspects the fields of the type to determine if they are valid. 2163func (s *ListTagsInput) Validate() error { 2164 invalidParams := request.ErrInvalidParams{Context: "ListTagsInput"} 2165 if s.MaxResults != nil && *s.MaxResults < 1 { 2166 invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) 2167 } 2168 if s.ResourceId == nil { 2169 invalidParams.Add(request.NewErrParamRequired("ResourceId")) 2170 } 2171 2172 if invalidParams.Len() > 0 { 2173 return invalidParams 2174 } 2175 return nil 2176} 2177 2178// SetMaxResults sets the MaxResults field's value. 2179func (s *ListTagsInput) SetMaxResults(v int64) *ListTagsInput { 2180 s.MaxResults = &v 2181 return s 2182} 2183 2184// SetNextToken sets the NextToken field's value. 2185func (s *ListTagsInput) SetNextToken(v string) *ListTagsInput { 2186 s.NextToken = &v 2187 return s 2188} 2189 2190// SetResourceId sets the ResourceId field's value. 2191func (s *ListTagsInput) SetResourceId(v string) *ListTagsInput { 2192 s.ResourceId = &v 2193 return s 2194} 2195 2196// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/ListTagsResponse 2197type ListTagsOutput struct { 2198 _ struct{} `type:"structure"` 2199 2200 // An opaque string that indicates that the response contains only a subset 2201 // of tags. Use this value in a subsequent ListTags request to get more tags. 2202 NextToken *string `type:"string"` 2203 2204 // A list of tags. 2205 // 2206 // TagList is a required field 2207 TagList []*Tag `min:"1" type:"list" required:"true"` 2208} 2209 2210// String returns the string representation 2211func (s ListTagsOutput) String() string { 2212 return awsutil.Prettify(s) 2213} 2214 2215// GoString returns the string representation 2216func (s ListTagsOutput) GoString() string { 2217 return s.String() 2218} 2219 2220// SetNextToken sets the NextToken field's value. 2221func (s *ListTagsOutput) SetNextToken(v string) *ListTagsOutput { 2222 s.NextToken = &v 2223 return s 2224} 2225 2226// SetTagList sets the TagList field's value. 2227func (s *ListTagsOutput) SetTagList(v []*Tag) *ListTagsOutput { 2228 s.TagList = v 2229 return s 2230} 2231 2232// Contains a tag. A tag is a key-value pair. 2233// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/Tag 2234type Tag struct { 2235 _ struct{} `type:"structure"` 2236 2237 // The key of the tag. 2238 // 2239 // Key is a required field 2240 Key *string `min:"1" type:"string" required:"true"` 2241 2242 // The value of the tag. 2243 // 2244 // Value is a required field 2245 Value *string `type:"string" required:"true"` 2246} 2247 2248// String returns the string representation 2249func (s Tag) String() string { 2250 return awsutil.Prettify(s) 2251} 2252 2253// GoString returns the string representation 2254func (s Tag) GoString() string { 2255 return s.String() 2256} 2257 2258// Validate inspects the fields of the type to determine if they are valid. 2259func (s *Tag) Validate() error { 2260 invalidParams := request.ErrInvalidParams{Context: "Tag"} 2261 if s.Key == nil { 2262 invalidParams.Add(request.NewErrParamRequired("Key")) 2263 } 2264 if s.Key != nil && len(*s.Key) < 1 { 2265 invalidParams.Add(request.NewErrParamMinLen("Key", 1)) 2266 } 2267 if s.Value == nil { 2268 invalidParams.Add(request.NewErrParamRequired("Value")) 2269 } 2270 2271 if invalidParams.Len() > 0 { 2272 return invalidParams 2273 } 2274 return nil 2275} 2276 2277// SetKey sets the Key field's value. 2278func (s *Tag) SetKey(v string) *Tag { 2279 s.Key = &v 2280 return s 2281} 2282 2283// SetValue sets the Value field's value. 2284func (s *Tag) SetValue(v string) *Tag { 2285 s.Value = &v 2286 return s 2287} 2288 2289// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/TagResourceRequest 2290type TagResourceInput struct { 2291 _ struct{} `type:"structure"` 2292 2293 // The cluster identifier (ID) for the cluster that you are tagging. To find 2294 // the cluster ID, use DescribeClusters. 2295 // 2296 // ResourceId is a required field 2297 ResourceId *string `type:"string" required:"true"` 2298 2299 // A list of one or more tags. 2300 // 2301 // TagList is a required field 2302 TagList []*Tag `min:"1" type:"list" required:"true"` 2303} 2304 2305// String returns the string representation 2306func (s TagResourceInput) String() string { 2307 return awsutil.Prettify(s) 2308} 2309 2310// GoString returns the string representation 2311func (s TagResourceInput) GoString() string { 2312 return s.String() 2313} 2314 2315// Validate inspects the fields of the type to determine if they are valid. 2316func (s *TagResourceInput) Validate() error { 2317 invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} 2318 if s.ResourceId == nil { 2319 invalidParams.Add(request.NewErrParamRequired("ResourceId")) 2320 } 2321 if s.TagList == nil { 2322 invalidParams.Add(request.NewErrParamRequired("TagList")) 2323 } 2324 if s.TagList != nil && len(s.TagList) < 1 { 2325 invalidParams.Add(request.NewErrParamMinLen("TagList", 1)) 2326 } 2327 if s.TagList != nil { 2328 for i, v := range s.TagList { 2329 if v == nil { 2330 continue 2331 } 2332 if err := v.Validate(); err != nil { 2333 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagList", i), err.(request.ErrInvalidParams)) 2334 } 2335 } 2336 } 2337 2338 if invalidParams.Len() > 0 { 2339 return invalidParams 2340 } 2341 return nil 2342} 2343 2344// SetResourceId sets the ResourceId field's value. 2345func (s *TagResourceInput) SetResourceId(v string) *TagResourceInput { 2346 s.ResourceId = &v 2347 return s 2348} 2349 2350// SetTagList sets the TagList field's value. 2351func (s *TagResourceInput) SetTagList(v []*Tag) *TagResourceInput { 2352 s.TagList = v 2353 return s 2354} 2355 2356// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/TagResourceResponse 2357type TagResourceOutput struct { 2358 _ struct{} `type:"structure"` 2359} 2360 2361// String returns the string representation 2362func (s TagResourceOutput) String() string { 2363 return awsutil.Prettify(s) 2364} 2365 2366// GoString returns the string representation 2367func (s TagResourceOutput) GoString() string { 2368 return s.String() 2369} 2370 2371// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/UntagResourceRequest 2372type UntagResourceInput struct { 2373 _ struct{} `type:"structure"` 2374 2375 // The cluster identifier (ID) for the cluster whose tags you are removing. 2376 // To find the cluster ID, use DescribeClusters. 2377 // 2378 // ResourceId is a required field 2379 ResourceId *string `type:"string" required:"true"` 2380 2381 // A list of one or more tag keys for the tags that you are removing. Specify 2382 // only the tag keys, not the tag values. 2383 // 2384 // TagKeyList is a required field 2385 TagKeyList []*string `min:"1" type:"list" required:"true"` 2386} 2387 2388// String returns the string representation 2389func (s UntagResourceInput) String() string { 2390 return awsutil.Prettify(s) 2391} 2392 2393// GoString returns the string representation 2394func (s UntagResourceInput) GoString() string { 2395 return s.String() 2396} 2397 2398// Validate inspects the fields of the type to determine if they are valid. 2399func (s *UntagResourceInput) Validate() error { 2400 invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} 2401 if s.ResourceId == nil { 2402 invalidParams.Add(request.NewErrParamRequired("ResourceId")) 2403 } 2404 if s.TagKeyList == nil { 2405 invalidParams.Add(request.NewErrParamRequired("TagKeyList")) 2406 } 2407 if s.TagKeyList != nil && len(s.TagKeyList) < 1 { 2408 invalidParams.Add(request.NewErrParamMinLen("TagKeyList", 1)) 2409 } 2410 2411 if invalidParams.Len() > 0 { 2412 return invalidParams 2413 } 2414 return nil 2415} 2416 2417// SetResourceId sets the ResourceId field's value. 2418func (s *UntagResourceInput) SetResourceId(v string) *UntagResourceInput { 2419 s.ResourceId = &v 2420 return s 2421} 2422 2423// SetTagKeyList sets the TagKeyList field's value. 2424func (s *UntagResourceInput) SetTagKeyList(v []*string) *UntagResourceInput { 2425 s.TagKeyList = v 2426 return s 2427} 2428 2429// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/UntagResourceResponse 2430type UntagResourceOutput struct { 2431 _ struct{} `type:"structure"` 2432} 2433 2434// String returns the string representation 2435func (s UntagResourceOutput) String() string { 2436 return awsutil.Prettify(s) 2437} 2438 2439// GoString returns the string representation 2440func (s UntagResourceOutput) GoString() string { 2441 return s.String() 2442} 2443 2444const ( 2445 // BackupPolicyDefault is a BackupPolicy enum value 2446 BackupPolicyDefault = "DEFAULT" 2447) 2448 2449const ( 2450 // BackupStateCreateInProgress is a BackupState enum value 2451 BackupStateCreateInProgress = "CREATE_IN_PROGRESS" 2452 2453 // BackupStateReady is a BackupState enum value 2454 BackupStateReady = "READY" 2455 2456 // BackupStateDeleted is a BackupState enum value 2457 BackupStateDeleted = "DELETED" 2458) 2459 2460const ( 2461 // ClusterStateCreateInProgress is a ClusterState enum value 2462 ClusterStateCreateInProgress = "CREATE_IN_PROGRESS" 2463 2464 // ClusterStateUninitialized is a ClusterState enum value 2465 ClusterStateUninitialized = "UNINITIALIZED" 2466 2467 // ClusterStateInitializeInProgress is a ClusterState enum value 2468 ClusterStateInitializeInProgress = "INITIALIZE_IN_PROGRESS" 2469 2470 // ClusterStateInitialized is a ClusterState enum value 2471 ClusterStateInitialized = "INITIALIZED" 2472 2473 // ClusterStateActive is a ClusterState enum value 2474 ClusterStateActive = "ACTIVE" 2475 2476 // ClusterStateUpdateInProgress is a ClusterState enum value 2477 ClusterStateUpdateInProgress = "UPDATE_IN_PROGRESS" 2478 2479 // ClusterStateDeleteInProgress is a ClusterState enum value 2480 ClusterStateDeleteInProgress = "DELETE_IN_PROGRESS" 2481 2482 // ClusterStateDeleted is a ClusterState enum value 2483 ClusterStateDeleted = "DELETED" 2484 2485 // ClusterStateDegraded is a ClusterState enum value 2486 ClusterStateDegraded = "DEGRADED" 2487) 2488 2489const ( 2490 // HsmStateCreateInProgress is a HsmState enum value 2491 HsmStateCreateInProgress = "CREATE_IN_PROGRESS" 2492 2493 // HsmStateActive is a HsmState enum value 2494 HsmStateActive = "ACTIVE" 2495 2496 // HsmStateDegraded is a HsmState enum value 2497 HsmStateDegraded = "DEGRADED" 2498 2499 // HsmStateDeleteInProgress is a HsmState enum value 2500 HsmStateDeleteInProgress = "DELETE_IN_PROGRESS" 2501 2502 // HsmStateDeleted is a HsmState enum value 2503 HsmStateDeleted = "DELETED" 2504) 2505