Skip to content

Commit

Permalink
feat(Organization): Add logo property
Browse files Browse the repository at this point in the history
  • Loading branch information
nokome committed Jan 31, 2020
1 parent 1c92adf commit f03d04c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions py/stencila/schema/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1603,6 +1603,7 @@ class Organization(Thing):
departments: Optional[Array["Organization"]] = None
funders: Optional[Array[Union["Organization", "Person"]]] = None
legalName: Optional[str] = None
logo: Optional[Union[str, "ImageObject"]] = None
parentOrganization: Optional["Organization"] = None

def __init__(
Expand All @@ -1617,6 +1618,7 @@ def __init__(
id: Optional[str] = None,
identifiers: Optional[Array[Union[str, "PropertyValue"]]] = None,
legalName: Optional[str] = None,
logo: Optional[Union[str, "ImageObject"]] = None,
meta: Optional[Dict[str, Any]] = None,
name: Optional[str] = None,
parentOrganization: Optional["Organization"] = None,
Expand All @@ -1643,6 +1645,8 @@ def __init__(
self.funders = funders
if legalName is not None:
self.legalName = legalName
if logo is not None:
self.logo = logo
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 @@ -1941,6 +1941,7 @@ MonetaryGrant <- function(
#' @param id The identifier for this item.
#' @param identifiers Any kind of identifier for any kind of Thing.
#' @param legalName Legal name for the Organization. Should only include letters and spaces.
#' @param logo The logo of the 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 @@ -1958,6 +1959,7 @@ Organization <- function(
id,
identifiers,
legalName,
logo,
meta,
name,
parentOrganization,
Expand All @@ -1979,6 +1981,7 @@ Organization <- function(
self[["departments"]] <- check_property("Organization", "departments", FALSE, missing(departments), Array(Organization), departments)
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[["parentOrganization"]] <- check_property("Organization", "parentOrganization", FALSE, missing(parentOrganization), Organization, parentOrganization)
class(self) <- c(class(self), "Organization")
self
Expand Down
10 changes: 10 additions & 0 deletions schema/Organization.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ properties:
Legal name for the Organization. Should only include letters and spaces.
type: string
pattern: '[a-zA-Z]'
logo:
'@id': schema:logo
description: The logo of the organization.
$comment: |
This is a singleton property because, at any one time, an organization
will usually only have one logo.
anyOf:
- type: string
format: uri
- $ref: ImageObject
parentOrganization:
'@id': schema:parentOrganization
description: |
Expand Down

0 comments on commit f03d04c

Please sign in to comment.