// SetOldNotification sets the OldNotification field's value.
337197
func (s *UpdateNotificationInput) SetOldNotification(v *Notification) *UpdateNotificationInput {
	s.OldNotification = v
	return s
}
923441
func (s *PutBucketNotificationInput) SetNotificationConfiguration(v *NotificationConfigurationDeprecated) *PutBucketNotificationInput {
	s.NotificationConfiguration = v
	return s
}
1173562
func (s *GetVaultNotificationsOutput) SetVaultNotificationConfig(v *VaultNotificationConfig) *GetVaultNotificationsOutput {
	s.VaultNotificationConfig = v
	return s
}
1095053
func (s *NotifyWhenUploadedOutput) SetNotificationId(v string) *NotifyWhenUploadedOutput {
	s.NotificationId = &v
	return s
}
1151915
func (s *NotificationConfig) SetNotificationArn(v string) *NotificationConfig {
	s.NotificationArn = &v
	return s
}
1129112
func (s *StartFaceSearchInput) SetNotificationChannel(v *NotificationChannel) *StartFaceSearchInput {
	s.NotificationChannel = v
	return s
}
346875
func (s *DeleteSubscriberInput) SetNotification(v *Notification) *DeleteSubscriberInput {
	s.Notification = v
	return s
}
1096517
func (s *ModifyReplicationGroupInput) SetNotificationTopicStatus(v string) *ModifyReplicationGroupInput {
	s.NotificationTopicStatus = &v
	return s
}
629703
func (s *Cluster) SetNotificationConfiguration(v *NotificationConfiguration) *Cluster {
	s.NotificationConfiguration = v
	return s
}
215413
func (s *JobRun) SetNotificationProperty(v *NotificationProperty) *JobRun {
	s.NotificationProperty = v
	return s
}
790609
func (s *CreateNotificationInput) SetNotification(v *Notification) *CreateNotificationInput {
	s.Notification = v
	return s
}
421839
func (s *LifecycleHook) SetNotificationMetadata(v string) *LifecycleHook {
	s.NotificationMetadata = &v
	return s
}
348770
func (s *Notification) SetNotifyAll(v bool) *Notification {
	s.NotifyAll = &v
	return s
}
31391
func (s *UpdatePipelineNotificationsInput) SetNotifications(v *Notifications) *UpdatePipelineNotificationsInput {
	s.Notifications = v
	return s
}
1275985
func (c Client) SetBucketNotification(bucketName string, bucketNotification BucketNotification) error {
	// Input validation.
	if err := s3utils.CheckValidBucketName(bucketName); err != nil {
		return err
	}

	// Get resources properly escaped and lined up before
	// using them in http request.
	urlValues := make(url.Values)
	urlValues.Set("notification", "")

	notifBytes, err := xml.Marshal(bucketNotification)
	if err != nil {
		return err
	}

	notifBuffer := bytes.NewReader(notifBytes)
	reqMetadata := requestMetadata{
		bucketName:       bucketName,
		queryValues:      urlValues,
		contentBody:      notifBuffer,
		contentLength:    int64(len(notifBytes)),
		contentMD5Base64: sumMD5Base64(notifBytes),
		contentSHA256Hex: sum256Hex(notifBytes),
	}

	// Execute PUT to upload a new bucket notification.
	resp, err := c.executeMethod(context.Background(), "PUT", reqMetadata)
	defer closeResponse(resp)
	if err != nil {
		return err
	}
	if resp != nil {
		if resp.StatusCode != http.StatusOK {
			return httpRespToErrorResponse(resp, bucketName, "")
		}
	}
	return nil
}
237797
func (s *UpdatePipelineInput) SetNotifications(v *Notifications) *UpdatePipelineInput {
	s.Notifications = v
	return s
}
353847
func (s *UpdateNotificationInput) SetNewNotification(v *Notification) *UpdateNotificationInput {
	s.NewNotification = v
	return s
}