{
  "typeName" : "AWS::DataZone::ProjectMembership",
  "description" : "Definition of AWS::DataZone::ProjectMembership Resource Type",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-datazone",
  "definitions" : {
    "Member" : {
      "oneOf" : [ {
        "type" : "object",
        "title" : "UserIdentifier",
        "properties" : {
          "UserIdentifier" : {
            "type" : "string"
          }
        },
        "required" : [ "UserIdentifier" ],
        "additionalProperties" : false
      }, {
        "type" : "object",
        "title" : "GroupIdentifier",
        "properties" : {
          "GroupIdentifier" : {
            "type" : "string"
          }
        },
        "required" : [ "GroupIdentifier" ],
        "additionalProperties" : false
      } ]
    },
    "MemberIdentifierType" : {
      "type" : "string",
      "enum" : [ "USER_IDENTIFIER", "GROUP_IDENTIFIER" ]
    },
    "UserDesignation" : {
      "type" : "string",
      "enum" : [ "PROJECT_OWNER", "PROJECT_CONTRIBUTOR", "PROJECT_CATALOG_VIEWER", "PROJECT_CATALOG_CONSUMER", "PROJECT_CATALOG_STEWARD" ]
    }
  },
  "properties" : {
    "Designation" : {
      "$ref" : "#/definitions/UserDesignation"
    },
    "DomainIdentifier" : {
      "type" : "string",
      "pattern" : "^dzd[-_][a-zA-Z0-9_-]{1,36}$"
    },
    "Member" : {
      "$ref" : "#/definitions/Member"
    },
    "MemberIdentifier" : {
      "type" : "string"
    },
    "MemberIdentifierType" : {
      "$ref" : "#/definitions/MemberIdentifierType"
    },
    "ProjectIdentifier" : {
      "type" : "string",
      "pattern" : "^[a-zA-Z0-9_-]{1,36}$"
    }
  },
  "required" : [ "Designation", "DomainIdentifier", "ProjectIdentifier", "Member" ],
  "readOnlyProperties" : [ "/properties/MemberIdentifier", "/properties/MemberIdentifierType" ],
  "writeOnlyProperties" : [ "/properties/Designation", "/properties/Member" ],
  "createOnlyProperties" : [ "/properties/DomainIdentifier", "/properties/ProjectIdentifier", "/properties/Member" ],
  "primaryIdentifier" : [ "/properties/DomainIdentifier", "/properties/MemberIdentifier", "/properties/MemberIdentifierType", "/properties/ProjectIdentifier" ],
  "tagging" : {
    "taggable" : false
  },
  "handlers" : {
    "create" : {
      "permissions" : [ "datazone:CreateProjectMembership", "datazone:ListProjectMemberships", "iam:GetRole", "datazone:GetGroupProfile", "datazone:GetUserProfile" ]
    },
    "read" : {
      "permissions" : [ "datazone:ListProjectMemberships" ]
    },
    "delete" : {
      "permissions" : [ "datazone:DeleteProjectMembership" ]
    },
    "update" : {
      "permissions" : [ "datazone:CreateProjectMembership", "datazone:DeleteProjectMembership" ]
    },
    "list" : {
      "handlerSchema" : {
        "properties" : {
          "DomainIdentifier" : {
            "$ref" : "resource-schema.json#/properties/DomainIdentifier"
          },
          "ProjectIdentifier" : {
            "$ref" : "resource-schema.json#/properties/ProjectIdentifier"
          }
        },
        "required" : [ "DomainIdentifier", "ProjectIdentifier" ]
      },
      "permissions" : [ "datazone:ListProjectMemberships" ]
    }
  },
  "additionalProperties" : false
}