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

     1  // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
     2  
     3  package apigatewaymanagementapi
     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  	"github.com/aavshr/aws-sdk-go/private/protocol/restjson"
    14  )
    15  
    16  const opDeleteConnection = "DeleteConnection"
    17  
    18  // DeleteConnectionRequest generates a "aws/request.Request" representing the
    19  // client's request for the DeleteConnection operation. The "output" return
    20  // value will be populated with the request's response once the request completes
    21  // successfully.
    22  //
    23  // Use "Send" method on the returned Request to send the API call to the service.
    24  // the "output" return value is not valid until after Send returns without error.
    25  //
    26  // See DeleteConnection for more information on using the DeleteConnection
    27  // API call, and error handling.
    28  //
    29  // This method is useful when you want to inject custom logic or configuration
    30  // into the SDK's request lifecycle. Such as custom headers, or retry logic.
    31  //
    32  //
    33  //    // Example sending a request using the DeleteConnectionRequest method.
    34  //    req, resp := client.DeleteConnectionRequest(params)
    35  //
    36  //    err := req.Send()
    37  //    if err == nil { // resp is now filled
    38  //        fmt.Println(resp)
    39  //    }
    40  //
    41  // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewaymanagementapi-2018-11-29/DeleteConnection
    42  func (c *ApiGatewayManagementApi) DeleteConnectionRequest(input *DeleteConnectionInput) (req *request.Request, output *DeleteConnectionOutput) {
    43  	op := &request.Operation{
    44  		Name:       opDeleteConnection,
    45  		HTTPMethod: "DELETE",
    46  		HTTPPath:   "/@connections/{connectionId}",
    47  	}
    48  
    49  	if input == nil {
    50  		input = &DeleteConnectionInput{}
    51  	}
    52  
    53  	output = &DeleteConnectionOutput{}
    54  	req = c.newRequest(op, input, output)
    55  	req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
    56  	return
    57  }
    58  
    59  // DeleteConnection API operation for AmazonApiGatewayManagementApi.
    60  //
    61  // Delete the connection with the provided id.
    62  //
    63  // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
    64  // with awserr.Error's Code and Message methods to get detailed information about
    65  // the error.
    66  //
    67  // See the AWS API reference guide for AmazonApiGatewayManagementApi's
    68  // API operation DeleteConnection for usage and error information.
    69  //
    70  // Returned Error Types:
    71  //   * GoneException
    72  //   The connection with the provided id no longer exists.
    73  //
    74  //   * LimitExceededException
    75  //   The client is sending more than the allowed number of requests per unit of
    76  //   time or the WebSocket client side buffer is full.
    77  //
    78  //   * ForbiddenException
    79  //   The caller is not authorized to invoke this operation.
    80  //
    81  // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewaymanagementapi-2018-11-29/DeleteConnection
    82  func (c *ApiGatewayManagementApi) DeleteConnection(input *DeleteConnectionInput) (*DeleteConnectionOutput, error) {
    83  	req, out := c.DeleteConnectionRequest(input)
    84  	return out, req.Send()
    85  }
    86  
    87  // DeleteConnectionWithContext is the same as DeleteConnection with the addition of
    88  // the ability to pass a context and additional request options.
    89  //
    90  // See DeleteConnection for details on how to use this API operation.
    91  //
    92  // The context must be non-nil and will be used for request cancellation. If
    93  // the context is nil a panic will occur. In the future the SDK may create
    94  // sub-contexts for http.Requests. See https://golang.org/pkg/context/
    95  // for more information on using Contexts.
    96  func (c *ApiGatewayManagementApi) DeleteConnectionWithContext(ctx aws.Context, input *DeleteConnectionInput, opts ...request.Option) (*DeleteConnectionOutput, error) {
    97  	req, out := c.DeleteConnectionRequest(input)
    98  	req.SetContext(ctx)
    99  	req.ApplyOptions(opts...)
   100  	return out, req.Send()
   101  }
   102  
   103  const opGetConnection = "GetConnection"
   104  
   105  // GetConnectionRequest generates a "aws/request.Request" representing the
   106  // client's request for the GetConnection operation. The "output" return
   107  // value will be populated with the request's response once the request completes
   108  // successfully.
   109  //
   110  // Use "Send" method on the returned Request to send the API call to the service.
   111  // the "output" return value is not valid until after Send returns without error.
   112  //
   113  // See GetConnection for more information on using the GetConnection
   114  // API call, and error handling.
   115  //
   116  // This method is useful when you want to inject custom logic or configuration
   117  // into the SDK's request lifecycle. Such as custom headers, or retry logic.
   118  //
   119  //
   120  //    // Example sending a request using the GetConnectionRequest method.
   121  //    req, resp := client.GetConnectionRequest(params)
   122  //
   123  //    err := req.Send()
   124  //    if err == nil { // resp is now filled
   125  //        fmt.Println(resp)
   126  //    }
   127  //
   128  // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewaymanagementapi-2018-11-29/GetConnection
   129  func (c *ApiGatewayManagementApi) GetConnectionRequest(input *GetConnectionInput) (req *request.Request, output *GetConnectionOutput) {
   130  	op := &request.Operation{
   131  		Name:       opGetConnection,
   132  		HTTPMethod: "GET",
   133  		HTTPPath:   "/@connections/{connectionId}",
   134  	}
   135  
   136  	if input == nil {
   137  		input = &GetConnectionInput{}
   138  	}
   139  
   140  	output = &GetConnectionOutput{}
   141  	req = c.newRequest(op, input, output)
   142  	return
   143  }
   144  
   145  // GetConnection API operation for AmazonApiGatewayManagementApi.
   146  //
   147  // Get information about the connection with the provided id.
   148  //
   149  // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
   150  // with awserr.Error's Code and Message methods to get detailed information about
   151  // the error.
   152  //
   153  // See the AWS API reference guide for AmazonApiGatewayManagementApi's
   154  // API operation GetConnection for usage and error information.
   155  //
   156  // Returned Error Types:
   157  //   * GoneException
   158  //   The connection with the provided id no longer exists.
   159  //
   160  //   * LimitExceededException
   161  //   The client is sending more than the allowed number of requests per unit of
   162  //   time or the WebSocket client side buffer is full.
   163  //
   164  //   * ForbiddenException
   165  //   The caller is not authorized to invoke this operation.
   166  //
   167  // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewaymanagementapi-2018-11-29/GetConnection
   168  func (c *ApiGatewayManagementApi) GetConnection(input *GetConnectionInput) (*GetConnectionOutput, error) {
   169  	req, out := c.GetConnectionRequest(input)
   170  	return out, req.Send()
   171  }
   172  
   173  // GetConnectionWithContext is the same as GetConnection with the addition of
   174  // the ability to pass a context and additional request options.
   175  //
   176  // See GetConnection for details on how to use this API operation.
   177  //
   178  // The context must be non-nil and will be used for request cancellation. If
   179  // the context is nil a panic will occur. In the future the SDK may create
   180  // sub-contexts for http.Requests. See https://golang.org/pkg/context/
   181  // for more information on using Contexts.
   182  func (c *ApiGatewayManagementApi) GetConnectionWithContext(ctx aws.Context, input *GetConnectionInput, opts ...request.Option) (*GetConnectionOutput, error) {
   183  	req, out := c.GetConnectionRequest(input)
   184  	req.SetContext(ctx)
   185  	req.ApplyOptions(opts...)
   186  	return out, req.Send()
   187  }
   188  
   189  const opPostToConnection = "PostToConnection"
   190  
   191  // PostToConnectionRequest generates a "aws/request.Request" representing the
   192  // client's request for the PostToConnection operation. The "output" return
   193  // value will be populated with the request's response once the request completes
   194  // successfully.
   195  //
   196  // Use "Send" method on the returned Request to send the API call to the service.
   197  // the "output" return value is not valid until after Send returns without error.
   198  //
   199  // See PostToConnection for more information on using the PostToConnection
   200  // API call, and error handling.
   201  //
   202  // This method is useful when you want to inject custom logic or configuration
   203  // into the SDK's request lifecycle. Such as custom headers, or retry logic.
   204  //
   205  //
   206  //    // Example sending a request using the PostToConnectionRequest method.
   207  //    req, resp := client.PostToConnectionRequest(params)
   208  //
   209  //    err := req.Send()
   210  //    if err == nil { // resp is now filled
   211  //        fmt.Println(resp)
   212  //    }
   213  //
   214  // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewaymanagementapi-2018-11-29/PostToConnection
   215  func (c *ApiGatewayManagementApi) PostToConnectionRequest(input *PostToConnectionInput) (req *request.Request, output *PostToConnectionOutput) {
   216  	op := &request.Operation{
   217  		Name:       opPostToConnection,
   218  		HTTPMethod: "POST",
   219  		HTTPPath:   "/@connections/{connectionId}",
   220  	}
   221  
   222  	if input == nil {
   223  		input = &PostToConnectionInput{}
   224  	}
   225  
   226  	output = &PostToConnectionOutput{}
   227  	req = c.newRequest(op, input, output)
   228  	req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
   229  	return
   230  }
   231  
   232  // PostToConnection API operation for AmazonApiGatewayManagementApi.
   233  //
   234  // Sends the provided data to the specified connection.
   235  //
   236  // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
   237  // with awserr.Error's Code and Message methods to get detailed information about
   238  // the error.
   239  //
   240  // See the AWS API reference guide for AmazonApiGatewayManagementApi's
   241  // API operation PostToConnection for usage and error information.
   242  //
   243  // Returned Error Types:
   244  //   * GoneException
   245  //   The connection with the provided id no longer exists.
   246  //
   247  //   * LimitExceededException
   248  //   The client is sending more than the allowed number of requests per unit of
   249  //   time or the WebSocket client side buffer is full.
   250  //
   251  //   * PayloadTooLargeException
   252  //   The data has exceeded the maximum size allowed.
   253  //
   254  //   * ForbiddenException
   255  //   The caller is not authorized to invoke this operation.
   256  //
   257  // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewaymanagementapi-2018-11-29/PostToConnection
   258  func (c *ApiGatewayManagementApi) PostToConnection(input *PostToConnectionInput) (*PostToConnectionOutput, error) {
   259  	req, out := c.PostToConnectionRequest(input)
   260  	return out, req.Send()
   261  }
   262  
   263  // PostToConnectionWithContext is the same as PostToConnection with the addition of
   264  // the ability to pass a context and additional request options.
   265  //
   266  // See PostToConnection for details on how to use this API operation.
   267  //
   268  // The context must be non-nil and will be used for request cancellation. If
   269  // the context is nil a panic will occur. In the future the SDK may create
   270  // sub-contexts for http.Requests. See https://golang.org/pkg/context/
   271  // for more information on using Contexts.
   272  func (c *ApiGatewayManagementApi) PostToConnectionWithContext(ctx aws.Context, input *PostToConnectionInput, opts ...request.Option) (*PostToConnectionOutput, error) {
   273  	req, out := c.PostToConnectionRequest(input)
   274  	req.SetContext(ctx)
   275  	req.ApplyOptions(opts...)
   276  	return out, req.Send()
   277  }
   278  
   279  type DeleteConnectionInput struct {
   280  	_ struct{} `type:"structure" nopayload:"true"`
   281  
   282  	// ConnectionId is a required field
   283  	ConnectionId *string `location:"uri" locationName:"connectionId" type:"string" required:"true"`
   284  }
   285  
   286  // String returns the string representation.
   287  //
   288  // API parameter values that are decorated as "sensitive" in the API will not
   289  // be included in the string output. The member name will be present, but the
   290  // value will be replaced with "sensitive".
   291  func (s DeleteConnectionInput) String() string {
   292  	return awsutil.Prettify(s)
   293  }
   294  
   295  // GoString returns the string representation.
   296  //
   297  // API parameter values that are decorated as "sensitive" in the API will not
   298  // be included in the string output. The member name will be present, but the
   299  // value will be replaced with "sensitive".
   300  func (s DeleteConnectionInput) GoString() string {
   301  	return s.String()
   302  }
   303  
   304  // Validate inspects the fields of the type to determine if they are valid.
   305  func (s *DeleteConnectionInput) Validate() error {
   306  	invalidParams := request.ErrInvalidParams{Context: "DeleteConnectionInput"}
   307  	if s.ConnectionId == nil {
   308  		invalidParams.Add(request.NewErrParamRequired("ConnectionId"))
   309  	}
   310  	if s.ConnectionId != nil && len(*s.ConnectionId) < 1 {
   311  		invalidParams.Add(request.NewErrParamMinLen("ConnectionId", 1))
   312  	}
   313  
   314  	if invalidParams.Len() > 0 {
   315  		return invalidParams
   316  	}
   317  	return nil
   318  }
   319  
   320  // SetConnectionId sets the ConnectionId field's value.
   321  func (s *DeleteConnectionInput) SetConnectionId(v string) *DeleteConnectionInput {
   322  	s.ConnectionId = &v
   323  	return s
   324  }
   325  
   326  type DeleteConnectionOutput struct {
   327  	_ struct{} `type:"structure" nopayload:"true"`
   328  }
   329  
   330  // String returns the string representation.
   331  //
   332  // API parameter values that are decorated as "sensitive" in the API will not
   333  // be included in the string output. The member name will be present, but the
   334  // value will be replaced with "sensitive".
   335  func (s DeleteConnectionOutput) String() string {
   336  	return awsutil.Prettify(s)
   337  }
   338  
   339  // GoString returns the string representation.
   340  //
   341  // API parameter values that are decorated as "sensitive" in the API will not
   342  // be included in the string output. The member name will be present, but the
   343  // value will be replaced with "sensitive".
   344  func (s DeleteConnectionOutput) GoString() string {
   345  	return s.String()
   346  }
   347  
   348  // The caller is not authorized to invoke this operation.
   349  type ForbiddenException struct {
   350  	_            struct{}                  `type:"structure"`
   351  	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
   352  
   353  	Message_ *string `locationName:"message" type:"string"`
   354  }
   355  
   356  // String returns the string representation.
   357  //
   358  // API parameter values that are decorated as "sensitive" in the API will not
   359  // be included in the string output. The member name will be present, but the
   360  // value will be replaced with "sensitive".
   361  func (s ForbiddenException) String() string {
   362  	return awsutil.Prettify(s)
   363  }
   364  
   365  // GoString returns the string representation.
   366  //
   367  // API parameter values that are decorated as "sensitive" in the API will not
   368  // be included in the string output. The member name will be present, but the
   369  // value will be replaced with "sensitive".
   370  func (s ForbiddenException) GoString() string {
   371  	return s.String()
   372  }
   373  
   374  func newErrorForbiddenException(v protocol.ResponseMetadata) error {
   375  	return &ForbiddenException{
   376  		RespMetadata: v,
   377  	}
   378  }
   379  
   380  // Code returns the exception type name.
   381  func (s *ForbiddenException) Code() string {
   382  	return "ForbiddenException"
   383  }
   384  
   385  // Message returns the exception's message.
   386  func (s *ForbiddenException) Message() string {
   387  	if s.Message_ != nil {
   388  		return *s.Message_
   389  	}
   390  	return ""
   391  }
   392  
   393  // OrigErr always returns nil, satisfies awserr.Error interface.
   394  func (s *ForbiddenException) OrigErr() error {
   395  	return nil
   396  }
   397  
   398  func (s *ForbiddenException) Error() string {
   399  	return fmt.Sprintf("%s: %s", s.Code(), s.Message())
   400  }
   401  
   402  // Status code returns the HTTP status code for the request's response error.
   403  func (s *ForbiddenException) StatusCode() int {
   404  	return s.RespMetadata.StatusCode
   405  }
   406  
   407  // RequestID returns the service's response RequestID for request.
   408  func (s *ForbiddenException) RequestID() string {
   409  	return s.RespMetadata.RequestID
   410  }
   411  
   412  type GetConnectionInput struct {
   413  	_ struct{} `type:"structure" nopayload:"true"`
   414  
   415  	// ConnectionId is a required field
   416  	ConnectionId *string `location:"uri" locationName:"connectionId" type:"string" required:"true"`
   417  }
   418  
   419  // String returns the string representation.
   420  //
   421  // API parameter values that are decorated as "sensitive" in the API will not
   422  // be included in the string output. The member name will be present, but the
   423  // value will be replaced with "sensitive".
   424  func (s GetConnectionInput) String() string {
   425  	return awsutil.Prettify(s)
   426  }
   427  
   428  // GoString returns the string representation.
   429  //
   430  // API parameter values that are decorated as "sensitive" in the API will not
   431  // be included in the string output. The member name will be present, but the
   432  // value will be replaced with "sensitive".
   433  func (s GetConnectionInput) GoString() string {
   434  	return s.String()
   435  }
   436  
   437  // Validate inspects the fields of the type to determine if they are valid.
   438  func (s *GetConnectionInput) Validate() error {
   439  	invalidParams := request.ErrInvalidParams{Context: "GetConnectionInput"}
   440  	if s.ConnectionId == nil {
   441  		invalidParams.Add(request.NewErrParamRequired("ConnectionId"))
   442  	}
   443  	if s.ConnectionId != nil && len(*s.ConnectionId) < 1 {
   444  		invalidParams.Add(request.NewErrParamMinLen("ConnectionId", 1))
   445  	}
   446  
   447  	if invalidParams.Len() > 0 {
   448  		return invalidParams
   449  	}
   450  	return nil
   451  }
   452  
   453  // SetConnectionId sets the ConnectionId field's value.
   454  func (s *GetConnectionInput) SetConnectionId(v string) *GetConnectionInput {
   455  	s.ConnectionId = &v
   456  	return s
   457  }
   458  
   459  type GetConnectionOutput struct {
   460  	_ struct{} `type:"structure"`
   461  
   462  	ConnectedAt *time.Time `locationName:"connectedAt" type:"timestamp" timestampFormat:"iso8601"`
   463  
   464  	Identity *Identity `locationName:"identity" type:"structure"`
   465  
   466  	LastActiveAt *time.Time `locationName:"lastActiveAt" type:"timestamp" timestampFormat:"iso8601"`
   467  }
   468  
   469  // String returns the string representation.
   470  //
   471  // API parameter values that are decorated as "sensitive" in the API will not
   472  // be included in the string output. The member name will be present, but the
   473  // value will be replaced with "sensitive".
   474  func (s GetConnectionOutput) String() string {
   475  	return awsutil.Prettify(s)
   476  }
   477  
   478  // GoString returns the string representation.
   479  //
   480  // API parameter values that are decorated as "sensitive" in the API will not
   481  // be included in the string output. The member name will be present, but the
   482  // value will be replaced with "sensitive".
   483  func (s GetConnectionOutput) GoString() string {
   484  	return s.String()
   485  }
   486  
   487  // SetConnectedAt sets the ConnectedAt field's value.
   488  func (s *GetConnectionOutput) SetConnectedAt(v time.Time) *GetConnectionOutput {
   489  	s.ConnectedAt = &v
   490  	return s
   491  }
   492  
   493  // SetIdentity sets the Identity field's value.
   494  func (s *GetConnectionOutput) SetIdentity(v *Identity) *GetConnectionOutput {
   495  	s.Identity = v
   496  	return s
   497  }
   498  
   499  // SetLastActiveAt sets the LastActiveAt field's value.
   500  func (s *GetConnectionOutput) SetLastActiveAt(v time.Time) *GetConnectionOutput {
   501  	s.LastActiveAt = &v
   502  	return s
   503  }
   504  
   505  // The connection with the provided id no longer exists.
   506  type GoneException struct {
   507  	_            struct{}                  `type:"structure"`
   508  	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
   509  
   510  	Message_ *string `locationName:"message" type:"string"`
   511  }
   512  
   513  // String returns the string representation.
   514  //
   515  // API parameter values that are decorated as "sensitive" in the API will not
   516  // be included in the string output. The member name will be present, but the
   517  // value will be replaced with "sensitive".
   518  func (s GoneException) String() string {
   519  	return awsutil.Prettify(s)
   520  }
   521  
   522  // GoString returns the string representation.
   523  //
   524  // API parameter values that are decorated as "sensitive" in the API will not
   525  // be included in the string output. The member name will be present, but the
   526  // value will be replaced with "sensitive".
   527  func (s GoneException) GoString() string {
   528  	return s.String()
   529  }
   530  
   531  func newErrorGoneException(v protocol.ResponseMetadata) error {
   532  	return &GoneException{
   533  		RespMetadata: v,
   534  	}
   535  }
   536  
   537  // Code returns the exception type name.
   538  func (s *GoneException) Code() string {
   539  	return "GoneException"
   540  }
   541  
   542  // Message returns the exception's message.
   543  func (s *GoneException) Message() string {
   544  	if s.Message_ != nil {
   545  		return *s.Message_
   546  	}
   547  	return ""
   548  }
   549  
   550  // OrigErr always returns nil, satisfies awserr.Error interface.
   551  func (s *GoneException) OrigErr() error {
   552  	return nil
   553  }
   554  
   555  func (s *GoneException) Error() string {
   556  	return fmt.Sprintf("%s: %s", s.Code(), s.Message())
   557  }
   558  
   559  // Status code returns the HTTP status code for the request's response error.
   560  func (s *GoneException) StatusCode() int {
   561  	return s.RespMetadata.StatusCode
   562  }
   563  
   564  // RequestID returns the service's response RequestID for request.
   565  func (s *GoneException) RequestID() string {
   566  	return s.RespMetadata.RequestID
   567  }
   568  
   569  type Identity struct {
   570  	_ struct{} `type:"structure"`
   571  
   572  	// The source IP address of the TCP connection making the request to API Gateway.
   573  	//
   574  	// SourceIp is a required field
   575  	SourceIp *string `locationName:"sourceIp" type:"string" required:"true"`
   576  
   577  	// The User Agent of the API caller.
   578  	//
   579  	// UserAgent is a required field
   580  	UserAgent *string `locationName:"userAgent" type:"string" required:"true"`
   581  }
   582  
   583  // String returns the string representation.
   584  //
   585  // API parameter values that are decorated as "sensitive" in the API will not
   586  // be included in the string output. The member name will be present, but the
   587  // value will be replaced with "sensitive".
   588  func (s Identity) String() string {
   589  	return awsutil.Prettify(s)
   590  }
   591  
   592  // GoString returns the string representation.
   593  //
   594  // API parameter values that are decorated as "sensitive" in the API will not
   595  // be included in the string output. The member name will be present, but the
   596  // value will be replaced with "sensitive".
   597  func (s Identity) GoString() string {
   598  	return s.String()
   599  }
   600  
   601  // SetSourceIp sets the SourceIp field's value.
   602  func (s *Identity) SetSourceIp(v string) *Identity {
   603  	s.SourceIp = &v
   604  	return s
   605  }
   606  
   607  // SetUserAgent sets the UserAgent field's value.
   608  func (s *Identity) SetUserAgent(v string) *Identity {
   609  	s.UserAgent = &v
   610  	return s
   611  }
   612  
   613  // The client is sending more than the allowed number of requests per unit of
   614  // time or the WebSocket client side buffer is full.
   615  type LimitExceededException struct {
   616  	_            struct{}                  `type:"structure"`
   617  	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
   618  
   619  	Message_ *string `locationName:"message" type:"string"`
   620  }
   621  
   622  // String returns the string representation.
   623  //
   624  // API parameter values that are decorated as "sensitive" in the API will not
   625  // be included in the string output. The member name will be present, but the
   626  // value will be replaced with "sensitive".
   627  func (s LimitExceededException) String() string {
   628  	return awsutil.Prettify(s)
   629  }
   630  
   631  // GoString returns the string representation.
   632  //
   633  // API parameter values that are decorated as "sensitive" in the API will not
   634  // be included in the string output. The member name will be present, but the
   635  // value will be replaced with "sensitive".
   636  func (s LimitExceededException) GoString() string {
   637  	return s.String()
   638  }
   639  
   640  func newErrorLimitExceededException(v protocol.ResponseMetadata) error {
   641  	return &LimitExceededException{
   642  		RespMetadata: v,
   643  	}
   644  }
   645  
   646  // Code returns the exception type name.
   647  func (s *LimitExceededException) Code() string {
   648  	return "LimitExceededException"
   649  }
   650  
   651  // Message returns the exception's message.
   652  func (s *LimitExceededException) Message() string {
   653  	if s.Message_ != nil {
   654  		return *s.Message_
   655  	}
   656  	return ""
   657  }
   658  
   659  // OrigErr always returns nil, satisfies awserr.Error interface.
   660  func (s *LimitExceededException) OrigErr() error {
   661  	return nil
   662  }
   663  
   664  func (s *LimitExceededException) Error() string {
   665  	return fmt.Sprintf("%s: %s", s.Code(), s.Message())
   666  }
   667  
   668  // Status code returns the HTTP status code for the request's response error.
   669  func (s *LimitExceededException) StatusCode() int {
   670  	return s.RespMetadata.StatusCode
   671  }
   672  
   673  // RequestID returns the service's response RequestID for request.
   674  func (s *LimitExceededException) RequestID() string {
   675  	return s.RespMetadata.RequestID
   676  }
   677  
   678  // The data has exceeded the maximum size allowed.
   679  type PayloadTooLargeException struct {
   680  	_            struct{}                  `type:"structure"`
   681  	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
   682  
   683  	Message_ *string `locationName:"message" type:"string"`
   684  }
   685  
   686  // String returns the string representation.
   687  //
   688  // API parameter values that are decorated as "sensitive" in the API will not
   689  // be included in the string output. The member name will be present, but the
   690  // value will be replaced with "sensitive".
   691  func (s PayloadTooLargeException) String() string {
   692  	return awsutil.Prettify(s)
   693  }
   694  
   695  // GoString returns the string representation.
   696  //
   697  // API parameter values that are decorated as "sensitive" in the API will not
   698  // be included in the string output. The member name will be present, but the
   699  // value will be replaced with "sensitive".
   700  func (s PayloadTooLargeException) GoString() string {
   701  	return s.String()
   702  }
   703  
   704  func newErrorPayloadTooLargeException(v protocol.ResponseMetadata) error {
   705  	return &PayloadTooLargeException{
   706  		RespMetadata: v,
   707  	}
   708  }
   709  
   710  // Code returns the exception type name.
   711  func (s *PayloadTooLargeException) Code() string {
   712  	return "PayloadTooLargeException"
   713  }
   714  
   715  // Message returns the exception's message.
   716  func (s *PayloadTooLargeException) Message() string {
   717  	if s.Message_ != nil {
   718  		return *s.Message_
   719  	}
   720  	return ""
   721  }
   722  
   723  // OrigErr always returns nil, satisfies awserr.Error interface.
   724  func (s *PayloadTooLargeException) OrigErr() error {
   725  	return nil
   726  }
   727  
   728  func (s *PayloadTooLargeException) Error() string {
   729  	return fmt.Sprintf("%s: %s", s.Code(), s.Message())
   730  }
   731  
   732  // Status code returns the HTTP status code for the request's response error.
   733  func (s *PayloadTooLargeException) StatusCode() int {
   734  	return s.RespMetadata.StatusCode
   735  }
   736  
   737  // RequestID returns the service's response RequestID for request.
   738  func (s *PayloadTooLargeException) RequestID() string {
   739  	return s.RespMetadata.RequestID
   740  }
   741  
   742  type PostToConnectionInput struct {
   743  	_ struct{} `type:"structure" payload:"Data"`
   744  
   745  	// ConnectionId is a required field
   746  	ConnectionId *string `location:"uri" locationName:"connectionId" type:"string" required:"true"`
   747  
   748  	// The data to be sent to the client specified by its connection id.
   749  	//
   750  	// Data is a required field
   751  	Data []byte `type:"blob" required:"true"`
   752  }
   753  
   754  // String returns the string representation.
   755  //
   756  // API parameter values that are decorated as "sensitive" in the API will not
   757  // be included in the string output. The member name will be present, but the
   758  // value will be replaced with "sensitive".
   759  func (s PostToConnectionInput) String() string {
   760  	return awsutil.Prettify(s)
   761  }
   762  
   763  // GoString returns the string representation.
   764  //
   765  // API parameter values that are decorated as "sensitive" in the API will not
   766  // be included in the string output. The member name will be present, but the
   767  // value will be replaced with "sensitive".
   768  func (s PostToConnectionInput) GoString() string {
   769  	return s.String()
   770  }
   771  
   772  // Validate inspects the fields of the type to determine if they are valid.
   773  func (s *PostToConnectionInput) Validate() error {
   774  	invalidParams := request.ErrInvalidParams{Context: "PostToConnectionInput"}
   775  	if s.ConnectionId == nil {
   776  		invalidParams.Add(request.NewErrParamRequired("ConnectionId"))
   777  	}
   778  	if s.ConnectionId != nil && len(*s.ConnectionId) < 1 {
   779  		invalidParams.Add(request.NewErrParamMinLen("ConnectionId", 1))
   780  	}
   781  	if s.Data == nil {
   782  		invalidParams.Add(request.NewErrParamRequired("Data"))
   783  	}
   784  
   785  	if invalidParams.Len() > 0 {
   786  		return invalidParams
   787  	}
   788  	return nil
   789  }
   790  
   791  // SetConnectionId sets the ConnectionId field's value.
   792  func (s *PostToConnectionInput) SetConnectionId(v string) *PostToConnectionInput {
   793  	s.ConnectionId = &v
   794  	return s
   795  }
   796  
   797  // SetData sets the Data field's value.
   798  func (s *PostToConnectionInput) SetData(v []byte) *PostToConnectionInput {
   799  	s.Data = v
   800  	return s
   801  }
   802  
   803  type PostToConnectionOutput struct {
   804  	_ struct{} `type:"structure" nopayload:"true"`
   805  }
   806  
   807  // String returns the string representation.
   808  //
   809  // API parameter values that are decorated as "sensitive" in the API will not
   810  // be included in the string output. The member name will be present, but the
   811  // value will be replaced with "sensitive".
   812  func (s PostToConnectionOutput) String() string {
   813  	return awsutil.Prettify(s)
   814  }
   815  
   816  // GoString returns the string representation.
   817  //
   818  // API parameter values that are decorated as "sensitive" in the API will not
   819  // be included in the string output. The member name will be present, but the
   820  // value will be replaced with "sensitive".
   821  func (s PostToConnectionOutput) GoString() string {
   822  	return s.String()
   823  }