{
  "typeName" : "AWS::IoTSiteWise::Gateway",
  "description" : "Resource schema for AWS::IoTSiteWise::Gateway",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-IoTSiteWise.git",
  "definitions" : {
    "GatewayPlatform" : {
      "description" : "Contains a gateway's platform information.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Greengrass" : {
          "description" : "A gateway that runs on AWS IoT Greengrass V1.",
          "$ref" : "#/definitions/Greengrass"
        },
        "GreengrassV2" : {
          "description" : "A gateway that runs on AWS IoT Greengrass V2.",
          "$ref" : "#/definitions/GreengrassV2"
        }
      },
      "oneOf" : [ {
        "required" : [ "Greengrass" ]
      }, {
        "required" : [ "GreengrassV2" ]
      } ]
    },
    "Greengrass" : {
      "description" : "Contains the ARN of AWS IoT Greengrass Group V1 that the gateway runs on.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "GroupArn" : {
          "description" : "The ARN of the Greengrass group.",
          "type" : "string"
        }
      },
      "required" : [ "GroupArn" ]
    },
    "GreengrassV2" : {
      "description" : "Contains the CoreDeviceThingName of AWS IoT Greengrass Group V2 that the gateway runs on.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "CoreDeviceThingName" : {
          "description" : "The name of the CoreDevice in GreenGrass V2.",
          "type" : "string"
        }
      },
      "required" : [ "CoreDeviceThingName" ]
    },
    "Tag" : {
      "description" : "To add or update tag, provide both key and value. To delete tag, provide only tag key to be deleted",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Key" : {
          "type" : "string"
        },
        "Value" : {
          "type" : "string"
        }
      },
      "required" : [ "Key", "Value" ]
    },
    "CapabilityNamespace" : {
      "description" : "The namespace of the capability configuration.",
      "type" : "string"
    },
    "CapabilityConfiguration" : {
      "description" : "The JSON document that defines the gateway capability's configuration.",
      "type" : "string"
    },
    "GatewayCapabilitySummary" : {
      "description" : "Contains a summary of a gateway capability configuration.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "CapabilityNamespace" : {
          "$ref" : "#/definitions/CapabilityNamespace"
        },
        "CapabilityConfiguration" : {
          "$ref" : "#/definitions/CapabilityConfiguration"
        }
      },
      "required" : [ "CapabilityNamespace" ]
    }
  },
  "properties" : {
    "GatewayName" : {
      "description" : "A unique, friendly name for the gateway.",
      "type" : "string"
    },
    "GatewayPlatform" : {
      "description" : "The gateway's platform. You can only specify one platform in a gateway.",
      "$ref" : "#/definitions/GatewayPlatform"
    },
    "Tags" : {
      "description" : "A list of key-value pairs that contain metadata for the gateway.",
      "type" : "array",
      "uniqueItems" : false,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "GatewayId" : {
      "description" : "The ID of the gateway device.",
      "type" : "string"
    },
    "GatewayCapabilitySummaries" : {
      "description" : "A list of gateway capability summaries that each contain a namespace and status.",
      "type" : "array",
      "uniqueItems" : true,
      "insertionOrder" : true,
      "items" : {
        "$ref" : "#/definitions/GatewayCapabilitySummary"
      }
    }
  },
  "additionalProperties" : false,
  "taggable" : true,
  "required" : [ "GatewayName", "GatewayPlatform" ],
  "readOnlyProperties" : [ "/properties/GatewayId" ],
  "createOnlyProperties" : [ "/properties/GatewayPlatform" ],
  "primaryIdentifier" : [ "/properties/GatewayId" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "iotsitewise:CreateGateway", "iotsitewise:UpdateGatewayCapabilityConfiguration", "iam:PassRole", "iam:GetRole", "greengrass:GetCoreDevice", "iot:DescribeThing" ]
    },
    "read" : {
      "permissions" : [ "iotsitewise:DescribeGateway", "iotsitewise:DescribeGatewayCapabilityConfiguration", "iotsitewise:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "iotsitewise:UpdateGateway", "iotsitewise:UpdateGatewayCapabilityConfiguration", "iotsitewise:TagResource", "iotsitewise:UntagResource", "iotsitewise:DescribeGateway", "iotsitewise:ListTagsForResource" ]
    },
    "delete" : {
      "permissions" : [ "iotsitewise:DeleteGateway" ]
    },
    "list" : {
      "permissions" : [ "iotsitewise:ListGateways" ]
    }
  }
}