{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-vpc-lattice/json-schema/amazon-vpc-lattice-update-listener-response-schema.json",
  "title": "UpdateListenerResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-vpc-lattice-updatelistener-api-openapi.yml#/components/schemas/UpdateListenerResponse",
  "type": "object",
  "properties": {
    "arn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of the listener."
    },
    "id": {
      "type": "string",
      "description": "The ID of the listener."
    },
    "name": {
      "type": "string",
      "description": "The name of the listener."
    },
    "protocol": {
      "type": "string",
      "description": "The protocol of the listener."
    },
    "port": {
      "type": "integer",
      "description": "The listener port."
    },
    "serviceArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of the service."
    },
    "serviceId": {
      "type": "string",
      "description": "The ID of the service."
    },
    "defaultAction": {
      "$ref": "#/$defs/RuleAction"
    }
  },
  "$defs": {
    "FixedResponseAction": {
      "type": "object",
      "properties": {
        "statusCode": {
          "type": "integer",
          "description": "The HTTP response code. Only 404 and 500 status codes are supported."
        }
      },
      "required": [
        "statusCode"
      ]
    },
    "ForwardAction": {
      "type": "object",
      "properties": {
        "targetGroups": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/WeightedTargetGroup"
          },
          "description": "The target groups. Traffic matching the rule is forwarded to the specified target groups. With forward actions, you can assign a weight that controls the prioritization and selection of each target group. This means that requests are distributed to individual target groups based on their weights. For example, if two target groups have the same weight, each target group receives half of the traffic. The default value is 1. This means that if only one target group is provided, there is no need to set the weight; 100% of the traffic goes to that target group."
        }
      },
      "required": [
        "targetGroups"
      ]
    },
    "RuleAction": {
      "type": "object",
      "properties": {
        "forward": {
          "$ref": "#/$defs/ForwardAction"
        },
        "fixedResponse": {
          "$ref": "#/$defs/FixedResponseAction"
        }
      },
      "description": "Exactly one member is set."
    },
    "WeightedTargetGroup": {
      "type": "object",
      "properties": {
        "targetGroupIdentifier": {
          "type": "string",
          "description": "The ID or ARN of the target group."
        },
        "weight": {
          "type": "integer",
          "description": "Only required if you specify multiple target groups for a forward action. The weight determines how requests are distributed to the target group. For example, if you specify two target groups, each with a weight of 10, each target group receives half the requests. If you specify two target groups, one with a weight of 10 and the other with a weight of 20, the target group with a weight of 20 receives twice as many requests as the other target group. If there's only one target group specified, then the default value is 100."
        }
      },
      "required": [
        "targetGroupIdentifier"
      ]
    }
  }
}