diff --git a/client/services/ContextService.ts b/client/services/ContextService.ts index bf8770a..1906454 100644 --- a/client/services/ContextService.ts +++ b/client/services/ContextService.ts @@ -2,62 +2,6 @@ import type { CancelablePromise } from "../core/CancelablePromise.ts"; import { OpenAPI } from "../core/OpenAPI.ts"; import { request as __request } from "../core/request.ts"; export class ContextService { - /** - * Create a new context - * @returns any The new context - * @throws ApiError - */ - public static createContext({ - requestBody, - }: { - requestBody?: { - /** - * The user defined name of the context. - */ - name: string; - owner: - | { - /** - * The unique ID of the owner of the context. Specify either this or slug. - */ - id: string; - /** - * The type of the owner. Defaults to "organization". Accounts are only used as context owners in server. - */ - type?: "account" | "organization"; - } - | { - /** - * A string that represents an organization. Specify either this or id. Cannot be used for accounts. - */ - slug: string; - /** - * The type of owner. Defaults to "organization". Accounts are only used as context owners in server and must be specified by an id instead of a slug. - */ - type?: "organization"; - }; - }; - }): CancelablePromise<{ - /** - * The unique ID of the context. - */ - id: string; - /** - * The user defined name of the context. - */ - name: string; - /** - * The date and time the context was created. - */ - created_at: string; - }> { - return __request(OpenAPI, { - method: "POST", - url: "/context", - body: requestBody, - mediaType: "application/json", - }); - } /** * List contexts * List all contexts for an owner. @@ -117,6 +61,62 @@ export class ContextService { }, }); } + /** + * Create a new context + * @returns any The new context + * @throws ApiError + */ + public static createContext({ + requestBody, + }: { + requestBody?: { + /** + * The user defined name of the context. + */ + name: string; + owner: + | { + /** + * The unique ID of the owner of the context. Specify either this or slug. + */ + id: string; + /** + * The type of the owner. Defaults to "organization". Accounts are only used as context owners in server. + */ + type?: "account" | "organization"; + } + | { + /** + * A string that represents an organization. Specify either this or id. Cannot be used for accounts. + */ + slug: string; + /** + * The type of owner. Defaults to "organization". Accounts are only used as context owners in server and must be specified by an id instead of a slug. + */ + type?: "organization"; + }; + }; + }): CancelablePromise<{ + /** + * The unique ID of the context. + */ + id: string; + /** + * The user defined name of the context. + */ + name: string; + /** + * The date and time the context was created. + */ + created_at: string; + }> { + return __request(OpenAPI, { + method: "POST", + url: "/context", + body: requestBody, + mediaType: "application/json", + }); + } /** * Delete a context * @returns any A confirmation message diff --git a/client/services/ProjectService.ts b/client/services/ProjectService.ts index a00488b..d9b72b0 100644 --- a/client/services/ProjectService.ts +++ b/client/services/ProjectService.ts @@ -60,39 +60,6 @@ export class ProjectService { }, }); } - /** - * Create a new checkout key - * Creates a new checkout key. This API request is only usable with a user API token. - * @returns any Error response. - * @throws ApiError - */ - public static createCheckoutKey({ - projectSlug, - requestBody, - }: { - /** - * Project slug in the form `vcs-slug/org-name/repo-name`. The `/` characters may be URL-escaped. - */ - projectSlug: string; - requestBody?: { - /** - * The type of checkout key to create. This may be either `deploy-key` or `user-key`. - */ - type: "user-key" | "deploy-key"; - }; - }): CancelablePromise<{ - message?: string; - }> { - return __request(OpenAPI, { - method: "POST", - url: "/project/{project-slug}/checkout-key", - path: { - "project-slug": projectSlug, - }, - body: requestBody, - mediaType: "application/json", - }); - } /** * Get all checkout keys * Returns a sequence of checkout keys for `:project`. @@ -143,36 +110,36 @@ export class ProjectService { }); } /** - * Delete a checkout key - * Deletes the checkout key. - * @returns any A confirmation message. + * Create a new checkout key + * Creates a new checkout key. This API request is only usable with a user API token. + * @returns any Error response. * @throws ApiError */ - public static deleteCheckoutKey({ + public static createCheckoutKey({ projectSlug, - fingerprint, + requestBody, }: { /** * Project slug in the form `vcs-slug/org-name/repo-name`. The `/` characters may be URL-escaped. */ projectSlug: string; - /** - * An SSH key fingerprint. - */ - fingerprint: string; + requestBody?: { + /** + * The type of checkout key to create. This may be either `deploy-key` or `user-key`. + */ + type: "user-key" | "deploy-key"; + }; }): CancelablePromise<{ - /** - * A human-readable message - */ - message: string; + message?: string; }> { return __request(OpenAPI, { - method: "DELETE", - url: "/project/{project-slug}/checkout-key/{fingerprint}", + method: "POST", + url: "/project/{project-slug}/checkout-key", path: { "project-slug": projectSlug, - fingerprint: fingerprint, }, + body: requestBody, + mediaType: "application/json", }); } /** @@ -224,6 +191,39 @@ export class ProjectService { }, }); } + /** + * Delete a checkout key + * Deletes the checkout key. + * @returns any A confirmation message. + * @throws ApiError + */ + public static deleteCheckoutKey({ + projectSlug, + fingerprint, + }: { + /** + * Project slug in the form `vcs-slug/org-name/repo-name`. The `/` characters may be URL-escaped. + */ + projectSlug: string; + /** + * An SSH key fingerprint. + */ + fingerprint: string; + }): CancelablePromise<{ + /** + * A human-readable message + */ + message: string; + }> { + return __request(OpenAPI, { + method: "DELETE", + url: "/project/{project-slug}/checkout-key/{fingerprint}", + path: { + "project-slug": projectSlug, + fingerprint: fingerprint, + }, + }); + } /** * List all environment variables * Returns four 'x' characters, in addition to the last four ASCII characters of the value, consistent with the display of environment variable values on the CircleCI website. diff --git a/client/services/ScheduleService.ts b/client/services/ScheduleService.ts index e7a40ea..06cd93a 100644 --- a/client/services/ScheduleService.ts +++ b/client/services/ScheduleService.ts @@ -285,33 +285,6 @@ export class ScheduleService { mediaType: "application/json", }); } - /** - * Delete a schedule - * Deletes the schedule by id. - * @returns any A confirmation message. - * @throws ApiError - */ - public static deleteScheduleById({ - scheduleId, - }: { - /** - * The unique ID of the schedule. - */ - scheduleId: string; - }): CancelablePromise<{ - /** - * A human-readable message - */ - message: string; - }> { - return __request(OpenAPI, { - method: "DELETE", - url: "/schedule/{schedule-id}", - path: { - "schedule-id": scheduleId, - }, - }); - } /** * Get a schedule * Get a schedule by id. @@ -665,4 +638,31 @@ export class ScheduleService { mediaType: "application/json", }); } + /** + * Delete a schedule + * Deletes the schedule by id. + * @returns any A confirmation message. + * @throws ApiError + */ + public static deleteScheduleById({ + scheduleId, + }: { + /** + * The unique ID of the schedule. + */ + scheduleId: string; + }): CancelablePromise<{ + /** + * A human-readable message + */ + message: string; + }> { + return __request(OpenAPI, { + method: "DELETE", + url: "/schedule/{schedule-id}", + path: { + "schedule-id": scheduleId, + }, + }); + } } diff --git a/client/services/WebhookService.ts b/client/services/WebhookService.ts index 5c768f4..dfea83c 100644 --- a/client/services/WebhookService.ts +++ b/client/services/WebhookService.ts @@ -2,6 +2,59 @@ import type { CancelablePromise } from "../core/CancelablePromise.ts"; import { OpenAPI } from "../core/OpenAPI.ts"; import { request as __request } from "../core/request.ts"; export class WebhookService { + /** + * Create a webhook + * @returns any Error response. + * @throws ApiError + */ + public static createWebhook({ + requestBody, + }: { + requestBody?: { + /** + * Name of the webhook + */ + name: string; + /** + * Events that will trigger the webhook + */ + events: Array<"workflow-completed" | "job-completed">; + /** + * URL to deliver the webhook to. Note: protocol must be included as well (only https is supported) + */ + url: string; + /** + * Whether to enforce TLS certificate verification when delivering the webhook + */ + "verify-tls": boolean; + /** + * Secret used to build an HMAC hash of the payload and passed as a header in the webhook request + */ + "signing-secret": string; + /** + * The scope in which the relevant events that will trigger webhooks + */ + scope: { + /** + * ID of the scope being used (at the moment, only project ID is supported) + */ + id: string; + /** + * Type of the scope being used + */ + type: "project"; + }; + }; + }): CancelablePromise<{ + message?: string; + }> { + return __request(OpenAPI, { + method: "POST", + url: "/webhook", + body: requestBody, + mediaType: "application/json", + }); + } /** * List webhooks * Get a list of webhook that match the given scope-type and scope-id @@ -83,56 +136,29 @@ export class WebhookService { }); } /** - * Create a webhook - * @returns any Error response. + * Delete a webhook + * @returns any A confirmation message * @throws ApiError */ - public static createWebhook({ - requestBody, + public static deleteWebhook({ + webhookId, }: { - requestBody?: { - /** - * Name of the webhook - */ - name: string; - /** - * Events that will trigger the webhook - */ - events: Array<"workflow-completed" | "job-completed">; - /** - * URL to deliver the webhook to. Note: protocol must be included as well (only https is supported) - */ - url: string; - /** - * Whether to enforce TLS certificate verification when delivering the webhook - */ - "verify-tls": boolean; - /** - * Secret used to build an HMAC hash of the payload and passed as a header in the webhook request - */ - "signing-secret": string; - /** - * The scope in which the relevant events that will trigger webhooks - */ - scope: { - /** - * ID of the scope being used (at the moment, only project ID is supported) - */ - id: string; - /** - * Type of the scope being used - */ - type: "project"; - }; - }; + /** + * ID of the webhook (UUID) + */ + webhookId: string; }): CancelablePromise<{ - message?: string; + /** + * A human-readable message + */ + message: string; }> { return __request(OpenAPI, { - method: "POST", - url: "/webhook", - body: requestBody, - mediaType: "application/json", + method: "DELETE", + url: "/webhook/{webhook-id}", + path: { + "webhook-id": webhookId, + }, }); } /** @@ -203,32 +229,6 @@ export class WebhookService { }, }); } - /** - * Delete a webhook - * @returns any A confirmation message - * @throws ApiError - */ - public static deleteWebhook({ - webhookId, - }: { - /** - * ID of the webhook (UUID) - */ - webhookId: string; - }): CancelablePromise<{ - /** - * A human-readable message - */ - message: string; - }> { - return __request(OpenAPI, { - method: "DELETE", - url: "/webhook/{webhook-id}", - path: { - "webhook-id": webhookId, - }, - }); - } /** * Update a webhook * @returns any A webhook diff --git a/swagger.json b/swagger.json index 83e1a3a..8c65b29 100644 --- a/swagger.json +++ b/swagger.json @@ -26,109 +26,6 @@ ], "paths": { "/context": { - "post": { - "summary": "Create a new context", - "tags": ["Context"], - "operationId": "createContext", - "responses": { - "200": { - "description": "The new context", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "The unique ID of the context." - }, - "name": { - "type": "string", - "description": "The user defined name of the context." - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "The date and time the context was created.", - "example": "2015-09-21T17:29:21.042Z" - } - }, - "required": ["id", "name", "created_at"], - "title": "Context" - } - } - } - }, - "default": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - } - } - }, - "description": "Error response." - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The user defined name of the context." - }, - "owner": { - "oneOf": [ - { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "The unique ID of the owner of the context. Specify either this or slug." - }, - "type": { - "enum": ["account", "organization"], - "type": "string", - "description": "The type of the owner. Defaults to \"organization\". Accounts are only used as context owners in server.", - "example": "organization" - } - }, - "required": ["id"] - }, - { - "type": "object", - "properties": { - "slug": { - "type": "string", - "description": "A string that represents an organization. Specify either this or id. Cannot be used for accounts." - }, - "type": { - "enum": ["organization"], - "type": "string", - "description": "The type of owner. Defaults to \"organization\". Accounts are only used as context owners in server and must be specified by an id instead of a slug." - } - }, - "required": ["slug"] - } - ] - } - }, - "required": ["name", "owner"] - } - } - } - } - }, "get": { "summary": "List contexts", "description": "List all contexts for an owner.", @@ -235,6 +132,109 @@ "allowEmptyValue": true } ] + }, + "post": { + "summary": "Create a new context", + "tags": ["Context"], + "operationId": "createContext", + "responses": { + "200": { + "description": "The new context", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The unique ID of the context." + }, + "name": { + "type": "string", + "description": "The user defined name of the context." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "The date and time the context was created.", + "example": "2015-09-21T17:29:21.042Z" + } + }, + "required": ["id", "name", "created_at"], + "title": "Context" + } + } + } + }, + "default": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + }, + "description": "Error response." + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The user defined name of the context." + }, + "owner": { + "oneOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The unique ID of the owner of the context. Specify either this or slug." + }, + "type": { + "enum": ["account", "organization"], + "type": "string", + "description": "The type of the owner. Defaults to \"organization\". Accounts are only used as context owners in server.", + "example": "organization" + } + }, + "required": ["id"] + }, + { + "type": "object", + "properties": { + "slug": { + "type": "string", + "description": "A string that represents an organization. Specify either this or id. Cannot be used for accounts." + }, + "type": { + "enum": ["organization"], + "type": "string", + "description": "The type of owner. Defaults to \"organization\". Accounts are only used as context owners in server and must be specified by an id instead of a slug." + } + }, + "required": ["slug"] + } + ] + } + }, + "required": ["name", "owner"] + } + } + } + } } }, "/context/{context-id}": { @@ -4065,118 +4065,14 @@ } }, "/project/{project-slug}/checkout-key": { - "post": { - "summary": "Create a new checkout key", - "description": "Creates a new checkout key. This API request is only usable with a user API token.", + "get": { + "summary": "Get all checkout keys", + "description": "Returns a sequence of checkout keys for `:project`.", "tags": ["Project"], - "operationId": "createCheckoutKey", + "operationId": "listCheckoutKeys", "responses": { - "201": { - "description": "The checkout key.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "public-key": { - "type": "string", - "description": "A public SSH key.", - "example": "ssh-rsa ..." - }, - "type": { - "enum": ["deploy-key", "github-user-key"], - "type": "string", - "description": "The type of checkout key. This may be either `deploy-key` or `github-user-key`.", - "title": "CheckoutKeyType", - "example": "deploy-key" - }, - "fingerprint": { - "type": "string", - "description": "An SSH key fingerprint.", - "example": "c9:0b:1c:4f:d5:65:56:b9:ad:88:f9:81:2b:37:74:2f" - }, - "preferred": { - "type": "boolean", - "description": "A boolean value that indicates if this key is preferred.", - "example": true - }, - "created-at": { - "type": "string", - "format": "date-time", - "description": "The date and time the checkout key was created.", - "example": "2015-09-21T17:29:21.042Z" - } - }, - "required": [ - "public-key", - "type", - "fingerprint", - "preferred", - "created-at" - ], - "title": "CheckoutKey" - } - } - } - }, - "default": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - } - } - }, - "description": "Error response." - } - }, - "parameters": [ - { - "in": "path", - "name": "project-slug", - "description": "Project slug in the form `vcs-slug/org-name/repo-name`. The `/` characters may be URL-escaped.", - "schema": { - "type": "string" - }, - "required": true, - "example": "gh/CircleCI-Public/api-preview-docs", - "allowReserved": true - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "type": { - "enum": ["user-key", "deploy-key"], - "type": "string", - "description": "The type of checkout key to create. This may be either `deploy-key` or `user-key`.", - "title": "CheckoutKeyInputType", - "example": "deploy-key" - } - }, - "required": ["type"], - "title": "CheckoutKeyInput" - } - } - } - } - }, - "get": { - "summary": "Get all checkout keys", - "description": "Returns a sequence of checkout keys for `:project`.", - "tags": ["Project"], - "operationId": "listCheckoutKeys", - "responses": { - "200": { - "description": "A sequence of checkout keys.", + "200": { + "description": "A sequence of checkout keys.", "content": { "application/json": { "schema": { @@ -4267,30 +4163,57 @@ "allowReserved": true } ] - } - }, - "/project/{project-slug}/checkout-key/{fingerprint}": { - "delete": { - "summary": "Delete a checkout key", - "description": "Deletes the checkout key.", + }, + "post": { + "summary": "Create a new checkout key", + "description": "Creates a new checkout key. This API request is only usable with a user API token.", "tags": ["Project"], - "operationId": "deleteCheckoutKey", + "operationId": "createCheckoutKey", "responses": { - "200": { - "description": "A confirmation message.", + "201": { + "description": "The checkout key.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "message": { + "public-key": { "type": "string", - "description": "A human-readable message" + "description": "A public SSH key.", + "example": "ssh-rsa ..." + }, + "type": { + "enum": ["deploy-key", "github-user-key"], + "type": "string", + "description": "The type of checkout key. This may be either `deploy-key` or `github-user-key`.", + "title": "CheckoutKeyType", + "example": "deploy-key" + }, + "fingerprint": { + "type": "string", + "description": "An SSH key fingerprint.", + "example": "c9:0b:1c:4f:d5:65:56:b9:ad:88:f9:81:2b:37:74:2f" + }, + "preferred": { + "type": "boolean", + "description": "A boolean value that indicates if this key is preferred.", + "example": true + }, + "created-at": { + "type": "string", + "format": "date-time", + "description": "The date and time the checkout key was created.", + "example": "2015-09-21T17:29:21.042Z" } }, - "required": ["message"], - "description": "message response", - "title": "MessageResponse" + "required": [ + "public-key", + "type", + "fingerprint", + "preferred", + "created-at" + ], + "title": "CheckoutKey" } } } @@ -4322,19 +4245,31 @@ "required": true, "example": "gh/CircleCI-Public/api-preview-docs", "allowReserved": true - }, - { - "in": "path", - "name": "fingerprint", - "description": "An SSH key fingerprint.", - "schema": { - "type": "string" - }, - "required": true, - "example": "c9:0b:1c:4f:d5:65:56:b9:ad:88:f9:81:2b:37:74:2f" } - ] - }, + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "enum": ["user-key", "deploy-key"], + "type": "string", + "description": "The type of checkout key to create. This may be either `deploy-key` or `user-key`.", + "title": "CheckoutKeyInputType", + "example": "deploy-key" + } + }, + "required": ["type"], + "title": "CheckoutKeyInput" + } + } + } + } + } + }, + "/project/{project-slug}/checkout-key/{fingerprint}": { "get": { "summary": "Get a checkout key", "description": "Returns an individual checkout key.", @@ -4428,6 +4363,71 @@ "example": "c9:0b:1c:4f:d5:65:56:b9:ad:88:f9:81:2b:37:74:2f" } ] + }, + "delete": { + "summary": "Delete a checkout key", + "description": "Deletes the checkout key.", + "tags": ["Project"], + "operationId": "deleteCheckoutKey", + "responses": { + "200": { + "description": "A confirmation message.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message" + } + }, + "required": ["message"], + "description": "message response", + "title": "MessageResponse" + } + } + } + }, + "default": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + }, + "description": "Error response." + } + }, + "parameters": [ + { + "in": "path", + "name": "project-slug", + "description": "Project slug in the form `vcs-slug/org-name/repo-name`. The `/` characters may be URL-escaped.", + "schema": { + "type": "string" + }, + "required": true, + "example": "gh/CircleCI-Public/api-preview-docs", + "allowReserved": true + }, + { + "in": "path", + "name": "fingerprint", + "description": "An SSH key fingerprint.", + "schema": { + "type": "string" + }, + "required": true, + "example": "c9:0b:1c:4f:d5:65:56:b9:ad:88:f9:81:2b:37:74:2f" + } + ] } }, "/project/{project-slug}/envvar": { @@ -7059,74 +7059,20 @@ } }, "/schedule/{schedule-id}": { - "delete": { - "summary": "Delete a schedule", - "description": "Deletes the schedule by id.", + "get": { + "summary": "Get a schedule", + "description": "Get a schedule by id.", "tags": ["Schedule"], - "operationId": "deleteScheduleById", + "operationId": "getScheduleById", "responses": { "200": { - "description": "A confirmation message.", + "description": "A schedule object.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "message": { - "type": "string", - "description": "A human-readable message" - } - }, - "required": ["message"], - "description": "message response", - "title": "MessageResponse" - } - } - } - }, - "default": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - } - } - }, - "description": "Error response." - } - }, - "parameters": [ - { - "in": "path", - "name": "schedule-id", - "description": "The unique ID of the schedule.", - "schema": { - "type": "string", - "format": "uuid" - }, - "required": true - } - ] - }, - "get": { - "summary": "Get a schedule", - "description": "Get a schedule by id.", - "tags": ["Schedule"], - "operationId": "getScheduleById", - "responses": { - "200": { - "description": "A schedule object.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { + "id": { "type": "string", "format": "uuid", "description": "The unique ID of the schedule." @@ -7791,39 +7737,28 @@ } } } - } - }, - "/user/{id}": { - "get": { - "summary": "User Information", - "description": "Provides information about the user with the given ID.", - "tags": ["User"], - "operationId": "getUser", + }, + "delete": { + "summary": "Delete a schedule", + "description": "Deletes the schedule by id.", + "tags": ["Schedule"], + "operationId": "deleteScheduleById", "responses": { "200": { - "description": "User login information.", + "description": "A confirmation message.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "The unique ID of the user." - }, - "login": { - "type": "string", - "description": "The login information for the user on the VCS.", - "title": "Login" - }, - "name": { + "message": { "type": "string", - "description": "The name of the user." + "description": "A human-readable message" } }, - "required": ["id", "login", "name"], - "title": "User" + "required": ["message"], + "description": "message response", + "title": "MessageResponse" } } } @@ -7847,8 +7782,8 @@ "parameters": [ { "in": "path", - "name": "id", - "description": "The unique ID of the user.", + "name": "schedule-id", + "description": "The unique ID of the schedule.", "schema": { "type": "string", "format": "uuid" @@ -7858,105 +7793,37 @@ ] } }, - "/webhook": { + "/user/{id}": { "get": { - "summary": "List webhooks", - "description": "Get a list of webhook that match the given scope-type and scope-id", - "tags": ["Webhook"], - "operationId": "getWebhooks", + "summary": "User Information", + "description": "Provides information about the user with the given ID.", + "tags": ["User"], + "operationId": "getUser", "responses": { "200": { - "description": "A list of webhooks", + "description": "User login information.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "URL to deliver the webhook to. Note: protocol must be included as well (only https is supported)" - }, - "verify-tls": { - "type": "boolean", - "description": "Whether to enforce TLS certificate verification when delivering the webhook" - }, - "id": { - "type": "string", - "format": "uuid", - "description": "The unique ID of the webhook" - }, - "signing-secret": { - "type": "string", - "description": "Masked value of the secret used to build an HMAC hash of the payload and passed as a header in the webhook request" - }, - "updated-at": { - "type": "string", - "format": "date-time", - "description": "The date and time the webhook was last updated.", - "example": "2015-09-21T17:29:21.042Z" - }, - "name": { - "type": "string", - "description": "Name of the webhook" - }, - "created-at": { - "type": "string", - "format": "date-time", - "description": "The date and time the webhook was created.", - "example": "2015-09-21T17:29:21.042Z" - }, - "scope": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "ID of the scope being used (at the moment, only project ID is supported)" - }, - "type": { - "type": "string", - "description": "Type of the scope being used" - } - }, - "required": ["id", "type"], - "description": "The scope in which the relevant events that will trigger webhooks" - }, - "events": { - "type": "array", - "items": { - "enum": ["workflow-completed", "job-completed"], - "type": "string" - }, - "description": "Events that will trigger the webhook" - } - }, - "required": [ - "id", - "scope", - "name", - "events", - "url", - "verify-tls", - "signing-secret", - "created-at", - "updated-at" - ], - "title": "Webhook" - } + "id": { + "type": "string", + "format": "uuid", + "description": "The unique ID of the user." }, - "next_page_token": { + "login": { "type": "string", - "x-nullable": true, - "description": "A token to pass as a `page-token` query parameter to return the next page of results." + "description": "The login information for the user on the VCS.", + "title": "Login" + }, + "name": { + "type": "string", + "description": "The name of the user." } }, - "required": ["items", "next_page_token"], - "description": "A list of webhooks" + "required": ["id", "login", "name"], + "title": "User" } } } @@ -7979,27 +7846,19 @@ }, "parameters": [ { - "in": "query", - "name": "scope-id", - "description": "ID of the scope being used (at the moment, only project ID is supported)", + "in": "path", + "name": "id", + "description": "The unique ID of the user.", "schema": { "type": "string", "format": "uuid" }, "required": true - }, - { - "in": "query", - "name": "scope-type", - "description": "Type of the scope being used", - "schema": { - "type": "string", - "enum": ["project"] - }, - "required": true } ] - }, + } + }, + "/webhook": { "post": { "summary": "Create a webhook", "tags": ["Webhook"], @@ -8163,9 +8022,203 @@ } } } + }, + "get": { + "summary": "List webhooks", + "description": "Get a list of webhook that match the given scope-type and scope-id", + "tags": ["Webhook"], + "operationId": "getWebhooks", + "responses": { + "200": { + "description": "A list of webhooks", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "URL to deliver the webhook to. Note: protocol must be included as well (only https is supported)" + }, + "verify-tls": { + "type": "boolean", + "description": "Whether to enforce TLS certificate verification when delivering the webhook" + }, + "id": { + "type": "string", + "format": "uuid", + "description": "The unique ID of the webhook" + }, + "signing-secret": { + "type": "string", + "description": "Masked value of the secret used to build an HMAC hash of the payload and passed as a header in the webhook request" + }, + "updated-at": { + "type": "string", + "format": "date-time", + "description": "The date and time the webhook was last updated.", + "example": "2015-09-21T17:29:21.042Z" + }, + "name": { + "type": "string", + "description": "Name of the webhook" + }, + "created-at": { + "type": "string", + "format": "date-time", + "description": "The date and time the webhook was created.", + "example": "2015-09-21T17:29:21.042Z" + }, + "scope": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "ID of the scope being used (at the moment, only project ID is supported)" + }, + "type": { + "type": "string", + "description": "Type of the scope being used" + } + }, + "required": ["id", "type"], + "description": "The scope in which the relevant events that will trigger webhooks" + }, + "events": { + "type": "array", + "items": { + "enum": ["workflow-completed", "job-completed"], + "type": "string" + }, + "description": "Events that will trigger the webhook" + } + }, + "required": [ + "id", + "scope", + "name", + "events", + "url", + "verify-tls", + "signing-secret", + "created-at", + "updated-at" + ], + "title": "Webhook" + } + }, + "next_page_token": { + "type": "string", + "x-nullable": true, + "description": "A token to pass as a `page-token` query parameter to return the next page of results." + } + }, + "required": ["items", "next_page_token"], + "description": "A list of webhooks" + } + } + } + }, + "default": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + }, + "description": "Error response." + } + }, + "parameters": [ + { + "in": "query", + "name": "scope-id", + "description": "ID of the scope being used (at the moment, only project ID is supported)", + "schema": { + "type": "string", + "format": "uuid" + }, + "required": true + }, + { + "in": "query", + "name": "scope-type", + "description": "Type of the scope being used", + "schema": { + "type": "string", + "enum": ["project"] + }, + "required": true + } + ] } }, "/webhook/{webhook-id}": { + "delete": { + "summary": "Delete a webhook", + "tags": ["Webhook"], + "operationId": "deleteWebhook", + "responses": { + "200": { + "description": "A confirmation message", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message" + } + }, + "required": ["message"], + "description": "message response", + "title": "MessageResponse" + } + } + } + }, + "default": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + }, + "description": "Error response." + } + }, + "parameters": [ + { + "in": "path", + "name": "webhook-id", + "description": "ID of the webhook (UUID)", + "schema": { + "type": "string", + "format": "uuid" + }, + "required": true + } + ] + }, "get": { "summary": "Get a webhook", "description": "Get a webhook by id.", @@ -8282,59 +8335,6 @@ } ] }, - "delete": { - "summary": "Delete a webhook", - "tags": ["Webhook"], - "operationId": "deleteWebhook", - "responses": { - "200": { - "description": "A confirmation message", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message" - } - }, - "required": ["message"], - "description": "message response", - "title": "MessageResponse" - } - } - } - }, - "default": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - } - } - }, - "description": "Error response." - } - }, - "parameters": [ - { - "in": "path", - "name": "webhook-id", - "description": "ID of the webhook (UUID)", - "schema": { - "type": "string", - "format": "uuid" - }, - "required": true - } - ] - }, "put": { "summary": "Update a webhook", "tags": ["Webhook"],