{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/acculynx/json-schema/acculynx-job-contact-schema.json",
  "title": "jobContact",
  "x-generated": "2026-10-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/acculynx-api-v2-api-openapi.yml#/components/schemas/jobContact",
  "allOf": [
    {
      "$ref": "#/$defs/jobContactLink"
    },
    {
      "type": "object",
      "properties": {
        "isPrimary": {
          "type": "boolean",
          "description": "Is this the primary contact for this job?"
        },
        "relationToPrimary": {
          "type": "string",
          "description": "how is this contact related to the primary contact?"
        },
        "contact": {
          "description": "ContactLink object is included by default. Specify includes=contact in the request to include the full Contact object.",
          "oneOf": [
            {
              "$ref": "#/$defs/contact"
            },
            {
              "$ref": "#/$defs/contactLink"
            }
          ]
        }
      }
    }
  ],
  "$defs": {
    "address": {
      "type": "object",
      "properties": {
        "street1": {
          "type": "string"
        },
        "street2": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "state": {
          "$ref": "#/$defs/state"
        },
        "zipCode": {
          "type": "string"
        },
        "country": {
          "$ref": "#/$defs/country"
        }
      }
    },
    "contact": {
      "allOf": [
        {
          "$ref": "#/$defs/contactLink"
        },
        {
          "type": "object",
          "properties": {
            "firstName": {
              "type": "string",
              "description": "First name of the contact."
            },
            "lastName": {
              "type": "string",
              "description": "Last name of the contact."
            },
            "salutation": {
              "type": "string",
              "description": "Salutation of the contact."
            },
            "crossReference": {
              "type": "string",
              "description": "CrossReference of the contact."
            },
            "companyName": {
              "type": "string",
              "description": "CompanyName of the contact."
            },
            "phoneNumbers": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/phoneNumberLink"
              }
            },
            "emailAddresses": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/emailAddressLink"
              }
            },
            "mailingAddress": {
              "$ref": "#/$defs/address"
            },
            "billingAddress": {
              "$ref": "#/$defs/address"
            },
            "createdDate": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time",
              "description": "Date the contact was created, in ISO 8601 format. Null when unavailable."
            },
            "modifiedDate": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time",
              "description": "Date the contact was last modified, in ISO 8601 format. Null when unavailable."
            }
          }
        }
      ]
    },
    "contactLink": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique GUID identifying this contact.",
          "format": "uuid"
        },
        "_link": {
          "type": "string",
          "description": "The unique URI for this resource."
        }
      }
    },
    "country": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "The id for the Country."
        },
        "name": {
          "type": "string",
          "description": "The name of the Country."
        },
        "abbreviation": {
          "type": "string",
          "description": "The 2 character abbreviation for the Country.",
          "minLength": 2,
          "maxLength": 2
        },
        "_link": {
          "type": "string",
          "description": "The URI of the Country."
        }
      }
    },
    "emailAddressLink": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The GUID of the Email Address.",
          "format": "uuid",
          "readOnly": true
        },
        "_link": {
          "type": "string",
          "description": "The URI of the Email Address",
          "readOnly": true
        }
      }
    },
    "jobContactLink": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "The contact's unique ID."
        },
        "_link": {
          "type": "string",
          "description": "The URI of this contact."
        }
      }
    },
    "phoneNumberLink": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The GUID of the Phone Number.",
          "format": "uuid",
          "readOnly": true
        },
        "_link": {
          "type": "string",
          "description": "The URI of the Phone Number.",
          "readOnly": true
        }
      }
    },
    "state": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "The id for the state."
        },
        "name": {
          "type": "string",
          "description": "The name of the State."
        },
        "abbreviation": {
          "type": "string",
          "description": "The 2 character abbreviation for the State.",
          "minLength": 2,
          "maxLength": 2
        },
        "_link": {
          "type": "string",
          "description": "The URI of the State."
        }
      }
    }
  }
}