From cf0f9501ab216467a2db0e56cc311070f9ba5766 Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Tue, 15 Jul 2025 17:59:45 +0200 Subject: [PATCH] add comment models --- src/gen/api/outline/models/Comment.ts | 133 ++++++++++++++++++ .../models/CommentsCreate200Response.ts | 73 ++++++++++ .../outline/models/CommentsCreateRequest.ts | 98 +++++++++++++ .../outline/models/CommentsInfo200Response.ts | 88 ++++++++++++ .../api/outline/models/CommentsInfoRequest.ts | 74 ++++++++++ .../outline/models/CommentsList200Response.ts | 103 ++++++++++++++ .../api/outline/models/CommentsListRequest.ts | 124 ++++++++++++++++ .../outline/models/CommentsUpdateRequest.ts | 75 ++++++++++ 8 files changed, 768 insertions(+) create mode 100644 src/gen/api/outline/models/Comment.ts create mode 100644 src/gen/api/outline/models/CommentsCreate200Response.ts create mode 100644 src/gen/api/outline/models/CommentsCreateRequest.ts create mode 100644 src/gen/api/outline/models/CommentsInfo200Response.ts create mode 100644 src/gen/api/outline/models/CommentsInfoRequest.ts create mode 100644 src/gen/api/outline/models/CommentsList200Response.ts create mode 100644 src/gen/api/outline/models/CommentsListRequest.ts create mode 100644 src/gen/api/outline/models/CommentsUpdateRequest.ts diff --git a/src/gen/api/outline/models/Comment.ts b/src/gen/api/outline/models/Comment.ts new file mode 100644 index 0000000..934f927 --- /dev/null +++ b/src/gen/api/outline/models/Comment.ts @@ -0,0 +1,133 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; + +/** + * + * @export + * @interface Comment + */ +export interface Comment { + /** + * Unique identifier for the object. + * @type {string} + * @memberof Comment + */ + readonly id?: string; + /** + * The editor data representing this comment. + * @type {object} + * @memberof Comment + */ + data?: object; + /** + * Identifier for the document this is related to. + * @type {string} + * @memberof Comment + */ + documentId?: string; + /** + * Identifier for the comment this is a child of, if any. + * @type {string} + * @memberof Comment + */ + parentCommentId?: string; + /** + * The date and time that this object was created + * @type {Date} + * @memberof Comment + */ + readonly createdAt?: Date; + /** + * + * @type {User} + * @memberof Comment + */ + createdBy?: User; + /** + * The date and time that this object was last changed + * @type {Date} + * @memberof Comment + */ + readonly updatedAt?: Date; + /** + * + * @type {User} + * @memberof Comment + */ + updatedBy?: User; + /** + * The document text that the comment is anchored to, only included if includeAnchorText=true. + * @type {string} + * @memberof Comment + */ + readonly anchorText?: string; +} + +/** + * Check if a given object implements the Comment interface. + */ +export function instanceOfComment(value: object): value is Comment { + return true; +} + +export function CommentFromJSON(json: any): Comment { + return CommentFromJSONTyped(json, false); +} + +export function CommentFromJSONTyped(json: any, ignoreDiscriminator: boolean): Comment { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'data': json['data'] == null ? undefined : json['data'], + 'documentId': json['documentId'] == null ? undefined : json['documentId'], + 'parentCommentId': json['parentCommentId'] == null ? undefined : json['parentCommentId'], + 'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])), + 'createdBy': json['createdBy'] == null ? undefined : UserFromJSON(json['createdBy']), + 'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])), + 'updatedBy': json['updatedBy'] == null ? undefined : UserFromJSON(json['updatedBy']), + 'anchorText': json['anchorText'] == null ? undefined : json['anchorText'], + }; +} + +export function CommentToJSON(json: any): Comment { + return CommentToJSONTyped(json, false); +} + +export function CommentToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': value['data'], + 'documentId': value['documentId'], + 'parentCommentId': value['parentCommentId'], + 'createdBy': UserToJSON(value['createdBy']), + 'updatedBy': UserToJSON(value['updatedBy']), + }; +} + diff --git a/src/gen/api/outline/models/CommentsCreate200Response.ts b/src/gen/api/outline/models/CommentsCreate200Response.ts new file mode 100644 index 0000000..f1db1a3 --- /dev/null +++ b/src/gen/api/outline/models/CommentsCreate200Response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Comment } from './Comment'; +import { + CommentFromJSON, + CommentFromJSONTyped, + CommentToJSON, + CommentToJSONTyped, +} from './Comment'; + +/** + * + * @export + * @interface CommentsCreate200Response + */ +export interface CommentsCreate200Response { + /** + * + * @type {Comment} + * @memberof CommentsCreate200Response + */ + data?: Comment; +} + +/** + * Check if a given object implements the CommentsCreate200Response interface. + */ +export function instanceOfCommentsCreate200Response(value: object): value is CommentsCreate200Response { + return true; +} + +export function CommentsCreate200ResponseFromJSON(json: any): CommentsCreate200Response { + return CommentsCreate200ResponseFromJSONTyped(json, false); +} + +export function CommentsCreate200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CommentsCreate200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : CommentFromJSON(json['data']), + }; +} + +export function CommentsCreate200ResponseToJSON(json: any): CommentsCreate200Response { + return CommentsCreate200ResponseToJSONTyped(json, false); +} + +export function CommentsCreate200ResponseToJSONTyped(value?: CommentsCreate200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': CommentToJSON(value['data']), + }; +} + diff --git a/src/gen/api/outline/models/CommentsCreateRequest.ts b/src/gen/api/outline/models/CommentsCreateRequest.ts new file mode 100644 index 0000000..e0468ca --- /dev/null +++ b/src/gen/api/outline/models/CommentsCreateRequest.ts @@ -0,0 +1,98 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface CommentsCreateRequest + */ +export interface CommentsCreateRequest { + /** + * + * @type {string} + * @memberof CommentsCreateRequest + */ + id?: string; + /** + * + * @type {string} + * @memberof CommentsCreateRequest + */ + documentId: string; + /** + * + * @type {string} + * @memberof CommentsCreateRequest + */ + parentCommentId?: string; + /** + * The body of the comment. + * @type {object} + * @memberof CommentsCreateRequest + */ + data?: object; + /** + * The body of the comment in markdown. + * @type {string} + * @memberof CommentsCreateRequest + */ + text?: string; +} + +/** + * Check if a given object implements the CommentsCreateRequest interface. + */ +export function instanceOfCommentsCreateRequest(value: object): value is CommentsCreateRequest { + if (!('documentId' in value) || value['documentId'] === undefined) return false; + return true; +} + +export function CommentsCreateRequestFromJSON(json: any): CommentsCreateRequest { + return CommentsCreateRequestFromJSONTyped(json, false); +} + +export function CommentsCreateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CommentsCreateRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'documentId': json['documentId'], + 'parentCommentId': json['parentCommentId'] == null ? undefined : json['parentCommentId'], + 'data': json['data'] == null ? undefined : json['data'], + 'text': json['text'] == null ? undefined : json['text'], + }; +} + +export function CommentsCreateRequestToJSON(json: any): CommentsCreateRequest { + return CommentsCreateRequestToJSONTyped(json, false); +} + +export function CommentsCreateRequestToJSONTyped(value?: CommentsCreateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'documentId': value['documentId'], + 'parentCommentId': value['parentCommentId'], + 'data': value['data'], + 'text': value['text'], + }; +} + diff --git a/src/gen/api/outline/models/CommentsInfo200Response.ts b/src/gen/api/outline/models/CommentsInfo200Response.ts new file mode 100644 index 0000000..3e1915e --- /dev/null +++ b/src/gen/api/outline/models/CommentsInfo200Response.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { Comment } from './Comment'; +import { + CommentFromJSON, + CommentFromJSONTyped, + CommentToJSON, + CommentToJSONTyped, +} from './Comment'; + +/** + * + * @export + * @interface CommentsInfo200Response + */ +export interface CommentsInfo200Response { + /** + * + * @type {Comment} + * @memberof CommentsInfo200Response + */ + data?: Comment; + /** + * + * @type {Array} + * @memberof CommentsInfo200Response + */ + policies?: Array; +} + +/** + * Check if a given object implements the CommentsInfo200Response interface. + */ +export function instanceOfCommentsInfo200Response(value: object): value is CommentsInfo200Response { + return true; +} + +export function CommentsInfo200ResponseFromJSON(json: any): CommentsInfo200Response { + return CommentsInfo200ResponseFromJSONTyped(json, false); +} + +export function CommentsInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CommentsInfo200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : CommentFromJSON(json['data']), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + }; +} + +export function CommentsInfo200ResponseToJSON(json: any): CommentsInfo200Response { + return CommentsInfo200ResponseToJSONTyped(json, false); +} + +export function CommentsInfo200ResponseToJSONTyped(value?: CommentsInfo200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': CommentToJSON(value['data']), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/CommentsInfoRequest.ts b/src/gen/api/outline/models/CommentsInfoRequest.ts new file mode 100644 index 0000000..5ce8e1b --- /dev/null +++ b/src/gen/api/outline/models/CommentsInfoRequest.ts @@ -0,0 +1,74 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface CommentsInfoRequest + */ +export interface CommentsInfoRequest { + /** + * + * @type {string} + * @memberof CommentsInfoRequest + */ + id: string; + /** + * Include the document text that the comment is anchored to, if any, in the response. + * @type {boolean} + * @memberof CommentsInfoRequest + */ + includeAnchorText?: boolean; +} + +/** + * Check if a given object implements the CommentsInfoRequest interface. + */ +export function instanceOfCommentsInfoRequest(value: object): value is CommentsInfoRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function CommentsInfoRequestFromJSON(json: any): CommentsInfoRequest { + return CommentsInfoRequestFromJSONTyped(json, false); +} + +export function CommentsInfoRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CommentsInfoRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'includeAnchorText': json['includeAnchorText'] == null ? undefined : json['includeAnchorText'], + }; +} + +export function CommentsInfoRequestToJSON(json: any): CommentsInfoRequest { + return CommentsInfoRequestToJSONTyped(json, false); +} + +export function CommentsInfoRequestToJSONTyped(value?: CommentsInfoRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'includeAnchorText': value['includeAnchorText'], + }; +} + diff --git a/src/gen/api/outline/models/CommentsList200Response.ts b/src/gen/api/outline/models/CommentsList200Response.ts new file mode 100644 index 0000000..e44ebd3 --- /dev/null +++ b/src/gen/api/outline/models/CommentsList200Response.ts @@ -0,0 +1,103 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { Comment } from './Comment'; +import { + CommentFromJSON, + CommentFromJSONTyped, + CommentToJSON, + CommentToJSONTyped, +} from './Comment'; +import type { Pagination } from './Pagination'; +import { + PaginationFromJSON, + PaginationFromJSONTyped, + PaginationToJSON, + PaginationToJSONTyped, +} from './Pagination'; + +/** + * + * @export + * @interface CommentsList200Response + */ +export interface CommentsList200Response { + /** + * + * @type {Array} + * @memberof CommentsList200Response + */ + data?: Array; + /** + * + * @type {Array} + * @memberof CommentsList200Response + */ + policies?: Array; + /** + * + * @type {Pagination} + * @memberof CommentsList200Response + */ + pagination?: Pagination; +} + +/** + * Check if a given object implements the CommentsList200Response interface. + */ +export function instanceOfCommentsList200Response(value: object): value is CommentsList200Response { + return true; +} + +export function CommentsList200ResponseFromJSON(json: any): CommentsList200Response { + return CommentsList200ResponseFromJSONTyped(json, false); +} + +export function CommentsList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CommentsList200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : ((json['data'] as Array).map(CommentFromJSON)), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + }; +} + +export function CommentsList200ResponseToJSON(json: any): CommentsList200Response { + return CommentsList200ResponseToJSONTyped(json, false); +} + +export function CommentsList200ResponseToJSONTyped(value?: CommentsList200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': value['data'] == null ? undefined : ((value['data'] as Array).map(CommentToJSON)), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + 'pagination': PaginationToJSON(value['pagination']), + }; +} + diff --git a/src/gen/api/outline/models/CommentsListRequest.ts b/src/gen/api/outline/models/CommentsListRequest.ts new file mode 100644 index 0000000..c7e405b --- /dev/null +++ b/src/gen/api/outline/models/CommentsListRequest.ts @@ -0,0 +1,124 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface CommentsListRequest + */ +export interface CommentsListRequest { + /** + * + * @type {number} + * @memberof CommentsListRequest + */ + offset?: number; + /** + * + * @type {number} + * @memberof CommentsListRequest + */ + limit?: number; + /** + * + * @type {string} + * @memberof CommentsListRequest + */ + sort?: string; + /** + * + * @type {string} + * @memberof CommentsListRequest + */ + direction?: CommentsListRequestDirectionEnum; + /** + * Filter to a specific document + * @type {string} + * @memberof CommentsListRequest + */ + documentId?: string; + /** + * Filter to a specific collection + * @type {string} + * @memberof CommentsListRequest + */ + collectionId?: string; + /** + * Include the document text that the comment is anchored to, if any, in the response. + * @type {boolean} + * @memberof CommentsListRequest + */ + includeAnchorText?: boolean; +} + + +/** + * @export + */ +export const CommentsListRequestDirectionEnum = { + Asc: 'ASC', + Desc: 'DESC' +} as const; +export type CommentsListRequestDirectionEnum = typeof CommentsListRequestDirectionEnum[keyof typeof CommentsListRequestDirectionEnum]; + + +/** + * Check if a given object implements the CommentsListRequest interface. + */ +export function instanceOfCommentsListRequest(value: object): value is CommentsListRequest { + return true; +} + +export function CommentsListRequestFromJSON(json: any): CommentsListRequest { + return CommentsListRequestFromJSONTyped(json, false); +} + +export function CommentsListRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CommentsListRequest { + if (json == null) { + return json; + } + return { + + 'offset': json['offset'] == null ? undefined : json['offset'], + 'limit': json['limit'] == null ? undefined : json['limit'], + 'sort': json['sort'] == null ? undefined : json['sort'], + 'direction': json['direction'] == null ? undefined : json['direction'], + 'documentId': json['documentId'] == null ? undefined : json['documentId'], + 'collectionId': json['collectionId'] == null ? undefined : json['collectionId'], + 'includeAnchorText': json['includeAnchorText'] == null ? undefined : json['includeAnchorText'], + }; +} + +export function CommentsListRequestToJSON(json: any): CommentsListRequest { + return CommentsListRequestToJSONTyped(json, false); +} + +export function CommentsListRequestToJSONTyped(value?: CommentsListRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'offset': value['offset'], + 'limit': value['limit'], + 'sort': value['sort'], + 'direction': value['direction'], + 'documentId': value['documentId'], + 'collectionId': value['collectionId'], + 'includeAnchorText': value['includeAnchorText'], + }; +} + diff --git a/src/gen/api/outline/models/CommentsUpdateRequest.ts b/src/gen/api/outline/models/CommentsUpdateRequest.ts new file mode 100644 index 0000000..7c029ae --- /dev/null +++ b/src/gen/api/outline/models/CommentsUpdateRequest.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface CommentsUpdateRequest + */ +export interface CommentsUpdateRequest { + /** + * + * @type {string} + * @memberof CommentsUpdateRequest + */ + id: string; + /** + * + * @type {object} + * @memberof CommentsUpdateRequest + */ + data: object; +} + +/** + * Check if a given object implements the CommentsUpdateRequest interface. + */ +export function instanceOfCommentsUpdateRequest(value: object): value is CommentsUpdateRequest { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('data' in value) || value['data'] === undefined) return false; + return true; +} + +export function CommentsUpdateRequestFromJSON(json: any): CommentsUpdateRequest { + return CommentsUpdateRequestFromJSONTyped(json, false); +} + +export function CommentsUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CommentsUpdateRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'data': json['data'], + }; +} + +export function CommentsUpdateRequestToJSON(json: any): CommentsUpdateRequest { + return CommentsUpdateRequestToJSONTyped(json, false); +} + +export function CommentsUpdateRequestToJSONTyped(value?: CommentsUpdateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'data': value['data'], + }; +} +