{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/avetta/json-schema/avetta-3-29-14-company-relationship-resource-schema.json",
  "title": "3.29.14_CompanyRelationshipResource",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/avetta-pegasusscope-scope-company-relationship-controller-api-openapi.yml#/components/schemas/3.29.14_CompanyRelationshipResource",
  "required": [
    "company",
    "scope",
    "subContractor"
  ],
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "format": "int32"
    },
    "scope": {
      "$ref": "#/$defs/3.29.14_KeyedIntegerResource"
    },
    "company": {
      "$ref": "#/$defs/3.29.14_CompanyResource"
    },
    "subContractor": {
      "$ref": "#/$defs/3.29.14_CompanyResource"
    },
    "createdBy": {
      "$ref": "#/$defs/3.29.14_UserResource"
    },
    "createdDate": {
      "type": "string"
    },
    "invitations": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/3.29.14_PortalCompanyInvitationResource"
      }
    }
  },
  "$defs": {
    "3.29.14_AddressResource": {
      "required": [
        "country"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32"
        },
        "address": {
          "maxLength": 200,
          "minLength": 0,
          "type": "string"
        },
        "town": {
          "maxLength": 50,
          "minLength": 0,
          "type": "string"
        },
        "state": {
          "maxLength": 50,
          "minLength": 0,
          "type": "string"
        },
        "postcode": {
          "maxLength": 15,
          "minLength": 0,
          "type": "string"
        },
        "country": {
          "maxLength": 2,
          "minLength": 0,
          "type": "string"
        }
      }
    },
    "3.29.14_CompanyResource": {
      "required": [
        "name"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32"
        },
        "name": {
          "maxLength": 185,
          "minLength": 0,
          "type": "string"
        },
        "nameWithQualifier": {
          "type": "string"
        },
        "qualifier": {
          "type": "string"
        },
        "address": {
          "$ref": "#/$defs/3.29.14_AddressResource"
        },
        "deliveryAddress": {
          "$ref": "#/$defs/3.29.14_DeliveryAddressResource"
        },
        "phone": {
          "maxLength": 20,
          "minLength": 0,
          "type": "string"
        },
        "mobilePhone": {
          "maxLength": 20,
          "minLength": 0,
          "type": "string"
        },
        "fax": {
          "maxLength": 20,
          "minLength": 0,
          "type": "string"
        },
        "contactFirstName": {
          "maxLength": 30,
          "minLength": 0,
          "type": "string"
        },
        "contactLastName": {
          "maxLength": 30,
          "minLength": 0,
          "type": "string"
        },
        "contactEmail": {
          "maxLength": 80,
          "minLength": 0,
          "type": "string"
        },
        "countryId": {
          "maxLength": 2,
          "minLength": 0,
          "type": "string"
        },
        "regionName": {
          "maxLength": 40,
          "minLength": 0,
          "type": "string"
        },
        "businessNo": {
          "maxLength": 20,
          "minLength": 0,
          "type": "string"
        },
        "webAddress": {
          "maxLength": 64,
          "minLength": 0,
          "type": "string"
        },
        "locale": {
          "type": "string"
        },
        "globalContractorEdit": {
          "type": "string",
          "enum": [
            "allow",
            "deny"
          ]
        },
        "allowEmployeesWithoutContractorRole": {
          "type": "boolean"
        },
        "extSysKey": {
          "type": "string"
        },
        "idKey": {
          "type": "string"
        },
        "clientKey": {
          "$ref": "#/$defs/3.29.14_NaturalKeyResource"
        },
        "connectStatus": {
          "type": "string",
          "enum": [
            "ACTIVE",
            "INACTIVE",
            "REJECTED",
            "PENDING"
          ]
        },
        "companyTypeNames": {
          "type": "string"
        }
      }
    },
    "3.29.14_DeliveryAddressResource": {
      "required": [
        "country"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32"
        },
        "address": {
          "maxLength": 200,
          "minLength": 0,
          "type": "string"
        },
        "town": {
          "maxLength": 50,
          "minLength": 0,
          "type": "string"
        },
        "state": {
          "maxLength": 50,
          "minLength": 0,
          "type": "string"
        },
        "postcode": {
          "maxLength": 15,
          "minLength": 0,
          "type": "string"
        },
        "country": {
          "maxLength": 2,
          "minLength": 0,
          "type": "string"
        }
      }
    },
    "3.29.14_KeyedIntegerResource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "3.29.14_NaturalKeyResource": {
      "type": "object",
      "properties": {
        "extSysKey": {
          "type": "string"
        },
        "idKey": {
          "type": "string"
        }
      }
    },
    "3.29.14_PortalCompanyInvitationCommunicationLogResource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32"
        },
        "companyContact": {
          "$ref": "#/$defs/3.29.14_UserResource"
        },
        "createdBy": {
          "$ref": "#/$defs/3.29.14_UserResource"
        },
        "createdDate": {
          "type": "string"
        }
      }
    },
    "3.29.14_PortalCompanyInvitationResource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32"
        },
        "company": {
          "$ref": "#/$defs/3.29.14_KeyedIntegerResource"
        },
        "invitationType": {
          "type": "string",
          "enum": [
            "NEW_COMPANY",
            "EXISTING_COMPANY"
          ]
        },
        "communicationLogs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/3.29.14_PortalCompanyInvitationCommunicationLogResource"
          }
        },
        "companyRelationshipId": {
          "type": "integer",
          "format": "int32"
        },
        "createdBy": {
          "$ref": "#/$defs/3.29.14_UserResource"
        },
        "createdDate": {
          "type": "string"
        },
        "accepted": {
          "type": "boolean"
        },
        "acceptedDate": {
          "type": "string"
        }
      }
    },
    "3.29.14_ScopeResource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32"
        },
        "name": {
          "type": "string"
        },
        "timezone": {
          "type": "string"
        },
        "fatigueLimit": {
          "type": "integer",
          "format": "int32"
        },
        "siteId": {
          "type": "integer",
          "format": "int32"
        },
        "realmId": {
          "type": "integer",
          "format": "int32"
        },
        "concoId": {
          "type": "integer",
          "format": "int32"
        },
        "type": {
          "type": "string",
          "enum": [
            "SYSTEM",
            "REALM",
            "SITE",
            "LOCATION",
            "CONCO_WEB",
            "EMPLOYEE",
            "UNKNOWN"
          ]
        },
        "typeDisplayName": {
          "type": "string"
        },
        "ownerName": {
          "type": "string"
        },
        "connectAccountId": {
          "type": "string"
        },
        "connectClient": {
          "type": "boolean"
        },
        "parentId": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "3.29.14_UserResource": {
      "type": "object",
      "properties": {
        "firstName": {
          "type": "string"
        },
        "lastName": {
          "type": "string"
        },
        "emailAddress": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        },
        "personId": {
          "type": "integer",
          "format": "int32"
        },
        "userType": {
          "type": "string",
          "enum": [
            "SITE",
            "EMPLOYEE",
            "SYSTEM",
            "CONCO_WEB",
            "UNICORN",
            "REALM",
            "SALES",
            "REPORTING",
            "ASSESSOR",
            "INTEGRATION",
            "SSO_INTEGRATION",
            "STYLE_SERVICE_INTEGRATION"
          ]
        },
        "userName": {
          "type": "string"
        },
        "scope": {
          "$ref": "#/$defs/3.29.14_ScopeResource"
        },
        "active": {
          "type": "boolean"
        },
        "updateTime": {
          "type": "string"
        },
        "locale": {
          "type": "string"
        },
        "email2": {
          "type": "string"
        },
        "phone2": {
          "type": "string"
        }
      }
    }
  }
}