text: # GENERATED BY KOMAND SDK - DO NOT EDIT
  import komand
  import json
  
  
  class Component:
      DESCRIPTION = "Create or replace a document by index"
  
  
  class Input:
      _ID = "_id"
      _INDEX = "_index"
      _TYPE = "_type"
      _VERSION = "_version"
      DOCUMENT = "document"
      PARENT = "parent"
      ROUTING = "routing"
      TIMEOUT = "timeout"
      VERSION_TYPE = "version_type"
      
  
  class Output:
      INDEX_RESPONSE = "index_response"
      
  
  class IndexDocumentInput(komand.Input):
      schema = json.loads("""
     {
    "type": "object",
    "title": "Variables",
    "properties": {
      "_id": {
        "type": "string",
        "title": "ID",
        "description": "Optional ID of Indexed Document",
        "order": 3
      },
      "_index": {
        "type": "string",
        "title": "Index",
        "description": "Index to Insert Document Into",
        "order": 1
      },
      "_type": {
        "type": "string",
        "title": "Type",
        "description": "Type of Document to Index",
        "order": 2
      },
      "_version": {
        "type": "integer",
        "title": "Version",
        "description": "Optional Version Specification",
        "order": 5
      },
      "document": {
        "type": "object",
        "title": "Document",
        "description": "JSON Document to Index",
        "order": 6
      },
      "parent": {
        "type": "string",
        "title": "Parent",
        "description": "Optional Parent",
        "order": 8
      },
      "routing": {
        "type": "string",
        "title": "Routing",
        "description": "Optional Shard Placement",
        "order": 7
      },
      "timeout": {
        "type": "string",
        "title": "Timeout",
        "description": "Custom Timeout Window",
        "default": "1m",
        "order": 9
      },
      "version_type": {
        "type": "string",
        "title": "Version Type",
        "description": "Optional Version Type",
        "default": "internal",
        "enum": [
          "internal",
          "external",
          "external_gt",
          "external_gte"
        ],
        "order": 4
      }
    },
    "required": [
      "_index"
    ]
  }
      """)
  
      def __init__(self):
          super(self.__class__, self).__init__(self.schema)
  
  
  class IndexDocumentOutput(komand.Output):
      schema = json.loads("""
     {
    "type": "object",
    "title": "Variables",
    "properties": {
      "index_response": {
        "$ref": "#/definitions/op_response",
        "title": "Index Response",
        "description": "Result of Index Operation",
        "order": 1
      }
    },
    "definitions": {
      "_shards": {
        "type": "object",
        "title": "_shards",
        "properties": {
          "failed": {
            "type": "integer",
            "title": "Failed",
            "description": "Number of Failed Shards",
            "order": 3
          },
          "skipped": {
            "type": "integer",
            "title": "Skipped",
            "description": "Number of Skipped Shards",
            "order": 4
          },
          "successful": {
            "type": "integer",
            "title": "Successful",
            "description": "Number of Successful Shards",
            "order": 2
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "description": "Number of Total Shards",
            "order": 1
          }
        }
      },
      "op_response": {
        "type": "object",
        "title": "op_response",
        "properties": {
          "_id": {
            "type": "string",
            "title": "ID",
            "description": "Document ID",
            "order": 3
          },
          "_index": {
            "type": "string",
            "title": "Index",
            "description": "Document Index",
            "order": 1
          },
          "_shards": {
            "$ref": "#/definitions/_shards",
            "title": "Shards",
            "description": "Information About the Replication Process",
            "order": 6
          },
          "_type": {
            "type": "string",
            "title": "Type",
            "description": "Document Type",
            "order": 2
          },
          "_version": {
            "type": "integer",
            "title": "Version",
            "description": "Document Version",
            "order": 4
          },
          "created": {
            "type": "boolean",
            "title": "Created",
            "description": "Flag for Successful Creation",
            "order": 7
          },
          "result": {
            "type": "string",
            "title": "Result",
            "description": "Result of Index",
            "order": 5
          }
        },
        "definitions": {
          "_shards": {
            "type": "object",
            "title": "_shards",
            "properties": {
              "failed": {
                "type": "integer",
                "title": "Failed",
                "description": "Number of Failed Shards",
                "order": 3
              },
              "skipped": {
                "type": "integer",
                "title": "Skipped",
                "description": "Number of Skipped Shards",
                "order": 4
              },
              "successful": {
                "type": "integer",
                "title": "Successful",
                "description": "Number of Successful Shards",
                "order": 2
              },
              "total": {
                "type": "integer",
                "title": "Total",
                "description": "Number of Total Shards",
                "order": 1
              }
            }
          }
        }
      }
    }
  }
      """)
  
      def __init__(self):
          super(self.__class__, self).__init__(self.schema)
  