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

     1  // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
     2  
     3  package workmailmessageflow
     4  
     5  import (
     6  	"fmt"
     7  	"io"
     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 opGetRawMessageContent = "GetRawMessageContent"
    17  
    18  // GetRawMessageContentRequest generates a "aws/request.Request" representing the
    19  // client's request for the GetRawMessageContent 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 GetRawMessageContent for more information on using the GetRawMessageContent
    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 GetRawMessageContentRequest method.
    34  //    req, resp := client.GetRawMessageContentRequest(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/workmailmessageflow-2019-05-01/GetRawMessageContent
    42  func (c *WorkMailMessageFlow) GetRawMessageContentRequest(input *GetRawMessageContentInput) (req *request.Request, output *GetRawMessageContentOutput) {
    43  	op := &request.Operation{
    44  		Name:       opGetRawMessageContent,
    45  		HTTPMethod: "GET",
    46  		HTTPPath:   "/messages/{messageId}",
    47  	}
    48  
    49  	if input == nil {
    50  		input = &GetRawMessageContentInput{}
    51  	}
    52  
    53  	output = &GetRawMessageContentOutput{}
    54  	req = c.newRequest(op, input, output)
    55  	return
    56  }
    57  
    58  // GetRawMessageContent API operation for Amazon WorkMail Message Flow.
    59  //
    60  // Retrieves the raw content of an in-transit email message, in MIME format.
    61  //
    62  // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
    63  // with awserr.Error's Code and Message methods to get detailed information about
    64  // the error.
    65  //
    66  // See the AWS API reference guide for Amazon WorkMail Message Flow's
    67  // API operation GetRawMessageContent for usage and error information.
    68  //
    69  // Returned Error Types:
    70  //   * ResourceNotFoundException
    71  //   The requested email message is not found.
    72  //
    73  // See also, https://docs.aws.amazon.com/goto/WebAPI/workmailmessageflow-2019-05-01/GetRawMessageContent
    74  func (c *WorkMailMessageFlow) GetRawMessageContent(input *GetRawMessageContentInput) (*GetRawMessageContentOutput, error) {
    75  	req, out := c.GetRawMessageContentRequest(input)
    76  	return out, req.Send()
    77  }
    78  
    79  // GetRawMessageContentWithContext is the same as GetRawMessageContent with the addition of
    80  // the ability to pass a context and additional request options.
    81  //
    82  // See GetRawMessageContent for details on how to use this API operation.
    83  //
    84  // The context must be non-nil and will be used for request cancellation. If
    85  // the context is nil a panic will occur. In the future the SDK may create
    86  // sub-contexts for http.Requests. See https://golang.org/pkg/context/
    87  // for more information on using Contexts.
    88  func (c *WorkMailMessageFlow) GetRawMessageContentWithContext(ctx aws.Context, input *GetRawMessageContentInput, opts ...request.Option) (*GetRawMessageContentOutput, error) {
    89  	req, out := c.GetRawMessageContentRequest(input)
    90  	req.SetContext(ctx)
    91  	req.ApplyOptions(opts...)
    92  	return out, req.Send()
    93  }
    94  
    95  const opPutRawMessageContent = "PutRawMessageContent"
    96  
    97  // PutRawMessageContentRequest generates a "aws/request.Request" representing the
    98  // client's request for the PutRawMessageContent operation. The "output" return
    99  // value will be populated with the request's response once the request completes
   100  // successfully.
   101  //
   102  // Use "Send" method on the returned Request to send the API call to the service.
   103  // the "output" return value is not valid until after Send returns without error.
   104  //
   105  // See PutRawMessageContent for more information on using the PutRawMessageContent
   106  // API call, and error handling.
   107  //
   108  // This method is useful when you want to inject custom logic or configuration
   109  // into the SDK's request lifecycle. Such as custom headers, or retry logic.
   110  //
   111  //
   112  //    // Example sending a request using the PutRawMessageContentRequest method.
   113  //    req, resp := client.PutRawMessageContentRequest(params)
   114  //
   115  //    err := req.Send()
   116  //    if err == nil { // resp is now filled
   117  //        fmt.Println(resp)
   118  //    }
   119  //
   120  // See also, https://docs.aws.amazon.com/goto/WebAPI/workmailmessageflow-2019-05-01/PutRawMessageContent
   121  func (c *WorkMailMessageFlow) PutRawMessageContentRequest(input *PutRawMessageContentInput) (req *request.Request, output *PutRawMessageContentOutput) {
   122  	op := &request.Operation{
   123  		Name:       opPutRawMessageContent,
   124  		HTTPMethod: "POST",
   125  		HTTPPath:   "/messages/{messageId}",
   126  	}
   127  
   128  	if input == nil {
   129  		input = &PutRawMessageContentInput{}
   130  	}
   131  
   132  	output = &PutRawMessageContentOutput{}
   133  	req = c.newRequest(op, input, output)
   134  	req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
   135  	return
   136  }
   137  
   138  // PutRawMessageContent API operation for Amazon WorkMail Message Flow.
   139  //
   140  // Updates the raw content of an in-transit email message, in MIME format.
   141  //
   142  // This example describes how to update in-transit email message. For more information
   143  // and examples for using this API, see Updating message content with AWS Lambda
   144  // (https://docs.aws.amazon.com/workmail/latest/adminguide/update-with-lambda.html).
   145  //
   146  // Updates to an in-transit message only appear when you call PutRawMessageContent
   147  // from an AWS Lambda function configured with a synchronous Run Lambda (https://docs.aws.amazon.com/workmail/latest/adminguide/lambda.html#synchronous-rules)
   148  // rule. If you call PutRawMessageContent on a delivered or sent message, the
   149  // message remains unchanged, even though GetRawMessageContent (https://docs.aws.amazon.com/workmail/latest/APIReference/API_messageflow_GetRawMessageContent.html)
   150  // returns an updated message.
   151  //
   152  // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
   153  // with awserr.Error's Code and Message methods to get detailed information about
   154  // the error.
   155  //
   156  // See the AWS API reference guide for Amazon WorkMail Message Flow's
   157  // API operation PutRawMessageContent for usage and error information.
   158  //
   159  // Returned Error Types:
   160  //   * ResourceNotFoundException
   161  //   The requested email message is not found.
   162  //
   163  //   * InvalidContentLocation
   164  //   WorkMail could not access the updated email content. Possible reasons:
   165  //
   166  //      * You made the request in a region other than your S3 bucket region.
   167  //
   168  //      * The S3 bucket owner (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-owner-condition.html)
   169  //      is not the same as the calling AWS account.
   170  //
   171  //      * You have an incomplete or missing S3 bucket policy. For more information
   172  //      about policies, see Updating message content with AWS Lambda (https://docs.aws.amazon.com/workmail/latest/adminguide/update-with-lambda.html)
   173  //      in the WorkMail Administrator Guide.
   174  //
   175  //   * MessageRejected
   176  //   The requested email could not be updated due to an error in the MIME content.
   177  //   Check the error message for more information about what caused the error.
   178  //
   179  //   * MessageFrozen
   180  //   The requested email is not eligible for update. This is usually the case
   181  //   for a redirected email.
   182  //
   183  // See also, https://docs.aws.amazon.com/goto/WebAPI/workmailmessageflow-2019-05-01/PutRawMessageContent
   184  func (c *WorkMailMessageFlow) PutRawMessageContent(input *PutRawMessageContentInput) (*PutRawMessageContentOutput, error) {
   185  	req, out := c.PutRawMessageContentRequest(input)
   186  	return out, req.Send()
   187  }
   188  
   189  // PutRawMessageContentWithContext is the same as PutRawMessageContent with the addition of
   190  // the ability to pass a context and additional request options.
   191  //
   192  // See PutRawMessageContent for details on how to use this API operation.
   193  //
   194  // The context must be non-nil and will be used for request cancellation. If
   195  // the context is nil a panic will occur. In the future the SDK may create
   196  // sub-contexts for http.Requests. See https://golang.org/pkg/context/
   197  // for more information on using Contexts.
   198  func (c *WorkMailMessageFlow) PutRawMessageContentWithContext(ctx aws.Context, input *PutRawMessageContentInput, opts ...request.Option) (*PutRawMessageContentOutput, error) {
   199  	req, out := c.PutRawMessageContentRequest(input)
   200  	req.SetContext(ctx)
   201  	req.ApplyOptions(opts...)
   202  	return out, req.Send()
   203  }
   204  
   205  type GetRawMessageContentInput struct {
   206  	_ struct{} `type:"structure" nopayload:"true"`
   207  
   208  	// The identifier of the email message to retrieve.
   209  	//
   210  	// MessageId is a required field
   211  	MessageId *string `location:"uri" locationName:"messageId" min:"1" type:"string" required:"true"`
   212  }
   213  
   214  // String returns the string representation.
   215  //
   216  // API parameter values that are decorated as "sensitive" in the API will not
   217  // be included in the string output. The member name will be present, but the
   218  // value will be replaced with "sensitive".
   219  func (s GetRawMessageContentInput) String() string {
   220  	return awsutil.Prettify(s)
   221  }
   222  
   223  // GoString returns the string representation.
   224  //
   225  // API parameter values that are decorated as "sensitive" in the API will not
   226  // be included in the string output. The member name will be present, but the
   227  // value will be replaced with "sensitive".
   228  func (s GetRawMessageContentInput) GoString() string {
   229  	return s.String()
   230  }
   231  
   232  // Validate inspects the fields of the type to determine if they are valid.
   233  func (s *GetRawMessageContentInput) Validate() error {
   234  	invalidParams := request.ErrInvalidParams{Context: "GetRawMessageContentInput"}
   235  	if s.MessageId == nil {
   236  		invalidParams.Add(request.NewErrParamRequired("MessageId"))
   237  	}
   238  	if s.MessageId != nil && len(*s.MessageId) < 1 {
   239  		invalidParams.Add(request.NewErrParamMinLen("MessageId", 1))
   240  	}
   241  
   242  	if invalidParams.Len() > 0 {
   243  		return invalidParams
   244  	}
   245  	return nil
   246  }
   247  
   248  // SetMessageId sets the MessageId field's value.
   249  func (s *GetRawMessageContentInput) SetMessageId(v string) *GetRawMessageContentInput {
   250  	s.MessageId = &v
   251  	return s
   252  }
   253  
   254  type GetRawMessageContentOutput struct {
   255  	_ struct{} `type:"structure" payload:"MessageContent"`
   256  
   257  	// The raw content of the email message, in MIME format.
   258  	//
   259  	// MessageContent is a required field
   260  	MessageContent io.ReadCloser `locationName:"messageContent" type:"blob" required:"true"`
   261  }
   262  
   263  // String returns the string representation.
   264  //
   265  // API parameter values that are decorated as "sensitive" in the API will not
   266  // be included in the string output. The member name will be present, but the
   267  // value will be replaced with "sensitive".
   268  func (s GetRawMessageContentOutput) String() string {
   269  	return awsutil.Prettify(s)
   270  }
   271  
   272  // GoString returns the string representation.
   273  //
   274  // API parameter values that are decorated as "sensitive" in the API will not
   275  // be included in the string output. The member name will be present, but the
   276  // value will be replaced with "sensitive".
   277  func (s GetRawMessageContentOutput) GoString() string {
   278  	return s.String()
   279  }
   280  
   281  // SetMessageContent sets the MessageContent field's value.
   282  func (s *GetRawMessageContentOutput) SetMessageContent(v io.ReadCloser) *GetRawMessageContentOutput {
   283  	s.MessageContent = v
   284  	return s
   285  }
   286  
   287  // WorkMail could not access the updated email content. Possible reasons:
   288  //
   289  //    * You made the request in a region other than your S3 bucket region.
   290  //
   291  //    * The S3 bucket owner (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-owner-condition.html)
   292  //    is not the same as the calling AWS account.
   293  //
   294  //    * You have an incomplete or missing S3 bucket policy. For more information
   295  //    about policies, see Updating message content with AWS Lambda (https://docs.aws.amazon.com/workmail/latest/adminguide/update-with-lambda.html)
   296  //    in the WorkMail Administrator Guide.
   297  type InvalidContentLocation struct {
   298  	_            struct{}                  `type:"structure"`
   299  	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
   300  
   301  	Message_ *string `locationName:"message" type:"string"`
   302  }
   303  
   304  // String returns the string representation.
   305  //
   306  // API parameter values that are decorated as "sensitive" in the API will not
   307  // be included in the string output. The member name will be present, but the
   308  // value will be replaced with "sensitive".
   309  func (s InvalidContentLocation) String() string {
   310  	return awsutil.Prettify(s)
   311  }
   312  
   313  // GoString returns the string representation.
   314  //
   315  // API parameter values that are decorated as "sensitive" in the API will not
   316  // be included in the string output. The member name will be present, but the
   317  // value will be replaced with "sensitive".
   318  func (s InvalidContentLocation) GoString() string {
   319  	return s.String()
   320  }
   321  
   322  func newErrorInvalidContentLocation(v protocol.ResponseMetadata) error {
   323  	return &InvalidContentLocation{
   324  		RespMetadata: v,
   325  	}
   326  }
   327  
   328  // Code returns the exception type name.
   329  func (s *InvalidContentLocation) Code() string {
   330  	return "InvalidContentLocation"
   331  }
   332  
   333  // Message returns the exception's message.
   334  func (s *InvalidContentLocation) Message() string {
   335  	if s.Message_ != nil {
   336  		return *s.Message_
   337  	}
   338  	return ""
   339  }
   340  
   341  // OrigErr always returns nil, satisfies awserr.Error interface.
   342  func (s *InvalidContentLocation) OrigErr() error {
   343  	return nil
   344  }
   345  
   346  func (s *InvalidContentLocation) Error() string {
   347  	return fmt.Sprintf("%s: %s", s.Code(), s.Message())
   348  }
   349  
   350  // Status code returns the HTTP status code for the request's response error.
   351  func (s *InvalidContentLocation) StatusCode() int {
   352  	return s.RespMetadata.StatusCode
   353  }
   354  
   355  // RequestID returns the service's response RequestID for request.
   356  func (s *InvalidContentLocation) RequestID() string {
   357  	return s.RespMetadata.RequestID
   358  }
   359  
   360  // The requested email is not eligible for update. This is usually the case
   361  // for a redirected email.
   362  type MessageFrozen struct {
   363  	_            struct{}                  `type:"structure"`
   364  	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
   365  
   366  	Message_ *string `locationName:"message" type:"string"`
   367  }
   368  
   369  // String returns the string representation.
   370  //
   371  // API parameter values that are decorated as "sensitive" in the API will not
   372  // be included in the string output. The member name will be present, but the
   373  // value will be replaced with "sensitive".
   374  func (s MessageFrozen) String() string {
   375  	return awsutil.Prettify(s)
   376  }
   377  
   378  // GoString returns the string representation.
   379  //
   380  // API parameter values that are decorated as "sensitive" in the API will not
   381  // be included in the string output. The member name will be present, but the
   382  // value will be replaced with "sensitive".
   383  func (s MessageFrozen) GoString() string {
   384  	return s.String()
   385  }
   386  
   387  func newErrorMessageFrozen(v protocol.ResponseMetadata) error {
   388  	return &MessageFrozen{
   389  		RespMetadata: v,
   390  	}
   391  }
   392  
   393  // Code returns the exception type name.
   394  func (s *MessageFrozen) Code() string {
   395  	return "MessageFrozen"
   396  }
   397  
   398  // Message returns the exception's message.
   399  func (s *MessageFrozen) Message() string {
   400  	if s.Message_ != nil {
   401  		return *s.Message_
   402  	}
   403  	return ""
   404  }
   405  
   406  // OrigErr always returns nil, satisfies awserr.Error interface.
   407  func (s *MessageFrozen) OrigErr() error {
   408  	return nil
   409  }
   410  
   411  func (s *MessageFrozen) Error() string {
   412  	return fmt.Sprintf("%s: %s", s.Code(), s.Message())
   413  }
   414  
   415  // Status code returns the HTTP status code for the request's response error.
   416  func (s *MessageFrozen) StatusCode() int {
   417  	return s.RespMetadata.StatusCode
   418  }
   419  
   420  // RequestID returns the service's response RequestID for request.
   421  func (s *MessageFrozen) RequestID() string {
   422  	return s.RespMetadata.RequestID
   423  }
   424  
   425  // The requested email could not be updated due to an error in the MIME content.
   426  // Check the error message for more information about what caused the error.
   427  type MessageRejected struct {
   428  	_            struct{}                  `type:"structure"`
   429  	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
   430  
   431  	Message_ *string `locationName:"message" type:"string"`
   432  }
   433  
   434  // String returns the string representation.
   435  //
   436  // API parameter values that are decorated as "sensitive" in the API will not
   437  // be included in the string output. The member name will be present, but the
   438  // value will be replaced with "sensitive".
   439  func (s MessageRejected) String() string {
   440  	return awsutil.Prettify(s)
   441  }
   442  
   443  // GoString returns the string representation.
   444  //
   445  // API parameter values that are decorated as "sensitive" in the API will not
   446  // be included in the string output. The member name will be present, but the
   447  // value will be replaced with "sensitive".
   448  func (s MessageRejected) GoString() string {
   449  	return s.String()
   450  }
   451  
   452  func newErrorMessageRejected(v protocol.ResponseMetadata) error {
   453  	return &MessageRejected{
   454  		RespMetadata: v,
   455  	}
   456  }
   457  
   458  // Code returns the exception type name.
   459  func (s *MessageRejected) Code() string {
   460  	return "MessageRejected"
   461  }
   462  
   463  // Message returns the exception's message.
   464  func (s *MessageRejected) Message() string {
   465  	if s.Message_ != nil {
   466  		return *s.Message_
   467  	}
   468  	return ""
   469  }
   470  
   471  // OrigErr always returns nil, satisfies awserr.Error interface.
   472  func (s *MessageRejected) OrigErr() error {
   473  	return nil
   474  }
   475  
   476  func (s *MessageRejected) Error() string {
   477  	return fmt.Sprintf("%s: %s", s.Code(), s.Message())
   478  }
   479  
   480  // Status code returns the HTTP status code for the request's response error.
   481  func (s *MessageRejected) StatusCode() int {
   482  	return s.RespMetadata.StatusCode
   483  }
   484  
   485  // RequestID returns the service's response RequestID for request.
   486  func (s *MessageRejected) RequestID() string {
   487  	return s.RespMetadata.RequestID
   488  }
   489  
   490  type PutRawMessageContentInput struct {
   491  	_ struct{} `type:"structure"`
   492  
   493  	// Describes the raw message content of the updated email message.
   494  	//
   495  	// Content is a required field
   496  	Content *RawMessageContent `locationName:"content" type:"structure" required:"true"`
   497  
   498  	// The identifier of the email message being updated.
   499  	//
   500  	// MessageId is a required field
   501  	MessageId *string `location:"uri" locationName:"messageId" min:"1" type:"string" required:"true"`
   502  }
   503  
   504  // String returns the string representation.
   505  //
   506  // API parameter values that are decorated as "sensitive" in the API will not
   507  // be included in the string output. The member name will be present, but the
   508  // value will be replaced with "sensitive".
   509  func (s PutRawMessageContentInput) String() string {
   510  	return awsutil.Prettify(s)
   511  }
   512  
   513  // GoString 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 PutRawMessageContentInput) GoString() string {
   519  	return s.String()
   520  }
   521  
   522  // Validate inspects the fields of the type to determine if they are valid.
   523  func (s *PutRawMessageContentInput) Validate() error {
   524  	invalidParams := request.ErrInvalidParams{Context: "PutRawMessageContentInput"}
   525  	if s.Content == nil {
   526  		invalidParams.Add(request.NewErrParamRequired("Content"))
   527  	}
   528  	if s.MessageId == nil {
   529  		invalidParams.Add(request.NewErrParamRequired("MessageId"))
   530  	}
   531  	if s.MessageId != nil && len(*s.MessageId) < 1 {
   532  		invalidParams.Add(request.NewErrParamMinLen("MessageId", 1))
   533  	}
   534  	if s.Content != nil {
   535  		if err := s.Content.Validate(); err != nil {
   536  			invalidParams.AddNested("Content", err.(request.ErrInvalidParams))
   537  		}
   538  	}
   539  
   540  	if invalidParams.Len() > 0 {
   541  		return invalidParams
   542  	}
   543  	return nil
   544  }
   545  
   546  // SetContent sets the Content field's value.
   547  func (s *PutRawMessageContentInput) SetContent(v *RawMessageContent) *PutRawMessageContentInput {
   548  	s.Content = v
   549  	return s
   550  }
   551  
   552  // SetMessageId sets the MessageId field's value.
   553  func (s *PutRawMessageContentInput) SetMessageId(v string) *PutRawMessageContentInput {
   554  	s.MessageId = &v
   555  	return s
   556  }
   557  
   558  type PutRawMessageContentOutput struct {
   559  	_ struct{} `type:"structure" nopayload:"true"`
   560  }
   561  
   562  // String returns the string representation.
   563  //
   564  // API parameter values that are decorated as "sensitive" in the API will not
   565  // be included in the string output. The member name will be present, but the
   566  // value will be replaced with "sensitive".
   567  func (s PutRawMessageContentOutput) String() string {
   568  	return awsutil.Prettify(s)
   569  }
   570  
   571  // GoString returns the string representation.
   572  //
   573  // API parameter values that are decorated as "sensitive" in the API will not
   574  // be included in the string output. The member name will be present, but the
   575  // value will be replaced with "sensitive".
   576  func (s PutRawMessageContentOutput) GoString() string {
   577  	return s.String()
   578  }
   579  
   580  // Provides the MIME content of the updated email message as an S3 object. All
   581  // MIME content must meet the following criteria:
   582  //
   583  //    * Each part of a multipart MIME message must be formatted properly.
   584  //
   585  //    * Attachments must be of a content type that Amazon SES supports. For
   586  //    more information, see Unsupported Attachment Types (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/mime-types-appendix.html).
   587  //
   588  //    * If any of the MIME parts in a message contain content that is outside
   589  //    of the 7-bit ASCII character range, we recommend encoding that content.
   590  //
   591  //    * Per RFC 5321 (https://tools.ietf.org/html/rfc5321#section-4.5.3.1.6),
   592  //    the maximum length of each line of text, including the <CRLF>, must not
   593  //    exceed 1,000 characters.
   594  //
   595  //    * The message must contain all the required header fields. Check the returned
   596  //    error message for more information.
   597  //
   598  //    * The value of immutable headers must remain unchanged. Check the returned
   599  //    error message for more information.
   600  //
   601  //    * Certain unique headers can only appear once. Check the returned error
   602  //    message for more information.
   603  type RawMessageContent struct {
   604  	_ struct{} `type:"structure"`
   605  
   606  	// The S3 reference of an email message.
   607  	//
   608  	// S3Reference is a required field
   609  	S3Reference *S3Reference `locationName:"s3Reference" type:"structure" required:"true"`
   610  }
   611  
   612  // String returns the string representation.
   613  //
   614  // API parameter values that are decorated as "sensitive" in the API will not
   615  // be included in the string output. The member name will be present, but the
   616  // value will be replaced with "sensitive".
   617  func (s RawMessageContent) String() string {
   618  	return awsutil.Prettify(s)
   619  }
   620  
   621  // GoString returns the string representation.
   622  //
   623  // API parameter values that are decorated as "sensitive" in the API will not
   624  // be included in the string output. The member name will be present, but the
   625  // value will be replaced with "sensitive".
   626  func (s RawMessageContent) GoString() string {
   627  	return s.String()
   628  }
   629  
   630  // Validate inspects the fields of the type to determine if they are valid.
   631  func (s *RawMessageContent) Validate() error {
   632  	invalidParams := request.ErrInvalidParams{Context: "RawMessageContent"}
   633  	if s.S3Reference == nil {
   634  		invalidParams.Add(request.NewErrParamRequired("S3Reference"))
   635  	}
   636  	if s.S3Reference != nil {
   637  		if err := s.S3Reference.Validate(); err != nil {
   638  			invalidParams.AddNested("S3Reference", err.(request.ErrInvalidParams))
   639  		}
   640  	}
   641  
   642  	if invalidParams.Len() > 0 {
   643  		return invalidParams
   644  	}
   645  	return nil
   646  }
   647  
   648  // SetS3Reference sets the S3Reference field's value.
   649  func (s *RawMessageContent) SetS3Reference(v *S3Reference) *RawMessageContent {
   650  	s.S3Reference = v
   651  	return s
   652  }
   653  
   654  // The requested email message is not found.
   655  type ResourceNotFoundException struct {
   656  	_            struct{}                  `type:"structure"`
   657  	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
   658  
   659  	Message_ *string `locationName:"message" type:"string"`
   660  }
   661  
   662  // String returns the string representation.
   663  //
   664  // API parameter values that are decorated as "sensitive" in the API will not
   665  // be included in the string output. The member name will be present, but the
   666  // value will be replaced with "sensitive".
   667  func (s ResourceNotFoundException) String() string {
   668  	return awsutil.Prettify(s)
   669  }
   670  
   671  // GoString returns the string representation.
   672  //
   673  // API parameter values that are decorated as "sensitive" in the API will not
   674  // be included in the string output. The member name will be present, but the
   675  // value will be replaced with "sensitive".
   676  func (s ResourceNotFoundException) GoString() string {
   677  	return s.String()
   678  }
   679  
   680  func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error {
   681  	return &ResourceNotFoundException{
   682  		RespMetadata: v,
   683  	}
   684  }
   685  
   686  // Code returns the exception type name.
   687  func (s *ResourceNotFoundException) Code() string {
   688  	return "ResourceNotFoundException"
   689  }
   690  
   691  // Message returns the exception's message.
   692  func (s *ResourceNotFoundException) Message() string {
   693  	if s.Message_ != nil {
   694  		return *s.Message_
   695  	}
   696  	return ""
   697  }
   698  
   699  // OrigErr always returns nil, satisfies awserr.Error interface.
   700  func (s *ResourceNotFoundException) OrigErr() error {
   701  	return nil
   702  }
   703  
   704  func (s *ResourceNotFoundException) Error() string {
   705  	return fmt.Sprintf("%s: %s", s.Code(), s.Message())
   706  }
   707  
   708  // Status code returns the HTTP status code for the request's response error.
   709  func (s *ResourceNotFoundException) StatusCode() int {
   710  	return s.RespMetadata.StatusCode
   711  }
   712  
   713  // RequestID returns the service's response RequestID for request.
   714  func (s *ResourceNotFoundException) RequestID() string {
   715  	return s.RespMetadata.RequestID
   716  }
   717  
   718  // Amazon S3 object representing the updated message content, in MIME format.
   719  //
   720  // The region for the S3 bucket containing the S3 object must match the region
   721  // used for WorkMail operations. Also, for WorkMail to process an S3 object,
   722  // it must have permission to access that object. For more information, see
   723  // Updating message content with AWS Lambda (https://docs.aws.amazon.com/workmail/latest/adminguide/update-with-lambda.html).
   724  type S3Reference struct {
   725  	_ struct{} `type:"structure"`
   726  
   727  	// The S3 bucket name.
   728  	//
   729  	// Bucket is a required field
   730  	Bucket *string `locationName:"bucket" min:"3" type:"string" required:"true"`
   731  
   732  	// The S3 key object name.
   733  	//
   734  	// Key is a required field
   735  	Key *string `locationName:"key" min:"1" type:"string" required:"true"`
   736  
   737  	// If you enable versioning for the bucket, you can specify the object version.
   738  	ObjectVersion *string `locationName:"objectVersion" min:"1" type:"string"`
   739  }
   740  
   741  // String returns the string representation.
   742  //
   743  // API parameter values that are decorated as "sensitive" in the API will not
   744  // be included in the string output. The member name will be present, but the
   745  // value will be replaced with "sensitive".
   746  func (s S3Reference) String() string {
   747  	return awsutil.Prettify(s)
   748  }
   749  
   750  // GoString returns the string representation.
   751  //
   752  // API parameter values that are decorated as "sensitive" in the API will not
   753  // be included in the string output. The member name will be present, but the
   754  // value will be replaced with "sensitive".
   755  func (s S3Reference) GoString() string {
   756  	return s.String()
   757  }
   758  
   759  // Validate inspects the fields of the type to determine if they are valid.
   760  func (s *S3Reference) Validate() error {
   761  	invalidParams := request.ErrInvalidParams{Context: "S3Reference"}
   762  	if s.Bucket == nil {
   763  		invalidParams.Add(request.NewErrParamRequired("Bucket"))
   764  	}
   765  	if s.Bucket != nil && len(*s.Bucket) < 3 {
   766  		invalidParams.Add(request.NewErrParamMinLen("Bucket", 3))
   767  	}
   768  	if s.Key == nil {
   769  		invalidParams.Add(request.NewErrParamRequired("Key"))
   770  	}
   771  	if s.Key != nil && len(*s.Key) < 1 {
   772  		invalidParams.Add(request.NewErrParamMinLen("Key", 1))
   773  	}
   774  	if s.ObjectVersion != nil && len(*s.ObjectVersion) < 1 {
   775  		invalidParams.Add(request.NewErrParamMinLen("ObjectVersion", 1))
   776  	}
   777  
   778  	if invalidParams.Len() > 0 {
   779  		return invalidParams
   780  	}
   781  	return nil
   782  }
   783  
   784  // SetBucket sets the Bucket field's value.
   785  func (s *S3Reference) SetBucket(v string) *S3Reference {
   786  	s.Bucket = &v
   787  	return s
   788  }
   789  
   790  // SetKey sets the Key field's value.
   791  func (s *S3Reference) SetKey(v string) *S3Reference {
   792  	s.Key = &v
   793  	return s
   794  }
   795  
   796  // SetObjectVersion sets the ObjectVersion field's value.
   797  func (s *S3Reference) SetObjectVersion(v string) *S3Reference {
   798  	s.ObjectVersion = &v
   799  	return s
   800  }