{
  "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" : {
        "GreengrassV2" : {
          "description" : "A gateway that runs on AWS IoT Greengrass V2.",
          "$ref" : "#/definitions/GreengrassV2"
        },
        "SiemensIE" : {
          "description" : "A gateway that runs on Siemens Industrial Edge.",
          "$ref" : "#/definitions/SiemensIE"
        }
      },
      "oneOf" : [ {
        "required" : [ "GreengrassV2" ]
      }, {
        "required" : [ "SiemensIE" ]
      } ]
    },
    "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"
        },
        "CoreDeviceOperatingSystem" : {
          "description" : "The operating system of the core device in AWS IoT Greengrass V2.",
          "type" : "string",
          "enum" : [ "LINUX_AARCH64", "LINUX_AMD64", "WINDOWS_AMD64" ]
        }
      },
      "required" : [ "CoreDeviceThingName" ]
    },
    "SiemensIE" : {
      "description" : "Contains the IotCoreThingName of AWS IoT Thing that the gateway runs on.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "IotCoreThingName" : {
          "description" : "The name of the IoT Core Thing.",
          "type" : "string"
        }
      },
      "required" : [ "IotCoreThingName" ]
    },
    "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" ]
    },
    "GatewayVersion" : {
      "description" : "The version of the gateway you want to create.",
      "type" : "string"
    },
    "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"
    },
    "GatewayVersion" : {
      "description" : "The version of the gateway you want to create.",
      "type" : "string"
    },
    "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,
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "iotsitewise:TagResource", "iotsitewise:UntagResource", "iotsitewise:ListTagsForResource" ]
  },
  "required" : [ "GatewayName", "GatewayPlatform" ],
  "readOnlyProperties" : [ "/properties/GatewayId" ],
  "createOnlyProperties" : [ "/properties/GatewayPlatform", "/properties/GatewayVersion" ],
  "primaryIdentifier" : [ "/properties/GatewayId" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "iotsitewise:CreateGateway", "iotsitewise:DescribeGateway", "iotsitewise:DescribeGatewayCapabilityConfiguration", "iotsitewise:UpdateGatewayCapabilityConfiguration", "iam:PassRole", "iam:GetRole", "iotsitewise:ListTagsForResource", "iotsitewise:TagResource" ]
    },
    "read" : {
      "permissions" : [ "iotsitewise:DescribeGateway", "iotsitewise:DescribeGatewayCapabilityConfiguration", "iotsitewise:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "iotsitewise:UpdateGateway", "iotsitewise:UpdateGatewayCapabilityConfiguration", "iotsitewise:TagResource", "iotsitewise:UntagResource", "iotsitewise:DescribeGateway", "iotsitewise:DescribeGatewayCapabilityConfiguration", "iotsitewise:ListTagsForResource" ]
    },
    "delete" : {
      "permissions" : [ "iotsitewise:DescribeGateway", "iotsitewise:DescribeGatewayCapabilityConfiguration", "iotsitewise:DeleteGateway" ]
    },
    "list" : {
      "permissions" : [ "iotsitewise:ListGateways", "iotsitewise:ListTagsForResource" ]
    }
  }
}