{
  "name": "PAAccount",
  "id": "http://parallels.com/aps/types/pa/account/1.2",
  "apsVersion": "2.0",
  "implements": [
    "http://aps-standard.org/types/core/account/1.0"
  ],
  "relations": {
    "subscriptions": {
      "type": "http://parallels.com/aps/types/pa/subscription/1.0",
      "collection": true
    },
    "domains": {
      "type": "http://parallels.com/aps/types/pa/dns/zone/1.0",
      "collection": true
    },
    "templates": {
      "type": "http://parallels.com/aps/types/pa/serviceTemplate/1.0",
      "collection": true
    },
    "brands": {
      "type": "http://parallels.com/aps/types/pa/brand/1.0",
      "collection": true
    },
    "publicActor": {
      "type": "http://parallels.com/aps/types/pa/account/public/actor/1.0",
      "assign": {
        "access": {
          "referrer": false
        }
      }
    },
    "parent": {
      "type": "http://parallels.com/aps/types/pa/account/1.2"
    },
    "accounts": {
      "type": "http://parallels.com/aps/types/pa/account/1.2",
      "collection": true,
      "assign": {
        "access": {
          "referrer": false
        }
      }
    },
    "adminContactUser": {
      "type": "http://aps-standard.org/types/core/user/1.0",
      "backrel": false
    },
    "billingContactUser": {
      "type": "http://aps-standard.org/types/core/user/1.0",
      "backrel": false
    },
    "techContactUser": {
      "type": "http://aps-standard.org/types/core/user/1.0",
      "backrel": false
    },
    "bssAccountInfo": {
      "type": "http://parallels.com/pa/bss-account-info/1.0"
    }
  },
  "properties": {
    "id": {
      "type": "integer",
      "required": true,
      "final": true
    },
    "type": {
      "type": "string",
      "required": true,
      "default": "CLIENT",
      "enum": [
        "ADMIN",
        "RESELLER",
        "CLIENT",
        "SYSTEM"
      ],
      "enumTitles": [
        "Provider",
        "Reseller",
        "Customer",
        "System"
      ]
    },
    "personal": {
      "type": "boolean",
      "required": true,
      "default": "true"
    },
    "locked": {
      "type": "boolean",
      "default": "false"
    },
    "adminContact": {
      "type": "Contact"
    },
    "billingContact": {
      "type": "Contact"
    },
    "techContact": {
      "type": "Contact"
    },
    "updatedBy": {
      "type": "string"
    },
    "externalId": {
      "type": "string",
      "access": {
        "global": false
      }
    }
  },
  "operations": {
    "resources": {
      "path": "/resources",
      "verb": "GET",
      "response": {
        "type": "array",
        "items": {
          "type": "SubscriptionResourceList"
        }
      },
      "errorResponse": {
        "type": "object"
      },
      "access": {
        "referrer": false
      }
    },
    "roles": {
      "path": "/roles",
      "verb": "GET",
      "response": {
        "type": "array",
        "items": {
          "type": "Role"
        }
      },
      "errorResponse": {
        "type": "object"
      },
      "access": {
        "referrer": false
      }
    },
    "getLoginURL": {
      "path": "/loginUrl",
      "verb": "GET",
      "response": {
        "type": "string"
      },
      "errorResponse": {
        "type": "object"
      },
      "access": {
        "referrer": false
      }
    },
    "getDefaultBrand": {
      "path": "/defaultBrand",
      "verb": "GET",
      "response": {
        "type": "Brand"
      },
      "errorResponse": {
        "type": "object"
      },
      "access": {
        "referrer": false
      }
    },
    "getAccountHierarchy": {
      "path": "/hierarchy",
      "verb": "GET",
      "response": {
        "type": "array",
        "items": {
          "type": "PAAccount"
        }
      },
      "errorResponse": {
        "type": "object"
      },
      "access": {
        "referrer": true,
        "public": true
      }
    }
  },
  "structures": {
    "Contact": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string",
          "format": "email"
        },
        "givenName": {
          "type": "string"
        },
        "familyName": {
          "type": "string"
        },
        "middleName": {
          "type": "string"
        },
        "organizationName": {
          "type": "string"
        },
        "telVoice": {
          "type": "string"
        },
        "telFax": {
          "type": "string"
        },
        "locale": {
          "type": "string"
        }
      }
    },
    "SubscriptionResourceList": {
      "type": "object",
      "properties": {
        "subscriptionId": {
          "type": "string",
          "required": true
        },
        "resources": {
          "type": "array",
          "items": {
            "type": "http://aps-standard.org/types/core/subscription/1.0#SubscriptionResource"
          }
        }
      }
    },
    "Role": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "Brand": {
      "type": "object",
      "properties": {
        "uid": {
          "type": "string"
        },
        "id": {
          "type": "integer"
        }
      }
    }
  }
}