Skip to content

Commit

Permalink
feat(Organization): Add members field
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ketch committed Sep 18, 2020
1 parent 9d85ec0 commit f5883dc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions py/stencila/schema/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2077,6 +2077,10 @@ class Organization(Thing):
logo: Optional[Union[str, "ImageObject"]] = None
"""The logo of the organization."""

members: Optional[Array[Union["Organization", "Person"]]] = None
"""Person(s) or Organization(s) who are members of this organization.
"""

parentOrganization: Optional["Organization"] = None
"""Entity that the Organization is a part of. For example, parentOrganization to a department is a university.
"""
Expand All @@ -2096,6 +2100,7 @@ def __init__(
images: Optional[Array[Union["ImageObject", str]]] = None,
legalName: Optional[str] = None,
logo: Optional[Union[str, "ImageObject"]] = None,
members: Optional[Array[Union["Organization", "Person"]]] = None,
meta: Optional[Dict[str, Any]] = None,
name: Optional[str] = None,
parentOrganization: Optional["Organization"] = None,
Expand Down Expand Up @@ -2125,6 +2130,8 @@ def __init__(
self.legalName = legalName
if logo is not None:
self.logo = logo
if members is not None:
self.members = members
if parentOrganization is not None:
self.parentOrganization = parentOrganization

Expand Down
3 changes: 3 additions & 0 deletions r/R/types.R
Original file line number Diff line number Diff line change
Expand Up @@ -2148,6 +2148,7 @@ NontextualAnnotation <- function(
#' @param images Images of the item.
#' @param legalName Legal name for the Organization. Should only include letters and spaces.
#' @param logo The logo of the organization.
#' @param members Person(s) or Organization(s) who are members of this organization.
#' @param meta Metadata associated with this item.
#' @param name The name of the item.
#' @param parentOrganization Entity that the Organization is a part of. For example, parentOrganization to a department is a university.
Expand All @@ -2167,6 +2168,7 @@ Organization <- function(
images,
legalName,
logo,
members,
meta,
name,
parentOrganization,
Expand All @@ -2190,6 +2192,7 @@ Organization <- function(
self[["funders"]] <- check_property("Organization", "funders", FALSE, missing(funders), Array(Union(Organization, Person)), funders)
self[["legalName"]] <- check_property("Organization", "legalName", FALSE, missing(legalName), "character", legalName)
self[["logo"]] <- check_property("Organization", "logo", FALSE, missing(logo), Union("character", ImageObject), logo)
self[["members"]] <- check_property("Organization", "members", FALSE, missing(members), Array(Union(Organization, Person)), members)
self[["parentOrganization"]] <- check_property("Organization", "parentOrganization", FALSE, missing(parentOrganization), Organization, parentOrganization)
class(self) <- c(class(self), "Organization")
self
Expand Down
9 changes: 9 additions & 0 deletions schema/Organization.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ properties:
type: array
items:
$ref: ContactPoint
members:
'@id': schema:members
description: |
Person(s) or Organization(s) who are members of this organization.
type: array
items:
anyOf:
- $ref: Organization
- $ref: Person
departments:
'@id': schema:department
description: |
Expand Down

0 comments on commit f5883dc

Please sign in to comment.