
# 修改关键操作通知 - UpdateNotification
#### 功能介绍
云审计服务支持修改已创建关键操作通知配置项，通过notification_id的字段匹配修改对象，notification_id必须已经存在。
#### 调用方法
请参见[如何调用API](https://support.huaweicloud.com/api-cts/cts_api_0006.html)。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-cts/cts_api_1001.html)。
- 如果使用身份策略授权，需具备如下身份策略权限。
  
  | 授权项                     | 访问级别  | 资源类型（\*为必须）  | 条件键 | 别名 | 依赖的授权项                                                                                                                                                                                                                                                                                                  |
  |:---|:---|:---|:---|:---|:---|
  | cts:notification:update | Write | notification | -   | -  | - smn:topic:listTopic  - iam:users:listUsers  - iam:groups:listGroups   |
     
  
 
#### URI
PUT /v3/{project_id}/notifications
表1路径参数 
| 参数         | 是否必选 | 参数类型   | 描述                                                                                 |
|:---|:---|:---|:---|
| project_id | 是    | String | 项目ID，参见[获取账号ID和项目ID](https://support.huaweicloud.com/api-cts/cts_api_0005.html)章节。 |
   
#### 请求参数
表2请求Body参数 
| 参数                | 是否必选 | 参数类型                                                                           | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|:---|:---|:---|:---|
| notification_name | 是    | String                                                                         | 标识关键操作通知名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| operation_type    | 是    | String                                                                         | 标识操作类型。 目前支持的操作类型有完整类型(complete)和自定义类型(customized)。 完整类型下，CTS发送通知的对象为已对接服务的所有事件。 自定义类型下，CTS发送通知的对象是在operations列表中指定的事件。                                                                                                                                                                                                                                                                                                                                                                               |
| operations        | 否    | Array of [Operations] objects               | 操作事件列表。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| notify_user_list  | 否    | Array of [NotificationUsers] objects | 通知用户列表，目前最多支持对10个用户组和50个用户发起的操作进行配置。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| status            | 是    | String                                                                         | 标识关键操作通知状态，包括正常(enabled)，停止(disabled)两种状态。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| topic_id          | 否    | String                                                                         | 消息通知服务的topic_urn或者函数工作流的func_urn，当"status"字段为enabled时，该字段必填。 - 消息通知服务的topic_urn可以通过消息通知服务的查询主题列表API获取，示例：urn:smn:regionId:f96188c7ccaf4ffba0c9aa149ab2bd57:test_topic_v2。   - 函数工作流的func_urn可以通过函数工作流的获取函数列表API获取，示例：urn:fss:xxxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test。    |
| notification_id   | 是    | String                                                                         | 关键操作通知id。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| filter            | 否    | [Filter] object                                 | 关键操作通知高级筛选条件。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| agency_name       | 否    | String                                                                         | 云服务委托名称。 参数值为"cts_admin_trust"时，创建关键操作通知时会自动创建云服务委托：cts_admin_trust。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
   
 表3Operations 
| 参数            | 是否必选 | 参数类型             | 描述                                                                                                                                             |
|:---|:---|:---|:---|
| service_type  | 是    | String           | 标识云服务类型。必须为已对接CTS的云服务的英文缩写，且服务类型一般为大写字母。 已对接的云服务列表参见《云审计服务用户指南》"支持审计的服务及详细操作列表"章节，单击对应云服务的文档链接，可以查看到该云服务的英文缩写。 |
| resource_type | 是    | String           | 标识资源类型。                                                                                                                                        |
| trace_names   | 是    | Array of strings | 标识事件名称。                                                                                                                                        |
   
 表4NotificationUsers 
| 参数         | 是否必选 | 参数类型             | 描述      |
|:---|:---|:---|:---|
| user_group | 是    | String           | IAM用户组。 |
| user_list  | 是    | Array of strings | IAM用户。  |
   
 表5Filter 
| 参数                | 是否必选 | 参数类型             | 描述                                                                                                                                                                                                                                                                                                                                                             |
|:---|:---|:---|:---|
| condition         | 是    | String           | 多条件关系。 - AND(默认值) 表示所有过滤条件满足后生效。   - OR 表示有任意一个条件满足时生效。    |
| is_support_filter | 是    | Boolean          | 是否打开高级筛选开关。                                                                                                                                                                                                                                                                                                                                                    |
| rule              | 是    | Array of strings | 高级过滤条件规则，示例如下："key != value"，格式为：字段 规则 值。-字段取值范围：api_version,code,trace_rating,trace_type,resource_id,resource_name。-规则：!= 或 =。- 值：api_version正则约束：\^(a-zA-Z0-9_-.){1,64}$；code：最小长度1，最大长度256；trace_rating枚举值："normal", "warning", "incident"；trace_type枚举值："ConsoleAction", "ApiCall", "SystemAction"；resource_id：最小长度1，最大长度350；resource_name：最小长度1，最大长度256   |
   
#### 响应参数
**状态码：200**
表6响应Body参数 
| 参数                | 参数类型                                                                            | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|:---|:---|:---|
| notification_name | String                                                                          | 标识关键操作通知名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| operation_type    | String                                                                          | 标识操作类型。 目前支持的操作类型有完整类型(complete)和自定义类型(customized)。 完整类型下，CTS发送通知的对象为已对接服务的所有事件。 自定义类型下，CTS发送通知的对象是在operations列表中指定的事件。                                                                                                                                                                                                                                                                                                                                                    |
| operations        | Array of [Operations] objects               | 操作事件列表。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| notify_user_list  | Array of [NotificationUsers] objects | 通知用户列表，目前最多支持对10个用户组和50个用户发起的操作进行配置。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| status            | String                                                                          | 标识关键操作通知状态，包括正常(enabled)，停止(disabled)两种状态。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| topic_id          | String                                                                          | 消息通知服务的topic_urn或者函数工作流的func_urn。 - 消息通知服务的topic_urn可以通过消息通知服务的查询主题列表API获取，示例：urn:smn:regionId:f96188c7ccaf4ffba0c9aa149ab2bd57:test_topic_v2。   - 函数工作流的func_urn可以通过函数工作流的获取函数列表API获取，示例：urn:fss:xxxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test。    |
| notification_id   | String                                                                          | 关键操作通知的唯一标识。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| notification_type | String                                                                          | 关键操作通知类型，根据topic_id区分为消息通知服务(smn)和函数工作流(fun)。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| project_id        | String                                                                          | 项目ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| create_time       | Long                                                                            | 关键操作通知创建时间戳。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| filter            | [Filter] object                                 | 关键操作通知高级筛选条件。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| agency_name       | String                                                                          | 云服务委托名称。 参数值为"cts_admin_trust"时，修改关键操作通知时会自动创建云服务委托：cts_admin_trust。                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
   
 表7Operations 
| 参数            | 参数类型             | 描述                                                                                                                                             |
|:---|:---|:---|
| service_type  | String           | 标识云服务类型。必须为已对接CTS的云服务的英文缩写，且服务类型一般为大写字母。 已对接的云服务列表参见《云审计服务用户指南》"支持审计的服务及详细操作列表"章节，单击对应云服务的文档链接，可以查看到该云服务的英文缩写。 |
| resource_type | String           | 标识资源类型。                                                                                                                                        |
| trace_names   | Array of strings | 标识事件名称。                                                                                                                                        |
   
 表8NotificationUsers 
| 参数         | 参数类型             | 描述      |
|:---|:---|:---|
| user_group | String           | IAM用户组。 |
| user_list  | Array of strings | IAM用户。  |
   
 表9Filter 
| 参数                | 参数类型             | 描述                                                                                                                                                                                                                                                                                                                                                             |
|:---|:---|:---|
| condition         | String           | 多条件关系。 - AND(默认值) 表示所有过滤条件满足后生效。   - OR 表示有任意一个条件满足时生效。    |
| is_support_filter | Boolean          | 是否打开高级筛选开关。                                                                                                                                                                                                                                                                                                                                                    |
| rule              | Array of strings | 高级过滤条件规则，示例如下："key != value"，格式为：字段 规则 值。-字段取值范围：api_version,code,trace_rating,trace_type,resource_id,resource_name。-规则：!= 或 =。- 值：api_version正则约束：\^(a-zA-Z0-9_-.){1,64}$；code：最小长度1，最大长度256；trace_rating枚举值："normal", "warning", "incident"；trace_type枚举值："ConsoleAction", "ApiCall", "SystemAction"；resource_id：最小长度1，最大长度350；resource_name：最小长度1，最大长度256   |
   
**状态码：400**
表10响应Body参数 
| 参数         | 参数类型   | 描述             |
|:---|:---|:---|
| error_code | String | 错误码标识，CTS.XXX。 |
| error_msg  | String | 错误描述。          |
   
**状态码：401**
表11响应Body参数 
| 参数         | 参数类型   | 描述             |
|:---|:---|:---|
| error_code | String | 错误码标识，CTS.XXX。 |
| error_msg  | String | 错误描述。          |
   
**状态码：403**
表12响应Body参数 
| 参数         | 参数类型   | 描述             |
|:---|:---|:---|
| error_code | String | 错误码标识，CTS.XXX。 |
| error_msg  | String | 错误描述。          |
   
**状态码：404**
表13响应Body参数 
| 参数         | 参数类型   | 描述             |
|:---|:---|:---|
| error_code | String | 错误码标识，CTS.XXX。 |
| error_msg  | String | 错误描述。          |
   
**状态码：500**
表14响应Body参数 
| 参数         | 参数类型   | 描述             |
|:---|:---|:---|
| error_code | String | 错误码标识，CTS.XXX。 |
| error_msg  | String | 错误描述。          |
   
**状态码：503**
表15响应Body参数 
| 参数         | 参数类型   | 描述             |
|:---|:---|:---|
| error_code | String | 错误码标识，CTS.XXX。 |
| error_msg  | String | 错误描述。          |
   
#### 请求示例
修改关键操作通知请求样例。
```
PUT https://{endpoint}/v3/{project_id}/notifications
{
  "notification_id" : "6d4a09bb-aa8e-40db-9e87-0d5e203823a8",
  "notification_name" : "test",
  "agency_name" : "cts_admin_trust",
  "operation_type" : "customized",
  "operations" : [ {
    "service_type" : "CTS",
    "resource_type" : "tracker",
    "trace_names" : [ "createTracker", "deleteTracker" ]
  }, {
    "service_type" : "CTS",
    "resource_type" : "notification",
    "trace_names" : [ "deleteNotification", "updateNotification" ]
  }, {
    "service_type" : "AOM",
    "resource_type" : "pe",
    "trace_names" : [ "deletePolicyGroup", "updatePolicyGroup", "createPolicyGroup" ]
  } ],
  "notify_user_list" : [ {
    "user_group" : "admin",
    "user_list" : [ "test", "test1" ]
  }, {
    "user_group" : "CTS view",
    "user_list" : [ "test2", "test3" ]
  } ],
  "status" : "enabled",
  "topic_id" : "urn:smn:cn-north-7:24edf66e79d04187acb99a463e610764:foo"
}
```
#### 响应示例
**状态码：200**
修改关键操作通知成功。
```
{
  "notification_id" : "6d4a09bb-aa8e-40db-9e87-0d5e203823a8",
  "notification_name" : "test",
  "agency_name" : "cts_admin_trust",
  "operation_type" : "customized",
  "operations" : [ {
    "service_type" : "CTS",
    "resource_type" : "tracker",
    "trace_names" : [ "createTracker", "deleteTracker" ]
  }, {
    "service_type" : "CTS",
    "resource_type" : "notification",
    "trace_names" : [ "deleteNotification", "updateNotification" ]
  }, {
    "service_type" : "AOM",
    "resource_type" : "pe",
    "trace_names" : [ "deletePolicyGroup", "updatePolicyGroup", "createPolicyGroup" ]
  } ],
  "notify_user_list" : [ {
    "user_group" : "admin",
    "user_list" : [ "test", "test1" ]
  }, {
    "user_group" : "CTS view",
    "user_list" : [ "test2", "test3" ]
  } ],
  "status" : "enabled",
  "project_id" : "24edf66e79d04187acb99a463e610764",
  "notification_type" : "smn",
  "create_time" : 1634001495876,
  "topic_id" : "urn:smn:cn-north-7:24edf66e79d04187acb99a463e610764:foo"
}
```
#### SDK代码示例
SDK代码示例如下。
- [Java]
  修改关键操作通知请求样例。
  ```
  package com.huaweicloud.sdk.test;
  import com.huaweicloud.sdk.core.auth.ICredential;
  import com.huaweicloud.sdk.core.auth.BasicCredentials;
  import com.huaweicloud.sdk.core.exception.ConnectionException;
  import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
  import com.huaweicloud.sdk.core.exception.ServiceResponseException;
  import com.huaweicloud.sdk.cts.v3.region.CtsRegion;
  import com.huaweicloud.sdk.cts.v3.*;
  import com.huaweicloud.sdk.cts.v3.model.*;
  import java.util.List;
  import java.util.ArrayList;
  public class UpdateNotificationSolution {
      public static void main(String[] args) {
          // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
          // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
          String ak = System.getenv("CLOUD_SDK_AK");
          String sk = System.getenv("CLOUD_SDK_SK");
          String projectId = "{project_id}";
          ICredential auth = new BasicCredentials()
                  .withProjectId(projectId)
                  .withAk(ak)
                  .withSk(sk);
          CtsClient client = CtsClient.newBuilder()
                  .withCredential(auth)
                  .withRegion(CtsRegion.valueOf("<YOUR REGION>"))
                  .build();
          UpdateNotificationRequest request = new UpdateNotificationRequest();
          UpdateNotificationRequestBody body = new UpdateNotificationRequestBody();
          List<String> listNotifyUserListUserList = new ArrayList<>();
          listNotifyUserListUserList.add("test2");
          listNotifyUserListUserList.add("test3");
          List<String> listNotifyUserListUserList1 = new ArrayList<>();
          listNotifyUserListUserList1.add("test");
          listNotifyUserListUserList1.add("test1");
          List<NotificationUsers> listbodyNotifyUserList = new ArrayList<>();
          listbodyNotifyUserList.add(
              new NotificationUsers()
                  .withUserGroup("admin")
                  .withUserList(listNotifyUserListUserList1)
          );
          listbodyNotifyUserList.add(
              new NotificationUsers()
                  .withUserGroup("CTS view")
                  .withUserList(listNotifyUserListUserList)
          );
          List<String> listOperationsTraceNames = new ArrayList<>();
          listOperationsTraceNames.add("deletePolicyGroup");
          listOperationsTraceNames.add("updatePolicyGroup");
          listOperationsTraceNames.add("createPolicyGroup");
          List<String> listOperationsTraceNames1 = new ArrayList<>();
          listOperationsTraceNames1.add("deleteNotification");
          listOperationsTraceNames1.add("updateNotification");
          List<String> listOperationsTraceNames2 = new ArrayList<>();
          listOperationsTraceNames2.add("createTracker");
          listOperationsTraceNames2.add("deleteTracker");
          List<Operations> listbodyOperations = new ArrayList<>();
          listbodyOperations.add(
              new Operations()
                  .withServiceType("CTS")
                  .withResourceType("tracker")
                  .withTraceNames(listOperationsTraceNames2)
          );
          listbodyOperations.add(
              new Operations()
                  .withServiceType("CTS")
                  .withResourceType("notification")
                  .withTraceNames(listOperationsTraceNames1)
          );
          listbodyOperations.add(
              new Operations()
                  .withServiceType("AOM")
                  .withResourceType("pe")
                  .withTraceNames(listOperationsTraceNames)
          );
          body.withNotificationId("6d4a09bb-aa8e-40db-9e87-0d5e203823a8");
          body.withTopicId("urn:smn:cn-north-7:24edf66e79d04187acb99a463e610764:foo");
          body.withStatus(UpdateNotificationRequestBody.UpdateNotificationRequestBody.fromValue("enabled"));
          body.withNotifyUserList(listbodyNotifyUserList);
          body.withOperations(listbodyOperations);
          body.withAgencyName(UpdateNotificationRequestBody.UpdateNotificationRequestBody.fromValue("cts_admin_trust"));
          body.withOperationType(UpdateNotificationRequestBody.UpdateNotificationRequestBody.fromValue("customized"));
          body.withNotificationName("test");
          request.withBody(body);
          try {
              UpdateNotificationResponse response = client.updateNotification(request);
              System.out.println(response.toString());
          } catch (ConnectionException e) {
              e.printStackTrace();
          } catch (RequestTimeoutException e) {
              e.printStackTrace();
          } catch (ServiceResponseException e) {
              e.printStackTrace();
              System.out.println(e.getHttpStatusCode());
              System.out.println(e.getRequestId());
              System.out.println(e.getErrorCode());
              System.out.println(e.getErrorMsg());
          }
      }
  }
  ```
- [Python]
  修改关键操作通知请求样例。
  ```
  # coding: utf-8
  import os
  from huaweicloudsdkcore.auth.credentials import BasicCredentials
  from huaweicloudsdkcts.v3.region.cts_region import CtsRegion
  from huaweicloudsdkcore.exceptions import exceptions
  from huaweicloudsdkcts.v3 import *
  if __name__ == "__main__":
      # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
      # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
      ak = os.environ["CLOUD_SDK_AK"]
      sk = os.environ["CLOUD_SDK_SK"]
      projectId = "{project_id}"
      credentials = BasicCredentials(ak, sk, projectId)
      client = CtsClient.new_builder() \
          .with_credentials(credentials) \
          .with_region(CtsRegion.value_of("<YOUR REGION>")) \
          .build()
      try:
          request = UpdateNotificationRequest()
          listUserListNotifyUserList = [
              "test2",
              "test3"
          ]
          listUserListNotifyUserList1 = [
              "test",
              "test1"
          ]
          listNotifyUserListbody = [
              NotificationUsers(
                  user_group="admin",
                  user_list=listUserListNotifyUserList1
              ),
              NotificationUsers(
                  user_group="CTS view",
                  user_list=listUserListNotifyUserList
              )
          ]
          listTraceNamesOperations = [
              "deletePolicyGroup",
              "updatePolicyGroup",
              "createPolicyGroup"
          ]
          listTraceNamesOperations1 = [
              "deleteNotification",
              "updateNotification"
          ]
          listTraceNamesOperations2 = [
              "createTracker",
              "deleteTracker"
          ]
          listOperationsbody = [
              Operations(
                  service_type="CTS",
                  resource_type="tracker",
                  trace_names=listTraceNamesOperations2
              ),
              Operations(
                  service_type="CTS",
                  resource_type="notification",
                  trace_names=listTraceNamesOperations1
              ),
              Operations(
                  service_type="AOM",
                  resource_type="pe",
                  trace_names=listTraceNamesOperations
              )
          ]
          request.body = UpdateNotificationRequestBody(
              notification_id="6d4a09bb-aa8e-40db-9e87-0d5e203823a8",
              topic_id="urn:smn:cn-north-7:24edf66e79d04187acb99a463e610764:foo",
              status="enabled",
              notify_user_list=listNotifyUserListbody,
              operations=listOperationsbody,
              agency_name="cts_admin_trust",
              operation_type="customized",
              notification_name="test"
          )
          response = client.update_notification(request)
          print(response)
      except exceptions.ClientRequestException as e:
          print(e.status_code)
          print(e.request_id)
          print(e.error_code)
          print(e.error_msg)
  ```
- [Go]
  修改关键操作通知请求样例。
  ```
  package main
  import (
  "fmt"
  "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
      cts "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cts/v3"
  "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cts/v3/model"
      region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cts/v3/region"
  )
  func main() {
      // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
      // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
      ak := os.Getenv("CLOUD_SDK_AK")
      sk := os.Getenv("CLOUD_SDK_SK")
      projectId := "{project_id}"
      auth, err := basic.NewCredentialsBuilder().
          WithAk(ak).
          WithSk(sk).
          WithProjectId(projectId).
          SafeBuild()
      if err != nil {
          fmt.Println(err)
          return
      }
      hcClient, err := cts.CtsClientBuilder().
           WithRegion(region.ValueOf("<YOUR REGION>")).
           WithCredential(auth).
           SafeBuild()
      if err != nil {
          fmt.Println(err)
          return
      }
      client := cts.NewCtsClient(hcClient)
      request := &model.UpdateNotificationRequest{}
  var listUserListNotifyUserList = []string{
          "test2",
      "test3",
      }
  var listUserListNotifyUserList1 = []string{
          "test",
      "test1",
      }
  var listNotifyUserListbody = []model.NotificationUsers{
          {
              UserGroup: "admin",
              UserList: listUserListNotifyUserList1,
          },
          {
              UserGroup: "CTS view",
              UserList: listUserListNotifyUserList,
          },
      }
  var listTraceNamesOperations = []string{
          "deletePolicyGroup",
      "updatePolicyGroup",
      "createPolicyGroup",
      }
  var listTraceNamesOperations1 = []string{
          "deleteNotification",
      "updateNotification",
      }
  var listTraceNamesOperations2 = []string{
          "createTracker",
      "deleteTracker",
      }
  var listOperationsbody = []model.Operations{
          {
              ServiceType: "CTS",
              ResourceType: "tracker",
              TraceNames: listTraceNamesOperations2,
          },
          {
              ServiceType: "CTS",
              ResourceType: "notification",
              TraceNames: listTraceNamesOperations1,
          },
          {
              ServiceType: "AOM",
              ResourceType: "pe",
              TraceNames: listTraceNamesOperations,
          },
      }
  topicIdUpdateNotificationRequestBody:= "urn:smn:cn-north-7:24edf66e79d04187acb99a463e610764:foo"
  agencyNameUpdateNotificationRequestBody:= model.GetUpdateNotificationRequestBodyAgencyNameEnum().CTS_ADMIN_TRUST
  request.Body = &model.UpdateNotificationRequestBody{
  NotificationId: "6d4a09bb-aa8e-40db-9e87-0d5e203823a8",
  TopicId: &topicIdUpdateNotificationRequestBody,
  Status: model.GetUpdateNotificationRequestBodyStatusEnum().ENABLED,
  NotifyUserList: &listNotifyUserListbody,
  Operations: &listOperationsbody,
  AgencyName: &agencyNameUpdateNotificationRequestBody,
  OperationType: model.GetUpdateNotificationRequestBodyOperationTypeEnum().CUSTOMIZED,
  NotificationName: "test",
  }
  response, err := client.UpdateNotification(request)
  if err == nil {
          fmt.Printf("%+v\n", response)
      } else {
          fmt.Println(err)
      }
  }
  ```
- [更多]
  更多编程语言的SDK代码示例，请参见[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/CTS/sdk?api=UpdateNotification)的代码示例页签，可生成自动对应的SDK代码示例。
#### 状态码
| 状态码 | 描述                          |
|:---|:---|
| 200 | 修改关键操作通知成功。                 |
| 400 | 服务器未能处理请求。                  |
| 401 | 请求鉴权校验失败，访问被拒绝。             |
| 403 | 请求权限校验失败，访问被禁止。             |
| 404 | 服务器无法找到被请求的资源或部分关键操作通知删除失败。 |
| 500 | 服务内部异常，请求未完成；或部分追踪器删除失败。    |
| 503 | 被请求的服务无效。建议直接修改该请求，不要重试该请求。 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-cts/ErrorCode.html)。
