{
  "swagger": "2.0",
  "info": {
    "title": "evey/v1/share.proto",
    "version": "version not set"
  },
  "tags": [
    {
      "name": "ShareService"
    }
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/api/v1/admin/share-links": {
      "get": {
        "operationId": "ShareService_ListShareLinks",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListShareLinksResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "tags": [
          "ShareService"
        ]
      }
    },
    "/api/v1/media/{mediaItemId}/share": {
      "post": {
        "operationId": "ShareService_CreateShareLink",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1CreateShareLinkResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "mediaItemId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ShareServiceCreateShareLinkBody"
            }
          }
        ],
        "tags": [
          "ShareService"
        ]
      }
    },
    "/api/v1/share-links/{id}": {
      "delete": {
        "operationId": "ShareService_RevokeShareLink",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1RevokeShareLinkResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "ShareService"
        ]
      }
    },
    "/api/v1/share/{token}": {
      "get": {
        "operationId": "ShareService_ValidateShareLink",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ValidateShareLinkResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "ShareService"
        ]
      }
    }
  },
  "definitions": {
    "ShareServiceCreateShareLinkBody": {
      "type": "object",
      "properties": {
        "durationHours": {
          "type": "integer",
          "format": "int32"
        },
        "maxViews": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "protobufAny": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        }
      },
      "additionalProperties": {}
    },
    "rpcStatus": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32"
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/protobufAny"
          }
        }
      }
    },
    "v1CreateShareLinkResponse": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "token": {
          "type": "string"
        },
        "mediaId": {
          "type": "string"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "maxViews": {
          "type": "integer",
          "format": "int32"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "v1ListShareLinksResponse": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1ShareLinkProto"
          }
        }
      }
    },
    "v1RevokeShareLinkResponse": {
      "type": "object"
    },
    "v1ShareLinkProto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "token": {
          "type": "string"
        },
        "mediaItemId": {
          "type": "string"
        },
        "createdBy": {
          "type": "string"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "maxViews": {
          "type": "integer",
          "format": "int32"
        },
        "viewCount": {
          "type": "integer",
          "format": "int32"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "v1ValidateShareLinkResponse": {
      "type": "object",
      "properties": {
        "mediaId": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "mediaType": {
          "type": "string"
        },
        "durationMs": {
          "type": "string",
          "format": "int64"
        },
        "streamUrl": {
          "type": "string"
        }
      }
    }
  }
}
