diff --git a/client/services/ContextService.ts b/client/services/ContextService.ts index bf8770a..1906454 100644 --- a/client/services/ContextService.ts +++ b/client/services/ContextService.ts @@ -2,62 +2,6 @@ import type { CancelablePromise } from "../core/CancelablePromise.ts"; import { OpenAPI } from "../core/OpenAPI.ts"; import { request as __request } from "../core/request.ts"; export class ContextService { - /** - * Create a new context - * @returns any The new context - * @throws ApiError - */ - public static createContext({ - requestBody, - }: { - requestBody?: { - /** - * The user defined name of the context. - */ - name: string; - owner: - | { - /** - * The unique ID of the owner of the context. Specify either this or slug. - */ - id: string; - /** - * The type of the owner. Defaults to "organization". Accounts are only used as context owners in server. - */ - type?: "account" | "organization"; - } - | { - /** - * A string that represents an organization. Specify either this or id. Cannot be used for accounts. - */ - slug: string; - /** - * The type of owner. Defaults to "organization". Accounts are only used as context owners in server and must be specified by an id instead of a slug. - */ - type?: "organization"; - }; - }; - }): CancelablePromise<{ - /** - * The unique ID of the context. - */ - id: string; - /** - * The user defined name of the context. - */ - name: string; - /** - * The date and time the context was created. - */ - created_at: string; - }> { - return __request(OpenAPI, { - method: "POST", - url: "/context", - body: requestBody, - mediaType: "application/json", - }); - } /** * List contexts * List all contexts for an owner. @@ -117,6 +61,62 @@ export class ContextService { }, }); } + /** + * Create a new context + * @returns any The new context + * @throws ApiError + */ + public static createContext({ + requestBody, + }: { + requestBody?: { + /** + * The user defined name of the context. + */ + name: string; + owner: + | { + /** + * The unique ID of the owner of the context. Specify either this or slug. + */ + id: string; + /** + * The type of the owner. Defaults to "organization". Accounts are only used as context owners in server. + */ + type?: "account" | "organization"; + } + | { + /** + * A string that represents an organization. Specify either this or id. Cannot be used for accounts. + */ + slug: string; + /** + * The type of owner. Defaults to "organization". Accounts are only used as context owners in server and must be specified by an id instead of a slug. + */ + type?: "organization"; + }; + }; + }): CancelablePromise<{ + /** + * The unique ID of the context. + */ + id: string; + /** + * The user defined name of the context. + */ + name: string; + /** + * The date and time the context was created. + */ + created_at: string; + }> { + return __request(OpenAPI, { + method: "POST", + url: "/context", + body: requestBody, + mediaType: "application/json", + }); + } /** * Delete a context * @returns any A confirmation message diff --git a/client/services/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 a00488b..afdbc5b 100644 --- a/client/services/ProjectService.ts +++ b/client/services/ProjectService.ts @@ -225,20 +225,20 @@ export class ProjectService { }); } /** - * 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. */ @@ -247,35 +247,35 @@ 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", }); } /** - * 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. */ @@ -284,27 +284,27 @@ 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", }); } /** - * 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 e7a40ea..acbd3fc 100644 --- a/client/services/ScheduleService.ts +++ b/client/services/ScheduleService.ts @@ -3,29 +3,24 @@ import { OpenAPI } from "../core/OpenAPI.ts"; import { request as __request } from "../core/request.ts"; export class ScheduleService { /** - * 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. */ @@ -105,82 +100,55 @@ 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", }); } /** - * 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. */ @@ -260,55 +228,60 @@ 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", - }); - } - /** - * Delete a schedule - * Deletes the schedule by id. - * @returns any A confirmation message. - * @throws ApiError - */ - public static deleteScheduleById({ - scheduleId, - }: { - /** - * The unique ID of the schedule. - */ - scheduleId: string; - }): CancelablePromise<{ - /** - * A human-readable message - */ - message: string; - }> { - return __request(OpenAPI, { - method: "DELETE", - url: "/schedule/{schedule-id}", - path: { - "schedule-id": scheduleId, + query: { + "page-token": pageToken, }, }); } @@ -458,6 +431,33 @@ export class ScheduleService { }, }); } + /** + * Delete a schedule + * Deletes the schedule by id. + * @returns any A confirmation message. + * @throws ApiError + */ + public static deleteScheduleById({ + scheduleId, + }: { + /** + * The unique ID of the schedule. + */ + scheduleId: string; + }): CancelablePromise<{ + /** + * A human-readable message + */ + message: string; + }> { + return __request(OpenAPI, { + method: "DELETE", + url: "/schedule/{schedule-id}", + path: { + "schedule-id": scheduleId, + }, + }); + } /** * Update a schedule * Updates a schedule and returns the updated schedule. diff --git a/client/services/WebhookService.ts b/client/services/WebhookService.ts index 5c768f4..a9b488b 100644 --- a/client/services/WebhookService.ts +++ b/client/services/WebhookService.ts @@ -136,18 +136,40 @@ export class WebhookService { }); } /** - * 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) @@ -196,11 +218,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", }); } /** @@ -230,40 +254,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) @@ -312,13 +314,11 @@ 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", }); } } diff --git a/swagger.json b/swagger.json index 1a19447..9e62482 100644 --- a/swagger.json +++ b/swagger.json @@ -26,109 +26,6 @@ ], "paths": { "/context": { - "post": { - "summary": "Create a new context", - "tags": ["Context"], - "operationId": "createContext", - "responses": { - "200": { - "description": "The new context", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "The unique ID of the context." - }, - "name": { - "type": "string", - "description": "The user defined name of the context." - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "The date and time the context was created.", - "example": "2015-09-21T17:29:21.042Z" - } - }, - "required": ["id", "name", "created_at"], - "title": "Context" - } - } - } - }, - "default": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - } - } - }, - "description": "Error response." - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The user defined name of the context." - }, - "owner": { - "oneOf": [ - { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "The unique ID of the owner of the context. Specify either this or slug." - }, - "type": { - "enum": ["account", "organization"], - "type": "string", - "description": "The type of the owner. Defaults to \"organization\". Accounts are only used as context owners in server.", - "example": "organization" - } - }, - "required": ["id"] - }, - { - "type": "object", - "properties": { - "slug": { - "type": "string", - "description": "A string that represents an organization. Specify either this or id. Cannot be used for accounts." - }, - "type": { - "enum": ["organization"], - "type": "string", - "description": "The type of owner. Defaults to \"organization\". Accounts are only used as context owners in server and must be specified by an id instead of a slug." - } - }, - "required": ["slug"] - } - ] - } - }, - "required": ["name", "owner"] - } - } - } - } - }, "get": { "summary": "List contexts", "description": "List all contexts for an owner.", @@ -235,6 +132,109 @@ "allowEmptyValue": true } ] + }, + "post": { + "summary": "Create a new context", + "tags": ["Context"], + "operationId": "createContext", + "responses": { + "200": { + "description": "The new context", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The unique ID of the context." + }, + "name": { + "type": "string", + "description": "The user defined name of the context." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "The date and time the context was created.", + "example": "2015-09-21T17:29:21.042Z" + } + }, + "required": ["id", "name", "created_at"], + "title": "Context" + } + } + } + }, + "default": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + }, + "description": "Error response." + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The user defined name of the context." + }, + "owner": { + "oneOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The unique ID of the owner of the context. Specify either this or slug." + }, + "type": { + "enum": ["account", "organization"], + "type": "string", + "description": "The type of the owner. Defaults to \"organization\". Accounts are only used as context owners in server.", + "example": "organization" + } + }, + "required": ["id"] + }, + { + "type": "object", + "properties": { + "slug": { + "type": "string", + "description": "A string that represents an organization. Specify either this or id. Cannot be used for accounts." + }, + "type": { + "enum": ["organization"], + "type": "string", + "description": "The type of owner. Defaults to \"organization\". Accounts are only used as context owners in server and must be specified by an id instead of a slug." + } + }, + "required": ["slug"] + } + ] + } + }, + "required": ["name", "owner"] + } + } + } + } } }, "/context/{context-id}": { @@ -4431,47 +4431,32 @@ } }, "/project/{project-slug}/envvar": { - "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" } } } @@ -4504,34 +4489,72 @@ "example": "gh/CircleCI-Public/api-preview-docs", "allowReserved": true } - ] - }, - "post": { - "summary": "Create an environment variable", - "description": "Creates a new environment variable.", + ], + "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.", "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" } } } @@ -4564,59 +4587,31 @@ "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}": { - "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": { - "type": "string", - "description": "The name of the environment variable.", - "example": "foo" - }, - "value": { + "message": { "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,83 +5077,206 @@ } }, "/project/{project-slug}/pipeline": { - "get": { - "summary": "Get all pipelines", - "description": "Returns all pipelines for this project.", + "post": { + "summary": "Trigger a new pipeline", + "description": "Triggers a new pipeline on the project.", "tags": ["Pipeline"], - "operationId": "listPipelinesForProject", + "operationId": "triggerPipeline", "responses": { - "200": { - "description": "A sequence of pipelines.", - "links": { - "NextPipelinePage": { - "operationId": "listPipelinesForProject", - "parameters": { - "project-slug": "$request.path.project-slug", - "page-token": "$response.body#/next_page_token" + "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": { - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "The unique ID of the pipeline.", - "example": "5034460f-c7c4-4c43-9457-de07e2029e7b" - }, - "errors": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "enum": [ - "config", - "config-fetch", - "timeout", - "permission", - "other", - "plan" - ], - "type": "string", - "description": "The type of error." - }, - "message": { - "type": "string", - "description": "A human-readable error message." - } - }, - "required": ["type", "message"], - "description": "An error with a type and message." - }, - "description": "A sequence of errors that have occurred within the pipeline." - }, - "project_slug": { - "type": "string", - "description": "The project-slug for the pipeline.", - "example": "gh/CircleCI-Public/api-preview-docs" - }, - "updated_at": { - "type": "string", - "format": "date-time", - "description": "The date and time the pipeline was last updated." - }, - "number": { - "type": "integer", - "format": "int64", - "description": "The number of the pipeline.", - "example": "25" - }, - "trigger_parameters": { + "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.", + "tags": ["Pipeline"], + "operationId": "listPipelinesForProject", + "responses": { + "200": { + "description": "A sequence of pipelines.", + "links": { + "NextPipelinePage": { + "operationId": "listPipelinesForProject", + "parameters": { + "project-slug": "$request.path.project-slug", + "page-token": "$response.body#/next_page_token" + } + } + }, + "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 pipeline.", + "example": "5034460f-c7c4-4c43-9457-de07e2029e7b" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "enum": [ + "config", + "config-fetch", + "timeout", + "permission", + "other", + "plan" + ], + "type": "string", + "description": "The type of error." + }, + "message": { + "type": "string", + "description": "A human-readable error message." + } + }, + "required": ["type", "message"], + "description": "An error with a type and message." + }, + "description": "A sequence of errors that have occurred within the pipeline." + }, + "project_slug": { + "type": "string", + "description": "The project-slug for the pipeline.", + "example": "gh/CircleCI-Public/api-preview-docs" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "The date and time the pipeline was last updated." + }, + "number": { + "type": "integer", + "format": "int64", + "description": "The number of the pipeline.", + "example": "25" + }, + "trigger_parameters": { "type": "object", "additionalProperties": { "anyOf": [ @@ -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": { @@ -6058,349 +6058,123 @@ } }, "/project/{project-slug}/schedule": { - "get": { - "summary": "Get all schedules", - "description": "Returns all schedules for this project.", + "post": { + "summary": "Create a schedule", + "description": "Creates a schedule and returns the created schedule.", "tags": ["Schedule"], - "operationId": "listSchedulesForProject", + "operationId": "createSchedule", "responses": { - "200": { - "description": "A sequence of schedules.", + "201": { + "description": "A schedule object.", "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." + "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." + } }, - "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" - ] + "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" }, - { - "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" - } - } - } - } - }, - "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" + "description": "Hours in a day in which the schedule triggers." }, - "hours-of-day": { + "days-of-month": { "type": "array", "items": { "type": "integer", "format": "integer", - "description": "Hour in a day in UTC, value must be between 0 and 24" + "description": "Day in a month, between 1 and 31." }, - "description": "Hours in a day in which the schedule triggers." + "description": "Days in a month in which the schedule triggers. This is mutually exclusive with days in a week." }, "days-of-week": { "type": "array", @@ -6419,15 +6193,6 @@ }, "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": { @@ -6454,79 +6219,7 @@ "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" + "days-of-month" ] } ], @@ -6828,24 +6521,331 @@ "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": { + "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" + } + } + } + } + }, + "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,60 +7059,6 @@ } }, "/schedule/{schedule-id}": { - "delete": { - "summary": "Delete a schedule", - "description": "Deletes the schedule by id.", - "tags": ["Schedule"], - "operationId": "deleteScheduleById", - "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": "schedule-id", - "description": "The unique ID of the schedule.", - "schema": { - "type": "string", - "format": "uuid" - }, - "required": true - } - ] - }, "get": { "summary": "Get a schedule", "description": "Get a schedule by id.", @@ -7394,6 +7340,60 @@ } ] }, + "delete": { + "summary": "Delete a schedule", + "description": "Deletes the schedule by id.", + "tags": ["Schedule"], + "operationId": "deleteScheduleById", + "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": "schedule-id", + "description": "The unique ID of the schedule.", + "schema": { + "type": "string", + "format": "uuid" + }, + "required": true + } + ] + }, "patch": { "summary": "Update a schedule", "description": "Updates a schedule and returns the updated schedule.", @@ -8166,11 +8166,10 @@ } }, "/webhook/{webhook-id}": { - "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", @@ -8280,7 +8279,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" + } + } + } + } }, "delete": { "summary": "Delete a webhook", @@ -8335,10 +8370,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", @@ -8448,43 +8484,7 @@ }, "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}": {