github.com/aavshr/aws-sdk-go@v1.41.3/service/migrationhubconfig/api.go (about)

     1  // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
     2  
     3  package migrationhubconfig
     4  
     5  import (
     6  	"fmt"
     7  	"time"
     8  
     9  	"github.com/aavshr/aws-sdk-go/aws"
    10  	"github.com/aavshr/aws-sdk-go/aws/awsutil"
    11  	"github.com/aavshr/aws-sdk-go/aws/request"
    12  	"github.com/aavshr/aws-sdk-go/private/protocol"
    13  )
    14  
    15  const opCreateHomeRegionControl = "CreateHomeRegionControl"
    16  
    17  // CreateHomeRegionControlRequest generates a "aws/request.Request" representing the
    18  // client's request for the CreateHomeRegionControl operation. The "output" return
    19  // value will be populated with the request's response once the request completes
    20  // successfully.
    21  //
    22  // Use "Send" method on the returned Request to send the API call to the service.
    23  // the "output" return value is not valid until after Send returns without error.
    24  //
    25  // See CreateHomeRegionControl for more information on using the CreateHomeRegionControl
    26  // API call, and error handling.
    27  //
    28  // This method is useful when you want to inject custom logic or configuration
    29  // into the SDK's request lifecycle. Such as custom headers, or retry logic.
    30  //
    31  //
    32  //    // Example sending a request using the CreateHomeRegionControlRequest method.
    33  //    req, resp := client.CreateHomeRegionControlRequest(params)
    34  //
    35  //    err := req.Send()
    36  //    if err == nil { // resp is now filled
    37  //        fmt.Println(resp)
    38  //    }
    39  //
    40  // See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhub-config-2019-06-30/CreateHomeRegionControl
    41  func (c *MigrationHubConfig) CreateHomeRegionControlRequest(input *CreateHomeRegionControlInput) (req *request.Request, output *CreateHomeRegionControlOutput) {
    42  	op := &request.Operation{
    43  		Name:       opCreateHomeRegionControl,
    44  		HTTPMethod: "POST",
    45  		HTTPPath:   "/",
    46  	}
    47  
    48  	if input == nil {
    49  		input = &CreateHomeRegionControlInput{}
    50  	}
    51  
    52  	output = &CreateHomeRegionControlOutput{}
    53  	req = c.newRequest(op, input, output)
    54  	return
    55  }
    56  
    57  // CreateHomeRegionControl API operation for AWS Migration Hub Config.
    58  //
    59  // This API sets up the home region for the calling account only.
    60  //
    61  // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
    62  // with awserr.Error's Code and Message methods to get detailed information about
    63  // the error.
    64  //
    65  // See the AWS API reference guide for AWS Migration Hub Config's
    66  // API operation CreateHomeRegionControl for usage and error information.
    67  //
    68  // Returned Error Types:
    69  //   * InternalServerError
    70  //   Exception raised when an internal, configuration, or dependency error is
    71  //   encountered.
    72  //
    73  //   * ServiceUnavailableException
    74  //   Exception raised when a request fails due to temporary unavailability of
    75  //   the service.
    76  //
    77  //   * AccessDeniedException
    78  //   You do not have sufficient access to perform this action.
    79  //
    80  //   * ThrottlingException
    81  //   The request was denied due to request throttling.
    82  //
    83  //   * DryRunOperation
    84  //   Exception raised to indicate that authorization of an action was successful,
    85  //   when the DryRun flag is set to true.
    86  //
    87  //   * InvalidInputException
    88  //   Exception raised when the provided input violates a policy constraint or
    89  //   is entered in the wrong format or data type.
    90  //
    91  // See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhub-config-2019-06-30/CreateHomeRegionControl
    92  func (c *MigrationHubConfig) CreateHomeRegionControl(input *CreateHomeRegionControlInput) (*CreateHomeRegionControlOutput, error) {
    93  	req, out := c.CreateHomeRegionControlRequest(input)
    94  	return out, req.Send()
    95  }
    96  
    97  // CreateHomeRegionControlWithContext is the same as CreateHomeRegionControl with the addition of
    98  // the ability to pass a context and additional request options.
    99  //
   100  // See CreateHomeRegionControl for details on how to use this API operation.
   101  //
   102  // The context must be non-nil and will be used for request cancellation. If
   103  // the context is nil a panic will occur. In the future the SDK may create
   104  // sub-contexts for http.Requests. See https://golang.org/pkg/context/
   105  // for more information on using Contexts.
   106  func (c *MigrationHubConfig) CreateHomeRegionControlWithContext(ctx aws.Context, input *CreateHomeRegionControlInput, opts ...request.Option) (*CreateHomeRegionControlOutput, error) {
   107  	req, out := c.CreateHomeRegionControlRequest(input)
   108  	req.SetContext(ctx)
   109  	req.ApplyOptions(opts...)
   110  	return out, req.Send()
   111  }
   112  
   113  const opDescribeHomeRegionControls = "DescribeHomeRegionControls"
   114  
   115  // DescribeHomeRegionControlsRequest generates a "aws/request.Request" representing the
   116  // client's request for the DescribeHomeRegionControls operation. The "output" return
   117  // value will be populated with the request's response once the request completes
   118  // successfully.
   119  //
   120  // Use "Send" method on the returned Request to send the API call to the service.
   121  // the "output" return value is not valid until after Send returns without error.
   122  //
   123  // See DescribeHomeRegionControls for more information on using the DescribeHomeRegionControls
   124  // API call, and error handling.
   125  //
   126  // This method is useful when you want to inject custom logic or configuration
   127  // into the SDK's request lifecycle. Such as custom headers, or retry logic.
   128  //
   129  //
   130  //    // Example sending a request using the DescribeHomeRegionControlsRequest method.
   131  //    req, resp := client.DescribeHomeRegionControlsRequest(params)
   132  //
   133  //    err := req.Send()
   134  //    if err == nil { // resp is now filled
   135  //        fmt.Println(resp)
   136  //    }
   137  //
   138  // See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhub-config-2019-06-30/DescribeHomeRegionControls
   139  func (c *MigrationHubConfig) DescribeHomeRegionControlsRequest(input *DescribeHomeRegionControlsInput) (req *request.Request, output *DescribeHomeRegionControlsOutput) {
   140  	op := &request.Operation{
   141  		Name:       opDescribeHomeRegionControls,
   142  		HTTPMethod: "POST",
   143  		HTTPPath:   "/",
   144  		Paginator: &request.Paginator{
   145  			InputTokens:     []string{"NextToken"},
   146  			OutputTokens:    []string{"NextToken"},
   147  			LimitToken:      "MaxResults",
   148  			TruncationToken: "",
   149  		},
   150  	}
   151  
   152  	if input == nil {
   153  		input = &DescribeHomeRegionControlsInput{}
   154  	}
   155  
   156  	output = &DescribeHomeRegionControlsOutput{}
   157  	req = c.newRequest(op, input, output)
   158  	return
   159  }
   160  
   161  // DescribeHomeRegionControls API operation for AWS Migration Hub Config.
   162  //
   163  // This API permits filtering on the ControlId and HomeRegion fields.
   164  //
   165  // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
   166  // with awserr.Error's Code and Message methods to get detailed information about
   167  // the error.
   168  //
   169  // See the AWS API reference guide for AWS Migration Hub Config's
   170  // API operation DescribeHomeRegionControls for usage and error information.
   171  //
   172  // Returned Error Types:
   173  //   * InternalServerError
   174  //   Exception raised when an internal, configuration, or dependency error is
   175  //   encountered.
   176  //
   177  //   * ServiceUnavailableException
   178  //   Exception raised when a request fails due to temporary unavailability of
   179  //   the service.
   180  //
   181  //   * AccessDeniedException
   182  //   You do not have sufficient access to perform this action.
   183  //
   184  //   * ThrottlingException
   185  //   The request was denied due to request throttling.
   186  //
   187  //   * InvalidInputException
   188  //   Exception raised when the provided input violates a policy constraint or
   189  //   is entered in the wrong format or data type.
   190  //
   191  // See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhub-config-2019-06-30/DescribeHomeRegionControls
   192  func (c *MigrationHubConfig) DescribeHomeRegionControls(input *DescribeHomeRegionControlsInput) (*DescribeHomeRegionControlsOutput, error) {
   193  	req, out := c.DescribeHomeRegionControlsRequest(input)
   194  	return out, req.Send()
   195  }
   196  
   197  // DescribeHomeRegionControlsWithContext is the same as DescribeHomeRegionControls with the addition of
   198  // the ability to pass a context and additional request options.
   199  //
   200  // See DescribeHomeRegionControls for details on how to use this API operation.
   201  //
   202  // The context must be non-nil and will be used for request cancellation. If
   203  // the context is nil a panic will occur. In the future the SDK may create
   204  // sub-contexts for http.Requests. See https://golang.org/pkg/context/
   205  // for more information on using Contexts.
   206  func (c *MigrationHubConfig) DescribeHomeRegionControlsWithContext(ctx aws.Context, input *DescribeHomeRegionControlsInput, opts ...request.Option) (*DescribeHomeRegionControlsOutput, error) {
   207  	req, out := c.DescribeHomeRegionControlsRequest(input)
   208  	req.SetContext(ctx)
   209  	req.ApplyOptions(opts...)
   210  	return out, req.Send()
   211  }
   212  
   213  // DescribeHomeRegionControlsPages iterates over the pages of a DescribeHomeRegionControls operation,
   214  // calling the "fn" function with the response data for each page. To stop
   215  // iterating, return false from the fn function.
   216  //
   217  // See DescribeHomeRegionControls method for more information on how to use this operation.
   218  //
   219  // Note: This operation can generate multiple requests to a service.
   220  //
   221  //    // Example iterating over at most 3 pages of a DescribeHomeRegionControls operation.
   222  //    pageNum := 0
   223  //    err := client.DescribeHomeRegionControlsPages(params,
   224  //        func(page *migrationhubconfig.DescribeHomeRegionControlsOutput, lastPage bool) bool {
   225  //            pageNum++
   226  //            fmt.Println(page)
   227  //            return pageNum <= 3
   228  //        })
   229  //
   230  func (c *MigrationHubConfig) DescribeHomeRegionControlsPages(input *DescribeHomeRegionControlsInput, fn func(*DescribeHomeRegionControlsOutput, bool) bool) error {
   231  	return c.DescribeHomeRegionControlsPagesWithContext(aws.BackgroundContext(), input, fn)
   232  }
   233  
   234  // DescribeHomeRegionControlsPagesWithContext same as DescribeHomeRegionControlsPages except
   235  // it takes a Context and allows setting request options on the pages.
   236  //
   237  // The context must be non-nil and will be used for request cancellation. If
   238  // the context is nil a panic will occur. In the future the SDK may create
   239  // sub-contexts for http.Requests. See https://golang.org/pkg/context/
   240  // for more information on using Contexts.
   241  func (c *MigrationHubConfig) DescribeHomeRegionControlsPagesWithContext(ctx aws.Context, input *DescribeHomeRegionControlsInput, fn func(*DescribeHomeRegionControlsOutput, bool) bool, opts ...request.Option) error {
   242  	p := request.Pagination{
   243  		NewRequest: func() (*request.Request, error) {
   244  			var inCpy *DescribeHomeRegionControlsInput
   245  			if input != nil {
   246  				tmp := *input
   247  				inCpy = &tmp
   248  			}
   249  			req, _ := c.DescribeHomeRegionControlsRequest(inCpy)
   250  			req.SetContext(ctx)
   251  			req.ApplyOptions(opts...)
   252  			return req, nil
   253  		},
   254  	}
   255  
   256  	for p.Next() {
   257  		if !fn(p.Page().(*DescribeHomeRegionControlsOutput), !p.HasNextPage()) {
   258  			break
   259  		}
   260  	}
   261  
   262  	return p.Err()
   263  }
   264  
   265  const opGetHomeRegion = "GetHomeRegion"
   266  
   267  // GetHomeRegionRequest generates a "aws/request.Request" representing the
   268  // client's request for the GetHomeRegion operation. The "output" return
   269  // value will be populated with the request's response once the request completes
   270  // successfully.
   271  //
   272  // Use "Send" method on the returned Request to send the API call to the service.
   273  // the "output" return value is not valid until after Send returns without error.
   274  //
   275  // See GetHomeRegion for more information on using the GetHomeRegion
   276  // API call, and error handling.
   277  //
   278  // This method is useful when you want to inject custom logic or configuration
   279  // into the SDK's request lifecycle. Such as custom headers, or retry logic.
   280  //
   281  //
   282  //    // Example sending a request using the GetHomeRegionRequest method.
   283  //    req, resp := client.GetHomeRegionRequest(params)
   284  //
   285  //    err := req.Send()
   286  //    if err == nil { // resp is now filled
   287  //        fmt.Println(resp)
   288  //    }
   289  //
   290  // See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhub-config-2019-06-30/GetHomeRegion
   291  func (c *MigrationHubConfig) GetHomeRegionRequest(input *GetHomeRegionInput) (req *request.Request, output *GetHomeRegionOutput) {
   292  	op := &request.Operation{
   293  		Name:       opGetHomeRegion,
   294  		HTTPMethod: "POST",
   295  		HTTPPath:   "/",
   296  	}
   297  
   298  	if input == nil {
   299  		input = &GetHomeRegionInput{}
   300  	}
   301  
   302  	output = &GetHomeRegionOutput{}
   303  	req = c.newRequest(op, input, output)
   304  	return
   305  }
   306  
   307  // GetHomeRegion API operation for AWS Migration Hub Config.
   308  //
   309  // Returns the calling account’s home region, if configured. This API is used
   310  // by other AWS services to determine the regional endpoint for calling AWS
   311  // Application Discovery Service and Migration Hub. You must call GetHomeRegion
   312  // at least once before you call any other AWS Application Discovery Service
   313  // and AWS Migration Hub APIs, to obtain the account's Migration Hub home region.
   314  //
   315  // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
   316  // with awserr.Error's Code and Message methods to get detailed information about
   317  // the error.
   318  //
   319  // See the AWS API reference guide for AWS Migration Hub Config's
   320  // API operation GetHomeRegion for usage and error information.
   321  //
   322  // Returned Error Types:
   323  //   * InternalServerError
   324  //   Exception raised when an internal, configuration, or dependency error is
   325  //   encountered.
   326  //
   327  //   * ServiceUnavailableException
   328  //   Exception raised when a request fails due to temporary unavailability of
   329  //   the service.
   330  //
   331  //   * AccessDeniedException
   332  //   You do not have sufficient access to perform this action.
   333  //
   334  //   * ThrottlingException
   335  //   The request was denied due to request throttling.
   336  //
   337  //   * InvalidInputException
   338  //   Exception raised when the provided input violates a policy constraint or
   339  //   is entered in the wrong format or data type.
   340  //
   341  // See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhub-config-2019-06-30/GetHomeRegion
   342  func (c *MigrationHubConfig) GetHomeRegion(input *GetHomeRegionInput) (*GetHomeRegionOutput, error) {
   343  	req, out := c.GetHomeRegionRequest(input)
   344  	return out, req.Send()
   345  }
   346  
   347  // GetHomeRegionWithContext is the same as GetHomeRegion with the addition of
   348  // the ability to pass a context and additional request options.
   349  //
   350  // See GetHomeRegion for details on how to use this API operation.
   351  //
   352  // The context must be non-nil and will be used for request cancellation. If
   353  // the context is nil a panic will occur. In the future the SDK may create
   354  // sub-contexts for http.Requests. See https://golang.org/pkg/context/
   355  // for more information on using Contexts.
   356  func (c *MigrationHubConfig) GetHomeRegionWithContext(ctx aws.Context, input *GetHomeRegionInput, opts ...request.Option) (*GetHomeRegionOutput, error) {
   357  	req, out := c.GetHomeRegionRequest(input)
   358  	req.SetContext(ctx)
   359  	req.ApplyOptions(opts...)
   360  	return out, req.Send()
   361  }
   362  
   363  // You do not have sufficient access to perform this action.
   364  type AccessDeniedException struct {
   365  	_            struct{}                  `type:"structure"`
   366  	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
   367  
   368  	Message_ *string `locationName:"Message" type:"string"`
   369  }
   370  
   371  // String returns the string representation.
   372  //
   373  // API parameter values that are decorated as "sensitive" in the API will not
   374  // be included in the string output. The member name will be present, but the
   375  // value will be replaced with "sensitive".
   376  func (s AccessDeniedException) String() string {
   377  	return awsutil.Prettify(s)
   378  }
   379  
   380  // GoString returns the string representation.
   381  //
   382  // API parameter values that are decorated as "sensitive" in the API will not
   383  // be included in the string output. The member name will be present, but the
   384  // value will be replaced with "sensitive".
   385  func (s AccessDeniedException) GoString() string {
   386  	return s.String()
   387  }
   388  
   389  func newErrorAccessDeniedException(v protocol.ResponseMetadata) error {
   390  	return &AccessDeniedException{
   391  		RespMetadata: v,
   392  	}
   393  }
   394  
   395  // Code returns the exception type name.
   396  func (s *AccessDeniedException) Code() string {
   397  	return "AccessDeniedException"
   398  }
   399  
   400  // Message returns the exception's message.
   401  func (s *AccessDeniedException) Message() string {
   402  	if s.Message_ != nil {
   403  		return *s.Message_
   404  	}
   405  	return ""
   406  }
   407  
   408  // OrigErr always returns nil, satisfies awserr.Error interface.
   409  func (s *AccessDeniedException) OrigErr() error {
   410  	return nil
   411  }
   412  
   413  func (s *AccessDeniedException) Error() string {
   414  	return fmt.Sprintf("%s: %s", s.Code(), s.Message())
   415  }
   416  
   417  // Status code returns the HTTP status code for the request's response error.
   418  func (s *AccessDeniedException) StatusCode() int {
   419  	return s.RespMetadata.StatusCode
   420  }
   421  
   422  // RequestID returns the service's response RequestID for request.
   423  func (s *AccessDeniedException) RequestID() string {
   424  	return s.RespMetadata.RequestID
   425  }
   426  
   427  type CreateHomeRegionControlInput struct {
   428  	_ struct{} `type:"structure"`
   429  
   430  	// Optional Boolean flag to indicate whether any effect should take place. It
   431  	// tests whether the caller has permission to make the call.
   432  	DryRun *bool `type:"boolean"`
   433  
   434  	// The name of the home region of the calling account.
   435  	//
   436  	// HomeRegion is a required field
   437  	HomeRegion *string `min:"1" type:"string" required:"true"`
   438  
   439  	// The account for which this command sets up a home region control. The Target
   440  	// is always of type ACCOUNT.
   441  	//
   442  	// Target is a required field
   443  	Target *Target `type:"structure" required:"true"`
   444  }
   445  
   446  // String returns the string representation.
   447  //
   448  // API parameter values that are decorated as "sensitive" in the API will not
   449  // be included in the string output. The member name will be present, but the
   450  // value will be replaced with "sensitive".
   451  func (s CreateHomeRegionControlInput) String() string {
   452  	return awsutil.Prettify(s)
   453  }
   454  
   455  // GoString returns the string representation.
   456  //
   457  // API parameter values that are decorated as "sensitive" in the API will not
   458  // be included in the string output. The member name will be present, but the
   459  // value will be replaced with "sensitive".
   460  func (s CreateHomeRegionControlInput) GoString() string {
   461  	return s.String()
   462  }
   463  
   464  // Validate inspects the fields of the type to determine if they are valid.
   465  func (s *CreateHomeRegionControlInput) Validate() error {
   466  	invalidParams := request.ErrInvalidParams{Context: "CreateHomeRegionControlInput"}
   467  	if s.HomeRegion == nil {
   468  		invalidParams.Add(request.NewErrParamRequired("HomeRegion"))
   469  	}
   470  	if s.HomeRegion != nil && len(*s.HomeRegion) < 1 {
   471  		invalidParams.Add(request.NewErrParamMinLen("HomeRegion", 1))
   472  	}
   473  	if s.Target == nil {
   474  		invalidParams.Add(request.NewErrParamRequired("Target"))
   475  	}
   476  	if s.Target != nil {
   477  		if err := s.Target.Validate(); err != nil {
   478  			invalidParams.AddNested("Target", err.(request.ErrInvalidParams))
   479  		}
   480  	}
   481  
   482  	if invalidParams.Len() > 0 {
   483  		return invalidParams
   484  	}
   485  	return nil
   486  }
   487  
   488  // SetDryRun sets the DryRun field's value.
   489  func (s *CreateHomeRegionControlInput) SetDryRun(v bool) *CreateHomeRegionControlInput {
   490  	s.DryRun = &v
   491  	return s
   492  }
   493  
   494  // SetHomeRegion sets the HomeRegion field's value.
   495  func (s *CreateHomeRegionControlInput) SetHomeRegion(v string) *CreateHomeRegionControlInput {
   496  	s.HomeRegion = &v
   497  	return s
   498  }
   499  
   500  // SetTarget sets the Target field's value.
   501  func (s *CreateHomeRegionControlInput) SetTarget(v *Target) *CreateHomeRegionControlInput {
   502  	s.Target = v
   503  	return s
   504  }
   505  
   506  type CreateHomeRegionControlOutput struct {
   507  	_ struct{} `type:"structure"`
   508  
   509  	// This object is the HomeRegionControl object that's returned by a successful
   510  	// call to CreateHomeRegionControl.
   511  	HomeRegionControl *HomeRegionControl `type:"structure"`
   512  }
   513  
   514  // String returns the string representation.
   515  //
   516  // API parameter values that are decorated as "sensitive" in the API will not
   517  // be included in the string output. The member name will be present, but the
   518  // value will be replaced with "sensitive".
   519  func (s CreateHomeRegionControlOutput) String() string {
   520  	return awsutil.Prettify(s)
   521  }
   522  
   523  // GoString returns the string representation.
   524  //
   525  // API parameter values that are decorated as "sensitive" in the API will not
   526  // be included in the string output. The member name will be present, but the
   527  // value will be replaced with "sensitive".
   528  func (s CreateHomeRegionControlOutput) GoString() string {
   529  	return s.String()
   530  }
   531  
   532  // SetHomeRegionControl sets the HomeRegionControl field's value.
   533  func (s *CreateHomeRegionControlOutput) SetHomeRegionControl(v *HomeRegionControl) *CreateHomeRegionControlOutput {
   534  	s.HomeRegionControl = v
   535  	return s
   536  }
   537  
   538  type DescribeHomeRegionControlsInput struct {
   539  	_ struct{} `type:"structure"`
   540  
   541  	// The ControlID is a unique identifier string of your HomeRegionControl object.
   542  	ControlId *string `min:"1" type:"string"`
   543  
   544  	// The name of the home region you'd like to view.
   545  	HomeRegion *string `min:"1" type:"string"`
   546  
   547  	// The maximum number of filtering results to display per page.
   548  	MaxResults *int64 `min:"1" type:"integer"`
   549  
   550  	// If a NextToken was returned by a previous call, more results are available.
   551  	// To retrieve the next page of results, make the call again using the returned
   552  	// token in NextToken.
   553  	NextToken *string `type:"string"`
   554  
   555  	// The target parameter specifies the identifier to which the home region is
   556  	// applied, which is always of type ACCOUNT. It applies the home region to the
   557  	// current ACCOUNT.
   558  	Target *Target `type:"structure"`
   559  }
   560  
   561  // String returns the string representation.
   562  //
   563  // API parameter values that are decorated as "sensitive" in the API will not
   564  // be included in the string output. The member name will be present, but the
   565  // value will be replaced with "sensitive".
   566  func (s DescribeHomeRegionControlsInput) String() string {
   567  	return awsutil.Prettify(s)
   568  }
   569  
   570  // GoString returns the string representation.
   571  //
   572  // API parameter values that are decorated as "sensitive" in the API will not
   573  // be included in the string output. The member name will be present, but the
   574  // value will be replaced with "sensitive".
   575  func (s DescribeHomeRegionControlsInput) GoString() string {
   576  	return s.String()
   577  }
   578  
   579  // Validate inspects the fields of the type to determine if they are valid.
   580  func (s *DescribeHomeRegionControlsInput) Validate() error {
   581  	invalidParams := request.ErrInvalidParams{Context: "DescribeHomeRegionControlsInput"}
   582  	if s.ControlId != nil && len(*s.ControlId) < 1 {
   583  		invalidParams.Add(request.NewErrParamMinLen("ControlId", 1))
   584  	}
   585  	if s.HomeRegion != nil && len(*s.HomeRegion) < 1 {
   586  		invalidParams.Add(request.NewErrParamMinLen("HomeRegion", 1))
   587  	}
   588  	if s.MaxResults != nil && *s.MaxResults < 1 {
   589  		invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
   590  	}
   591  	if s.Target != nil {
   592  		if err := s.Target.Validate(); err != nil {
   593  			invalidParams.AddNested("Target", err.(request.ErrInvalidParams))
   594  		}
   595  	}
   596  
   597  	if invalidParams.Len() > 0 {
   598  		return invalidParams
   599  	}
   600  	return nil
   601  }
   602  
   603  // SetControlId sets the ControlId field's value.
   604  func (s *DescribeHomeRegionControlsInput) SetControlId(v string) *DescribeHomeRegionControlsInput {
   605  	s.ControlId = &v
   606  	return s
   607  }
   608  
   609  // SetHomeRegion sets the HomeRegion field's value.
   610  func (s *DescribeHomeRegionControlsInput) SetHomeRegion(v string) *DescribeHomeRegionControlsInput {
   611  	s.HomeRegion = &v
   612  	return s
   613  }
   614  
   615  // SetMaxResults sets the MaxResults field's value.
   616  func (s *DescribeHomeRegionControlsInput) SetMaxResults(v int64) *DescribeHomeRegionControlsInput {
   617  	s.MaxResults = &v
   618  	return s
   619  }
   620  
   621  // SetNextToken sets the NextToken field's value.
   622  func (s *DescribeHomeRegionControlsInput) SetNextToken(v string) *DescribeHomeRegionControlsInput {
   623  	s.NextToken = &v
   624  	return s
   625  }
   626  
   627  // SetTarget sets the Target field's value.
   628  func (s *DescribeHomeRegionControlsInput) SetTarget(v *Target) *DescribeHomeRegionControlsInput {
   629  	s.Target = v
   630  	return s
   631  }
   632  
   633  type DescribeHomeRegionControlsOutput struct {
   634  	_ struct{} `type:"structure"`
   635  
   636  	// An array that contains your HomeRegionControl objects.
   637  	HomeRegionControls []*HomeRegionControl `type:"list"`
   638  
   639  	// If a NextToken was returned by a previous call, more results are available.
   640  	// To retrieve the next page of results, make the call again using the returned
   641  	// token in NextToken.
   642  	NextToken *string `type:"string"`
   643  }
   644  
   645  // String returns the string representation.
   646  //
   647  // API parameter values that are decorated as "sensitive" in the API will not
   648  // be included in the string output. The member name will be present, but the
   649  // value will be replaced with "sensitive".
   650  func (s DescribeHomeRegionControlsOutput) String() string {
   651  	return awsutil.Prettify(s)
   652  }
   653  
   654  // GoString returns the string representation.
   655  //
   656  // API parameter values that are decorated as "sensitive" in the API will not
   657  // be included in the string output. The member name will be present, but the
   658  // value will be replaced with "sensitive".
   659  func (s DescribeHomeRegionControlsOutput) GoString() string {
   660  	return s.String()
   661  }
   662  
   663  // SetHomeRegionControls sets the HomeRegionControls field's value.
   664  func (s *DescribeHomeRegionControlsOutput) SetHomeRegionControls(v []*HomeRegionControl) *DescribeHomeRegionControlsOutput {
   665  	s.HomeRegionControls = v
   666  	return s
   667  }
   668  
   669  // SetNextToken sets the NextToken field's value.
   670  func (s *DescribeHomeRegionControlsOutput) SetNextToken(v string) *DescribeHomeRegionControlsOutput {
   671  	s.NextToken = &v
   672  	return s
   673  }
   674  
   675  // Exception raised to indicate that authorization of an action was successful,
   676  // when the DryRun flag is set to true.
   677  type DryRunOperation struct {
   678  	_            struct{}                  `type:"structure"`
   679  	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
   680  
   681  	Message_ *string `locationName:"Message" type:"string"`
   682  }
   683  
   684  // String returns the string representation.
   685  //
   686  // API parameter values that are decorated as "sensitive" in the API will not
   687  // be included in the string output. The member name will be present, but the
   688  // value will be replaced with "sensitive".
   689  func (s DryRunOperation) String() string {
   690  	return awsutil.Prettify(s)
   691  }
   692  
   693  // GoString returns the string representation.
   694  //
   695  // API parameter values that are decorated as "sensitive" in the API will not
   696  // be included in the string output. The member name will be present, but the
   697  // value will be replaced with "sensitive".
   698  func (s DryRunOperation) GoString() string {
   699  	return s.String()
   700  }
   701  
   702  func newErrorDryRunOperation(v protocol.ResponseMetadata) error {
   703  	return &DryRunOperation{
   704  		RespMetadata: v,
   705  	}
   706  }
   707  
   708  // Code returns the exception type name.
   709  func (s *DryRunOperation) Code() string {
   710  	return "DryRunOperation"
   711  }
   712  
   713  // Message returns the exception's message.
   714  func (s *DryRunOperation) Message() string {
   715  	if s.Message_ != nil {
   716  		return *s.Message_
   717  	}
   718  	return ""
   719  }
   720  
   721  // OrigErr always returns nil, satisfies awserr.Error interface.
   722  func (s *DryRunOperation) OrigErr() error {
   723  	return nil
   724  }
   725  
   726  func (s *DryRunOperation) Error() string {
   727  	return fmt.Sprintf("%s: %s", s.Code(), s.Message())
   728  }
   729  
   730  // Status code returns the HTTP status code for the request's response error.
   731  func (s *DryRunOperation) StatusCode() int {
   732  	return s.RespMetadata.StatusCode
   733  }
   734  
   735  // RequestID returns the service's response RequestID for request.
   736  func (s *DryRunOperation) RequestID() string {
   737  	return s.RespMetadata.RequestID
   738  }
   739  
   740  type GetHomeRegionInput struct {
   741  	_ struct{} `type:"structure"`
   742  }
   743  
   744  // String returns the string representation.
   745  //
   746  // API parameter values that are decorated as "sensitive" in the API will not
   747  // be included in the string output. The member name will be present, but the
   748  // value will be replaced with "sensitive".
   749  func (s GetHomeRegionInput) String() string {
   750  	return awsutil.Prettify(s)
   751  }
   752  
   753  // GoString returns the string representation.
   754  //
   755  // API parameter values that are decorated as "sensitive" in the API will not
   756  // be included in the string output. The member name will be present, but the
   757  // value will be replaced with "sensitive".
   758  func (s GetHomeRegionInput) GoString() string {
   759  	return s.String()
   760  }
   761  
   762  type GetHomeRegionOutput struct {
   763  	_ struct{} `type:"structure"`
   764  
   765  	// The name of the home region of the calling account.
   766  	HomeRegion *string `min:"1" type:"string"`
   767  }
   768  
   769  // String returns the string representation.
   770  //
   771  // API parameter values that are decorated as "sensitive" in the API will not
   772  // be included in the string output. The member name will be present, but the
   773  // value will be replaced with "sensitive".
   774  func (s GetHomeRegionOutput) String() string {
   775  	return awsutil.Prettify(s)
   776  }
   777  
   778  // GoString returns the string representation.
   779  //
   780  // API parameter values that are decorated as "sensitive" in the API will not
   781  // be included in the string output. The member name will be present, but the
   782  // value will be replaced with "sensitive".
   783  func (s GetHomeRegionOutput) GoString() string {
   784  	return s.String()
   785  }
   786  
   787  // SetHomeRegion sets the HomeRegion field's value.
   788  func (s *GetHomeRegionOutput) SetHomeRegion(v string) *GetHomeRegionOutput {
   789  	s.HomeRegion = &v
   790  	return s
   791  }
   792  
   793  // A home region control is an object that specifies the home region for an
   794  // account, with some additional information. It contains a target (always of
   795  // type ACCOUNT), an ID, and a time at which the home region was set.
   796  type HomeRegionControl struct {
   797  	_ struct{} `type:"structure"`
   798  
   799  	// A unique identifier that's generated for each home region control. It's always
   800  	// a string that begins with "hrc-" followed by 12 lowercase letters and numbers.
   801  	ControlId *string `min:"1" type:"string"`
   802  
   803  	// The AWS Region that's been set as home region. For example, "us-west-2" or
   804  	// "eu-central-1" are valid home regions.
   805  	HomeRegion *string `min:"1" type:"string"`
   806  
   807  	// A timestamp representing the time when the customer called CreateHomeregionControl
   808  	// and set the home region for the account.
   809  	RequestedTime *time.Time `type:"timestamp"`
   810  
   811  	// The target parameter specifies the identifier to which the home region is
   812  	// applied, which is always an ACCOUNT. It applies the home region to the current
   813  	// ACCOUNT.
   814  	Target *Target `type:"structure"`
   815  }
   816  
   817  // String returns the string representation.
   818  //
   819  // API parameter values that are decorated as "sensitive" in the API will not
   820  // be included in the string output. The member name will be present, but the
   821  // value will be replaced with "sensitive".
   822  func (s HomeRegionControl) String() string {
   823  	return awsutil.Prettify(s)
   824  }
   825  
   826  // GoString returns the string representation.
   827  //
   828  // API parameter values that are decorated as "sensitive" in the API will not
   829  // be included in the string output. The member name will be present, but the
   830  // value will be replaced with "sensitive".
   831  func (s HomeRegionControl) GoString() string {
   832  	return s.String()
   833  }
   834  
   835  // SetControlId sets the ControlId field's value.
   836  func (s *HomeRegionControl) SetControlId(v string) *HomeRegionControl {
   837  	s.ControlId = &v
   838  	return s
   839  }
   840  
   841  // SetHomeRegion sets the HomeRegion field's value.
   842  func (s *HomeRegionControl) SetHomeRegion(v string) *HomeRegionControl {
   843  	s.HomeRegion = &v
   844  	return s
   845  }
   846  
   847  // SetRequestedTime sets the RequestedTime field's value.
   848  func (s *HomeRegionControl) SetRequestedTime(v time.Time) *HomeRegionControl {
   849  	s.RequestedTime = &v
   850  	return s
   851  }
   852  
   853  // SetTarget sets the Target field's value.
   854  func (s *HomeRegionControl) SetTarget(v *Target) *HomeRegionControl {
   855  	s.Target = v
   856  	return s
   857  }
   858  
   859  // Exception raised when an internal, configuration, or dependency error is
   860  // encountered.
   861  type InternalServerError struct {
   862  	_            struct{}                  `type:"structure"`
   863  	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
   864  
   865  	Message_ *string `locationName:"Message" type:"string"`
   866  }
   867  
   868  // String returns the string representation.
   869  //
   870  // API parameter values that are decorated as "sensitive" in the API will not
   871  // be included in the string output. The member name will be present, but the
   872  // value will be replaced with "sensitive".
   873  func (s InternalServerError) String() string {
   874  	return awsutil.Prettify(s)
   875  }
   876  
   877  // GoString returns the string representation.
   878  //
   879  // API parameter values that are decorated as "sensitive" in the API will not
   880  // be included in the string output. The member name will be present, but the
   881  // value will be replaced with "sensitive".
   882  func (s InternalServerError) GoString() string {
   883  	return s.String()
   884  }
   885  
   886  func newErrorInternalServerError(v protocol.ResponseMetadata) error {
   887  	return &InternalServerError{
   888  		RespMetadata: v,
   889  	}
   890  }
   891  
   892  // Code returns the exception type name.
   893  func (s *InternalServerError) Code() string {
   894  	return "InternalServerError"
   895  }
   896  
   897  // Message returns the exception's message.
   898  func (s *InternalServerError) Message() string {
   899  	if s.Message_ != nil {
   900  		return *s.Message_
   901  	}
   902  	return ""
   903  }
   904  
   905  // OrigErr always returns nil, satisfies awserr.Error interface.
   906  func (s *InternalServerError) OrigErr() error {
   907  	return nil
   908  }
   909  
   910  func (s *InternalServerError) Error() string {
   911  	return fmt.Sprintf("%s: %s", s.Code(), s.Message())
   912  }
   913  
   914  // Status code returns the HTTP status code for the request's response error.
   915  func (s *InternalServerError) StatusCode() int {
   916  	return s.RespMetadata.StatusCode
   917  }
   918  
   919  // RequestID returns the service's response RequestID for request.
   920  func (s *InternalServerError) RequestID() string {
   921  	return s.RespMetadata.RequestID
   922  }
   923  
   924  // Exception raised when the provided input violates a policy constraint or
   925  // is entered in the wrong format or data type.
   926  type InvalidInputException struct {
   927  	_            struct{}                  `type:"structure"`
   928  	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
   929  
   930  	Message_ *string `locationName:"Message" type:"string"`
   931  }
   932  
   933  // String returns the string representation.
   934  //
   935  // API parameter values that are decorated as "sensitive" in the API will not
   936  // be included in the string output. The member name will be present, but the
   937  // value will be replaced with "sensitive".
   938  func (s InvalidInputException) String() string {
   939  	return awsutil.Prettify(s)
   940  }
   941  
   942  // GoString returns the string representation.
   943  //
   944  // API parameter values that are decorated as "sensitive" in the API will not
   945  // be included in the string output. The member name will be present, but the
   946  // value will be replaced with "sensitive".
   947  func (s InvalidInputException) GoString() string {
   948  	return s.String()
   949  }
   950  
   951  func newErrorInvalidInputException(v protocol.ResponseMetadata) error {
   952  	return &InvalidInputException{
   953  		RespMetadata: v,
   954  	}
   955  }
   956  
   957  // Code returns the exception type name.
   958  func (s *InvalidInputException) Code() string {
   959  	return "InvalidInputException"
   960  }
   961  
   962  // Message returns the exception's message.
   963  func (s *InvalidInputException) Message() string {
   964  	if s.Message_ != nil {
   965  		return *s.Message_
   966  	}
   967  	return ""
   968  }
   969  
   970  // OrigErr always returns nil, satisfies awserr.Error interface.
   971  func (s *InvalidInputException) OrigErr() error {
   972  	return nil
   973  }
   974  
   975  func (s *InvalidInputException) Error() string {
   976  	return fmt.Sprintf("%s: %s", s.Code(), s.Message())
   977  }
   978  
   979  // Status code returns the HTTP status code for the request's response error.
   980  func (s *InvalidInputException) StatusCode() int {
   981  	return s.RespMetadata.StatusCode
   982  }
   983  
   984  // RequestID returns the service's response RequestID for request.
   985  func (s *InvalidInputException) RequestID() string {
   986  	return s.RespMetadata.RequestID
   987  }
   988  
   989  // Exception raised when a request fails due to temporary unavailability of
   990  // the service.
   991  type ServiceUnavailableException struct {
   992  	_            struct{}                  `type:"structure"`
   993  	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
   994  
   995  	Message_ *string `locationName:"Message" type:"string"`
   996  }
   997  
   998  // String returns the string representation.
   999  //
  1000  // API parameter values that are decorated as "sensitive" in the API will not
  1001  // be included in the string output. The member name will be present, but the
  1002  // value will be replaced with "sensitive".
  1003  func (s ServiceUnavailableException) String() string {
  1004  	return awsutil.Prettify(s)
  1005  }
  1006  
  1007  // GoString returns the string representation.
  1008  //
  1009  // API parameter values that are decorated as "sensitive" in the API will not
  1010  // be included in the string output. The member name will be present, but the
  1011  // value will be replaced with "sensitive".
  1012  func (s ServiceUnavailableException) GoString() string {
  1013  	return s.String()
  1014  }
  1015  
  1016  func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error {
  1017  	return &ServiceUnavailableException{
  1018  		RespMetadata: v,
  1019  	}
  1020  }
  1021  
  1022  // Code returns the exception type name.
  1023  func (s *ServiceUnavailableException) Code() string {
  1024  	return "ServiceUnavailableException"
  1025  }
  1026  
  1027  // Message returns the exception's message.
  1028  func (s *ServiceUnavailableException) Message() string {
  1029  	if s.Message_ != nil {
  1030  		return *s.Message_
  1031  	}
  1032  	return ""
  1033  }
  1034  
  1035  // OrigErr always returns nil, satisfies awserr.Error interface.
  1036  func (s *ServiceUnavailableException) OrigErr() error {
  1037  	return nil
  1038  }
  1039  
  1040  func (s *ServiceUnavailableException) Error() string {
  1041  	return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  1042  }
  1043  
  1044  // Status code returns the HTTP status code for the request's response error.
  1045  func (s *ServiceUnavailableException) StatusCode() int {
  1046  	return s.RespMetadata.StatusCode
  1047  }
  1048  
  1049  // RequestID returns the service's response RequestID for request.
  1050  func (s *ServiceUnavailableException) RequestID() string {
  1051  	return s.RespMetadata.RequestID
  1052  }
  1053  
  1054  // The target parameter specifies the identifier to which the home region is
  1055  // applied, which is always an ACCOUNT. It applies the home region to the current
  1056  // ACCOUNT.
  1057  type Target struct {
  1058  	_ struct{} `type:"structure"`
  1059  
  1060  	// The TargetID is a 12-character identifier of the ACCOUNT for which the control
  1061  	// was created. (This must be the current account.)
  1062  	Id *string `min:"12" type:"string"`
  1063  
  1064  	// The target type is always an ACCOUNT.
  1065  	//
  1066  	// Type is a required field
  1067  	Type *string `type:"string" required:"true" enum:"TargetType"`
  1068  }
  1069  
  1070  // String returns the string representation.
  1071  //
  1072  // API parameter values that are decorated as "sensitive" in the API will not
  1073  // be included in the string output. The member name will be present, but the
  1074  // value will be replaced with "sensitive".
  1075  func (s Target) String() string {
  1076  	return awsutil.Prettify(s)
  1077  }
  1078  
  1079  // GoString returns the string representation.
  1080  //
  1081  // API parameter values that are decorated as "sensitive" in the API will not
  1082  // be included in the string output. The member name will be present, but the
  1083  // value will be replaced with "sensitive".
  1084  func (s Target) GoString() string {
  1085  	return s.String()
  1086  }
  1087  
  1088  // Validate inspects the fields of the type to determine if they are valid.
  1089  func (s *Target) Validate() error {
  1090  	invalidParams := request.ErrInvalidParams{Context: "Target"}
  1091  	if s.Id != nil && len(*s.Id) < 12 {
  1092  		invalidParams.Add(request.NewErrParamMinLen("Id", 12))
  1093  	}
  1094  	if s.Type == nil {
  1095  		invalidParams.Add(request.NewErrParamRequired("Type"))
  1096  	}
  1097  
  1098  	if invalidParams.Len() > 0 {
  1099  		return invalidParams
  1100  	}
  1101  	return nil
  1102  }
  1103  
  1104  // SetId sets the Id field's value.
  1105  func (s *Target) SetId(v string) *Target {
  1106  	s.Id = &v
  1107  	return s
  1108  }
  1109  
  1110  // SetType sets the Type field's value.
  1111  func (s *Target) SetType(v string) *Target {
  1112  	s.Type = &v
  1113  	return s
  1114  }
  1115  
  1116  // The request was denied due to request throttling.
  1117  type ThrottlingException struct {
  1118  	_            struct{}                  `type:"structure"`
  1119  	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
  1120  
  1121  	Message_ *string `locationName:"Message" type:"string"`
  1122  
  1123  	// The number of seconds the caller should wait before retrying.
  1124  	RetryAfterSeconds *int64 `type:"integer"`
  1125  }
  1126  
  1127  // String returns the string representation.
  1128  //
  1129  // API parameter values that are decorated as "sensitive" in the API will not
  1130  // be included in the string output. The member name will be present, but the
  1131  // value will be replaced with "sensitive".
  1132  func (s ThrottlingException) String() string {
  1133  	return awsutil.Prettify(s)
  1134  }
  1135  
  1136  // GoString returns the string representation.
  1137  //
  1138  // API parameter values that are decorated as "sensitive" in the API will not
  1139  // be included in the string output. The member name will be present, but the
  1140  // value will be replaced with "sensitive".
  1141  func (s ThrottlingException) GoString() string {
  1142  	return s.String()
  1143  }
  1144  
  1145  func newErrorThrottlingException(v protocol.ResponseMetadata) error {
  1146  	return &ThrottlingException{
  1147  		RespMetadata: v,
  1148  	}
  1149  }
  1150  
  1151  // Code returns the exception type name.
  1152  func (s *ThrottlingException) Code() string {
  1153  	return "ThrottlingException"
  1154  }
  1155  
  1156  // Message returns the exception's message.
  1157  func (s *ThrottlingException) Message() string {
  1158  	if s.Message_ != nil {
  1159  		return *s.Message_
  1160  	}
  1161  	return ""
  1162  }
  1163  
  1164  // OrigErr always returns nil, satisfies awserr.Error interface.
  1165  func (s *ThrottlingException) OrigErr() error {
  1166  	return nil
  1167  }
  1168  
  1169  func (s *ThrottlingException) Error() string {
  1170  	return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String())
  1171  }
  1172  
  1173  // Status code returns the HTTP status code for the request's response error.
  1174  func (s *ThrottlingException) StatusCode() int {
  1175  	return s.RespMetadata.StatusCode
  1176  }
  1177  
  1178  // RequestID returns the service's response RequestID for request.
  1179  func (s *ThrottlingException) RequestID() string {
  1180  	return s.RespMetadata.RequestID
  1181  }
  1182  
  1183  const (
  1184  	// TargetTypeAccount is a TargetType enum value
  1185  	TargetTypeAccount = "ACCOUNT"
  1186  )
  1187  
  1188  // TargetType_Values returns all elements of the TargetType enum
  1189  func TargetType_Values() []string {
  1190  	return []string{
  1191  		TargetTypeAccount,
  1192  	}
  1193  }