diff --git a/client/services/ContextService.ts b/client/services/ContextService.ts index e9de478..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 @@ -219,6 +219,39 @@ 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. @@ -277,37 +310,4 @@ 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/InsightsService.ts b/client/services/InsightsService.ts index 354c52e..a4b2cad 100644 --- a/client/services/InsightsService.ts +++ b/client/services/InsightsService.ts @@ -233,7 +233,7 @@ export class InsightsService { projectSlug, workflowName, branch, - timeseriesGranularity, + granularity, startDate, endDate, }: { @@ -252,7 +252,7 @@ export class InsightsService { /** * The granularity for which to query timeseries data. */ - timeseriesGranularity?: "daily" | "hourly"; + granularity?: "daily" | "hourly"; /** * Include only executions that started at or after this date. This must be specified if an end-date is provided. */ @@ -351,7 +351,7 @@ export class InsightsService { }, query: { branch: branch, - "timeseries-granularity": timeseriesGranularity, + granularity: granularity, "start-date": startDate, "end-date": endDate, }, @@ -1010,7 +1010,7 @@ export class InsightsService { branches?: any; }): CancelablePromise<{ /** - * Metrics aggregated acrooss a workflow for a given time window. + * Metrics aggregated across a workflow for a given time window. */ metrics: { /** @@ -1077,7 +1077,7 @@ export class InsightsService { throughput: number; }; /** - * Trends for aggregated metrics acrooss a workflow for a given time window. + * Trends for aggregated metrics across a workflow for a given time window. */ trends: { /** diff --git a/client/services/ProjectService.ts b/client/services/ProjectService.ts index fbf7f39..b841daa 100644 --- a/client/services/ProjectService.ts +++ b/client/services/ProjectService.ts @@ -60,6 +60,39 @@ export class ProjectService { }, }); } + /** + * Create a new checkout key + * Creates a new checkout key. This API request is only usable with a user API token. + * @returns any Error response. + * @throws ApiError + */ + public static createCheckoutKey({ + projectSlug, + requestBody, + }: { + /** + * Project slug in the form `vcs-slug/org-name/repo-name`. The `/` characters may be URL-escaped. + */ + projectSlug: string; + requestBody?: { + /** + * The type of checkout key to create. This may be either `deploy-key` or `user-key`. + */ + type: "user-key" | "deploy-key"; + }; + }): CancelablePromise<{ + message?: string; + }> { + return __request(OpenAPI, { + method: "POST", + url: "/project/{project-slug}/checkout-key", + path: { + "project-slug": projectSlug, + }, + body: requestBody, + mediaType: "application/json", + }); + } /** * Get all checkout keys * Returns a sequence of checkout keys for `:project`. @@ -110,64 +143,47 @@ export class ProjectService { }); } /** - * Create a new checkout key - * Creates a new checkout key. This API request is only usable with a user API token. - * @returns any Error response. + * Get a checkout key + * Returns an individual checkout key. + * @returns any The checkout key. * @throws ApiError */ - public static createCheckoutKey({ + public static getCheckoutKey({ projectSlug, - requestBody, + fingerprint, }: { /** * Project slug in the form `vcs-slug/org-name/repo-name`. The `/` characters may be URL-escaped. */ projectSlug: string; - requestBody?: { - /** - * The type of checkout key to create. This may be either `deploy-key` or `user-key`. - */ - type: "user-key" | "deploy-key"; - }; + /** + * An SSH key fingerprint. + */ + fingerprint: string; }): CancelablePromise<{ - message?: string; - }> { - return __request(OpenAPI, { - method: "POST", - url: "/project/{project-slug}/checkout-key", - path: { - "project-slug": projectSlug, - }, - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Delete a checkout key - * Deletes the checkout key. - * @returns any A confirmation message. - * @throws ApiError - */ - public static deleteCheckoutKey({ - projectSlug, - fingerprint, - }: { /** - * Project slug in the form `vcs-slug/org-name/repo-name`. The `/` characters may be URL-escaped. + * A public SSH key. */ - projectSlug: string; + "public-key": string; + /** + * The type of checkout key. This may be either `deploy-key` or `github-user-key`. + */ + type: "deploy-key" | "github-user-key"; /** * An SSH key fingerprint. */ fingerprint: string; - }): CancelablePromise<{ /** - * A human-readable message + * A boolean value that indicates if this key is preferred. */ - message: string; + preferred: boolean; + /** + * The date and time the checkout key was created. + */ + "created-at": string; }> { return __request(OpenAPI, { - method: "DELETE", + method: "GET", url: "/project/{project-slug}/checkout-key/{fingerprint}", path: { "project-slug": projectSlug, @@ -176,12 +192,12 @@ export class ProjectService { }); } /** - * Get a checkout key - * Returns an individual checkout key. - * @returns any The checkout key. + * Delete a checkout key + * Deletes the checkout key. + * @returns any A confirmation message. * @throws ApiError */ - public static getCheckoutKey({ + public static deleteCheckoutKey({ projectSlug, fingerprint, }: { @@ -195,28 +211,12 @@ export class ProjectService { fingerprint: string; }): CancelablePromise<{ /** - * A public SSH key. - */ - "public-key": string; - /** - * The type of checkout key. This may be either `deploy-key` or `github-user-key`. - */ - type: "deploy-key" | "github-user-key"; - /** - * An SSH key fingerprint. - */ - fingerprint: string; - /** - * A boolean value that indicates if this key is preferred. - */ - preferred: boolean; - /** - * The date and time the checkout key was created. + * A human-readable message */ - "created-at": string; + message: string; }> { return __request(OpenAPI, { - method: "GET", + method: "DELETE", url: "/project/{project-slug}/checkout-key/{fingerprint}", path: { "project-slug": projectSlug, diff --git a/client/services/ScheduleService.ts b/client/services/ScheduleService.ts index 06cd93a..f651925 100644 --- a/client/services/ScheduleService.ts +++ b/client/services/ScheduleService.ts @@ -431,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. @@ -638,31 +665,4 @@ export class ScheduleService { mediaType: "application/json", }); } - /** - * Delete a schedule - * Deletes the schedule by id. - * @returns any A confirmation message. - * @throws ApiError - */ - public static deleteScheduleById({ - scheduleId, - }: { - /** - * The unique ID of the schedule. - */ - scheduleId: string; - }): CancelablePromise<{ - /** - * A human-readable message - */ - message: string; - }> { - return __request(OpenAPI, { - method: "DELETE", - url: "/schedule/{schedule-id}", - path: { - "schedule-id": scheduleId, - }, - }); - } } diff --git a/client/services/WebhookService.ts b/client/services/WebhookService.ts index 37346ab..87d2bf1 100644 --- a/client/services/WebhookService.ts +++ b/client/services/WebhookService.ts @@ -136,40 +136,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) @@ -218,28 +196,48 @@ export class WebhookService { events: Array<"workflow-completed" | "job-completed">; }> { return __request(OpenAPI, { - method: "PUT", + method: "GET", url: "/webhook/{webhook-id}", path: { "webhook-id": webhookId, }, - body: requestBody, - mediaType: "application/json", }); } /** - * Get a webhook - * Get a webhook by id. + * Update a webhook * @returns any A webhook * @throws ApiError */ - public static getWebhookById({ + public static updateWebhook({ webhookId, + requestBody, }: { /** * ID of the webhook (UUID) */ webhookId: string; + requestBody?: { + /** + * Name of the webhook + */ + name?: string; + /** + * Events that will trigger the webhook + */ + events?: Array<"workflow-completed" | "job-completed">; + /** + * URL to deliver the webhook to. Note: protocol must be included as well (only https is supported) + */ + url?: string; + /** + * Secret used to build an HMAC hash of the payload and passed as a header in the webhook request + */ + "signing-secret"?: string; + /** + * Whether to enforce TLS certificate verification when delivering the webhook + */ + "verify-tls"?: boolean; + }; }): CancelablePromise<{ /** * URL to deliver the webhook to. Note: protocol must be included as well (only https is supported) @@ -288,11 +286,13 @@ export class WebhookService { events: Array<"workflow-completed" | "job-completed">; }> { return __request(OpenAPI, { - method: "GET", + method: "PUT", url: "/webhook/{webhook-id}", path: { "webhook-id": webhookId, }, + body: requestBody, + mediaType: "application/json", }); } /** diff --git a/swagger.json b/swagger.json index 04646b2..41bc582 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}": { @@ -437,53 +437,27 @@ } }, "/context/{context-id}/environment-variable/{env-var-name}": { - "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.", + "delete": { + "summary": "Remove an environment variable", + "description": "Delete an environment variable from a context.", "tags": ["Context"], - "operationId": "addEnvironmentVariableToContext", + "operationId": "deleteEnvironmentVariableFromContext", "responses": { "200": { - "description": "The new environment variable", + "description": "A confirmation message", "content": { "application/json": { "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "variable": { - "type": "string", - "description": "The name of the environment variable", - "example": "POSTGRES_USER" - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "The date and time the environment variable was created.", - "example": "2015-09-21T17:29:21.042Z" - }, - "context_id": { - "type": "string", - "format": "uuid", - "description": "ID of the context (UUID)" - } - }, - "required": ["variable", "created_at", "context_id"] - }, - { - "type": "object", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message" - } - }, - "required": ["message"], - "description": "message response", - "title": "MessageResponse" + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message" } - ] + }, + "required": ["message"], + "description": "message response", + "title": "MessageResponse" } } } @@ -505,16 +479,6 @@ } }, "parameters": [ - { - "in": "path", - "name": "context-id", - "description": "ID of the context (UUID)", - "schema": { - "type": "string", - "format": "uuid" - }, - "required": true - }, { "in": "path", "name": "env-var-name", @@ -524,47 +488,66 @@ }, "required": true, "example": "POSTGRES_USER" + }, + { + "in": "path", + "name": "context-id", + "description": "ID of the context (UUID)", + "schema": { + "type": "string", + "format": "uuid" + }, + "required": true } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "value": { - "type": "string", - "description": "The value of the environment variable", - "example": "some-secret-value" - } - }, - "required": ["value"] - } - } - } - } + ] }, - "delete": { - "summary": "Remove an environment variable", - "description": "Delete an environment variable from a context.", + "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.", "tags": ["Context"], - "operationId": "deleteEnvironmentVariableFromContext", + "operationId": "addEnvironmentVariableToContext", "responses": { "200": { - "description": "A confirmation message", + "description": "The new environment variable", "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message" + "anyOf": [ + { + "type": "object", + "properties": { + "variable": { + "type": "string", + "description": "The name of the environment variable", + "example": "POSTGRES_USER" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "The date and time the environment variable was created.", + "example": "2015-09-21T17:29:21.042Z" + }, + "context_id": { + "type": "string", + "format": "uuid", + "description": "ID of the context (UUID)" + } + }, + "required": ["variable", "created_at", "context_id"] + }, + { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message" + } + }, + "required": ["message"], + "description": "message response", + "title": "MessageResponse" } - }, - "required": ["message"], - "description": "message response", - "title": "MessageResponse" + ] } } } @@ -586,16 +569,6 @@ } }, "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", @@ -605,8 +578,35 @@ "format": "uuid" }, "required": true + }, + { + "in": "path", + "name": "env-var-name", + "description": "The name of the environment variable", + "schema": { + "type": "string" + }, + "required": true, + "example": "POSTGRES_USER" } - ] + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The value of the environment variable", + "example": "some-secret-value" + } + }, + "required": ["value"] + } + } + } + } } }, "/insights/pages/{project-slug}/summary": { @@ -1184,7 +1184,7 @@ }, { "in": "query", - "name": "timeseries-granularity", + "name": "granularity", "description": "The granularity for which to query timeseries data.", "schema": { "type": "string", @@ -2493,7 +2493,7 @@ "mttr", "failed_runs" ], - "description": "Metrics aggregated acrooss a workflow for a given time window." + "description": "Metrics aggregated across a workflow for a given time window." }, "trends": { "type": "object", @@ -2549,7 +2549,7 @@ "mttr", "throughput" ], - "description": "Trends for aggregated metrics acrooss a workflow for a given time window." + "description": "Trends for aggregated metrics across a workflow for a given time window." }, "workflow_names": { "type": "array", @@ -4059,6 +4059,110 @@ } }, "/project/{project-slug}/checkout-key": { + "post": { + "summary": "Create a new checkout key", + "description": "Creates a new checkout key. This API request is only usable with a user API token.", + "tags": ["Project"], + "operationId": "createCheckoutKey", + "responses": { + "201": { + "description": "The checkout key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "public-key": { + "type": "string", + "description": "A public SSH key.", + "example": "ssh-rsa ..." + }, + "type": { + "enum": ["deploy-key", "github-user-key"], + "type": "string", + "description": "The type of checkout key. This may be either `deploy-key` or `github-user-key`.", + "title": "CheckoutKeyType", + "example": "deploy-key" + }, + "fingerprint": { + "type": "string", + "description": "An SSH key fingerprint.", + "example": "c9:0b:1c:4f:d5:65:56:b9:ad:88:f9:81:2b:37:74:2f" + }, + "preferred": { + "type": "boolean", + "description": "A boolean value that indicates if this key is preferred.", + "example": true + }, + "created-at": { + "type": "string", + "format": "date-time", + "description": "The date and time the checkout key was created.", + "example": "2015-09-21T17:29:21.042Z" + } + }, + "required": [ + "public-key", + "type", + "fingerprint", + "preferred", + "created-at" + ], + "title": "CheckoutKey" + } + } + } + }, + "default": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + }, + "description": "Error response." + } + }, + "parameters": [ + { + "in": "path", + "name": "project-slug", + "description": "Project slug in the form `vcs-slug/org-name/repo-name`. The `/` characters may be URL-escaped.", + "schema": { + "type": "string" + }, + "required": true, + "example": "gh/CircleCI-Public/api-preview-docs", + "allowReserved": true + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "enum": ["user-key", "deploy-key"], + "type": "string", + "description": "The type of checkout key to create. This may be either `deploy-key` or `user-key`.", + "title": "CheckoutKeyInputType", + "example": "deploy-key" + } + }, + "required": ["type"], + "title": "CheckoutKeyInput" + } + } + } + } + }, "get": { "summary": "Get all checkout keys", "description": "Returns a sequence of checkout keys for `:project`.", @@ -4157,14 +4261,16 @@ "allowReserved": true } ] - }, - "post": { - "summary": "Create a new checkout key", - "description": "Creates a new checkout key. This API request is only usable with a user API token.", + } + }, + "/project/{project-slug}/checkout-key/{fingerprint}": { + "get": { + "summary": "Get a checkout key", + "description": "Returns an individual checkout key.", "tags": ["Project"], - "operationId": "createCheckoutKey", + "operationId": "getCheckoutKey", "responses": { - "201": { + "200": { "description": "The checkout key.", "content": { "application/json": { @@ -4199,92 +4305,15 @@ "description": "The date and time the checkout key was created.", "example": "2015-09-21T17:29:21.042Z" } - }, - "required": [ - "public-key", - "type", - "fingerprint", - "preferred", - "created-at" - ], - "title": "CheckoutKey" - } - } - } - }, - "default": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - } - } - }, - "description": "Error response." - } - }, - "parameters": [ - { - "in": "path", - "name": "project-slug", - "description": "Project slug in the form `vcs-slug/org-name/repo-name`. The `/` characters may be URL-escaped.", - "schema": { - "type": "string" - }, - "required": true, - "example": "gh/CircleCI-Public/api-preview-docs", - "allowReserved": true - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "type": { - "enum": ["user-key", "deploy-key"], - "type": "string", - "description": "The type of checkout key to create. This may be either `deploy-key` or `user-key`.", - "title": "CheckoutKeyInputType", - "example": "deploy-key" - } - }, - "required": ["type"], - "title": "CheckoutKeyInput" - } - } - } - } - } - }, - "/project/{project-slug}/checkout-key/{fingerprint}": { - "delete": { - "summary": "Delete a checkout key", - "description": "Deletes the checkout key.", - "tags": ["Project"], - "operationId": "deleteCheckoutKey", - "responses": { - "200": { - "description": "A confirmation message.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message" - } - }, - "required": ["message"], - "description": "message response", - "title": "MessageResponse" + }, + "required": [ + "public-key", + "type", + "fingerprint", + "preferred", + "created-at" + ], + "title": "CheckoutKey" } } } @@ -4329,56 +4358,27 @@ } ] }, - "get": { - "summary": "Get a checkout key", - "description": "Returns an individual checkout key.", + "delete": { + "summary": "Delete a checkout key", + "description": "Deletes the checkout key.", "tags": ["Project"], - "operationId": "getCheckoutKey", + "operationId": "deleteCheckoutKey", "responses": { "200": { - "description": "The checkout key.", + "description": "A confirmation message.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "public-key": { - "type": "string", - "description": "A public SSH key.", - "example": "ssh-rsa ..." - }, - "type": { - "enum": ["deploy-key", "github-user-key"], - "type": "string", - "description": "The type of checkout key. This may be either `deploy-key` or `github-user-key`.", - "title": "CheckoutKeyType", - "example": "deploy-key" - }, - "fingerprint": { - "type": "string", - "description": "An SSH key fingerprint.", - "example": "c9:0b:1c:4f:d5:65:56:b9:ad:88:f9:81:2b:37:74:2f" - }, - "preferred": { - "type": "boolean", - "description": "A boolean value that indicates if this key is preferred.", - "example": true - }, - "created-at": { + "message": { "type": "string", - "format": "date-time", - "description": "The date and time the checkout key was created.", - "example": "2015-09-21T17:29:21.042Z" + "description": "A human-readable message" } }, - "required": [ - "public-key", - "type", - "fingerprint", - "preferred", - "created-at" - ], - "title": "CheckoutKey" + "required": ["message"], + "description": "message response", + "title": "MessageResponse" } } } @@ -7334,6 +7334,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.", @@ -7731,60 +7785,6 @@ } } } - }, - "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 - } - ] } }, "/user/{id}": { @@ -8160,10 +8160,11 @@ } }, "/webhook/{webhook-id}": { - "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", @@ -8273,49 +8274,12 @@ }, "required": true } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Name of the webhook" - }, - "events": { - "type": "array", - "items": { - "enum": ["workflow-completed", "job-completed"], - "type": "string" - }, - "description": "Events that will trigger the webhook" - }, - "url": { - "type": "string", - "description": "URL to deliver the webhook to. Note: protocol must be included as well (only https is supported)" - }, - "signing-secret": { - "type": "string", - "description": "Secret used to build an HMAC hash of the payload and passed as a header in the webhook request" - }, - "verify-tls": { - "type": "boolean", - "description": "Whether to enforce TLS certificate verification when delivering the webhook" - } - }, - "description": "The parameters for an update webhook request" - } - } - } - } + ] }, - "get": { - "summary": "Get a webhook", - "description": "Get a webhook by id.", + "put": { + "summary": "Update a webhook", "tags": ["Webhook"], - "operationId": "getWebhookById", + "operationId": "updateWebhook", "responses": { "200": { "description": "A webhook", @@ -8425,7 +8389,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",