From 294a8bbca0e3f182c40e023e46e933135fe9e332 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 14 Sep 2022 00:03:29 +0000 Subject: [PATCH] daily update 20220914T000329 --- client/services/ContextService.ts | 108 +- client/services/ProjectService.ts | 48 +- client/services/ScheduleService.ts | 280 ++-- client/services/WebhookService.ts | 216 ++-- swagger.json | 1906 ++++++++++++++-------------- 5 files changed, 1279 insertions(+), 1279 deletions(-) diff --git a/client/services/ContextService.ts b/client/services/ContextService.ts index 1906454..a7db764 100644 --- a/client/services/ContextService.ts +++ b/client/services/ContextService.ts @@ -118,11 +118,12 @@ export class ContextService { }); } /** - * Delete a context - * @returns any A confirmation message + * Get a context + * Returns basic information about a context. + * @returns any The context * @throws ApiError */ - public static deleteContext({ + public static getContext({ contextId, }: { /** @@ -131,12 +132,20 @@ export class ContextService { contextId: string; }): CancelablePromise<{ /** - * A human-readable message + * The unique ID of the context. */ - message: string; + 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: "DELETE", + method: "GET", url: "/context/{context-id}", path: { "context-id": contextId, @@ -144,12 +153,11 @@ export class ContextService { }); } /** - * Get a context - * Returns basic information about a context. - * @returns any The context + * Delete a context + * @returns any A confirmation message * @throws ApiError */ - public static getContext({ + public static deleteContext({ contextId, }: { /** @@ -158,20 +166,12 @@ export class ContextService { contextId: string; }): 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. + * A human-readable message */ - created_at: string; + message: string; }> { return __request(OpenAPI, { - method: "GET", + method: "DELETE", url: "/context/{context-id}", path: { "context-id": contextId, @@ -219,39 +219,6 @@ export class ContextService { }, }); } - /** - * Remove an environment variable - * Delete an environment variable from a context. - * @returns any A confirmation message - * @throws ApiError - */ - public static deleteEnvironmentVariableFromContext({ - envVarName, - contextId, - }: { - /** - * The name of the environment variable - */ - envVarName: string; - /** - * ID of the context (UUID) - */ - contextId: string; - }): CancelablePromise<{ - /** - * A human-readable message - */ - message: string; - }> { - return __request(OpenAPI, { - method: "DELETE", - url: "/context/{context-id}/environment-variable/{env-var-name}", - path: { - "env-var-name": envVarName, - "context-id": contextId, - }, - }); - } /** * Add or update an environment variable * Create or update an environment variable within a context. Returns information about the environment variable, not including its value. @@ -310,4 +277,37 @@ export class ContextService { mediaType: "application/json", }); } + /** + * Remove an environment variable + * Delete an environment variable from a context. + * @returns any A confirmation message + * @throws ApiError + */ + public static deleteEnvironmentVariableFromContext({ + envVarName, + contextId, + }: { + /** + * The name of the environment variable + */ + envVarName: string; + /** + * ID of the context (UUID) + */ + contextId: string; + }): CancelablePromise<{ + /** + * A human-readable message + */ + message: string; + }> { + return __request(OpenAPI, { + method: "DELETE", + url: "/context/{context-id}/environment-variable/{env-var-name}", + path: { + "env-var-name": envVarName, + "context-id": contextId, + }, + }); + } } diff --git a/client/services/ProjectService.ts b/client/services/ProjectService.ts index afdbc5b..cdf17df 100644 --- a/client/services/ProjectService.ts +++ b/client/services/ProjectService.ts @@ -225,20 +225,20 @@ export class ProjectService { }); } /** - * Create an environment variable - * Creates a new environment variable. - * @returns any Error response. + * 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. + * @returns any A sequence of environment variables. * @throws ApiError */ - public static createEnvVar({ + public static listEnvVars({ projectSlug, - requestBody, }: { /** * Project slug in the form `vcs-slug/org-name/repo-name`. The `/` characters may be URL-escaped. */ projectSlug: string; - requestBody?: { + }): CancelablePromise<{ + items: Array<{ /** * The name of the environment variable. */ @@ -247,35 +247,35 @@ export class ProjectService { * The value of the environment variable. */ value: string; - }; - }): CancelablePromise<{ - message?: string; + }>; + /** + * A token to pass as a `page-token` query parameter to return the next page of results. + */ + next_page_token: string; }> { return __request(OpenAPI, { - method: "POST", + method: "GET", url: "/project/{project-slug}/envvar", path: { "project-slug": projectSlug, }, - body: requestBody, - mediaType: "application/json", }); } /** - * 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. - * @returns any A sequence of environment variables. + * Create an environment variable + * Creates a new environment variable. + * @returns any Error response. * @throws ApiError */ - public static listEnvVars({ + public static createEnvVar({ projectSlug, + requestBody, }: { /** * Project slug in the form `vcs-slug/org-name/repo-name`. The `/` characters may be URL-escaped. */ projectSlug: string; - }): CancelablePromise<{ - items: Array<{ + requestBody?: { /** * The name of the environment variable. */ @@ -284,18 +284,18 @@ export class ProjectService { * The value of the environment variable. */ value: string; - }>; - /** - * A token to pass as a `page-token` query parameter to return the next page of results. - */ - next_page_token: string; + }; + }): CancelablePromise<{ + message?: string; }> { return __request(OpenAPI, { - method: "GET", + method: "POST", url: "/project/{project-slug}/envvar", path: { "project-slug": projectSlug, }, + body: requestBody, + mediaType: "application/json", }); } /** diff --git a/client/services/ScheduleService.ts b/client/services/ScheduleService.ts index acbd3fc..26948bb 100644 --- a/client/services/ScheduleService.ts +++ b/client/services/ScheduleService.ts @@ -3,24 +3,29 @@ import { OpenAPI } from "../core/OpenAPI.ts"; import { request as __request } from "../core/request.ts"; export class ScheduleService { /** - * Create a schedule - * Creates a schedule and returns the created schedule. - * @returns any Error response. + * Get all schedules + * Returns all schedules for this project. + * @returns any A sequence of schedules. * @throws ApiError */ - public static createSchedule({ + public static listSchedulesForProject({ projectSlug, - requestBody, + pageToken, }: { /** * Project slug in the form `vcs-slug/org-name/repo-name`. The `/` characters may be URL-escaped. */ projectSlug: string; - requestBody?: { + /** + * A token to retrieve the next page of results. + */ + pageToken?: string; + }): CancelablePromise<{ + items: Array<{ /** - * Name of the schedule. + * The unique ID of the schedule. */ - name: string; + id: string; /** * Timetable that specifies when a schedule triggers. */ @@ -100,55 +105,82 @@ export class ScheduleService { >; }; /** - * The attribution-actor of the scheduled pipeline. + * The date and time the pipeline was last updated. */ - "attribution-actor": "current" | "system"; + "updated-at": string; + /** + * Name of the schedule. + */ + name: string; + /** + * The date and time the pipeline was created. + */ + "created-at": string; + /** + * The project-slug for the schedule + */ + "project-slug": string; /** * Pipeline parameters represented as key-value pairs. Must contain branch or tag. */ parameters: Record; + /** + * The attribution actor who will run the scheduled pipeline. + */ + actor: { + /** + * The unique ID of the user. + */ + id: string; + /** + * The login information for the user on the VCS. + */ + login: string; + /** + * The name of the user. + */ + name: string; + }; /** * Description of the schedule. */ - description?: string; - }; - }): CancelablePromise<{ - message?: string; + description: string; + }>; + /** + * A token to pass as a `page-token` query parameter to return the next page of results. + */ + next_page_token: string; }> { return __request(OpenAPI, { - method: "POST", + method: "GET", url: "/project/{project-slug}/schedule", path: { "project-slug": projectSlug, }, - body: requestBody, - mediaType: "application/json", + query: { + "page-token": pageToken, + }, }); } /** - * Get all schedules - * Returns all schedules for this project. - * @returns any A sequence of schedules. + * Create a schedule + * Creates a schedule and returns the created schedule. + * @returns any Error response. * @throws ApiError */ - public static listSchedulesForProject({ + public static createSchedule({ projectSlug, - pageToken, + requestBody, }: { /** * Project slug in the form `vcs-slug/org-name/repo-name`. The `/` characters may be URL-escaped. */ projectSlug: string; - /** - * A token to retrieve the next page of results. - */ - pageToken?: string; - }): CancelablePromise<{ - items: Array<{ + requestBody?: { /** - * The unique ID of the schedule. + * Name of the schedule. */ - id: string; + name: string; /** * Timetable that specifies when a schedule triggers. */ @@ -228,76 +260,103 @@ export class ScheduleService { >; }; /** - * The date and time the pipeline was last updated. - */ - "updated-at": string; - /** - * Name of the schedule. - */ - name: string; - /** - * The date and time the pipeline was created. - */ - "created-at": string; - /** - * The project-slug for the schedule + * The attribution-actor of the scheduled pipeline. */ - "project-slug": string; + "attribution-actor": "current" | "system"; /** * Pipeline parameters represented as key-value pairs. Must contain branch or tag. */ parameters: Record; - /** - * The attribution actor who will run the scheduled pipeline. - */ - actor: { - /** - * The unique ID of the user. - */ - id: string; - /** - * The login information for the user on the VCS. - */ - login: string; - /** - * The name of the user. - */ - name: string; - }; /** * Description of the schedule. */ - description: string; - }>; - /** - * A token to pass as a `page-token` query parameter to return the next page of results. - */ - next_page_token: string; + description?: string; + }; + }): CancelablePromise<{ + message?: string; }> { return __request(OpenAPI, { - method: "GET", + method: "POST", url: "/project/{project-slug}/schedule", path: { "project-slug": projectSlug, }, - query: { - "page-token": pageToken, - }, + 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. @@ -424,11 +483,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", }); } /** @@ -459,77 +520,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. @@ -656,13 +658,11 @@ 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", }); } } diff --git a/client/services/WebhookService.ts b/client/services/WebhookService.ts index a9b488b..87d2bf1 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,71 @@ export class WebhookService { }); } /** - * Create a webhook - * @returns any Error response. + * Get a webhook + * Get a webhook by id. + * @returns any A webhook * @throws ApiError */ - public static createWebhook({ - requestBody, + public static getWebhookById({ + 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; + /** + * ID of the webhook (UUID) + */ + webhookId: string; + }): CancelablePromise<{ + /** + * 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; + /** + * The unique ID of the webhook + */ + id: string; + /** + * Masked value of the secret used to build an HMAC hash of the payload and passed as a header in the webhook request + */ + "signing-secret": string; + /** + * The date and time the webhook was last updated. + */ + "updated-at": string; + /** + * Name of the webhook + */ + name: string; + /** + * The date and time the webhook was created. + */ + "created-at": string; + /** + * The scope in which the relevant events that will trigger webhooks + */ + scope: { /** - * Secret used to build an HMAC hash of the payload and passed as a header in the webhook request + * ID of the scope being used (at the moment, only project ID is supported) */ - "signing-secret": string; + id: string; /** - * The scope in which the relevant events that will trigger webhooks + * Type of the scope being used */ - 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"; - }; + type: string; }; - }): CancelablePromise<{ - message?: string; + /** + * Events that will trigger the webhook + */ + events: Array<"workflow-completed" | "job-completed">; }> { return __request(OpenAPI, { - method: "POST", - url: "/webhook", - body: requestBody, - mediaType: "application/json", + method: "GET", + url: "/webhook/{webhook-id}", + path: { + "webhook-id": webhookId, + }, }); } /** @@ -253,72 +321,4 @@ export class WebhookService { }, }); } - /** - * Get a webhook - * Get a webhook by id. - * @returns any A webhook - * @throws ApiError - */ - public static getWebhookById({ - webhookId, - }: { - /** - * ID of the webhook (UUID) - */ - webhookId: string; - }): CancelablePromise<{ - /** - * 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; - /** - * The unique ID of the webhook - */ - id: string; - /** - * Masked value of the secret used to build an HMAC hash of the payload and passed as a header in the webhook request - */ - "signing-secret": string; - /** - * The date and time the webhook was last updated. - */ - "updated-at": string; - /** - * Name of the webhook - */ - name: string; - /** - * The date and time the webhook was created. - */ - "created-at": 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: string; - }; - /** - * Events that will trigger the webhook - */ - events: Array<"workflow-completed" | "job-completed">; - }> { - return __request(OpenAPI, { - method: "GET", - url: "/webhook/{webhook-id}", - path: { - "webhook-id": webhookId, - }, - }); - } } diff --git a/swagger.json b/swagger.json index 75b42f2..f5211af 100644 --- a/swagger.json +++ b/swagger.json @@ -238,26 +238,37 @@ } }, "/context/{context-id}": { - "delete": { - "summary": "Delete a context", + "get": { + "summary": "Get a context", + "description": "Returns basic information about a context.", "tags": ["Context"], - "operationId": "deleteContext", + "operationId": "getContext", "responses": { "200": { - "description": "A confirmation message", + "description": "The context", "content": { "application/json": { "schema": { "type": "object", "properties": { - "message": { + "id": { "type": "string", - "description": "A human-readable message" + "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": ["message"], - "description": "message response", - "title": "MessageResponse" + "required": ["id", "name", "created_at"], + "title": "Context" } } } @@ -291,37 +302,26 @@ } ] }, - "get": { - "summary": "Get a context", - "description": "Returns basic information about a context.", + "delete": { + "summary": "Delete a context", "tags": ["Context"], - "operationId": "getContext", + "operationId": "deleteContext", "responses": { "200": { - "description": "The 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" } } } @@ -437,70 +437,6 @@ } }, "/context/{context-id}/environment-variable/{env-var-name}": { - "delete": { - "summary": "Remove an environment variable", - "description": "Delete an environment variable from a context.", - "tags": ["Context"], - "operationId": "deleteEnvironmentVariableFromContext", - "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": "env-var-name", - "description": "The name of the environment variable", - "schema": { - "type": "string" - }, - "required": true, - "example": "POSTGRES_USER" - }, - { - "in": "path", - "name": "context-id", - "description": "ID of the context (UUID)", - "schema": { - "type": "string", - "format": "uuid" - }, - "required": true - } - ] - }, "put": { "summary": "Add or update an environment variable", "description": "Create or update an environment variable within a context. Returns information about the environment variable, not including its value.", @@ -607,6 +543,70 @@ } } } + }, + "delete": { + "summary": "Remove an environment variable", + "description": "Delete an environment variable from a context.", + "tags": ["Context"], + "operationId": "deleteEnvironmentVariableFromContext", + "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": "env-var-name", + "description": "The name of the environment variable", + "schema": { + "type": "string" + }, + "required": true, + "example": "POSTGRES_USER" + }, + { + "in": "path", + "name": "context-id", + "description": "ID of the context (UUID)", + "schema": { + "type": "string", + "format": "uuid" + }, + "required": true + } + ] } }, "/insights/pages/{project-slug}/summary": { @@ -4431,32 +4431,47 @@ } }, "/project/{project-slug}/envvar": { - "post": { - "summary": "Create an environment variable", - "description": "Creates a new environment variable.", + "get": { + "summary": "List all environment variables", + "description": "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.", "tags": ["Project"], - "operationId": "createEnvVar", + "operationId": "listEnvVars", "responses": { - "201": { - "description": "The environment variable.", + "200": { + "description": "A sequence of environment variables.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "name": { - "type": "string", - "description": "The name of the environment variable.", - "example": "foo" + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the environment variable.", + "example": "foo" + }, + "value": { + "type": "string", + "description": "The value of the environment variable.", + "example": "xxxx1234" + } + }, + "required": ["name", "value"], + "title": "EnvironmentVariablePair" + } }, - "value": { + "next_page_token": { "type": "string", - "description": "The value of the environment variable.", - "example": "xxxx1234" + "x-nullable": true, + "description": "A token to pass as a `page-token` query parameter to return the next page of results." } }, - "required": ["name", "value"], - "title": "EnvironmentVariablePair" + "required": ["items", "next_page_token"], + "title": "EnvironmentVariableListResponse" } } } @@ -4489,72 +4504,34 @@ "example": "gh/CircleCI-Public/api-preview-docs", "allowReserved": true } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the environment variable.", - "example": "foo" - }, - "value": { - "type": "string", - "description": "The value of the environment variable.", - "example": "xxxx1234" - } - }, - "required": ["name", "value"], - "title": "EnvironmentVariablePair" - } - } - } - } + ] }, - "get": { - "summary": "List all environment variables", - "description": "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.", + "post": { + "summary": "Create an environment variable", + "description": "Creates a new environment variable.", "tags": ["Project"], - "operationId": "listEnvVars", + "operationId": "createEnvVar", "responses": { - "200": { - "description": "A sequence of environment variables.", + "201": { + "description": "The environment variable.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the environment variable.", - "example": "foo" - }, - "value": { - "type": "string", - "description": "The value of the environment variable.", - "example": "xxxx1234" - } - }, - "required": ["name", "value"], - "title": "EnvironmentVariablePair" - } + "name": { + "type": "string", + "description": "The name of the environment variable.", + "example": "foo" }, - "next_page_token": { + "value": { "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 value of the environment variable.", + "example": "xxxx1234" } }, - "required": ["items", "next_page_token"], - "title": "EnvironmentVariableListResponse" + "required": ["name", "value"], + "title": "EnvironmentVariablePair" } } } @@ -4587,7 +4564,30 @@ "example": "gh/CircleCI-Public/api-preview-docs", "allowReserved": true } - ] + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the environment variable.", + "example": "foo" + }, + "value": { + "type": "string", + "description": "The value of the environment variable.", + "example": "xxxx1234" + } + }, + "required": ["name", "value"], + "title": "EnvironmentVariablePair" + } + } + } + } } }, "/project/{project-slug}/envvar/{name}": { @@ -6058,123 +6058,349 @@ } }, "/project/{project-slug}/schedule": { - "post": { - "summary": "Create a schedule", - "description": "Creates a schedule and returns the created schedule.", + "get": { + "summary": "Get all schedules", + "description": "Returns all schedules for this project.", "tags": ["Schedule"], - "operationId": "createSchedule", + "operationId": "listSchedulesForProject", "responses": { - "201": { - "description": "A schedule object.", + "200": { + "description": "A sequence of schedules.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "The unique ID of the schedule." - }, - "timetable": { - "anyOf": [ - { - "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." - } + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The unique ID of the schedule." }, - "required": [ - "per-hour", - "hours-of-day", - "days-of-week" - ] - }, - { - "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" + "timetable": { + "anyOf": [ + { + "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." + } + }, + "required": [ + "per-hour", + "hours-of-day", + "days-of-week" + ] }, - "description": "Hours in a day in which the schedule triggers." + { + "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-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." + }, + "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." + }, + "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." + } + }, + "required": [ + "per-hour", + "hours-of-day", + "days-of-month" + ] + } + ], + "description": "Timetable that specifies when a schedule triggers." + }, + "updated-at": { + "type": "string", + "format": "date-time", + "description": "The date and time the pipeline was last updated." + }, + "name": { + "type": "string", + "description": "Name of the schedule." + }, + "created-at": { + "type": "string", + "format": "date-time", + "description": "The date and time the pipeline was created." + }, + "project-slug": { + "type": "string", + "description": "The project-slug for the schedule", + "example": "gh/CircleCI-Public/api-preview-docs" + }, + "parameters": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] }, - "days-of-month": { + "description": "Pipeline parameters represented as key-value pairs. Must contain branch or tag.", + "example": { + "deploy_prod": true, + "branch": "feature/design-new-api" + } + }, + "actor": { + "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": { + "type": "string", + "description": "The name of the user." + } + }, + "required": ["id", "login", "name"], + "title": "User", + "description": "The attribution actor who will run the scheduled pipeline." + }, + "description": { + "type": "string", + "x-nullable": true, + "description": "Description of the schedule." + } + }, + "required": [ + "id", + "name", + "timetable", + "description", + "project-slug", + "actor", + "created-at", + "updated-at", + "parameters" + ], + "description": "A schedule response", + "title": "Schedule" + } + }, + "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 sequence of schedules" + } + } + } + }, + "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": "query", + "name": "page-token", + "description": "A token to retrieve the next page of results.", + "schema": { + "type": "string" + }, + "required": false, + "allowEmptyValue": true + } + ] + }, + "post": { + "summary": "Create a schedule", + "description": "Creates a schedule and returns the created schedule.", + "tags": ["Schedule"], + "operationId": "createSchedule", + "responses": { + "201": { + "description": "A schedule object.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The unique ID of the schedule." + }, + "timetable": { + "anyOf": [ + { + "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": "Day in a month, between 1 and 31." + "description": "Hour in a day in UTC, value must be between 0 and 24" }, - "description": "Days in a month in which the schedule triggers. This is mutually exclusive with days in a week." + "description": "Hours in a day in which the schedule triggers." }, "days-of-week": { "type": "array", @@ -6193,6 +6419,15 @@ }, "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": { @@ -6219,9 +6454,81 @@ "required": [ "per-hour", "hours-of-day", - "days-of-month" + "days-of-week" ] - } + }, + { + "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-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." + }, + "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." + }, + "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." + } + }, + "required": [ + "per-hour", + "hours-of-day", + "days-of-month" + ] + } ], "description": "Timetable that specifies when a schedule triggers." }, @@ -6518,334 +6825,27 @@ "description": "Pipeline parameters represented as key-value pairs. Must contain branch or tag.", "example": { "deploy_prod": true, - "branch": "feature/design-new-api" - } - }, - "description": { - "type": "string", - "x-nullable": true, - "description": "Description of the schedule." - } - }, - "required": [ - "name", - "timetable", - "attribution-actor", - "parameters" - ], - "description": "The parameters for a create schedule request", - "title": "CreateScheduleParameters" - } - } - } - } - }, - "get": { - "summary": "Get all schedules", - "description": "Returns all schedules for this project.", - "tags": ["Schedule"], - "operationId": "listSchedulesForProject", - "responses": { - "200": { - "description": "A sequence of schedules.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "The unique ID of the schedule." - }, - "timetable": { - "anyOf": [ - { - "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." - } - }, - "required": [ - "per-hour", - "hours-of-day", - "days-of-week" - ] - }, - { - "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-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." - }, - "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." - }, - "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." - } - }, - "required": [ - "per-hour", - "hours-of-day", - "days-of-month" - ] - } - ], - "description": "Timetable that specifies when a schedule triggers." - }, - "updated-at": { - "type": "string", - "format": "date-time", - "description": "The date and time the pipeline was last updated." - }, - "name": { - "type": "string", - "description": "Name of the schedule." - }, - "created-at": { - "type": "string", - "format": "date-time", - "description": "The date and time the pipeline was created." - }, - "project-slug": { - "type": "string", - "description": "The project-slug for the schedule", - "example": "gh/CircleCI-Public/api-preview-docs" - }, - "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" - } - }, - "actor": { - "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": { - "type": "string", - "description": "The name of the user." - } - }, - "required": ["id", "login", "name"], - "title": "User", - "description": "The attribution actor who will run the scheduled pipeline." - }, - "description": { - "type": "string", - "x-nullable": true, - "description": "Description of the schedule." - } - }, - "required": [ - "id", - "name", - "timetable", - "description", - "project-slug", - "actor", - "created-at", - "updated-at", - "parameters" - ], - "description": "A schedule response", - "title": "Schedule" - } - }, - "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 sequence of schedules" - } - } - } - }, - "default": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "message": { - "type": "string" + "branch": "feature/design-new-api" } + }, + "description": { + "type": "string", + "x-nullable": true, + "description": "Description of the schedule." } - } + }, + "required": [ + "name", + "timetable", + "attribution-actor", + "parameters" + ], + "description": "The parameters for a create schedule request", + "title": "CreateScheduleParameters" } - }, - "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": "query", - "name": "page-token", - "description": "A token to retrieve the next page of results.", - "schema": { - "type": "string" - }, - "required": false, - "allowEmptyValue": true + } } - ] + } } }, "/project/{project-slug}/{job-number}/artifacts": { @@ -7059,11 +7059,11 @@ } }, "/schedule/{schedule-id}": { - "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.", @@ -7338,7 +7338,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" + } + } + } + } }, "delete": { "summary": "Delete a schedule", @@ -7394,11 +7511,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.", @@ -7625,23 +7742,88 @@ }, "description": { "type": "string", - "x-nullable": true, - "description": "Description of the schedule." + "x-nullable": true, + "description": "Description of the schedule." + } + }, + "required": [ + "id", + "name", + "timetable", + "description", + "project-slug", + "actor", + "created-at", + "updated-at", + "parameters" + ], + "description": "A schedule response", + "title": "Schedule" + } + } + } + }, + "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 + } + ] + } + }, + "/user/{id}": { + "get": { + "summary": "User Information", + "description": "Provides information about the user with the given ID.", + "tags": ["User"], + "operationId": "getUser", + "responses": { + "200": { + "description": "User login information.", + "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": { + "type": "string", + "description": "The name of the user." } }, - "required": [ - "id", - "name", - "timetable", - "description", - "project-slug", - "actor", - "created-at", - "updated-at", - "parameters" - ], - "description": "A schedule response", - "title": "Schedule" + "required": ["id", "login", "name"], + "title": "User" } } } @@ -7665,165 +7847,100 @@ "parameters": [ { "in": "path", - "name": "schedule-id", - "description": "The unique ID of the schedule.", + "name": "id", + "description": "The unique ID of the user.", "schema": { "type": "string", "format": "uuid" }, "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}": { - "get": { - "summary": "User Information", - "description": "Provides information about the user with the given ID.", - "tags": ["User"], - "operationId": "getUser", + "/webhook": { + "post": { + "summary": "Create a webhook", + "tags": ["Webhook"], + "operationId": "createWebhook", "responses": { - "200": { - "description": "User login information.", + "201": { + "description": "A webhook", "content": { "application/json": { "schema": { "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 user." + "description": "The unique ID of the webhook" }, - "login": { + "signing-secret": { "type": "string", - "description": "The login information for the user on the VCS.", - "title": "Login" + "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": "The name of the user." + "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", "login", "name"], - "title": "User" + "required": [ + "id", + "scope", + "name", + "events", + "url", + "verify-tls", + "signing-secret", + "created-at", + "updated-at" + ], + "title": "Webhook" } } } @@ -7838,27 +7955,74 @@ "type": "string" } } - } + } + } + }, + "description": "Error response." + } + }, + "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)" + }, + "verify-tls": { + "type": "boolean", + "description": "Whether to enforce TLS certificate verification when delivering the webhook" + }, + "signing-secret": { + "type": "string", + "description": "Secret used to build an HMAC hash of the payload and passed as a header in the webhook request" + }, + "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": { + "enum": ["project"], + "type": "string", + "description": "Type of the scope being used" + } + }, + "required": ["id", "type"], + "description": "The scope in which the relevant events that will trigger webhooks" + } + }, + "required": [ + "name", + "events", + "url", + "verify-tls", + "signing-secret", + "scope" + ], + "description": "The parameters for a create webhook request" } - }, - "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", @@ -7999,13 +8163,16 @@ "required": true } ] - }, - "post": { - "summary": "Create a webhook", + } + }, + "/webhook/{webhook-id}": { + "get": { + "summary": "Get a webhook", + "description": "Get a webhook by id.", "tags": ["Webhook"], - "operationId": "createWebhook", + "operationId": "getWebhookById", "responses": { - "201": { + "200": { "description": "A webhook", "content": { "application/json": { @@ -8102,70 +8269,19 @@ "description": "Error response." } }, - "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)" - }, - "verify-tls": { - "type": "boolean", - "description": "Whether to enforce TLS certificate verification when delivering the webhook" - }, - "signing-secret": { - "type": "string", - "description": "Secret used to build an HMAC hash of the payload and passed as a header in the webhook request" - }, - "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": { - "enum": ["project"], - "type": "string", - "description": "Type of the scope being used" - } - }, - "required": ["id", "type"], - "description": "The scope in which the relevant events that will trigger webhooks" - } - }, - "required": [ - "name", - "events", - "url", - "verify-tls", - "signing-secret", - "scope" - ], - "description": "The parameters for a create webhook request" - } - } + "parameters": [ + { + "in": "path", + "name": "webhook-id", + "description": "ID of the webhook (UUID)", + "schema": { + "type": "string", + "format": "uuid" + }, + "required": true } - } - } - }, - "/webhook/{webhook-id}": { + ] + }, "put": { "summary": "Update a webhook", "tags": ["Webhook"], @@ -8369,122 +8485,6 @@ "required": true } ] - }, - "get": { - "summary": "Get a webhook", - "description": "Get a webhook by id.", - "tags": ["Webhook"], - "operationId": "getWebhookById", - "responses": { - "200": { - "description": "A webhook", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - }, - "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 - } - ] } }, "/workflow/{id}": {