# 
## Json Schema derived from SIF IN v3.6
# 
$schema: 'http://json-schema.org/draft-07/schema#'
title: SIF IN v3.6
description: JSON Schema derived from SIF IN v3.6
type: array
items:
  oneOf:
  - required: [ adminDirective ]
  - required: [ adminDirectives ]
  - required: [ alert ]
  - required: [ alerts ]
  - required: [ codeSet ]
  - required: [ codeSets ]
  - required: [ createResponse ]
  - required: [ createResponses ]
  - required: [ deleteRequest ]
  - required: [ deleteRequests ]
  - required: [ deleteResponse ]
  - required: [ deleteResponses ]
  - required: [ environment ]
  - required: [ environments ]
  - required: [ error ]
  - required: [ errors ]
  - required: [ job ]
  - required: [ jobs ]
  - required: [ namespace ]
  - required: [ namespaces ]
  - required: [ pod ]
  - required: [ pods ]
  - required: [ provider ]
  - required: [ providers ]
  - required: [ provisionRequest ]
  - required: [ provisionRequests ]
  - required: [ queue ]
  - required: [ queues ]
  - required: [ state ]
  - required: [ states ]
  - required: [ subscription ]
  - required: [ subscriptions ]
  - required: [ updateResponse ]
  - required: [ updateResponses ]
  - required: [ xquery ]
  - required: [ xquerys ]
  - required: [ zone ]
  - required: [ zones ]
properties:
  adminDirective:
    $ref: '#/definitions/adminDirective'
  adminDirectives:
    $ref: '#/definitions/adminDirectiveCollection'

  alert:
    $ref: '#/definitions/alert'
  alerts:
    $ref: '#/definitions/alertCollection'

  codeSet:
    $ref: '#/definitions/codeSet'
  codeSets:
    $ref: '#/definitions/codeSetCollection'

  createResponse:
    $ref: '#/definitions/createResponse'
  createResponses:
    $ref: '#/definitions/createResponseCollection'

  deleteRequest:
    $ref: '#/definitions/deleteRequest'
  deleteRequests:
    $ref: '#/definitions/deleteRequestCollection'

  deleteResponse:
    $ref: '#/definitions/deleteResponse'
  deleteResponses:
    $ref: '#/definitions/deleteResponseCollection'

  environment:
    $ref: '#/definitions/environment'
  environments:
    $ref: '#/definitions/environmentCollection'

  error:
    $ref: '#/definitions/error'
  errors:
    $ref: '#/definitions/errorCollection'

  job:
    $ref: '#/definitions/job'
  jobs:
    $ref: '#/definitions/jobCollection'

  namespace:
    $ref: '#/definitions/namespace'
  namespaces:
    $ref: '#/definitions/namespaceCollection'

  pod:
    $ref: '#/definitions/pod'
  pods:
    $ref: '#/definitions/podCollection'

  provider:
    $ref: '#/definitions/provider'
  providers:
    $ref: '#/definitions/providerCollection'

  provisionRequest:
    $ref: '#/definitions/provisionRequest'
  provisionRequests:
    $ref: '#/definitions/provisionRequestCollection'

  queue:
    $ref: '#/definitions/queue'
  queues:
    $ref: '#/definitions/queueCollection'

  state:
    $ref: '#/definitions/state'
  states:
    $ref: '#/definitions/stateCollection'

  subscription:
    $ref: '#/definitions/subscription'
  subscriptions:
    $ref: '#/definitions/subscriptionCollection'

  updateResponse:
    $ref: '#/definitions/updateResponse'
  updateResponses:
    $ref: '#/definitions/updateResponseCollection'

  xquery:
    $ref: '#/definitions/xquery'
  xquerys:
    $ref: '#/definitions/xqueryCollection'

  zone:
    $ref: '#/definitions/zone'
  zones:
    $ref: '#/definitions/zoneCollection'

definitions:
  # //////////////////////////////// data object /////////////////////////////
  environmentCollection:
    type: object
    properties:
      environment:
        type: array
        items:
          $ref: '#/definitions/environment'
  environment:
    type: object
    properties:
      type:
        type: string
        $ref: '#/definitions/environmentType'
        xml:
          attribute: true
      id:
        type: string
        $ref: '#/definitions/uuid'
        xml:
          attribute: true
      fingerprint:
        type: string
        description: >-
          <p>Unique environment identifier that can be safely shared with others. In order to not compromise security it MUST NOT match the environment's refId, sessionToken, userToken, or applicationKey.</p>
      sessionToken:
        type: string
      solutionId:
        type: string
        description: >-
          <p>The solution the Application would like to participate in. This is optional only, is advisory, and may be ignored by the Administrator. If processed it may be reflected in the URLs of the infrastructure services which are provided in the consumerEnvironment.</p>
      defaultZone:
        type: object
        $ref: '#/definitions/defaultZone'
      authenticationMethod:
        type: string
        description: >-
          <p>Defines the way in which the applicationKey can be used to enforce security.</p>
      instanceId:
        type: string
      userToken:
        type: string
      consumerName:
        type: string
        description: >-
          <p>A descriptive name for the application that will be readily identifiable to Zone Administrators if it becomes a Registered Consumer</p>
      applicationInfo:
        type: object
        $ref: '#/definitions/applicationInfo'
      infrastructureServices:
        type: object
        $ref: '#/definitions/infrastructureServices'
      provisionedZones:
        type: object
        $ref: '#/definitions/provisionedZones'
    description: >-
      <p>The Consumer Environment Service is the gateway to all other services. It scopes the Consumer's possible interactions with the infrastructure and any Provider Services accessible from it. The Environment Service provides the set of (possibly customized) information the Application needs to interoperate successfully.</p>
  # //////////////////////////////// data object /////////////////////////////
  provisionRequestCollection:
    type: object
    properties:
      provisionRequest:
        type: array
        items:
          $ref: '#/definitions/provisionRequest'
  provisionRequest:
    required:
    - "provisionedZones"
    type: object
    properties:
      id:
        type: string
        $ref: '#/definitions/uuid'
        xml:
          attribute: true
      completionStatus:
        oneOf:
        - const: "ACCEPTED"
          title: ACCEPTED
        - const: "MIXED"
          title: MIXED
        - const: "REJECTED"
          title: REJECTED
        xml:
          attribute: true
      provisionedZones:
        type: object
        description: >-
          <p>A specific Zone defined for this environment.</p>
        $ref: '#/definitions/provisionedZones'
    description: >-
      <p>If an Environment supports self-provisioning Consumers than either this section must initially contain all the rights the Consumer has to all Services in all Zones, or the provisionRequests Infrastructure Service must be present in the Consumer's Environment to allow additional rights to be obtained.</p>
  # //////////////////////////////// data object /////////////////////////////
  queueCollection:
    type: object
    properties:
      queue:
        type: array
        items:
          $ref: '#/definitions/queue'
  queue:
    type: object
    properties:
      id:
        type: string
        $ref: '#/definitions/uuid'
        xml:
          attribute: true
      polling:
        description: >-
          <p>Determines, when no messages are queued, whether the Consumer will have to periodically reissue Polling Requests at timed intervals or can reissue a Polling Request immediately.</p>
        oneOf:
        - const: "IMMEDIATE"
          title: IMMEDIATE
        - const: "LONG"
          title: LONG
      ownerId:
        type: string
        description: >-
          <p>The Environment ID of the owning Consumer for which this Queue is buffering messages. It is not specified at Queue create time, but is returned as part of the response to a query operation, and serves to allow an administrative application to identify which application the Queue instance is assigned to.</p>
        $ref: '#/definitions/uuid'
      name:
        type: string
        description: >-
          <p>A name which the Consumer assigns to the Queue. It is useful for reporting purposes, but is not guaranteed to be unique.</p>
      queueUri:
        type: string
        format: uri
        description: >-
          <p>The URI of the Messages Service associated with the Queue instance. This is the endpoint where the 'get next message' requests are issued.</p>
      ownerUri:
        type: string
        format: uri
        description: >-
          <p>When present, this contains the URL which the Queue instance will use when it determines the owner needs to be asynchronously alerted that a new message has arrived in the Queue.</p>
      idleTimeout:
        type: integer
        description: >-
          <p>Is the maximum time in seconds the Messages Service will wait for a message to arrive, before returning an HTTPS Response of 'no message seen' to the Consumer.</p>
      minWaitTime:
        type: integer
        description: >-
          <p>indicates the minimum time in seconds that the Consumer should wait after receiving a 'no message seen' response to a previous query, before posting another.</p>
      maxConcurrentConnections:
        type: integer
        description: >-
          <p>Number of (properly identified) concurrent connections supported by (the consumer, if suggested, and) the queue.</p>
      created:
        type: string
        description: >-
          <p>Time that Queue Instance was Created</p>
      lastAccessed:
        type: string
        description: >-
          <p>Time that Queue Instance was last Accessed and a message was dequeued.</p>
      lastModified:
        type: string
        description: >-
          <p>Time that Queue Instance was last Modified by receiving a new incoming message.</p>
      messageCount:
        type: integer
        description: >-
          <p>The number of messages currently residing in the Queue.</p>
    description: >-
      <p>The Queues Service supports creation, deletion and querying of Queue (Instance) / Queue Messages Service pairs.</p>
  # //////////////////////////////// data object /////////////////////////////
  subscriptionCollection:
    type: object
    properties:
      subscription:
        type: array
        items:
          $ref: '#/definitions/subscription'
  subscription:
    required:
    - "queueId"
    - "serviceName"
    - "serviceType"
    - "zoneId"
    type: object
    properties:
      id:
        type: string
        $ref: '#/definitions/uuid'
        xml:
          attribute: true
      zoneId:
        type: string
      contextId:
        type: string
        description: >-
          <p>The unique identity of a context element, which is associated with a Provider of this name and type operating in a Zone with this ID.</p>
      serviceType:
        type: string
        description: >-
          <p>The type of the service</p>
        $ref: '#/definitions/serviceType'
      serviceSubType:
        type: string
        description: >-
          <p>The subtype of the Service</p>
        $ref: '#/definitions/serviceSubType'
      messageType:
        type: string
        description: >-
          <p>The type of the message</p>
        $ref: '#/definitions/messageType'
      serviceName:
        type: string
        description: >-
          <p>The name of the Service. For utilities, this is fixed to one of the defined set of Utility Service Names. For objects and functions, it is defined by the Data Model.</p>
      queueId:
        type: string
        description: >-
          <p>Specifies which queues you want data associated with this subscription published to.</p>
    description: >-
      <p>A Consumer uses the Subscriptions Infrastructure Service to subscribe to Events published by one or more Service Providers.</p>
  # //////////////////////////////// data object /////////////////////////////
  jobCollection:
    type: object
    properties:
      job:
        type: array
        items:
          $ref: '#/definitions/job'
  job:
    required:
    - "name"
    type: object
    properties:
      id:
        type: string
        $ref: '#/definitions/uuid'
        xml:
          attribute: true
      name:
        type: string
        description: >-
          <p>The name of the job, e.g. "grading" or "sre".</p>
      description:
        type: string
        description: >-
          <p>A description of the job, e.g. "Bowers Elementary School Final Marks"</p>
      state:
        type: string
        description: >-
          <p>The current enumerable state of the job.</p>
        $ref: '#/definitions/jobState'
      stateDescription:
        type: string
        description: >-
          <p>A descriptive message elaborating on the current state, e.g. if the current state is "FAILED" the stateDescription may be "Timeout occured".</p>
      created:
        type: string
        description: >-
          <p>The datetime this job was created.</p>
      lastModified:
        type: string
        description: >-
          <p>The datetime this job was last modified.</p>
      timeout:
        type: string
        description: >-
          <p>The ammount of time after creation before this job is automatically deleted.</p>
      phases:
        type: object
        description: >-
          <p>The phases that make up this job.</p>
        $ref: '#/definitions/phaseCollection'
      initialization:
        type: object
        $ref: '#/definitions/initialization'
    description: >-
      <p>All functional services must use this object design to track state. While Events may be published back to the objects creator, they must not be published to the Consumer when the event was generated based on its request (since results were included in the response). Each functional service should define the expectations of how management of the job is managed for both the Consumer and Provider. For instance, certain optional fields may need to be included in-order-to successfully cause a job to be created.</p>
  # //////////////////////////////// data object /////////////////////////////
  stateCollection:
    type: object
    properties:
      state:
        type: array
        items:
          $ref: '#/definitions/stateCommon'
  state:
    required:
    - "type"
    type: object
    description: >-
      <p>For states updatable by the Consumer, it creates a new state much like it would a single object. The actual result (state or error) is included in the response. Each functional service should define the expectations for which Adaptor is responsible for updating the phase status. NOTE: The "states" collection represented here is reserved for future capabilities.</p>
#   allOfA:
    $ref: '#/definitions/stateCommon'
  # //////////////////////////////// data object /////////////////////////////
  alertCollection:
    type: object
    properties:
      alert:
        type: array
        items:
          $ref: '#/definitions/alert'
  alert:
    required:
    - "exchange"
    - "level"
    - "reporter"
    type: object
    properties:
      id:
        type: string
        $ref: '#/definitions/uuid'
        xml:
          attribute: true
      reporter:
        type: string
        description: >-
          <p>External identification of the Application (Consumer or Provider) reporting this Alert.</p>
      cause:
        type: string
        description: >-
          <p>External identification of the cause of the Alert.</p>
      exchange:
        description: >-
          <p>The exchange (or lack of exchange) responsible for generating the Alert.</p>
        oneOf:
        - const: "REQUEST"
          title: REQUEST
        - const: "RESPONSE"
          title: RESPONSE
        - const: "EVENT"
          title: EVENT
        - const: "TIMEOUT"
          title: TIMEOUT
        - const: "OTHER"
          title: OTHER
      level:
        description: >-
          <p>The level of the Alert.</p>
        oneOf:
        - const: "INFO"
          title: INFO
        - const: "STATECHANGE"
          title: STATECHANGE
        - const: "EVENT"
          title: EVENT
        - const: "WARNING"
          title: WARNING
        - const: "ERROR"
          title: ERROR
      description:
        type: string
        description: >-
          <p>A description of the reason for the Alert.</p>
      messageID:
        type: string
        description: >-
          <p>If available, the ID of the Message causing the problem.</p>
      body:
        type: string
        description: >-
          <p>The internals of the offending message or a more complete description of the information or state change. Usage of the CDATA designation is recommended in order to make the XML contents more readable to humans. </p>
      error:
        type: string
        description: >-
          <p>Detailed error results such as a stack trace.</p>
      xpath:
        type: string
        description: >-
          <p>An indicator of the specific element that was in error (or contributed to the problem. [NEEDS TO BE CHANGED TO the SIF XPATH TYPE]</p>
      category:
        type: integer
        description: >-
          <p>If the Alert Level is an error, this value must be the SIF 3.0.1 Error Category corresponding to the type of Error being reported</p>
      code:
        type: integer
        description: >-
          <p>If the Alert Level is an error, this value must be the SIF 3.0.1 Error Code corresponding to the type of Error being reported.</p>
      internal:
        type: string
        description: >-
          <p>Code internal to the reporter.</p>
    description: >-
      <p>Alerts form a system wide log that can be protected, as it may contain sensitive data. Ideally an Alert should contain as much identifying information about the problem being reported as possible.</p>
  # //////////////////////////////// data object /////////////////////////////
  codeSetCollection:
    type: object
    properties:
      codeSet:
        type: array
        items:
          $ref: '#/definitions/codeSet'
  codeSet:
    required:
    - "timestamp"
    - "version"
    - "zone"
    type: object
    properties:
      id:
        type: string
        minLength: 0
        maxLength: 128
        xml:
          attribute: true
      zone:
        type: string
        description: >-
          <p>If this is tied to a specific zone it is specified here, otherwise "environment-global" indicates applicability to all zones in the Environment.</p>
      version:
        type: string
        description: >-
          <p>The official major, minor, and revision version of the code set.</p>
        $ref: '#/definitions/version'
      timestamp:
        type: string
        description: >-
          <p>The date and time of the last change to this code set. So that only updates can be queried efficiently (where applicable).</p>
      source:
        type: string
        description: >-
          <p>URL to an external code set whose values are not (yet) present in the system.</p>
        $ref: '#/definitions/uri'
      codeItems:
        type: object
        $ref: '#/definitions/codeItems'
    description: >-
      <p>The Code Set Registry Service provides a way for all legal codes to be defined outside of the SIF Specification while allowing changes (additions and replacements) of external code set values to be easily verified by the recipient so as not to break existing Consumer / Provider interoperability.</p>
  # //////////////////////////////// data object /////////////////////////////
  namespaceCollection:
    type: object
    properties:
      namespace:
        type: array
        items:
          $ref: '#/definitions/namespace'
  namespace:
    required:
    - "uri"
    - "url"
    - "zone"
    type: object
    properties:
      id:
        type: string
        $ref: '#/definitions/uuid'
        xml:
          attribute: true
      zone:
        type: string
        description: >-
          <p>If this namespace is tied to a specific zone it is specified here.</p>
      uri:
        type: string
        format: uri
        description: >-
          <p>The namespace URI of the retrieved URL.</p>
        maxLength: 2048
      url:
        type: string
        format: uri
        description: >-
          <p>The URL of the specified namespace URI.</p>
        maxLength: 2048
    description: >-
      <p>The Namespaces Registry contains the set of XML namespace URIs and their corresponding schema location URLs that are currently valid within the Environment.</p>
  # //////////////////////////////// data object /////////////////////////////
  providerCollection:
    type: object
    properties:
      provider:
        type: array
        items:
          $ref: '#/definitions/provider'
  provider:
    required:
    - "contextId"
    - "providerName"
    - "querySupport"
    - "serviceName"
    - "serviceType"
    - "zoneId"
    type: object
    properties:
      id:
        type: string
        $ref: '#/definitions/uuid'
        xml:
          attribute: true
      serviceType:
        type: string
        description: >-
          <p>The generic type of Service being provided.</p>
        $ref: '#/definitions/serviceType'
      serviceName:
        type: string
        description: >-
          <p>The name of the Service or the Service Path being provided.</p>
      contextId:
        type: string
        description: >-
          <p>The name of the Service Context being provided.</p>
      zoneId:
        type: string
        description: >-
          <p>The Zone in which the Service Context is being provided.</p>
      providerName:
        type: string
        description: >-
          <p>The name of the Service Provider as it would be referred to by the administrator of the Zone (ex: RamseySIS).</p>
      querySupport:
        type: object
        $ref: '#/definitions/querySupport'
      mimeTypes:
        type: object
        $ref: '#/definitions/mediaTypes'
      endPoint:
        type: object
        description: >-
          <p>In a Brokered Environment, this element contains the URL where all requests for this Service Provider should be re-invoked by the Connector</p>
        $ref: '#/definitions/protocol'
      supportedRequestTypes:
        type: object
        $ref: '#/definitions/supportedRequests'
    description: >-
      <p>All potentially accessible Services have an entry in the Providers Registry (including the Providers Registry Utility Service itself), although full or even partial Consumer access to that Service is determined by the access rights currently granted in the Consumer's Environment object, and is not guaranteed.</p>
  # //////////////////////////////// data object /////////////////////////////
  xqueryCollection:
    type: object
    properties:
      xquery:
        type: array
        items:
          $ref: '#/definitions/xquery'
  xquery:
    required:
    - "parameters"
    - "returnType"
    - "script"
    - "status"
    - "type"
    type: object
    properties:
      id:
        type: string
        description: >-
          <p>The unique ID of the XQuery Template, which is contained in the Query Request URL when this template is being utilized. "Suggested" by the Consumer issuing the create Request, or pre-set in accordance with the binding requirements of a particular SIF release. This is NOT required to be a UUID, and must be provided as the Service Identifier in every Query URL which invokes this Template. Ex: "StudentSnapshot". </p>
        xml:
          attribute: true
      type:
        description: >-
          <p>Determines if the query may be sent to a data provider or if it requires the extended XQuery mechanism.</p>
        oneOf:
        - const: "SINGULAR"
          title: SINGULAR
        - const: "FORMULA"
          title: FORMULA
        - const: "EXTENDED"
          title: EXTENDED
      status:
        description: >-
          <p>Communicates if the query has been inspected for data hiding and the results of that assessment.</p>
        oneOf:
        - const: "PENDING"
          title: PENDING
        - const: "APPROVED"
          title: APPROVED
        - const: "DISALLOWED"
          title: DISALLOWED
      qualifier:
        type: string
        description: >-
          <p>If status is DISALLOWED this element optionally contains the reason.</p>
        minLength: 0
        maxLength: 1024
      description:
        type: string
        description: >-
          <p>Human readable description of the XQuery's intended behavior.</p>
        maxLength: 1024
        minLength: 0
      script:
        type: string
        description: >-
          <p>The text of the XQuery which MAY accept parameters. Usage of the CDATA designation is recommended. An empty value indicates the query is implimented wihtout XQuery or its logic is not disclosed</p>
        minLength: 0
      parameters:
        type: object
        $ref: '#/definitions/parameters'
      returnType:
        type: string
        format: uri
        description: >-
          <p>The fully qualified name of the root element returned by this service. Example: http://www.sifassociation.org/datamodel/na/3.3:students </p>
    description: >-
      <p>This collection defines the entire set of named queries that Consumers may legally issue for execution by Service Providers. A Consumer specifies the ID of a Named XQuery in a Query Request to a specific Service Provider, along with a set of values for any associated script parameters.</p>
  # //////////////////////////////// data object /////////////////////////////
  zoneCollection:
    type: object
    properties:
      zone:
        type: array
        items:
          $ref: '#/definitions/zone'
  zone:
    type: object
    properties:
      id:
        type: string
        xml:
          attribute: true
      description:
        type: string
        description: >-
          <p>A short (possibly multi-sentence) description of the Zone</p>
      properties:
        type: object
        $ref: '#/definitions/properties'
    description: >-
      <p>Zone identifiers are chosen by the administrator and can follow any convention that best meets the needs of the deploying organization. The Zone in which the Service is to be found always qualifies every Consumer request for any Provider Service. Each Service Consumer is assigned a "default" Zone at Registration time, which is used whenever a specific Zone is not explicitly included in one of its Provider Service Requests.</p>
  # //////////////////////////////// data object /////////////////////////////
  podCollection:
    type: object
    properties:
      pod:
        type: array
        items:
          $ref: '#/definitions/pod'
  pod:
    required:
    - "id"
    - "partyId"
    - "podStatus"
    - "podToken"
    - "podVersion"
    - "privacyList"
    type: object
    properties:
      id:
        type: string
        description: >-
          <p>The ID (GUID) that uniquely identifies this object.</p>
        $ref: '#/definitions/uuid'
        xml:
          attribute: true
      podStatus:
        description: >-
          <p>The status value for this POD.</p>
        oneOf:
        - const: "Live"
          title: Live
        - const: "Draft"
          title: Draft
        - const: "Pending"
          title: Pending
        - const: "Expired"
          title: Expired
      podToken:
        type: string
        description: >-
          <p>The token reference for the POD, also conveyed as the dataPrivacyMarker header.</p>
        $ref: '#/definitions/gCoreLocalId'
      podVersion:
        type: string
        description: >-
          <p>The POD version number. PODs are expected to change over time.</p>
      partyId:
        type: string
        description: >-
          <p>The name of the party (typically the data processor) which will receive the data from the school, district or state and has entered into an agreement to process the data and respect the privacy obligations of the data.</p>
      privacyList:
        type: object
        description: >-
          The set of privacy controls, laws and obligations which apply in this POD. There may be multiple sets which apply.
        $ref: '#/definitions/privacyList'
    description: >-
      <p>This object contains information about privacy obligations.</p>
  # //////////////////////////////// data object /////////////////////////////
  deleteRequestCollection:
    type: object
    properties:
      deleteRequest:
        type: array
        items:
          $ref: '#/definitions/deleteRequest'
  deleteRequest:
    required:
    - "deletes"
    type: object
    properties:
      deletes:
        type: object
        $ref: '#/definitions/deleteIdCollection'
    description: >-
      <p>A "deleteRequest" element, which consists of multiple, "delete" object ids. Since REST conventions do not support payloads on HTTP DELETE messages, all multi-object Delete Requests are conveyed via an HTTP PUT message containing an additional HTTP Header Field value of methodOverride set to DELETE.</p>
  # //////////////////////////////// data object /////////////////////////////
  createResponseCollection:
    type: object
    properties:
      createResponse:
        type: array
        items:
          $ref: '#/definitions/createResponse'
  createResponse:
    required:
    - "creates"
    type: object
    properties:
      creates:
        type: object
        $ref: '#/definitions/creates'
    description: >-
      <p>An HTTP Response with a status of 200 and a payload consisting of a single "createResponse" element. This includes, for each requested object successfully created, an internal status of 201 and the service-assigned refId. Any requested object that failed to be created is indicated by an error statusCode and a corresponding error payload.</p>
  # //////////////////////////////// data object /////////////////////////////
  deleteResponseCollection:
    type: object
    properties:
      deleteResponse:
        type: array
        items:
          $ref: '#/definitions/deleteResponse'
  deleteResponse:
    required:
    - "deletes"
    type: object
    properties:
      deletes:
        type: object
        $ref: '#/definitions/deleteStatusCollection'
    description: >-
      <p>An HTTP Response with a status of 200 (success). It contains a payload consisting of a single "deleteResponse" element.</p>
  # //////////////////////////////// data object /////////////////////////////
  errorCollection:
    type: object
    properties:
      error:
        type: array
        items:
          $ref: '#/definitions/errorCommon'
  error:
    required:
    - "code"
    - "message"
    - "scope"
    type: object
    description: >-
      
#   allOfA:
    $ref: '#/definitions/errorCommon'
  # //////////////////////////////// data object /////////////////////////////
  updateResponseCollection:
    type: object
    properties:
      updateResponse:
        type: array
        items:
          $ref: '#/definitions/updateResponse'
  updateResponse:
    required:
    - "updates"
    type: object
    properties:
      updates:
        type: object
        $ref: '#/definitions/updates'
    description: >-
      <p>An HTTP Response with a status of 200 (success) and a location corresponding to the URL of the first successfully modified object. It contains a payload consisting of a single "updateResponse" element.</p>
  # //////////////////////////////// data object /////////////////////////////
  adminDirectiveCollection:
    type: object
    properties:
      adminDirective:
        type: array
        items:
          $ref: '#/definitions/adminDirective'
  adminDirective:
    required:
    - "method"
    - "serviceName"
    - "timeout"
    - "timestamp"
    type: object
    properties:
      id:
        type: string
        xml:
          attribute: true
      timestamp:
        type: string
        description: >-
          <p>Timestamp when request was issued.</p>
      timeout:
        type: string
        description: >-
          <p>When should the request expire if not fulfilled.</p>
      serviceName:
        type: string
        description: >-
          <p>The name of the Service. For utilities, this is fixed to one of the defined set of Utility Service Names. For objects and functions, it is defined by the Data Model.</p>
      method:
        type: string
        description: >-
          <p>Unique ID/Name or requested method.</p>
      methodParameters:
        type: object
        $ref: '#/definitions/methodParameters'
    description: >-
      <p>Admin Directives, empowers endpoint providers to “inform” or “direct” endpoint consumers what needs to happen. This opens the possibility to prompt the resending of data, expose what objects have been updated, initiate functional services etc. Some common use-cases and details on Admin Directive functionality can be found on the respective Admin Directives section.</p>

  # ///////////////////////////////// list ////////////////////////////
  gCoreEmailList:
    description: >-
      <p>A list of e-mail addresses associated with an individual or organization.</p>
    type: object
    required:
    - "email"
    properties:
      email:
        type: array
        items:
          $ref: '#/definitions/gCoreEmail'

  # ////////////////////////////// xs:* no attrs ///////////////////////////////
  gCoreEmail:
    description: >-
      <p>This element represents an e-mail address of one of a number of types and occurs in objects such as StudentPersonal, StaffPersonal, StudentContactPersonal, etc..</p>
    type: string

  # ///////////////////////////////// list ////////////////////////////
  gCorePhoneNumberList:
    description: >-
      <p>Lists phone numbers associated with an entity.</p>
    type: object
    required:
    - "phoneNumber"
    properties:
      phoneNumber:
        type: array
        items:
          $ref: '#/definitions/gCorePhoneNumber'

  # ////////////////////////////// default sequence ///////////////////////////////
  gCorePhoneNumber:
    description: >-
      <p>This element represents a phone number and occurs within objects such as StudentPersonal, StaffPersonal, etc.</p>
    type: object
    required:
    - "number"
    properties:
      number:
        type: string
        description: >-
          <p>Phone number. Free-form, but typical Australian formats include:</p> <ul> <li>(###) ####-####</li> <li>####-####</li> <li>+##### ### ###</li> </ul>
      extension:
        type: string
        description: >-
          <p>Phone number extension.</p>
      listedStatus:
        description: >-
          <p>Indicates whether or not the phone number is available to the public.</p>
        oneOf:
        - const: "Y"
          title: Y
        - const: "N"
          title: N
      preference:
        type: integer
        description: >-
          <p>Preference number indicating an order in which phone numbers should be used when contacting person.</p>

  # ////////////////////////////// default sequence ///////////////////////////////
  gCoreName:
    description: >-
      <p> Core Name Type or <code>Name</code> elements, primarily to allow structure to be leveraged with different <code>Type</code> attribute values. </p>
    type: object
    properties:
      title:
        type: string
        description: >-
          <p>A title or prefix associated with the name. If any of: Mr, Mrs, Ms, Miss, Rev, Fr, Dr, Prof, Hon, Sir, Lord, Lady - these must be as shown, otherwise free text. Note that title is not applicable to learners. </p>
      familyName:
        type: string
        description: >-
          <p>Family name. That part of the person`s name which is used to describe family, clan, tribal group, or marital association. Note that this element is required when known. However, it may not be possible to know the family name in which case you should add the available information to the FullName element. </p>
      givenName:
        type: string
        description: >-
          <p>Given name of the person. Note that this element is required if known. However, it may not be possible to know the given name in which case you should add the available information to the FullName element. </p>
      otherGivenNames:
        type: string
        description: >-
          <p>All other given or middle names, each separated with a single space character. </p>
      familyNameFirst:
        description: >-
          <p>An indicator used to identify the naming conventions used by some predominantly non-European, ethnic or language groups and related to the display nature of a name. </p>
        oneOf:
        - const: "Y"
          title: Y
        - const: "N"
          title: N
      preferredName:
        type: string
        description: >-
          <p>The given name preferred most by the person (as written). </p>

  # ///////////////////////////////// list ////////////////////////////
  gCoreContactList:
    description: >-
      <p>List of Contacts associated with an entity.</p>
    type: object
    required:
    - "contact"
    properties:
      contact:
        type: array
        items:
          $ref: '#/definitions/gCoreContactInfo'

  # ////////////////////////////// default sequence ///////////////////////////////
  gCoreContactInfo:
    description: >-
      <p>Common element used to supply information for a contact person at a school, LEA, or other institution.</p>
    type: object
    required:
    - "name"
    properties:
      name:
        type: object
        $ref: '#/definitions/gCoreName'
      positionTitle:
        type: string
        description: >-
          <p>The contact person`s position title.</p>
      role:
        type: string
        description: >-
          <p>Role played by this contact in this instance.</p>
      registrationDetails:
        type: string
        description: >-
          Registration Details of the Contact.
      qualifications:
        type: string
        description: >-
          Qualifications of the Contact.
      address:
        type: object
        description: >-
          <p>Address of the contact.</p>
        $ref: '#/definitions/gCoreAddress'
      emailList:
        type: object
        description: >-
          <p>List of Email elements.</p>
        $ref: '#/definitions/gCoreEmailList'
      phoneNumberList:
        type: object
        description: >-
          <p>List of PhoneNumber elements.</p>
        $ref: '#/definitions/gCorePhoneNumberList'

  # ////////////////////////////// default sequence ///////////////////////////////
  gCoreAddress:
    description: >-
      <p>This element contains address data.</p>
    type: object
    required:
    - "city"
    - "line1"
    - "postalCode"
    properties:
      effectiveFromDate:
        type: string
        format: date
        description: >-
          <p>Date the address became valid.</p>
      effectiveToDate:
        type: string
        format: date
        description: >-
          <p>Date the address ceases to be valid.</p>
      line1:
        type: string
        description: >-
          <p>Address line 1.</p>
      line2:
        type: string
        description: >-
          <p>Address line 2.</p>
      line3:
        type: string
        description: >-
          <p>Address line 3.</p>
      city:
        type: string
        description: >-
          <p>The city or Suburb part of the address.</p>
      stateProvince:
        type: string
        description: >-
          <p>The state or province or county.</p>
        $ref: '#/definitions/gCoreStateProvince'
      country:
        type: string
        description: >-
          <p>The country code.</p>
        $ref: '#/definitions/gCoreCountry'
      postalCode:
        type: string
        description: >-
          <p>The ZIP/postal code.</p>

  # ///////////////////////////////// list ////////////////////////////
  gCoreAddressList:
    description: >-
      <p>A list of Address elements.</p>
    type: object
    required:
    - "address"
    properties:
      address:
        type: array
        items:
          $ref: '#/definitions/gCoreAddress'

  # ////////////////////////////// xs:* no attrs ///////////////////////////////
  gCoreCountry:
    description: >-
      <p>A country code or name.</p>
    type: string

  # ////////////////////////////// xs:* no attrs ///////////////////////////////
  gCoreLocalId:
    description: >-
      <p> This is a common element used to define the locally assigned identifier associated with an entity. </p>
    type: string

  # ////////////////////////////// xs:* no attrs ///////////////////////////////
  gCoreStateProvinceId:
    description: >-
      <p>The identifier for this entity as assigned by the state or province.</p>
    type: string

  # ////////////////////////////// xs:* no attrs ///////////////////////////////
  gCoreStateProvince:
    description: >-
      <p>A state or province code. Note: When dealing with countries other than Australia, state/province codes/values other than those referenced here can be used.</p>
    type: string

  # ///////////////////////////// single Item with Values ////////////////////////////////
  gCoreGender:
    type: string
    oneOf:
    - const: "M"
      title: M
      description: >-
        Male
    - const: "F"
      title: F
      description: >-
        Female
    - const: "X"
      title: X
      description: >-
        Non-binary/Intersex
    - const: "U"
      title: U
      description: >-
        Unknown/Not-defined

  # ///////////////////////////////// list ////////////////////////////
  privacyList:
    description: >-
      <p></p>
    type: object
    properties:
      privacy:
        type: array
        items:
          $ref: '#/definitions/privacy'

  # ////////////////////////////// default sequence ///////////////////////////////
  privacy:
    description: >-
      <p>.</p>
    type: object
    required:
    - "default"
    properties:
      default:
        description: >-
          <p>Is this the default privacy template?</p>
        oneOf:
        - const: "Y"
          title: Y
        - const: "N"
          title: N
      appIDList:
        type: object
        description: >-
          <p>The list of applications in this contract.</p>
        $ref: '#/definitions/appIDList'
      adapterFingerprintList:
        type: object
        description: >-
          <p>A list of fingerprints.</p>
        $ref: '#/definitions/adapterFingerprintList'
      zoneContextList:
        type: object
        description: >-
          <p>A list zones and contexts where this POD applies.</p>
        $ref: '#/definitions/zoneContextList'
      endpointList:
        type: object
        description: >-
          <p>A list of endpoints that are covered by this POD.</p>
        $ref: '#/definitions/endpointList'
      dataModelNamespace:
        type: string
        format: uri
        description: >-
          <p>Namespace associated with the relevant datamodel.</p>
      dataModelVersionMin:
        type: string
        description: >-
          <p>Minimum data model version.</p>
      dataModelVersionMax:
        type: string
        description: >-
          <p>Maximum data model version.</p>
      privacyObligationsDocument:
        type: object
        description: >-
          <p>The legal and technical requirements that are required to be met to satisfy privacy and security concerns.</p>
        $ref: '#/definitions/privacyObligationsDocument'

  # ////////////////////////////// default sequence ///////////////////////////////
  privacyObligationsDocument:
    description: >-
      <p></p>
    type: object
    properties:
      contract:
        type: object
        description: >-
          <p>The details of the contract the POD has been derived from.</p>
        $ref: '#/definitions/contract'
      legalRequirements:
        type: object
        description: >-
          <p>Legal Requirements Container.</p>
        $ref: '#/definitions/legalRequirements'
      technicalRequirements:
        type: object
        description: >-
          <p>Technical Requirements Container.</p>
        $ref: '#/definitions/technicalRequirements'
      dataController:
        type: object
        description: >-
          <p>The data controller, means the natural or legal person, public authority, agency or other body which, alone or jointly with others, determines the purposes and means of the processing of personal data, see GDPR.</p>
        $ref: '#/definitions/dataController'
      dataProcessor:
        type: object
        description: >-
          <p>The data processor, means a natural or legal person, public authority, agency or other body which processes personal data on behalf of the controller, see GDPR.</p>
        $ref: '#/definitions/dataProcessor'
      dataSubProcessorList:
        type: object
        description: >-
          <p>The list of data sub-Processors who are the bodies that process data on behalf of the Data Processor.</p>
        $ref: '#/definitions/dataSubProcessorList'

  # ////////////////////////////// default sequence ///////////////////////////////
  contract:
    description: >-
      The details of the contract the POD has been derived from.
    type: object
    required:
    - "contractName"
    - "contractURI"
    - "dateValidFrom"
    - "lawList"
    properties:
      contractURI:
        type: string
        format: uri
        description: >-
          <p>URI associated with contract. This may be a resolvable URL or just a unique identifier.</p>
      contractName:
        type: string
        description: >-
          <p>Name associated with contract</p>
      dateValidFrom:
        type: string
        format: date
        description: >-
          <p>The initial date that the contract is enforceable.</p>
      dateValidTo:
        type: string
        format: date
        description: >-
          <p>The date the contract expires and is no longer enforcable.</p>
      contractVersion:
        type: string
        description: >-
          <p>The version of the contract being represented by the associated elements.</p>
      lawList:
        type: object
        description: >-
          <p>List of laws covered referenced by the contract.</p>
        $ref: '#/definitions/lawList'
      studentDataIPRights:
        type: string
        description: >-
          <p>Who owns the intellectual property for any student under this contract.</p>

  # ///////////////////////////////// list ////////////////////////////
  lawList:
    description: >-
      <p>A list of parties and data sharing permissions.</p>
    type: object
    properties:
      law:
        type: array
        items:
          $ref: '#/definitions/law'

  # ////////////////////////////// default sequence ///////////////////////////////
  law:
    description: >-
      <p>Information about the specific law.</p>
    type: object
    required:
    - "lawDescription"
    - "lawName"
    properties:
      lawName:
        type: string
        description: >-
          <p>The name of the law support is being included for.</p>
      lawDescription:
        type: string
        description: >-
          <p>A simplified representation of a law, designed to communicate its intent to any member of the public.</p>

  # ////////////////////////////// default sequence ///////////////////////////////
  legalRequirements:
    description: >-
      <p>Contains a list of the legal clauses within the contract.</p>
    type: object
    required:
    - "clauseList"
    properties:
      clauseList:
        type: object
        description: >-
          <p>A list of the legal clauses within the contract.</p>
        $ref: '#/definitions/clauseList'

  # ///////////////////////////////// list ////////////////////////////
  clauseList:
    description: >-
      <p>A list of the legal clauses within the contract.</p>
    type: object
    properties:
      clause:
        type: array
        items:
          $ref: '#/definitions/clause'

  # ////////////////////////////// default sequence ///////////////////////////////
  clause:
    description: >-
      <p>Details of a legal clause within the contract.</p>
    type: object
    properties:
      clauseLabel:
        type: string
        description: >-
          <p>A human friendly handle for refering to the associated clause.</p>
      clauseReference:
        type: string
        description: >-
          <p>An exact reference within the contract to a specific clause.</p>
      clauseContent:
        type: string
        description: >-
          <p>The actual detailed content of the clause.</p>
      obligationList:
        type: object
        description: >-
          <p>List of obligations.</p>
        $ref: '#/definitions/obligationList'

  # ///////////////////////////////// list ////////////////////////////
  benchmarkList:
    description: >-
      <p>A List of benchmarks - where a benchmark is a set of technical or process standards to ensure the clause is met.</p>
    type: object
    properties:
      benchmark:
        type: array
        items:
          $ref: '#/definitions/benchmark'

  # ////////////////////////////// default sequence ///////////////////////////////
  benchmark:
    description: >-
      <p>A set of technical or process standards to ensure the clause is met.</p>
    type: object
    properties:
      benchmarkName:
        type: string
        description: >-
          <p>A name given to the evidence against which privacy obligations or requirements may be assessed or measured.</p>
      benchmarkId:
        type: string
        description: >-
          <p>A unique identifier assigned to an instance of the evidence against which privacy obligations or requirements may be assessed or measured.</p>
        $ref: '#/definitions/gCoreLocalId'
      benchmarkDescription:
        type: string
        description: >-
          <p>A description of the evidence against which privacy obligations or requirements may be assessed or measured.</p>
      benchmarkURL:
        type: string
        format: uri
        description: >-
          <p>A URL pointing to the evidence against which privacy obligations or requirements may be assessed or measured.</p>

  # ///////////////////////////////// list ////////////////////////////
  obligationList:
    description: >-
      <p>A list of requirements imposed by the contract.</p>
    type: object
    properties:
      obligation:
        type: array
        items:
          $ref: '#/definitions/obligation'

  # ////////////////////////////// default sequence ///////////////////////////////
  obligation:
    description: >-
      <p>A requirement imposed by the contract.</p>
    type: object
    properties:
      obligationDescription:
        type: string
        description: >-
          <p>The narrative of an individual requirement imposed by the contract.</p>
      obligationURL:
        type: string
        format: uri
        description: >-
          <p>The URL pointing to the official definition of a requirment imposed by the contract.</p>
      benchmarkList:
        type: object
        description: >-
          <p>A list of benchmarks associated with the obligation.</p>
        $ref: '#/definitions/benchmarkList'

  # ////////////////////////////// default sequence ///////////////////////////////
  technicalRequirements:
    description: >-
      <p>Details of technical requirements that need to be met to achieve the POD.</p>
    type: object
    properties:
      dataAccess:
        type: object
        description: >-
          <p>A list of the data that can be accessed and any rules that specifically apply.</p>
        $ref: '#/definitions/dataAccess'
      conditionList:
        type: object
        $ref: '#/definitions/conditionList'
      dataSubject:
        type: object
        description: >-
          <p>The specific clauses obligations and benchmarks that applies to the subject - teacher, student or parent.</p>
        $ref: '#/definitions/dataSubject'
      dataDeletion:
        type: object
        description: >-
          <p>Details and requirements for data deletion.</p>
        $ref: '#/definitions/dataDeletion'
      securityTechnologyList:
        type: object
        $ref: '#/definitions/securityTechnologyList'

  # ////////////////////////////// default sequence ///////////////////////////////
  dataAccess:
    description: >-
      <p>A list of the data that can be accessed and any rules that specifically apply.</p>
    type: object
    properties:
      clauseList:
        type: object
        description: >-
          <p>A list of clauses that specifically apply to these technical requirements.</p>
        $ref: '#/definitions/clauseList'
      fieldList:
        type: object
        description: >-
          <p>A list of fields that can be accessed under this POD. Equivalent to a green list.</p>
        $ref: '#/definitions/fieldList'

  # ////////////////////////////// default sequence ///////////////////////////////
  dataSubject:
    description: >-
      <p>The specific clauses obligations and benchmarks that applies to the subject - teacher, student or parent.</p>
    type: object
    properties:
      clauseList:
        type: object
        $ref: '#/definitions/clauseList'
      benchmarkList:
        type: object
        $ref: '#/definitions/benchmarkList'
      fieldList:
        type: object
        description: >-
          <p>A list of fields that can be accessed under this POD. Equivalent to a green list.</p>
        $ref: '#/definitions/fieldList'
      respondInDays:
        type: integer
        description: >-
          <p>Maximum response time, number of days, for information regarding this data.</p>
      requirePortability:
        description: >-
          <p>Flag indicating that the rules surrounding this data must be ported with applicable data that is transmitted.</p>
        oneOf:
        - const: "Y"
          title: Y
        - const: "N"
          title: N

  # ////////////////////////////// default sequence ///////////////////////////////
  dataDeletion:
    description: >-
      <p>Details and requirements for data deletion.</p>
    type: object
    properties:
      deleteData:
        description: >-
          <p>Flag indicating that the data must be deleted when no longer requred for the primary purpose.</p>
        oneOf:
        - const: "Y"
          title: Y
        - const: "N"
          title: N
      dataRetention:
        type: integer
        description: >-
          <p>If allowed, the length of time the data be retained when no longer required for the primary purpose.</p>
      deleteBy:
        type: string
        format: date
        description: >-
          <p>The specific date should this data be removed from the systems.</p>
      partyToDeleteData:
        type: object
        description: >-
          <p>Who is responsible for deletion of this data?</p>
        $ref: '#/definitions/partyToDeleteData'
      respondInDays:
        type: integer
        description: >-
          <p>Maximum response time, number of days, for information regarding this data.</p>
      requirePortability:
        description: >-
          <p>Flag indicating that the rules surrounding this data must be ported with applicable data that is transmitted.</p>
        oneOf:
        - const: "Y"
          title: Y
        - const: "N"
          title: N

  # ////////////////////////////// default sequence ///////////////////////////////
  partyToDeleteData:
    description: >-
      <p>Who is responsible for deletion of this data?</p>
    type: object
    properties:
      organisation:
        type: string
        description: >-
          <p>The group responsible for ensuring the data is removed when required.</p>
        $ref: '#/definitions/gCoreLocalId'
      deletecontactInfo:
        type: object
        $ref: '#/definitions/gCoreContactInfo'

  # ///////////////////////////////// list ////////////////////////////
  securityTechnologyList:
    description: >-
      <p></p>
    type: object
    properties:
      securityTechnology:
        type: array
        items:
          $ref: '#/definitions/securityTechnology'

  # ////////////////////////////// default sequence ///////////////////////////////
  securityTechnology:
    description: >-
      <p></p>
    type: object
    properties:
      clauseList:
        type: object
        $ref: '#/definitions/clauseList'
      technologyName:
        type: string
        description: >-
          <p>The name of the technology being utilized.</p>
      technologyDescription:
        type: string
        description: >-
          <p>The narrative as to what the technology`s role is in providing security.</p>
      referenceURL:
        type: string
        format: uri
      versionMin:
        type: string
        description: >-
          <p>The version at which the technology is considered sufficient to supply security for its applicable area.</p>

  # ///////////////////////////////// list ////////////////////////////
  fieldList:
    description: >-
      <p>A list of fields that can be accessed under this POD. Equivalent to a green list.</p>
    type: object
    properties:
      field:
        type: array
        items:
          $ref: '#/definitions/field'

  # ////////////////////////////// default sequence ///////////////////////////////
  field:
    description: >-
      <p>Details of a field that can be accessed under this POD, equivalent to an element in a green list.</p>
    type: object
    properties:
      fieldName:
        type: string
        description: >-
          <p>The full unique path for the data field being granted access to.</p>
      controlrights:
        description: >-
          <p>The level of access being granted to the data.</p>
        oneOf:
        - const: "R"
          title: R
        - const: "RW"
          title: RW

  # ////////////////////////////// default sequence ///////////////////////////////
  dataController:
    description: >-
      <p>The data controller, means the natural or legal person, public authority, agency or other body which, alone or jointly with others, determines the purposes and means of the processing of personal data, see GDPR.</p>
    type: object
    required:
    - "privacyPolicyURL"
    properties:
      dataControllerName:
        type: string
        description: >-
          <p>The name of the natural or legal person, public authority, agency or other body which, alone or jointly with others, determines the purposes and means of the processing of personal data.</p>
      privacyPolicyURL:
        type: string
        format: uri
        description: >-
          <p>URL Associated with contract</p>
      privacyContactList:
        type: object
        description: >-
          <p>The details of the privacy contact.</p>
        $ref: '#/definitions/gCoreContactList'
      issuesNotificationContactList:
        type: object
        description: >-
          <p>The details of the individual to be contacted if there are issues in fulfilling the obligations of the contract.</p>
        $ref: '#/definitions/gCoreContactList'

  # ///////////////////////////////// list ////////////////////////////
  dataSubProcessorList:
    description: >-
      <p>The list of data sub-Processors who are the bodies that process data on behalf of the Data Processor.</p>
    type: object
    properties:
      dataSubProcessor:
        type: array
        items:
          $ref: '#/definitions/dataSubProcessor'

  # ////////////////////////////// default sequence ///////////////////////////////
  dataProcessor:
    description: >-
      <p>The data processor, means a natural or legal person, public authority, agency or other body which processes personal data on behalf of the controller, see GDPR.</p>
    type: object
    required:
    - "privacyPolicyURL"
    properties:
      dataProcessorName:
        type: string
        description: >-
          <p>The label for the vendor who will be accessing, consuming and/or providing information back to the controller.</p>
      privacyPolicyURL:
        type: string
        format: uri
        description: >-
          <p>URL Associated with contract</p>
      privacyContactList:
        type: object
        description: >-
          <p>The details of the privacy contact.</p>
        $ref: '#/definitions/gCoreContactList'
      notifyDataControllerOnAccessRequests:
        description: >-
          <p>Indicates if the processor needs to advise the controller of access requests.</p>
        oneOf:
        - const: "Y"
          title: Y
        - const: "N"
          title: N
      dataProcessorContactForAccessRequestsList:
        type: object
        description: >-
          <p>The details of the person to contact for access requests.</p>
        $ref: '#/definitions/gCoreContactList'
      purposeList:
        type: object
        description: >-
          <p>A list or purposes for which the data may be used.</p>
        $ref: '#/definitions/purposeList'
      alternatePurposeList:
        type: object
        description: >-
          <p>A purpose for which the data may be shared beyond its orginal uses.</p>
        $ref: '#/definitions/alternatePurposeList'
      deidentifiedPurposeList:
        type: object
        description: >-
          <p>The purposes for which deidentified data is able to be used (if any).</p>
        $ref: '#/definitions/deidentifiedPurposeList'
      dataUsageMarketingAllowed:
        description: >-
          <p>Determines whether the data may be used for marketing purposes.</p>
        oneOf:
        - const: "Y"
          title: Y
        - const: "N"
          title: N
      personalInformationUpdatedFromSource:
        type: integer
        description: >-
          <p>The frequency at which personal information is to be updated from source systems, including deletions.</p>
      dataBreachNotification:
        description: >-
          <p>Determines if notification of those in the breach contact list is required.</p>
        oneOf:
        - const: "Y"
          title: Y
        - const: "N"
          title: N
      dataBreachContactList:
        type: object
        description: >-
          <p>Contact details for the individual/s to be notified in the event of a data breach.</p>
        $ref: '#/definitions/gCoreContactList'
      employeesMustComplyWithAgreement:
        description: >-
          <p>Determines whether the data controller and their staff must also comply with the privacy agreement.</p>
        oneOf:
        - const: "Y"
          title: Y
        - const: "N"
          title: N
      employeeConfidentialityAgreement:
        description: >-
          <p>Determines whether the data controller and their staff must also comply with the confidentiality agreement.</p>
        oneOf:
        - const: "Y"
          title: Y
        - const: "N"
          title: N
      employeeTrainingList:
        type: object
        description: >-
          <p>A list of the data controller employee’s training requirements.</p>
        $ref: '#/definitions/employeeTrainingList'
      passwordEmployeeAccessStandard:
        type: object
        description: >-
          <p>A list of the data controller employee’s password access standards.</p>
        $ref: '#/definitions/passwordEmployeeAccessStandard'
      securityTestRequiredList:
        type: object
        description: >-
          <p>A list of security testing required to be completed by the data controller.</p>
        $ref: '#/definitions/securityTestRequiredList'
      countryImpactedList:
        type: object
        description: >-
          <p>List of impacted countries in or through which the data transits or is stored.</p>
        $ref: '#/definitions/countryImpactedList'

  # ////////////////////////////// default sequence ///////////////////////////////
  dataSubProcessor:
    description: >-
      <p>Details of organisations who process data on behalf of the data processor.</p>
    type: object
    required:
    - "privacyPolicyURL"
    properties:
      subProcessorName:
        type: string
        description: >-
          <p>The name of the natural or legal person, public authority, agency or other body which processes personal data on behalf of the controller.</p>
      privacyPolicyURL:
        type: string
        format: uri
        description: >-
          <p>URL Associated with contract</p>
      privacyContactList:
        type: object
        description: >-
          <p>Details of the data sub processor`s privacy contact.</p>
        $ref: '#/definitions/gCoreContactList'
      purposeList:
        type: object
        description: >-
          <p>The purpose for which data is supplied to the data sub processor by the data processor.</p>
        $ref: '#/definitions/purposeList'

  # ///////////////////////////////// list ////////////////////////////
  appIDList:
    description: >-
      <p>List of application identifiers.</p>
    type: object
    properties:
      appID:
        type: array
        items:
          type: string

  # ///////////////////////////////// list ////////////////////////////
  adapterFingerprintList:
    description: >-
      <p></p>
    type: object
    properties:
      adapterFingerprint:
        type: array
        items:
          type: string

  # ///////////////////////////////// list ////////////////////////////
  deidentifiedPurposeList:
    description: >-
      <p>A purposes for which deidentified data may be used.</p>
    type: object
    properties:
      deidentifiedPurpose:
        type: array
        items:
          type: string

  # ///////////////////////////////// list ////////////////////////////
  purposeList:
    description: >-
      <p>A list of the purposes for which data is may be used.</p>
    type: object
    properties:
      purpose:
        type: array
        items:
          type: string

  # ///////////////////////////////// list ////////////////////////////
  alternatePurposeList:
    description: >-
      <p>Purposes for which the data may be shared beyond its orginal uses.</p>
    type: object
    properties:
      alternatePurpose:
        type: array
        items:
          type: string

  # ///////////////////////////////// list ////////////////////////////
  conditionList:
    description: >-
      <p></p>
    type: object
    properties:
      condition:
        type: array
        items:
          $ref: '#/definitions/condition'

  # ////////////////////////////// default sequence ///////////////////////////////
  condition:
    description: >-
      <p></p>
    type: object
    properties:
      typeOfCondition:
        type: string
        description: >-
          <p>The name of the parameter used fo enforce the privacy condition.</p>
      conditionName:
        type: string
        description: >-
          <p>The name of the parameter used to enforce the privacy condition.</p>
      conditionDescription:
        type: string
        description: >-
          <p>The explanation of what the related privacy conditions combine to do in plain terms.</p>
      propertyList:
        type: object
        $ref: '#/definitions/propertyNVList'

  # ///////////////////////////////// list ////////////////////////////
  zoneContextList:
    description: >-
      <p></p>
    type: object
    properties:
      zoneContext:
        type: array
        items:
          $ref: '#/definitions/zoneContext'

  # ////////////////////////////// default sequence ///////////////////////////////
  zoneContext:
    description: >-
      <p>A Zone and/or Context related to a POD.</p>
    type: object
    properties:
      zoneId:
        type: string
        description: >-
          <p>Identifies the collection of appropriate data providers.</p>
        $ref: '#/definitions/gCoreLocalId'
      contextId:
        type: string
        description: >-
          <p>Identifies the data scope within the zone.</p>
        $ref: '#/definitions/gCoreLocalId'

  # ///////////////////////////////// list ////////////////////////////
  endpointList:
    description: >-
      <p></p>
    type: object
    properties:
      endpoint:
        type: array
        items:
          $ref: '#/definitions/endpoint'

  # ////////////////////////////// default sequence ///////////////////////////////
  endpoint:
    description: >-
      <p>A type of endpoint.</p>
    type: object
    properties:
      endpointURL:
        type: string
        format: uri
        description: >-
          <p>The url of the endpoint.</p>
      endpointProviderName:
        type: string
        description: >-
          <p>The name of the provider of the endpoint.</p>

  # ///////////////////////////////// list ////////////////////////////
  employeeTrainingList:
    description: >-
      <p></p>
    type: object
    properties:
      employeeTraining:
        type: array
        items:
          $ref: '#/definitions/employeeTraining'

  # ////////////////////////////// default sequence ///////////////////////////////
  employeeTraining:
    description: >-
      <p></p>
    type: object
    properties:
      trainingName:
        type: string
        description: >-
          <p>The label of the training being given to employees to teach privacy requirements and practices.</p>
      trainingURL:
        type: string
        format: uri
        description: >-
          <p>The URL of the training being given to employees to teach privacy requirements and practices.</p>

  # ////////////////////////////// default sequence ///////////////////////////////
  passwordEmployeeAccessStandard:
    description: >-
      <p></p>
    type: object
    properties:
      standardName:
        type: string
        description: >-
          <p>The label of rule set for the proceessor used to define valid passwords.</p>
      standardURL:
        type: string
        format: uri
        description: >-
          <p>A link to an authoritative source for this standard.</p>

  # ///////////////////////////////// list ////////////////////////////
  countryImpactedList:
    description: >-
      <p>List of impacted countries in or through which the data transits or is stored.</p>
    type: object
    properties:
      countryImpacted:
        type: array
        items:
          $ref: '#/definitions/countryImpacted'

  # ////////////////////////////// default sequence ///////////////////////////////
  countryImpacted:
    description: >-
      <p></p>
    type: object
    properties:
      country:
        type: string
        description: >-
          <p>Name of a country impacted in or through which the data transits or is stored.</p>
        $ref: '#/definitions/gCoreCountry'
      usage:
        type: string
        description: >-
          <p>Country specific details about how the processor handles the data.</p>

  # ///////////////////////////////// list ////////////////////////////
  securityTestRequiredList:
    description: >-
      <p></p>
    type: object
    properties:
      securityTestRequired:
        type: array
        items:
          $ref: '#/definitions/securityTestRequired'

  # ////////////////////////////// default sequence ///////////////////////////////
  securityTestRequired:
    description: >-
      <p>Details of the security test required.</p>
    type: object
    properties:
      testType:
        type: string
        description: >-
          <p>Type of the test.</p>
      testFrequency:
        type: string
        description: >-
          <p>How often does this test need to be performed?</p>
      remediationRequiredIn:
        type: string
        description: >-
          <p>Number of days allowed to remediate any inadequacies discovered during testing.</p>
      shareResults:
        description: >-
          <p>Determines whether the results of a security test may be made publicly known.</p>
        oneOf:
        - const: "Y"
          title: Y
        - const: "N"
          title: N

  # ///////////////////////////////// list ////////////////////////////
  propertyNVList:
    description: >-
      <p></p>
    type: object
    properties:
      property:
        type: array
        items:
          $ref: '#/definitions/propertyNV'

  # ////////////////////////////// default sequence ///////////////////////////////
  propertyNV:
    description: >-
      <p></p>
    type: object
    properties:
      propertyName:
        type: string
        description: >-
          <p>A short label meant to convey quick meaning of the machine readable expression.</p>
      propertyValue:
        type: string
        description: >-
          <p>A machine readable expression designed to specify one aspect of the condition for machine enforcement.</p>

  # ///////////////////////////// single Item with Values ////////////////////////////////
  DefinedProtocols:
    type: string
    oneOf:
    - const: "HTTPS"
      title: HTTPS
    - const: "HTTP"
      title: HTTP

  # ////////////////////////////// another type ///////////////////////////////
  ExtendedContent:
#    allOfD:
    type: object
    description: >-
      Allows for any mixed XML in an element.

  # ////////////////////////////// another type ///////////////////////////////
  SelectedContent:
#    allOfD:
    type: object
    description: >-
      Allows an XML fragment selected from an object to be used in an element with XML validation skipped.

  # ///////////////////////////////// list ////////////////////////////
  provisionedZones:
    type: object
    required:
    - "provisionedZone"
    properties:
      provisionedZone:
        type: array
        items:
          $ref: '#/definitions/provisionedZone'

  # ////////////////////////////// default sequence ///////////////////////////////
  provisionedZone:
    type: object
    required:
    - "id"
    properties:
      id:
        type: string
        description: >-
          <p>The unique id of the Zone, and the key to the Zone element in the Zone Registry.</p>
        xml:
          attribute: true
      services:
        type: object
        $ref: '#/definitions/services'

  # ///////////////////////////////// list ////////////////////////////
  creates:
    type: object
    required:
    - "create"
    properties:
      create:
        type: array
        items:
          $ref: '#/definitions/create'

  # ////////////////////////////// default sequence ///////////////////////////////
  create:
    type: object
    required:
    - "advisoryId"
    properties:
      id:
        type: string
        xml:
          attribute: true
      advisoryId:
        type: string
        xml:
          attribute: true
      statusCode:
        type: string
        pattern: '^[24-5][0-9]{2}$'
        xml:
          attribute: true
      error:
        type: object
        $ref: '#/definitions/errorCommon'

  # ////////////////////////////// default sequence ///////////////////////////////
  errorCommon:
    type: object
    required:
    - "code"
    - "message"
    - "scope"
    properties:
      id:
        type: string
        xml:
          attribute: true
      code:
        type: integer
        description: >-
          <p>Corresponds to the value contained in the HTTPS Header Status-Code" field in which the Error Object is the payload.</p>
      scope:
        type: string
        description: >-
          <p>Attempted operation. Ex: "Modify Student"</p>
      type:
        type: string
        description: >-
          <p>Indicator if the error relates to infrastructure or data.</p>
        $ref: '#/definitions/errorType'
      subCode:
        type: string
        description: >-
          <p>Machine readable second code used to eliminate ambiguity.</p>
      message:
        type: string
        description: >-
          <p>A simple, easy to understand, compact description of the error. The primary consumer of this message is the application user. Example: "Unable to open database."</p>
      description:
        type: string
        description: >-
          <p>An optional error description that is more complete and technical in nature. It is to be used as a diagnostic message in trouble-shooting procedures. Example: "The 'Students' table is opened in exclusive mode by user 'ADM1' (dbm.cpp, line 300)."</p>
      errorDetails:
        type: object
        $ref: '#/definitions/errorDetails'

  # ////////////////////////////// default sequence ///////////////////////////////
  errorDetail:
    type: object
    required:
    - "message"
    properties:
      id:
        type: string
        xml:
          attribute: true
      type:
        type: string
        description: >-
          <p>Indicator if the error relates to infrastructure or data.</p>
        $ref: '#/definitions/errorType'
      subCode:
        type: string
        description: >-
          <p>Machine readable second code used to eliminate ambiguity.</p>
      message:
        type: string
        description: >-
          <p>A simple, easy to understand, compact description of the error. The primary consumer of this message is the application user. Example: "Unable to open database."</p>
      description:
        type: string
        description: >-
          <p>An optional error description that is more complete and technical in nature. It is to be used as a diagnostic message in trouble-shooting procedures. Example: "The 'Students' table is opened in exclusive mode by user 'ADM1' (dbm.cpp, line 300)."</p>

  # ///////////////////////////// single Item with Values ////////////////////////////////
  errorType:
    type: string
    oneOf:
    - const: "INFRASTRUCTURE"
      title: INFRASTRUCTURE
    - const: "DATA"
      title: DATA

  # ///////////////////////////////// list ////////////////////////////
  errorDetails:
    type: object
    properties:
      errorDetail:
        type: array
        items:
          $ref: '#/definitions/errorDetail'

  # ///////////////////////////////// list ////////////////////////////
  stateList:
    type: object
    required:
    - "state"
    properties:
      state:
        type: array
        items:
          $ref: '#/definitions/stateCommon'

  # ////////////////////////////// default sequence ///////////////////////////////
  stateCommon:
    type: object
    required:
    - "type"
    properties:
      id:
        type: string
        $ref: '#/definitions/uuid'
        xml:
          attribute: true
      type:
        type: string
        description: >-
          <p>The type of this State object.</p>
        $ref: '#/definitions/phaseState'
      created:
        type: string
        description: >-
          <p>The datetime this job was created.</p>
      lastModified:
        type: string
        description: >-
          <p>The datetime this job was last modified.</p>
      description:
        type: string
        description: >-
          <p>A descriptive message ellaborating the condition of this state, e.g. if the state is "FAILED" the stateDescription may be "Timeout occured".</p>

  # ///////////////////////////////// list ////////////////////////////
  deleteIdCollection:
    type: object
    required:
    - "delete"
    properties:
      delete:
        type: array
        items:
          $ref: '#/definitions/deleteId'

  # ////////////////////////////// default sequence ///////////////////////////////
  defaultZone:
    description: >-
      <p>Zone identifiers are chosen by the administrator and can follow any convention that best meets the needs of the deploying organization. The Zone in which the Service is to be found always qualifies every Consumer request for any Provider Service. Each Service Consumer is assigned a "default" Zone at Registration time, which is used whenever a specific Zone is not explicitly included in one of its Provider Service Requests.</p>
    type: object
    properties:
      id:
        type: string
        xml:
          attribute: true
      description:
        type: string
        description: >-
          <p>A short (possibly multi-sentence) description of the Zone</p>
      properties:
        type: object
        $ref: '#/definitions/properties'

  # ///////////////////////////// single Item with Values ////////////////////////////////
  environmentType:
    type: string
    oneOf:
    - const: "DIRECT"
      title: DIRECT
    - const: "BROKERED"
      title: BROKERED

  # ///////////////////////////// single Item with Values ////////////////////////////////
  jobState:
    type: string
    oneOf:
    - const: "NOTSTARTED"
      title: NOTSTARTED
    - const: "INPROGRESS"
      title: INPROGRESS
    - const: "COMPLETED"
      title: COMPLETED
    - const: "FAILED"
      title: FAILED

  # ///////////////////////////////// list ////////////////////////////
  phaseCollection:
    type: object
    required:
    - "phase"
    properties:
      phase:
        type: array
        items:
          $ref: '#/definitions/phase'

  # ////////////////////////////// default sequence ///////////////////////////////
  phase:
    type: object
    required:
    - "name"
    - "required"
    - "rights"
    - "states"
    - "statesRights"
    properties:
      name:
        type: string
        description: >-
          <p>The name of the Phase unique within the context of the owning job.</p>
      states:
        type: object
        description: >-
          <p>A collection of the states the Phase has been through, must initially contain a NOTAPPLICABLE or NOTSTARTED state.</p>
        $ref: '#/definitions/stateList'
      required:
        type: boolean
        description: >-
          <p>Whether or not this phase is required for the job to complete successfully.</p>
      rights:
        type: object
        description: >-
          <p>Access rights given to the consumer for this phase.</p>
        $ref: '#/definitions/rights'
      statesRights:
        type: object
        description: >-
          <p>Access rights given to the consumer for each state.</p>
        $ref: '#/definitions/rights'

  # ////////////////////////////// default sequence ///////////////////////////////
  initialization:
    type: object
    required:
    - "payload"
    properties:
      phaseName:
        type: string
        description: >-
          <p>Name of initialization phase the payload corresponds to.</p>
      payload:
        type: object
        description: >-
          <p>Information matching the initialization phase, should result in corresponding phase having an INPROGRESS, COMPLETED, or FAILED state.</p>

  # ///////////////////////////// single Item with Values ////////////////////////////////
  phaseState:
    type: string
    oneOf:
    - const: "NOTAPPLICABLE"
      title: NOTAPPLICABLE
    - const: "NOTSTARTED"
      title: NOTSTARTED
    - const: "PENDING"
      title: PENDING
    - const: "SKIPPED"
      title: SKIPPED
    - const: "INPROGRESS"
      title: INPROGRESS
    - const: "COMPLETED"
      title: COMPLETED
    - const: "FAILED"
      title: FAILED

  # ///////////////////////////////// list ////////////////////////////
  enumerations:
    type: object
    required:
    - "enumeration"
    properties:
      enumeration:
        type: array
        items:
          $ref: '#/definitions/enumeration'

  # ////////////////////////////// default sequence ///////////////////////////////
  enumeration:
    type: object
    required:
    - "value"
    properties:
      value:
        type: string
        description: >-
          <p>An acceptable parameter value for this query.</p>
      code:
        type: string
        description: >-
          <p>If enumerated value has an equivalent code, this field may be used for conversion.</p>

  # ///////////////////////////////// list ////////////////////////////
  parameters:
    type: object
    properties:
      parameter:
        type: array
        items:
          $ref: '#/definitions/parameter'

  # ////////////////////////////// default sequence ///////////////////////////////
  parameter:
    type: object
    required:
    - "name"
    properties:
      name:
        type: string
        description: >-
          <p>The name of the query parameter to be passed in. Note: Must not conflict with any other query parameter name.</p>
      type:
        type: string
        description: >-
          <p>A well understood type that MAY be used for parameter validation. Example: xs:unsignedInt.</p>
      default:
        type: string
        description: >-
          <p>Value to be supplied for this parameter if the submitter omits it.</p>
      description:
        type: string
        description: >-
          <p>An explanation of what this parameter represents.</p>
        minLength: 0
        maxLength: 1024
      required:
        type: boolean
        description: >-
          <p>Indicator as to if this parameter is required. If omitted, the parameter is assumed to be required!.</p>
      enumerations:
        type: object
        $ref: '#/definitions/enumerations'
      range:
        type: object
        $ref: '#/definitions/range'
      minLength:
        type: integer
        description: >-
          <p>The minimum length for values of this parameter. If omitted, zero. May be functionally different because of other restrictions.</p>
      maxLength:
        type: integer
        description: >-
          <p>The maximum length for values of this parameter. If omitted, unbounded. May be functionally different because of other restrictions.</p>

  # ///////////////////////////////// list ////////////////////////////
  properties:
    type: object
    required:
    - "property"
    properties:
      property:
        type: array
        items:
          $ref: '#/definitions/property'

  # ////////////////////////////// default sequence ///////////////////////////////
  range:
    type: object
    required:
    - "end"
    - "start"
    properties:
      start:
        type: integer
        description: >-
          <p>If a numeric range is used, this holds the inclusive starting value.</p>
      end:
        type: integer
        description: >-
          <p>If a numeric range is used, this holds the inclusive ending value.</p>

  # //////////////////////// xs:* with attrs /////////////////////////////////////
  property:
    type: object
    required:
    - "name"
    properties:
      value:
        type: string
      name:
        type: string
        description: >-
          <p>Name/Value pair.</p>
        xml:
          attribute: true

  # ////////////////////////////// default sequence ///////////////////////////////
  applicationInfo:
    type: object
    properties:
      applicationKey:
        type: string
        description: >-
          <p>An opaque (to the SIF standard) element which contains any required Consumer authentication information. The content of this element is site-specific. For a Direct Environment which accepts Consumer Registration Requests from a mobile application, this element might contain a combination of the User ID and Password.</p>
      supportedInfrastructureVersion:
        type: string
        description: >-
          <p>The version of the SIF infrastructure which the Consumer supports.</p>
      dataModelNamespace:
        type: string
        format: uri
        description: >-
          <p>The namespace of the data payloads conveyed by this environment. Returns may be of a diffrent minor version. Utility payloads will be of the infrastructure namespace.</p>
      transport:
        type: string
        description: >-
          <p>The transport which the Consumer expects the infrastructure to use to interoperate with it. The default is whichever transport the create request was issued on</p>
      applicationProduct:
        type: object
        $ref: '#/definitions/productIdentity'
      adapterProduct:
        type: object
        $ref: '#/definitions/productIdentity'

  # ////////////////////////////// default sequence ///////////////////////////////
  productIdentity:
    type: object
    required:
    - "productName"
    properties:
      vendorName:
        type: string
        description: >-
          <p>The name of the company supplying this Product.</p>
      productName:
        type: string
        description: >-
          <p>The name of the Product</p>
      productVersion:
        type: string
        description: >-
          <p>The format of this field is undefined, but it should match the format used in the agent's conformance statement, if the agent is SIF Certified.</p>
      iconURI:
        type: string
        format: uri
        description: >-
          <p>HTTP URL referencing an icon for graphical representation of the application/agent. Should range from 16x16 pixels to 128x128 pixels and be of an image MIME type commonly supported by Web browsers (e.g. PNG, JPEG, GIF).</p>

  # ///////////////////////////////// list ////////////////////////////
  services:
    type: object
    required:
    - "service"
    properties:
      service:
        type: array
        items:
          $ref: '#/definitions/service'

  # ////////////////////////////// default sequence ///////////////////////////////
  service:
    type: object
    required:
    - "name"
    - "rights"
    - "type"
    properties:
      type:
        type: string
        $ref: '#/definitions/serviceType'
        xml:
          attribute: true
      subType:
        type: string
        $ref: '#/definitions/serviceSubType'
        xml:
          attribute: true
      name:
        type: string
        description: >-
          <p>The name of the Service. For utilities, this is fixed to one of the defined set of Utility Service Names. For objects and functions, it is defined by the Data Model.</p>
        xml:
          attribute: true
      contextId:
        type: string
        description: >-
          <p>The unique identity of a context element, which is associated with a Provider of this name and type operating in a Zone with this ID. All Services with the same name in the same Zone must have different Context IDs. Only one such Service can have no Context.</p>
        xml:
          attribute: true
      rights:
        type: object
        $ref: '#/definitions/rights'

  # ///////////////////////////////// list ////////////////////////////
  rights:
    type: object
    required:
    - "right"
    properties:
      right:
        type: array
        items:
          $ref: '#/definitions/right'

  # ///////////////////////////// single Item with Values ////////////////////////////////
  rightValue:
    type: string
    oneOf:
    - const: "APPROVED"
      title: APPROVED
    - const: "SUPPORTED"
      title: SUPPORTED
    - const: "REJECTED"
      title: REJECTED
    - const: "UNSUPPORTED"
      title: UNSUPPORTED
    - const: "REQUESTED"
      title: REQUESTED

  # ///////////////////////////// single Item with Values ////////////////////////////////
  rightType:
    type: string
    oneOf:
    - const: "QUERY"
      title: QUERY
    - const: "CREATE"
      title: CREATE
    - const: "UPDATE"
      title: UPDATE
    - const: "DELETE"
      title: DELETE
    - const: "SUBSCRIBE"
      title: SUBSCRIBE
    - const: "PROVIDE"
      title: PROVIDE

  # //////////////////////// IdRef with attrs /////////////////////////////////////
  right:
    type: object
    properties:
      value:
        type: string
        $ref: '#/definitions/rightValue'
      type:
        type: string
        description: >-
          <p>The type of the requested Access Right</p>
        $ref: '#/definitions/rightType'
        xml:
          attribute: true

  # ///////////////////////////// single Item with Values ////////////////////////////////
  serviceType:
    type: string
    oneOf:
    - const: "UTILITY"
      title: UTILITY
    - const: "OBJECT"
      title: OBJECT
    - const: "FUNCTIONAL"
      title: FUNCTIONAL
    - const: "SERVICEPATH"
      title: SERVICEPATH
    - const: "XQUERYTEMPLATE"
      title: XQUERYTEMPLATE
    - const: "SERVICE"
      title: SERVICE

  # ///////////////////////////// single Item with Values ////////////////////////////////
  serviceSubType:
    type: string
    oneOf:
    - const: "adminDirective"
      title: adminDirective

  # ///////////////////////////////// list ////////////////////////////
  infrastructureServices:
    type: object
    required:
    - "infrastructureService"
    properties:
      infrastructureService:
        type: array
        items:
          $ref: '#/definitions/infrastructureService'

  # //////////////////////// xs:* with attrs /////////////////////////////////////
  infrastructureService:
    type: object
    properties:
      value:
        type: string
      name:
        type: string
        $ref: '#/definitions/infrastructureServiceNames'
        xml:
          attribute: true

  # ///////////////////////////// single Item with Values ////////////////////////////////
  infrastructureServiceNames:
    type: string
    oneOf:
    - const: "environment"
      title: environment
    - const: "provisionRequests"
      title: provisionRequests
    - const: "requestsConnector"
      title: requestsConnector
    - const: "eventsConnector"
      title: eventsConnector
    - const: "queues"
      title: queues
    - const: "subscriptions"
      title: subscriptions
    - const: "servicesConnector"
      title: servicesConnector

  # ////////////////////////////// xs:* no attrs ///////////////////////////////
  uuid:
    type: string
    pattern: '^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[14][a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'

  # ////////////////////////////// xs:* no attrs ///////////////////////////////
  version:
    type: string
    pattern: '^[0-9]{1,3}[.][0-9]{1,3}([.][0-9]{1,3})?$'

  # ////////////////////////////// xs:* no attrs ///////////////////////////////
  uri:
    type: string
    format: uri

  # ///////////////////////////////// list ////////////////////////////
  aliases:
    type: object
    required:
    - "alias"
    properties:
      alias:
        type: array
        items:
          $ref: '#/definitions/alias'

  # ////////////////////////////// default sequence ///////////////////////////////
  querySupport:
    type: object
    properties:
      dynamicQuery:
        type: boolean
        description: >-
          <p>True if this service is capable of honoring the "where" parameter.</p>
      queryByExample:
        type: boolean
        description: >-
          <p>True if this service is capable of honoring query by example payloads.</p>
      changesSinceMarker:
        type: boolean
        description: >-
          <p>True if this service is capable of supporting Changes Since Queries.</p>
      paged:
        type: boolean
        description: >-
          <p>True if this service is capable of responding to Paged Query Requests (both Interactive and Batch).</p>
      maxPageSize:
        type: integer
        description: >-
          <p>If Paged Queries are supported, this is the maximum number of Objects that will be returned on a Page of Query results.</p>
      totalCount:
        type: boolean
      applicationProduct:
        type: object
        description: >-
          <p>Application Vendor Identification</p>
        $ref: '#/definitions/productIdentity'
      adapterProduct:
        type: object
        description: >-
          <p>Adapter Vendor Identification</p>
        $ref: '#/definitions/productIdentity'

  # ////////////////////////////// default sequence ///////////////////////////////
  alias:
    type: object
    required:
    - "code"
    properties:
      code:
        type: object
        $ref: '#/definitions/code'
      source:
        type: string
        description: >-
          <p>URL where the related abbreviation comes from.</p>
        $ref: '#/definitions/uri'
      namespace:
        type: string
        description: >-
          <p>Namespace where the related abbreviation comes from.</p>
        $ref: '#/definitions/uri'

  # ////////////////////////////// default sequence ///////////////////////////////
  codeItem:
    type: object
    required:
    - "action"
    - "code"
    - "timestamp"
    - "value"
    properties:
      code:
        type: string
        description: >-
          <p>Official abbreviation for the given value.</p>
      source:
        type: string
        description: >-
          <p>URL where the related abbreviation comes from.</p>
        $ref: '#/definitions/uri'
      namespace:
        type: string
        description: >-
          <p>Namespace where the related abbreviation comes from.</p>
        $ref: '#/definitions/uri'
      value:
        type: string
        description: >-
          <p>What the code represents.</p>
        minLength: 0
        maxLength: 128
      description:
        type: string
        description: >-
          <p>Human readable explanation of what the code represents.</p>
        minLength: 0
        maxLength: 1024
      definition:
        type: string
        description: >-
          <p>Human readable explanation provided by the source!</p>
        minLength: 0
        maxLength: 4096
      aliases:
        type: object
        $ref: '#/definitions/aliases'
      action:
        description: >-
          <p>The last action to be taken for this code item.</p>
        oneOf:
        - const: "ADD"
          title: ADD
        - const: "CHANGE"
          title: CHANGE
        - const: "DEPRECATED"
          title: DEPRECATED
        - const: "DELETE"
          title: DELETE
      timestamp:
        type: string
        description: >-
          <p>The date and time of the last action taken on this code item. So that only updates can be queried efficiently (where applicable).</p>

  # ////////////////////////////// default sequence ///////////////////////////////
  code:
    type: object
    required:
    - "official"
    - "old"
    - "value"
    properties:
      old:
        type: boolean
        description: >-
          <p>Indicates the alias code has been deprecated or deleted, even if it no longer appears in the register.</p>
      official:
        type: boolean
        description: >-
          <p>Indicates the alias code is an official one; however the locale uses this one to represent that concept, at least in part.</p>
      value:
        type: string
        description: >-
          <p>Alternate abbreviation that might need to be more specific or correct.</p>

  # ///////////////////////////////// list ////////////////////////////
  codeItems:
    type: object
    required:
    - "codeItem"
    properties:
      codeItem:
        type: array
        items:
          $ref: '#/definitions/codeItem'

  # ///////////////////////////////// list ////////////////////////////
  deleteStatusCollection:
    type: object
    required:
    - "delete"
    properties:
      delete:
        type: array
        items:
          $ref: '#/definitions/deleteStatus'

  # ////////////////////////////// default sequence ///////////////////////////////
  deleteStatus:
    type: object
    properties:
      id:
        type: string
        xml:
          attribute: true
      statusCode:
        type: string
        pattern: '^[24-5][0-9]{2}$'
        xml:
          attribute: true
      error:
        type: object
        $ref: '#/definitions/errorCommon'

  # ////////////////////////// EMPTY with attrs ///////////////////////////////////
  deleteId:
    type: object
    properties:
      id:
        type: string
        xml:
          attribute: true

  # ///////////////////////////////// list ////////////////////////////
  mediaTypes:
    type: object
    required:
    - "mediaType"
    properties:
      mediaType:
        type: array
        items:
          type: string

  # ////////////////////////////// default sequence ///////////////////////////////
  protocol:
    type: object
    required:
    - "location"
    properties:
      location:
        type: string
        format: uri
        description: >-
          <p>The URL to use when sending Requests to a Provider</p>
      properties:
        type: object
        description: >-
          <p>May contain zero or more property elements containing name/value pairs describing any protocol settings required to ensure proper communication</p>
        $ref: '#/definitions/properties'

  # ///////////////////////////////// list ////////////////////////////
  updates:
    type: object
    required:
    - "update"
    properties:
      update:
        type: array
        items:
          $ref: '#/definitions/update'

  # ////////////////////////////// default sequence ///////////////////////////////
  update:
    type: object
    properties:
      id:
        type: string
        xml:
          attribute: true
      statusCode:
        type: string
        pattern: '^[24-5][0-9]{2}$'
        xml:
          attribute: true
      error:
        type: object
        $ref: '#/definitions/errorCommon'

  # ///////////////////////////////// list ////////////////////////////
  methodParameters:
    type: object
    required:
    - "methodParameter"
    properties:
      methodParameter:
        type: array
        items:
          $ref: '#/definitions/methodParameter'

  # ////////////////////////////// default sequence ///////////////////////////////
  methodParameter:
    type: object
    required:
    - "paramName"
    - "paramValue"
    properties:
      paramName:
        type: string
        description: >-
          <p>The name of the parameter being passed in.</p>
      paramValue:
        type: string
        description: >-
          <p>The value of the parameter being passed in.</p>
      comparisonType:
        type: string
        description: >-
          <p>The operation used to make the comparison. If not provided EQUAL is assumed.</p>

  # ///////////////////////////////// list ////////////////////////////
  supportedRequests:
    type: object
    required:
    - "supportedRequestType"
    properties:
      supportedRequestType:
        type: array
        items:
          $ref: '#/definitions/supportedRequest'

  # ////////////////////////////// default sequence ///////////////////////////////
  supportedRequest:
    type: object
    required:
    - "operations"
    properties:
      requestType:
        type: string
        description: >-
          <p>Relay an delayed request or turn it into an immediate call.</p>
        $ref: '#/definitions/requestTypeValue'
      operations:
        type: object
        description: >-
          <p>The list of operations a request can target, such as CREATE.</p>
        $ref: '#/definitions/operations'

  # ///////////////////////////// single Item with Values ////////////////////////////////
  requestTypeValue:
    type: string
    oneOf:
    - const: "IMMEDIATE"
      title: IMMEDIATE
    - const: "DELAYED"
      title: DELAYED

  # ///////////////////////////////// list ////////////////////////////
  operations:
    type: object
    required:
    - "operation"
    properties:
      operation:
        type: array
        items:
          $ref: '#/definitions/operation'

  # ///////////////////////////// single Item with Values ////////////////////////////////
  operation:
    type: string
    oneOf:
    - const: "QUERY"
      title: QUERY
    - const: "CREATE"
      title: CREATE
    - const: "UPDATE"
      title: UPDATE
    - const: "DELETE"
      title: DELETE

  # ///////////////////////////// single Item with Values ////////////////////////////////
  messageType:
    type: string
    oneOf:
    - const: "EVENT"
      title: EVENT
    - const: "REQUEST"
      title: REQUEST
