# dev.gitosphere.repository.prepareIssueMutation

> Published by [gitosphere-lex.bsky.social](https://lexicon.garden/identity/did:plc:iz47txlteeb2ojtp5ygiqet6)

✓ This is the authoritative definition for this NSID.

## Description

Manages authorization, acceptance, and migration of Issue changes.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:iz47txlteeb2ojtp5ygiqet6/dev.gitosphere.repository.prepareIssueMutation)
- [Documentation](https://lexicon.garden/lexicon/did:plc:iz47txlteeb2ojtp5ygiqet6/dev.gitosphere.repository.prepareIssueMutation/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:iz47txlteeb2ojtp5ygiqet6/dev.gitosphere.repository.prepareIssueMutation/examples)

## Definitions

### `dev.gitosphere.repository.prepareIssueMutation#createIntent`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `bodyDocument` | `bytes` | Yes |  |
| `bodyDocumentFormat` | `string` | Yes |  |
| `operation` | `string` | Yes |  |
| `title` | `string` | Yes |  |

### `dev.gitosphere.repository.prepareIssueMutation#editIntent`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `bodyDocument` | `bytes` | Yes |  |
| `bodyDocumentFormat` | `string` | Yes |  |
| `number` | `integer` | Yes |  |
| `operation` | `string` | Yes |  |
| `title` | `string` | Yes |  |

### `dev.gitosphere.repository.prepareIssueMutation#editTitleIntent`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `number` | `integer` | Yes |  |
| `operation` | `string` | Yes |  |
| `title` | `string` | Yes |  |

### `dev.gitosphere.repository.prepareIssueMutation`

**Type**: `procedure`

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `baseRevision` | `string` | No |  |
| `dryRun` | `boolean` | No |  |
| `idempotencyKey` | `ref` → `dev.gitosphere.defs#idempotencyKey` | Yes |  |
| `intent` | `union` | Yes |  |
| `realmId` | `string` | Yes |  |
| `repositoryId` | `string` | Yes |  |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `accepted` | `boolean` | Yes |  |
| `record` | `ref` → `dev.gitosphere.repository.issueMutation` | No |  |
| `recordKey` | `string` | No |  |
| `replayed` | `boolean` | Yes |  |

#### Errors

- **InvalidRequest**
- **ValidationFailed**
- **AuthenticationRequired**
- **AccessDenied**
- **RepositoryMismatch**
- **RecordNotFound**
- **Conflict**
- **IdempotencyConflict**
- **DependencyUnavailable**
- **InternalServerError**
- **InvitationRequired**: An invitation is required to use this service.
- **AccountSuspended**: Service access for this DID is suspended.
- **ServicePaused**: An administrator has paused new requests for this target.

### `dev.gitosphere.repository.prepareIssueMutation#relationIntent`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `number` | `integer` | Yes |  |
| `operation` | `string` | Yes |  |
| `relation` | `string` | Yes |  |
| `relationRevision` | `string` | Yes |  |
| `target` | `string` (at-uri) | Yes |  |

### `dev.gitosphere.repository.prepareIssueMutation#stateIntent`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `number` | `integer` | Yes |  |
| `operation` | `string` | Yes |  |
| `state` | `string` | Yes |  |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "createIntent": {
      "properties": {
        "bodyDocument": {
          "maxLength": 262144,
          "type": "bytes"
        },
        "bodyDocumentFormat": {
          "knownValues": [
            "gsp-xml-zip-v1"
          ],
          "type": "string"
        },
        "operation": {
          "enum": [
            "create"
          ],
          "type": "string"
        },
        "title": {
          "maxLength": 2560,
          "type": "string"
        }
      },
      "required": [
        "operation",
        "title",
        "bodyDocument",
        "bodyDocumentFormat"
      ],
      "type": "object"
    },
    "editIntent": {
      "properties": {
        "bodyDocument": {
          "maxLength": 262144,
          "type": "bytes"
        },
        "bodyDocumentFormat": {
          "knownValues": [
            "gsp-xml-zip-v1"
          ],
          "type": "string"
        },
        "number": {
          "minimum": 1,
          "type": "integer"
        },
        "operation": {
          "enum": [
            "edit"
          ],
          "type": "string"
        },
        "title": {
          "maxLength": 2560,
          "type": "string"
        }
      },
      "required": [
        "operation",
        "number",
        "title",
        "bodyDocument",
        "bodyDocumentFormat"
      ],
      "type": "object"
    },
    "editTitleIntent": {
      "properties": {
        "number": {
          "minimum": 1,
          "type": "integer"
        },
        "operation": {
          "enum": [
            "edit"
          ],
          "type": "string"
        },
        "title": {
          "maxLength": 2560,
          "type": "string"
        }
      },
      "required": [
        "operation",
        "number",
        "title"
      ],
      "type": "object"
    },
    "main": {
      "errors": [
        {
          "name": "InvalidRequest"
        },
        {
          "name": "ValidationFailed"
        },
        {
          "name": "AuthenticationRequired"
        },
        {
          "name": "AccessDenied"
        },
        {
          "name": "RepositoryMismatch"
        },
        {
          "name": "RecordNotFound"
        },
        {
          "name": "Conflict"
        },
        {
          "name": "IdempotencyConflict"
        },
        {
          "name": "DependencyUnavailable"
        },
        {
          "name": "InternalServerError"
        },
        {
          "description": "An invitation is required to use this service.",
          "name": "InvitationRequired"
        },
        {
          "description": "Service access for this DID is suspended.",
          "name": "AccountSuspended"
        },
        {
          "description": "An administrator has paused new requests for this target.",
          "name": "ServicePaused"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "baseRevision": {
              "type": "string"
            },
            "dryRun": {
              "type": "boolean"
            },
            "idempotencyKey": {
              "ref": "dev.gitosphere.defs#idempotencyKey",
              "type": "ref"
            },
            "intent": {
              "closed": true,
              "refs": [
                "#createIntent",
                "#editIntent",
                "#editTitleIntent",
                "#stateIntent",
                "#relationIntent"
              ],
              "type": "union"
            },
            "realmId": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            },
            "repositoryId": {
              "maxLength": 36,
              "minLength": 36,
              "type": "string"
            }
          },
          "required": [
            "realmId",
            "repositoryId",
            "idempotencyKey",
            "intent"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "accepted": {
              "type": "boolean"
            },
            "record": {
              "ref": "dev.gitosphere.repository.issueMutation",
              "type": "ref"
            },
            "recordKey": {
              "type": "string"
            },
            "replayed": {
              "type": "boolean"
            }
          },
          "required": [
            "replayed",
            "accepted"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    },
    "relationIntent": {
      "properties": {
        "number": {
          "minimum": 1,
          "type": "integer"
        },
        "operation": {
          "enum": [
            "relation"
          ],
          "type": "string"
        },
        "relation": {
          "type": "string"
        },
        "relationRevision": {
          "type": "string"
        },
        "target": {
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "operation",
        "number",
        "target",
        "relation",
        "relationRevision"
      ],
      "type": "object"
    },
    "stateIntent": {
      "properties": {
        "number": {
          "minimum": 1,
          "type": "integer"
        },
        "operation": {
          "enum": [
            "state"
          ],
          "type": "string"
        },
        "state": {
          "enum": [
            "open",
            "closed"
          ],
          "type": "string"
        }
      },
      "required": [
        "operation",
        "number",
        "state"
      ],
      "type": "object"
    }
  },
  "description": "Manages authorization, acceptance, and migration of Issue changes.",
  "id": "dev.gitosphere.repository.prepareIssueMutation",
  "lexicon": 1
}
```
