# social.grain.group.defs

- Kind: defs
- Authority: group.grain.social
- Lexicon: 1
- Published by [grain.social](https://lexicon.garden/identity/did:plc:e7rftrdyz5e2rw4y6ocszew2), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:e7rftrdyz5e2rw4y6ocszew2/social.grain.group.defs)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:e7rftrdyz5e2rw4y6ocszew2/social.grain.group.defs/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:e7rftrdyz5e2rw4y6ocszew2/social.grain.group.defs/analytics)

## #groupRef (`social.grain.group.defs#groupRef`)

Type: object

### Properties

- `did` (string · did, required)
- `displayName` (string)
- `handle` (string, required)
- `item` (string · at-uri, required): The social.grain.group.item that pools this gallery.

## #groupView (`social.grain.group.defs#groupView`)

Type: object

### Properties

- `avatar` (string · uri)
- `description` (string)
- `did` (string · did, required)
- `displayName` (string)
- `handle` (string, required)
- `joinPolicy` (string): How to get in, from the group's public profile.
  - Constraints: knownValues: open | request | invite
- `lastActivityAt` (string · datetime): When the pool last changed.
- `pendingCount` (integer): Submissions awaiting review. Only present for a viewer acting as the group.
- `poolCount` (integer): Galleries in the pool.
- `rules` (array)
  - `items` (ref)
    - Reference: `#rule`
- `url` (string · uri): The group's own site, from its opensocial profile. Where the group is actually run.
- `viewer` (ref)
  - Reference: `#viewerState`

## #rule (`social.grain.group.defs#rule`)

Type: object

### Properties

- `text` (string)
- `title` (string, required)
- `uri` (string · at-uri, required)

## #submissionState (`social.grain.group.defs#submissionState`)

Type: object

### Properties

- `item` (string · at-uri): The group's item record, once accepted.
- `status` (string, required)
  - Constraints: knownValues: pending | accepted | declined
- `uri` (string · at-uri, required): The submission record.

## #submissionView (`social.grain.group.defs#submissionView`)

Type: object

### Properties

- `cid` (string · cid, required)
- `createdAt` (string · datetime, required)
- `gallery` (ref, required)
  - Reference: `social.grain.gallery.defs#galleryView`
- `group` (string · did, required)
- `uri` (string · at-uri, required)

## #viewerState (`social.grain.group.defs#viewerState`)

Type: object

### Properties

- `acting` (boolean): The viewer is signed in as this group, so may accept and remove.
- `member` (boolean): The viewer has accepted membership of this group, as their own PDS lists it. A claim, not access: the host decides that.
- `submission` (ref): The viewer's standing for the gallery named in the request, if one was.
  - Reference: `#submissionState`

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "groupRef": {
      "properties": {
        "did": {
          "format": "did",
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "handle": {
          "type": "string"
        },
        "item": {
          "description": "The social.grain.group.item that pools this gallery.",
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "did",
        "handle",
        "item"
      ],
      "type": "object"
    },
    "groupView": {
      "properties": {
        "avatar": {
          "format": "uri",
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "did": {
          "format": "did",
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "handle": {
          "type": "string"
        },
        "joinPolicy": {
          "description": "How to get in, from the group's public profile.",
          "knownValues": [
            "open",
            "request",
            "invite"
          ],
          "type": "string"
        },
        "lastActivityAt": {
          "description": "When the pool last changed.",
          "format": "datetime",
          "type": "string"
        },
        "pendingCount": {
          "description": "Submissions awaiting review. Only present for a viewer acting as the group.",
          "type": "integer"
        },
        "poolCount": {
          "description": "Galleries in the pool.",
          "type": "integer"
        },
        "rules": {
          "items": {
            "ref": "#rule",
            "type": "ref"
          },
          "type": "array"
        },
        "url": {
          "description": "The group's own site, from its opensocial profile. Where the group is actually run.",
          "format": "uri",
          "type": "string"
        },
        "viewer": {
          "ref": "#viewerState",
          "type": "ref"
        }
      },
      "required": [
        "did",
        "handle"
      ],
      "type": "object"
    },
    "rule": {
      "properties": {
        "text": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "uri": {
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "title"
      ],
      "type": "object"
    },
    "submissionState": {
      "properties": {
        "item": {
          "description": "The group's item record, once accepted.",
          "format": "at-uri",
          "type": "string"
        },
        "status": {
          "knownValues": [
            "pending",
            "accepted",
            "declined"
          ],
          "type": "string"
        },
        "uri": {
          "description": "The submission record.",
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "status"
      ],
      "type": "object"
    },
    "submissionView": {
      "properties": {
        "cid": {
          "format": "cid",
          "type": "string"
        },
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "gallery": {
          "ref": "social.grain.gallery.defs#galleryView",
          "type": "ref"
        },
        "group": {
          "format": "did",
          "type": "string"
        },
        "uri": {
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "cid",
        "group",
        "gallery",
        "createdAt"
      ],
      "type": "object"
    },
    "viewerState": {
      "properties": {
        "acting": {
          "description": "The viewer is signed in as this group, so may accept and remove.",
          "type": "boolean"
        },
        "member": {
          "description": "The viewer has accepted membership of this group, as their own PDS lists it. A claim, not access: the host decides that.",
          "type": "boolean"
        },
        "submission": {
          "description": "The viewer's standing for the gallery named in the request, if one was.",
          "ref": "#submissionState",
          "type": "ref"
        }
      },
      "type": "object"
    }
  },
  "id": "social.grain.group.defs",
  "lexicon": 1
}
```
