From 96077baf3877896c4dafb1ea907ca7e53ffcabfa Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 23 Sep 2022 00:03:35 +0000 Subject: [PATCH] daily update 20220923T000335 --- client/services/ContextService.ts | 140 +-- client/services/PipelineService.ts | 82 +- client/services/ProjectService.ts | 160 +-- client/services/ScheduleService.ts | 138 +-- client/services/WebhookService.ts | 170 ++-- swagger.json | 1472 ++++++++++++++-------------- 6 files changed, 1081 insertions(+), 1081 deletions(-) diff --git a/client/services/ContextService.ts b/client/services/ContextService.ts index b102a0c..bf8770a 100644 --- a/client/services/ContextService.ts +++ b/client/services/ContextService.ts @@ -2,6 +2,62 @@ 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. @@ -62,59 +118,29 @@ export class ContextService { }); } /** - * Create a new context - * @returns any The new context + * Delete a context + * @returns any A confirmation message * @throws ApiError */ - public static createContext({ - requestBody, + public static deleteContext({ + contextId, }: { - 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. + * ID of the context (UUID) */ - name: string; + contextId: string; + }): CancelablePromise<{ /** - * The date and time the context was created. + * A human-readable message */ - created_at: string; + message: string; }> { return __request(OpenAPI, { - method: "POST", - url: "/context", - body: requestBody, - mediaType: "application/json", + method: "DELETE", + url: "/context/{context-id}", + path: { + "context-id": contextId, + }, }); } /** @@ -152,32 +178,6 @@ export class ContextService { }, }); } - /** - * Delete a context - * @returns any A confirmation message - * @throws ApiError - */ - public static deleteContext({ - contextId, - }: { - /** - * ID of the context (UUID) - */ - contextId: string; - }): CancelablePromise<{ - /** - * A human-readable message - */ - message: string; - }> { - return __request(OpenAPI, { - method: "DELETE", - url: "/context/{context-id}", - path: { - "context-id": contextId, - }, - }); - } /** * List environment variables * List information about environment variables in a context, not including their values. diff --git a/client/services/PipelineService.ts b/client/services/PipelineService.ts index 0b740a4..dc48a65 100644 --- a/client/services/PipelineService.ts +++ b/client/services/PipelineService.ts @@ -469,6 +469,47 @@ export class PipelineService { }, }); } + /** + * Trigger a new pipeline + * Triggers a new pipeline on the project. + * @returns any Error response. + * @throws ApiError + */ + public static triggerPipeline({ + projectSlug, + requestBody, + }: { + /** + * Project slug in the form `vcs-slug/org-name/repo-name`. The `/` characters may be URL-escaped. + */ + projectSlug: string; + requestBody?: { + /** + * The branch where the pipeline ran. The HEAD commit on this branch was used for the pipeline. Note that `branch` and `tag` are mutually exclusive. To trigger a pipeline for a PR by number use `pull//head` for the PR ref or `pull//merge` for the merge ref (GitHub only). + */ + branch?: string; + /** + * The tag used by the pipeline. The commit that this tag points to was used for the pipeline. Note that `branch` and `tag` are mutually exclusive. + */ + tag?: string; + /** + * An object containing pipeline parameters and their values. + */ + parameters?: Record; + }; + }): CancelablePromise<{ + message?: string; + }> { + return __request(OpenAPI, { + method: "POST", + url: "/project/{project-slug}/pipeline", + path: { + "project-slug": projectSlug, + }, + body: requestBody, + mediaType: "application/json", + }); + } /** * Get all pipelines * Returns all pipelines for this project. @@ -632,47 +673,6 @@ export class PipelineService { }, }); } - /** - * Trigger a new pipeline - * Triggers a new pipeline on the project. - * @returns any Error response. - * @throws ApiError - */ - public static triggerPipeline({ - projectSlug, - requestBody, - }: { - /** - * Project slug in the form `vcs-slug/org-name/repo-name`. The `/` characters may be URL-escaped. - */ - projectSlug: string; - requestBody?: { - /** - * The branch where the pipeline ran. The HEAD commit on this branch was used for the pipeline. Note that `branch` and `tag` are mutually exclusive. To trigger a pipeline for a PR by number use `pull//head` for the PR ref or `pull//merge` for the merge ref (GitHub only). - */ - branch?: string; - /** - * The tag used by the pipeline. The commit that this tag points to was used for the pipeline. Note that `branch` and `tag` are mutually exclusive. - */ - tag?: string; - /** - * An object containing pipeline parameters and their values. - */ - parameters?: Record; - }; - }): CancelablePromise<{ - message?: string; - }> { - return __request(OpenAPI, { - method: "POST", - url: "/project/{project-slug}/pipeline", - path: { - "project-slug": projectSlug, - }, - body: requestBody, - mediaType: "application/json", - }); - } /** * Get your pipelines * Returns a sequence of all pipelines for this project triggered by the user. diff --git a/client/services/ProjectService.ts b/client/services/ProjectService.ts index fbf7f39..8fb81bd 100644 --- a/client/services/ProjectService.ts +++ b/client/services/ProjectService.ts @@ -60,6 +60,39 @@ 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`. @@ -110,64 +143,47 @@ 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. + * Get a checkout key + * Returns an individual checkout key. + * @returns any The checkout key. * @throws ApiError */ - public static createCheckoutKey({ + public static getCheckoutKey({ projectSlug, - requestBody, + fingerprint, }: { /** * 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"; - }; + /** + * An SSH key fingerprint. + */ + fingerprint: string; }): CancelablePromise<{ - message?: string; - }> { - return __request(OpenAPI, { - method: "POST", - url: "/project/{project-slug}/checkout-key", - path: { - "project-slug": projectSlug, - }, - body: requestBody, - mediaType: "application/json", - }); - } - /** - * 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. + * A public SSH key. */ - projectSlug: string; + "public-key": string; + /** + * The type of checkout key. This may be either `deploy-key` or `github-user-key`. + */ + type: "deploy-key" | "github-user-key"; /** * An SSH key fingerprint. */ fingerprint: string; - }): CancelablePromise<{ /** - * A human-readable message + * A boolean value that indicates if this key is preferred. */ - message: string; + preferred: boolean; + /** + * The date and time the checkout key was created. + */ + "created-at": string; }> { return __request(OpenAPI, { - method: "DELETE", + method: "GET", url: "/project/{project-slug}/checkout-key/{fingerprint}", path: { "project-slug": projectSlug, @@ -176,12 +192,12 @@ export class ProjectService { }); } /** - * Get a checkout key - * Returns an individual checkout key. - * @returns any The checkout key. + * Delete a checkout key + * Deletes the checkout key. + * @returns any A confirmation message. * @throws ApiError */ - public static getCheckoutKey({ + public static deleteCheckoutKey({ projectSlug, fingerprint, }: { @@ -195,28 +211,12 @@ export class ProjectService { fingerprint: string; }): CancelablePromise<{ /** - * A public SSH key. - */ - "public-key": string; - /** - * The type of checkout key. This may be either `deploy-key` or `github-user-key`. - */ - type: "deploy-key" | "github-user-key"; - /** - * An SSH key fingerprint. - */ - fingerprint: string; - /** - * A boolean value that indicates if this key is preferred. - */ - preferred: boolean; - /** - * The date and time the checkout key was created. + * A human-readable message */ - "created-at": string; + message: string; }> { return __request(OpenAPI, { - method: "GET", + method: "DELETE", url: "/project/{project-slug}/checkout-key/{fingerprint}", path: { "project-slug": projectSlug, @@ -299,12 +299,12 @@ export class ProjectService { }); } /** - * Get a masked environment variable - * Returns the masked value of environment variable :name. - * @returns any The environment variable. + * Delete an environment variable + * Deletes the environment variable named :name. + * @returns any A confirmation message. * @throws ApiError */ - public static getEnvVar({ + public static deleteEnvVar({ projectSlug, name, }: { @@ -318,16 +318,12 @@ export class ProjectService { name: string; }): CancelablePromise<{ /** - * The name of the environment variable. - */ - name: string; - /** - * The value of the environment variable. + * A human-readable message */ - value: string; + message: string; }> { return __request(OpenAPI, { - method: "GET", + method: "DELETE", url: "/project/{project-slug}/envvar/{name}", path: { "project-slug": projectSlug, @@ -336,12 +332,12 @@ export class ProjectService { }); } /** - * Delete an environment variable - * Deletes the environment variable named :name. - * @returns any A confirmation message. + * Get a masked environment variable + * Returns the masked value of environment variable :name. + * @returns any The environment variable. * @throws ApiError */ - public static deleteEnvVar({ + public static getEnvVar({ projectSlug, name, }: { @@ -355,12 +351,16 @@ export class ProjectService { name: string; }): CancelablePromise<{ /** - * A human-readable message + * The name of the environment variable. */ - message: string; + name: string; + /** + * The value of the environment variable. + */ + value: string; }> { return __request(OpenAPI, { - method: "DELETE", + method: "GET", url: "/project/{project-slug}/envvar/{name}", path: { "project-slug": projectSlug, diff --git a/client/services/ScheduleService.ts b/client/services/ScheduleService.ts index a5d0de3..e7a40ea 100644 --- a/client/services/ScheduleService.ts +++ b/client/services/ScheduleService.ts @@ -313,77 +313,18 @@ export class ScheduleService { }); } /** - * Update a schedule - * Updates a schedule and returns the updated schedule. + * Get a schedule + * Get a schedule by id. * @returns any A schedule object. * @throws ApiError */ - public static updateSchedule({ + public static getScheduleById({ scheduleId, - requestBody, }: { /** * The unique ID of the schedule. */ scheduleId: string; - requestBody?: { - /** - * Description of the schedule. - */ - description?: string; - /** - * Name of the schedule. - */ - name?: string; - /** - * Timetable that specifies when a schedule triggers. - */ - timetable?: { - /** - * Number of times a schedule triggers per hour, value must be between 1 and 60 - */ - "per-hour"?: number; - /** - * Hours in a day in which the schedule triggers. - */ - "hours-of-day"?: Array; - /** - * Days in a week in which the schedule triggers. - */ - "days-of-week"?: Array< - "TUE" | "SAT" | "SUN" | "MON" | "THU" | "WED" | "FRI" - >; - /** - * Days in a month in which the schedule triggers. This is mutually exclusive with days in a week. - */ - "days-of-month"?: Array; - /** - * Months in which the schedule triggers. - */ - months?: Array< - | "MAR" - | "NOV" - | "DEC" - | "JUN" - | "MAY" - | "OCT" - | "FEB" - | "APR" - | "SEP" - | "AUG" - | "JAN" - | "JUL" - >; - }; - /** - * The attribution-actor of the scheduled pipeline. - */ - "attribution-actor"?: "current" | "system"; - /** - * Pipeline parameters represented as key-value pairs. Must contain branch or tag. - */ - parameters?: Record; - }; }): CancelablePromise<{ /** * The unique ID of the schedule. @@ -510,28 +451,85 @@ export class ScheduleService { description: string; }> { return __request(OpenAPI, { - method: "PATCH", + method: "GET", url: "/schedule/{schedule-id}", path: { "schedule-id": scheduleId, }, - body: requestBody, - mediaType: "application/json", }); } /** - * Get a schedule - * Get a schedule by id. + * Update a schedule + * Updates a schedule and returns the updated schedule. * @returns any A schedule object. * @throws ApiError */ - public static getScheduleById({ + public static updateSchedule({ scheduleId, + requestBody, }: { /** * The unique ID of the schedule. */ scheduleId: string; + requestBody?: { + /** + * Description of the schedule. + */ + description?: string; + /** + * Name of the schedule. + */ + name?: string; + /** + * Timetable that specifies when a schedule triggers. + */ + timetable?: { + /** + * Number of times a schedule triggers per hour, value must be between 1 and 60 + */ + "per-hour"?: number; + /** + * Hours in a day in which the schedule triggers. + */ + "hours-of-day"?: Array; + /** + * Days in a week in which the schedule triggers. + */ + "days-of-week"?: Array< + "TUE" | "SAT" | "SUN" | "MON" | "THU" | "WED" | "FRI" + >; + /** + * Days in a month in which the schedule triggers. This is mutually exclusive with days in a week. + */ + "days-of-month"?: Array; + /** + * Months in which the schedule triggers. + */ + months?: Array< + | "MAR" + | "NOV" + | "DEC" + | "JUN" + | "MAY" + | "OCT" + | "FEB" + | "APR" + | "SEP" + | "AUG" + | "JAN" + | "JUL" + >; + }; + /** + * The attribution-actor of the scheduled pipeline. + */ + "attribution-actor"?: "current" | "system"; + /** + * Pipeline parameters represented as key-value pairs. Must contain branch or tag. + */ + parameters?: Record; + }; }): CancelablePromise<{ /** * The unique ID of the schedule. @@ -658,11 +656,13 @@ export class ScheduleService { description: string; }> { return __request(OpenAPI, { - method: "GET", + method: "PATCH", url: "/schedule/{schedule-id}", path: { "schedule-id": scheduleId, }, + body: requestBody, + mediaType: "application/json", }); } } diff --git a/client/services/WebhookService.ts b/client/services/WebhookService.ts index 36e14c2..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 @@ -82,59 +135,6 @@ 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", - }); - } /** * Delete a webhook * @returns any A confirmation message @@ -162,40 +162,18 @@ export class WebhookService { }); } /** - * Update a webhook + * Get a webhook + * Get a webhook by id. * @returns any A webhook * @throws ApiError */ - public static updateWebhook({ + public static getWebhookById({ webhookId, - requestBody, }: { /** * ID of the webhook (UUID) */ webhookId: string; - 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; - /** - * Secret used to build an HMAC hash of the payload and passed as a header in the webhook request - */ - "signing-secret"?: string; - /** - * Whether to enforce TLS certificate verification when delivering the webhook - */ - "verify-tls"?: boolean; - }; }): CancelablePromise<{ /** * URL to deliver the webhook to. Note: protocol must be included as well (only https is supported) @@ -244,28 +222,48 @@ export class WebhookService { events: Array<"workflow-completed" | "job-completed">; }> { return __request(OpenAPI, { - method: "PUT", + method: "GET", url: "/webhook/{webhook-id}", path: { "webhook-id": webhookId, }, - body: requestBody, - mediaType: "application/json", }); } /** - * Get a webhook - * Get a webhook by id. + * Update a webhook * @returns any A webhook * @throws ApiError */ - public static getWebhookById({ + public static updateWebhook({ webhookId, + requestBody, }: { /** * ID of the webhook (UUID) */ webhookId: string; + 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; + /** + * Secret used to build an HMAC hash of the payload and passed as a header in the webhook request + */ + "signing-secret"?: string; + /** + * Whether to enforce TLS certificate verification when delivering the webhook + */ + "verify-tls"?: boolean; + }; }): CancelablePromise<{ /** * URL to deliver the webhook to. Note: protocol must be included as well (only https is supported) @@ -314,11 +312,13 @@ export class WebhookService { events: Array<"workflow-completed" | "job-completed">; }> { return __request(OpenAPI, { - method: "GET", + method: "PUT", url: "/webhook/{webhook-id}", path: { "webhook-id": webhookId, }, + body: requestBody, + mediaType: "application/json", }); } } diff --git a/swagger.json b/swagger.json index 47c8198..d1f22a1 100644 --- a/swagger.json +++ b/swagger.json @@ -26,6 +26,109 @@ ], "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.", @@ -132,37 +235,29 @@ "allowEmptyValue": true } ] - }, - "post": { - "summary": "Create a new context", + } + }, + "/context/{context-id}": { + "delete": { + "summary": "Delete a context", "tags": ["Context"], - "operationId": "createContext", + "operationId": "deleteContext", "responses": { "200": { - "description": "The new context", + "description": "A confirmation message", "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": { + "message": { "type": "string", - "format": "date-time", - "description": "The date and time the context was created.", - "example": "2015-09-21T17:29:21.042Z" + "description": "A human-readable message" } }, - "required": ["id", "name", "created_at"], - "title": "Context" + "required": ["message"], + "description": "message response", + "title": "MessageResponse" } } } @@ -183,61 +278,19 @@ "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"] - } - } + "parameters": [ + { + "in": "path", + "name": "context-id", + "description": "ID of the context (UUID)", + "schema": { + "type": "string", + "format": "uuid" + }, + "required": true } - } - } - }, - "/context/{context-id}": { + ] + }, "get": { "summary": "Get a context", "description": "Returns basic information about a context.", @@ -301,59 +354,6 @@ "required": true } ] - }, - "delete": { - "summary": "Delete a context", - "tags": ["Context"], - "operationId": "deleteContext", - "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": "context-id", - "description": "ID of the context (UUID)", - "schema": { - "type": "string", - "format": "uuid" - }, - "required": true - } - ] } }, "/context/{context-id}/environment-variable": { @@ -4065,105 +4065,6 @@ } }, "/project/{project-slug}/checkout-key": { - "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.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "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" - } - }, - "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"], - "title": "CheckoutKeyListResponse" - } - } - } - }, - "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 - } - ] - }, "post": { "summary": "Create a new checkout key", "description": "Creates a new checkout key. This API request is only usable with a user API token.", @@ -4267,30 +4168,72 @@ } } } - } - }, - "/project/{project-slug}/checkout-key/{fingerprint}": { - "delete": { - "summary": "Delete a checkout key", - "description": "Deletes the checkout key.", + }, + "get": { + "summary": "Get all checkout keys", + "description": "Returns a sequence of checkout keys for `:project`.", "tags": ["Project"], - "operationId": "deleteCheckoutKey", + "operationId": "listCheckoutKeys", "responses": { "200": { - "description": "A confirmation message.", + "description": "A sequence of checkout keys.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "message": { + "items": { + "type": "array", + "items": { + "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" + } + }, + "next_page_token": { "type": "string", - "description": "A human-readable message" + "x-nullable": true, + "description": "A token to pass as a `page-token` query parameter to return the next page of results." } }, - "required": ["message"], - "description": "message response", - "title": "MessageResponse" + "required": ["items", "next_page_token"], + "title": "CheckoutKeyListResponse" } } } @@ -4322,19 +4265,11 @@ "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}/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": { @@ -4591,32 +4591,27 @@ } }, "/project/{project-slug}/envvar/{name}": { - "get": { - "summary": "Get a masked environment variable", - "description": "Returns the masked value of environment variable :name.", + "delete": { + "summary": "Delete an environment variable", + "description": "Deletes the environment variable named :name.", "tags": ["Project"], - "operationId": "getEnvVar", + "operationId": "deleteEnvVar", "responses": { "200": { - "description": "The environment variable.", + "description": "A confirmation message.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "name": { + "message": { "type": "string", - "description": "The name of the environment variable.", - "example": "foo" - }, - "value": { - "type": "string", - "description": "The value of the environment variable.", - "example": "xxxx1234" + "description": "A human-readable message" } }, - "required": ["name", "value"], - "title": "EnvironmentVariablePair" + "required": ["message"], + "description": "message response", + "title": "MessageResponse" } } } @@ -4661,27 +4656,32 @@ } ] }, - "delete": { - "summary": "Delete an environment variable", - "description": "Deletes the environment variable named :name.", + "get": { + "summary": "Get a masked environment variable", + "description": "Returns the masked value of environment variable :name.", "tags": ["Project"], - "operationId": "deleteEnvVar", + "operationId": "getEnvVar", "responses": { "200": { - "description": "A confirmation message.", + "description": "The environment variable.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "message": { + "name": { "type": "string", - "description": "A human-readable message" + "description": "The name of the environment variable.", + "example": "foo" + }, + "value": { + "type": "string", + "description": "The value of the environment variable.", + "example": "xxxx1234" } }, - "required": ["message"], - "description": "message response", - "title": "MessageResponse" + "required": ["name", "value"], + "title": "EnvironmentVariablePair" } } } @@ -5077,6 +5077,129 @@ } }, "/project/{project-slug}/pipeline": { + "post": { + "summary": "Trigger a new pipeline", + "description": "Triggers a new pipeline on the project.", + "tags": ["Pipeline"], + "operationId": "triggerPipeline", + "responses": { + "201": { + "description": "The created pipeline.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The unique ID of the pipeline.", + "example": "5034460f-c7c4-4c43-9457-de07e2029e7b" + }, + "state": { + "enum": [ + "created", + "errored", + "setup-pending", + "setup", + "pending" + ], + "type": "string", + "description": "The current state of the pipeline." + }, + "number": { + "type": "integer", + "format": "int64", + "description": "The number of the pipeline.", + "example": "25" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "The date and time the pipeline was created." + } + }, + "required": ["id", "state", "number", "created_at"], + "description": "A pipeline creation response.", + "title": "PipelineCreation" + } + } + } + }, + "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": { + "branch": { + "type": "string", + "description": "The branch where the pipeline ran. The HEAD commit on this branch was used for the pipeline. Note that `branch` and `tag` are mutually exclusive. To trigger a pipeline for a PR by number use `pull//head` for the PR ref or `pull//merge` for the merge ref (GitHub only).", + "example": "feature/design-new-api" + }, + "tag": { + "type": "string", + "description": "The tag used by the pipeline. The commit that this tag points to was used for the pipeline. Note that `branch` and `tag` are mutually exclusive.", + "example": "v3.1.4159" + }, + "parameters": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "description": "An object containing pipeline parameters and their values.", + "example": { + "deploy_prod": true + } + } + }, + "x-nullable": true, + "description": "The information you can supply when triggering a pipeline.", + "title": "TriggerPipelineParameters" + } + } + } + } + }, "get": { "summary": "Get all pipelines", "description": "Returns all pipelines for this project.", @@ -5373,149 +5496,26 @@ "allowEmptyValue": true } ] - }, - "post": { - "summary": "Trigger a new pipeline", - "description": "Triggers a new pipeline on the project.", + } + }, + "/project/{project-slug}/pipeline/mine": { + "get": { + "summary": "Get your pipelines", + "description": "Returns a sequence of all pipelines for this project triggered by the user.", "tags": ["Pipeline"], - "operationId": "triggerPipeline", + "operationId": "listMyPipelines", "responses": { - "201": { - "description": "The created pipeline.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "The unique ID of the pipeline.", - "example": "5034460f-c7c4-4c43-9457-de07e2029e7b" - }, - "state": { - "enum": [ - "created", - "errored", - "setup-pending", - "setup", - "pending" - ], - "type": "string", - "description": "The current state of the pipeline." - }, - "number": { - "type": "integer", - "format": "int64", - "description": "The number of the pipeline.", - "example": "25" - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "The date and time the pipeline was created." - } - }, - "required": ["id", "state", "number", "created_at"], - "description": "A pipeline creation response.", - "title": "PipelineCreation" + "200": { + "description": "A sequence of pipelines.", + "links": { + "NextPipelinePage": { + "operationId": "listMyPipelines", + "parameters": { + "project-slug": "$request.path.project-slug", + "page-token": "$response.body#/next_page_token" } } - } - }, - "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": { - "branch": { - "type": "string", - "description": "The branch where the pipeline ran. The HEAD commit on this branch was used for the pipeline. Note that `branch` and `tag` are mutually exclusive. To trigger a pipeline for a PR by number use `pull//head` for the PR ref or `pull//merge` for the merge ref (GitHub only).", - "example": "feature/design-new-api" - }, - "tag": { - "type": "string", - "description": "The tag used by the pipeline. The commit that this tag points to was used for the pipeline. Note that `branch` and `tag` are mutually exclusive.", - "example": "v3.1.4159" - }, - "parameters": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string" - }, - { - "type": "boolean" - } - ] - }, - "description": "An object containing pipeline parameters and their values.", - "example": { - "deploy_prod": true - } - } - }, - "x-nullable": true, - "description": "The information you can supply when triggering a pipeline.", - "title": "TriggerPipelineParameters" - } - } - } - } - } - }, - "/project/{project-slug}/pipeline/mine": { - "get": { - "summary": "Get your pipelines", - "description": "Returns a sequence of all pipelines for this project triggered by the user.", - "tags": ["Pipeline"], - "operationId": "listMyPipelines", - "responses": { - "200": { - "description": "A sequence of pipelines.", - "links": { - "NextPipelinePage": { - "operationId": "listMyPipelines", - "parameters": { - "project-slug": "$request.path.project-slug", - "page-token": "$response.body#/next_page_token" - } - } - }, + }, "content": { "application/json": { "schema": { @@ -7113,11 +7113,11 @@ } ] }, - "patch": { - "summary": "Update a schedule", - "description": "Updates a schedule and returns the updated schedule.", + "get": { + "summary": "Get a schedule", + "description": "Get a schedule by id.", "tags": ["Schedule"], - "operationId": "updateSchedule", + "operationId": "getScheduleById", "responses": { "200": { "description": "A schedule object.", @@ -7392,130 +7392,13 @@ }, "required": true } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "description": { - "type": "string", - "x-nullable": true, - "description": "Description of the schedule." - }, - "name": { - "type": "string", - "description": "Name of the schedule." - }, - "timetable": { - "type": "object", - "properties": { - "per-hour": { - "type": "integer", - "format": "integer", - "description": "Number of times a schedule triggers per hour, value must be between 1 and 60" - }, - "hours-of-day": { - "type": "array", - "items": { - "type": "integer", - "format": "integer", - "description": "Hour in a day in UTC, value must be between 0 and 24" - }, - "description": "Hours in a day in which the schedule triggers." - }, - "days-of-week": { - "type": "array", - "items": { - "enum": [ - "TUE", - "SAT", - "SUN", - "MON", - "THU", - "WED", - "FRI" - ], - "type": "string", - "description": "Day in a week, in three letters format" - }, - "description": "Days in a week in which the schedule triggers." - }, - "days-of-month": { - "type": "array", - "items": { - "type": "integer", - "format": "integer", - "description": "Day in a month, between 1 and 31." - }, - "description": "Days in a month in which the schedule triggers. This is mutually exclusive with days in a week." - }, - "months": { - "type": "array", - "items": { - "enum": [ - "MAR", - "NOV", - "DEC", - "JUN", - "MAY", - "OCT", - "FEB", - "APR", - "SEP", - "AUG", - "JAN", - "JUL" - ], - "type": "string", - "description": "Month, in three letters format." - }, - "description": "Months in which the schedule triggers." - } - }, - "description": "Timetable that specifies when a schedule triggers." - }, - "attribution-actor": { - "enum": ["current", "system"], - "type": "string", - "description": "The attribution-actor of the scheduled pipeline.", - "example": "current" - }, - "parameters": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string" - }, - { - "type": "boolean" - } - ] - }, - "description": "Pipeline parameters represented as key-value pairs. Must contain branch or tag.", - "example": { - "deploy_prod": true, - "branch": "feature/design-new-api" - } - } - }, - "description": "The parameters for an update schedule request", - "title": "UpdateScheduleParameters" - } - } - } - } + ] }, - "get": { - "summary": "Get a schedule", - "description": "Get a schedule by id.", + "patch": { + "summary": "Update a schedule", + "description": "Updates a schedule and returns the updated schedule.", "tags": ["Schedule"], - "operationId": "getScheduleById", + "operationId": "updateSchedule", "responses": { "200": { "description": "A schedule object.", @@ -7790,7 +7673,124 @@ }, "required": true } - ] + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "description": { + "type": "string", + "x-nullable": true, + "description": "Description of the schedule." + }, + "name": { + "type": "string", + "description": "Name of the schedule." + }, + "timetable": { + "type": "object", + "properties": { + "per-hour": { + "type": "integer", + "format": "integer", + "description": "Number of times a schedule triggers per hour, value must be between 1 and 60" + }, + "hours-of-day": { + "type": "array", + "items": { + "type": "integer", + "format": "integer", + "description": "Hour in a day in UTC, value must be between 0 and 24" + }, + "description": "Hours in a day in which the schedule triggers." + }, + "days-of-week": { + "type": "array", + "items": { + "enum": [ + "TUE", + "SAT", + "SUN", + "MON", + "THU", + "WED", + "FRI" + ], + "type": "string", + "description": "Day in a week, in three letters format" + }, + "description": "Days in a week in which the schedule triggers." + }, + "days-of-month": { + "type": "array", + "items": { + "type": "integer", + "format": "integer", + "description": "Day in a month, between 1 and 31." + }, + "description": "Days in a month in which the schedule triggers. This is mutually exclusive with days in a week." + }, + "months": { + "type": "array", + "items": { + "enum": [ + "MAR", + "NOV", + "DEC", + "JUN", + "MAY", + "OCT", + "FEB", + "APR", + "SEP", + "AUG", + "JAN", + "JUL" + ], + "type": "string", + "description": "Month, in three letters format." + }, + "description": "Months in which the schedule triggers." + } + }, + "description": "Timetable that specifies when a schedule triggers." + }, + "attribution-actor": { + "enum": ["current", "system"], + "type": "string", + "description": "The attribution-actor of the scheduled pipeline.", + "example": "current" + }, + "parameters": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "description": "Pipeline parameters represented as key-value pairs. Must contain branch or tag.", + "example": { + "deploy_prod": true, + "branch": "feature/design-new-api" + } + } + }, + "description": "The parameters for an update schedule request", + "title": "UpdateScheduleParameters" + } + } + } + } } }, "/user/{id}": { @@ -7819,144 +7819,11 @@ }, "name": { "type": "string", - "description": "The name of the user." - } - }, - "required": ["id", "login", "name"], - "title": "User" - } - } - } - }, - "default": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - } - } - }, - "description": "Error response." - } - }, - "parameters": [ - { - "in": "path", - "name": "id", - "description": "The unique ID of the user.", - "schema": { - "type": "string", - "format": "uuid" - }, - "required": true - } - ] - } - }, - "/webhook": { - "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." + "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,6 +8022,147 @@ } } } + }, + "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}": { @@ -8219,10 +8219,11 @@ } ] }, - "put": { - "summary": "Update a webhook", + "get": { + "summary": "Get a webhook", + "description": "Get a webhook by id.", "tags": ["Webhook"], - "operationId": "updateWebhook", + "operationId": "getWebhookById", "responses": { "200": { "description": "A webhook", @@ -8332,49 +8333,12 @@ }, "required": true } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Name of the webhook" - }, - "events": { - "type": "array", - "items": { - "enum": ["workflow-completed", "job-completed"], - "type": "string" - }, - "description": "Events that will trigger the webhook" - }, - "url": { - "type": "string", - "description": "URL to deliver the webhook to. Note: protocol must be included as well (only https is supported)" - }, - "signing-secret": { - "type": "string", - "description": "Secret used to build an HMAC hash of the payload and passed as a header in the webhook request" - }, - "verify-tls": { - "type": "boolean", - "description": "Whether to enforce TLS certificate verification when delivering the webhook" - } - }, - "description": "The parameters for an update webhook request" - } - } - } - } + ] }, - "get": { - "summary": "Get a webhook", - "description": "Get a webhook by id.", + "put": { + "summary": "Update a webhook", "tags": ["Webhook"], - "operationId": "getWebhookById", + "operationId": "updateWebhook", "responses": { "200": { "description": "A webhook", @@ -8484,7 +8448,43 @@ }, "required": true } - ] + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the webhook" + }, + "events": { + "type": "array", + "items": { + "enum": ["workflow-completed", "job-completed"], + "type": "string" + }, + "description": "Events that will trigger the webhook" + }, + "url": { + "type": "string", + "description": "URL to deliver the webhook to. Note: protocol must be included as well (only https is supported)" + }, + "signing-secret": { + "type": "string", + "description": "Secret used to build an HMAC hash of the payload and passed as a header in the webhook request" + }, + "verify-tls": { + "type": "boolean", + "description": "Whether to enforce TLS certificate verification when delivering the webhook" + } + }, + "description": "The parameters for an update webhook request" + } + } + } + } } }, "/workflow/{id}": {