diff --git a/client/services/ContextService.ts b/client/services/ContextService.ts index ba430cb..68daf2b 100644 --- a/client/services/ContextService.ts +++ b/client/services/ContextService.ts @@ -2,57 +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 { - /** - * List contexts - * List all contexts for an owner. - * @returns any A paginated list of contexts - * @throws ApiError - */ - public static listContexts({ - ownerId, - ownerSlug, - ownerType, - pageToken, - }: { - /** The unique ID of the owner of the context. Specify either this or owner-slug. **/ - ownerId?: string; - /** A string that represents an organization. Specify either this or owner-id. Cannot be used for accounts. **/ - ownerSlug?: string; - /** The type of the owner. Defaults to "organization". Accounts are only used as context owners in server. **/ - ownerType?: "account" | "organization"; - /** A token to retrieve the next page of results. **/ - pageToken?: string; - }): CancelablePromise<{ - items: Array<{ - /** - * 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; - }>; - /** - * 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: "GET", - url: "/context", - query: { - "owner-id": ownerId, - "owner-slug": ownerSlug, - "owner-type": ownerType, - "page-token": pageToken, - }, - }); - } /** * Create a new context * @returns any The new context @@ -110,26 +59,53 @@ export class ContextService { }); } /** - * Delete a context - * @returns any A confirmation message + * List contexts + * List all contexts for an owner. + * @returns any A paginated list of contexts * @throws ApiError */ - public static deleteContext({ - contextId, + public static listContexts({ + ownerId, + ownerSlug, + ownerType, + pageToken, }: { - /** ID of the context (UUID) **/ - contextId: string; + /** The unique ID of the owner of the context. Specify either this or owner-slug. **/ + ownerId?: string; + /** A string that represents an organization. Specify either this or owner-id. Cannot be used for accounts. **/ + ownerSlug?: string; + /** The type of the owner. Defaults to "organization". Accounts are only used as context owners in server. **/ + ownerType?: "account" | "organization"; + /** A token to retrieve the next page of results. **/ + pageToken?: string; }): CancelablePromise<{ + items: Array<{ + /** + * 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; + }>; /** - * A human-readable message + * A token to pass as a `page-token` query parameter to return the next page of results. */ - message: string; + next_page_token: string; }> { return __request(OpenAPI, { - method: "DELETE", - url: "/context/{context-id}", - path: { - "context-id": contextId, + method: "GET", + url: "/context", + query: { + "owner-id": ownerId, + "owner-slug": ownerSlug, + "owner-type": ownerType, + "page-token": pageToken, }, }); } @@ -166,6 +142,30 @@ export class ContextService { }, }); } + /** + * Delete a context + * @returns any A confirmation message + * @throws ApiError + */ + public static deleteContext({ + contextId, + }: { + /** ID of the context (UUID) **/ + contextId: string; + }): CancelablePromise<{ + /** + * A human-readable message + */ + message: string; + }> { + return __request(OpenAPI, { + method: "DELETE", + url: "/context/{context-id}", + path: { + "context-id": contextId, + }, + }); + } /** * List environment variables * List information about environment variables in a context, not including their values. diff --git a/client/services/ProjectService.ts b/client/services/ProjectService.ts index f8c3a11..1068805 100644 --- a/client/services/ProjectService.ts +++ b/client/services/ProjectService.ts @@ -281,12 +281,12 @@ export class ProjectService { }); } /** - * Get a masked environment variable - * Returns the masked value of environment variable :name. - * @returns any The environment variable. + * Delete an environment variable + * Deletes the environment variable named :name. + * @returns any A confirmation message. * @throws ApiError */ - public static getEnvVar({ + public static deleteEnvVar({ projectSlug, name, }: { @@ -296,16 +296,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, @@ -314,12 +310,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, }: { @@ -329,12 +325,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 270e336..e741b03 100644 --- a/client/services/ScheduleService.ts +++ b/client/services/ScheduleService.ts @@ -187,16 +187,54 @@ export class ScheduleService { }); } /** - * Get a schedule - * Get a schedule by id. + * Update a schedule + * Updates a schedule and returns the updated schedule. * @returns any A schedule object. * @throws ApiError */ - public static getScheduleById({ + public static updateSchedule({ scheduleId, + requestBody, }: { /** The unique ID of the schedule. **/ scheduleId: string; + requestBody?: { + /** + * Description of the schedule. + */ + description?: string; + /** + * Name of the schedule. + */ + name?: string; + /** + * Timetable that specifies when a schedule triggers. + */ + timetable?: { + /** + * Number of times a schedule triggers per hour, value must be between 1 and 60 + */ + "per-hour"?: number; + /** + * Hours in a day in which the schedule triggers. + */ + "hours-of-day"?: Array; + /** + * Days in a week in which the schedule triggers. + */ + "days-of-week"?: Array< + "TUE" | "SAT" | "SUN" | "MON" | "THU" | "WED" | "FRI" + >; + }; + /** + * The attribution-actor of the scheduled pipeline. + */ + "attribution-actor"?: "current" | "system"; + /** + * Pipeline parameters represented as key-value pairs. Must contain branch or tag. + */ + parameters?: Record; + }; }): CancelablePromise<{ /** * The unique ID of the schedule. @@ -264,62 +302,26 @@ export class ScheduleService { description: string; }> { return __request(OpenAPI, { - method: "GET", + method: "PATCH", url: "/schedule/{schedule-id}", path: { "schedule-id": scheduleId, }, + body: requestBody, + mediaType: "application/json", }); } /** - * Update a schedule - * Updates a schedule and returns the updated schedule. + * Get a schedule + * Get a schedule by id. * @returns any A schedule object. * @throws ApiError */ - public static updateSchedule({ + public static getScheduleById({ scheduleId, - requestBody, }: { /** The unique ID of the schedule. **/ scheduleId: string; - requestBody?: { - /** - * Description of the schedule. - */ - description?: string; - /** - * Name of the schedule. - */ - name?: string; - /** - * Timetable that specifies when a schedule triggers. - */ - timetable?: { - /** - * Number of times a schedule triggers per hour, value must be between 1 and 60 - */ - "per-hour"?: number; - /** - * Hours in a day in which the schedule triggers. - */ - "hours-of-day"?: Array; - /** - * Days in a week in which the schedule triggers. - */ - "days-of-week"?: Array< - "TUE" | "SAT" | "SUN" | "MON" | "THU" | "WED" | "FRI" - >; - }; - /** - * The attribution-actor of the scheduled pipeline. - */ - "attribution-actor"?: "current" | "system"; - /** - * Pipeline parameters represented as key-value pairs. Must contain branch or tag. - */ - parameters?: Record; - }; }): CancelablePromise<{ /** * The unique ID of the schedule. @@ -387,13 +389,11 @@ export class ScheduleService { description: string; }> { return __request(OpenAPI, { - method: "PATCH", + method: "GET", url: "/schedule/{schedule-id}", path: { "schedule-id": scheduleId, }, - body: requestBody, - mediaType: "application/json", }); } } diff --git a/client/services/WebhookService.ts b/client/services/WebhookService.ts index b32176e..6671a21 100644 --- a/client/services/WebhookService.ts +++ b/client/services/WebhookService.ts @@ -2,59 +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 WebhookService { - /** - * Create a webhook - * @returns any Error response. - * @throws ApiError - */ - public static createWebhook({ - requestBody, - }: { - requestBody?: { - /** - * Name of the webhook - */ - name: string; - /** - * Events that will trigger the webhook - */ - events: Array<"workflow-completed" | "job-completed">; - /** - * URL to deliver the webhook to. Note: protocol must be included as well (only https is supported) - */ - url: string; - /** - * Whether to enforce TLS certificate verification when delivering the webhook - */ - "verify-tls": boolean; - /** - * This is a secret used to build an hmac hash of the payload and passed as a header in the webhook request - */ - "signing-secret": string; - /** - * The scope in which the relevant events that will trigger webhooks - */ - scope: { - /** - * ID of the scope being used (at the moment, only project ID is supported) - */ - id: string; - /** - * Type of the scope being used - */ - type: "project"; - }; - }; - }): CancelablePromise<{ - message?: string; - }> { - return __request(OpenAPI, { - method: "POST", - url: "/webhook", - body: requestBody, - mediaType: "application/json", - }); - } /** * List webhooks * Get a list of webhook that match the given scope-type and scope-id @@ -132,62 +79,69 @@ export class WebhookService { }); } /** - * Delete a webhook - * @returns any A confirmation message - * @throws ApiError - */ - public static deleteWebhook({ - webhookId, - }: { - /** ID of the webhook (UUID) **/ - webhookId: string; - }): CancelablePromise<{ - /** - * A human-readable message - */ - message: string; - }> { - return __request(OpenAPI, { - method: "DELETE", - url: "/webhook/{webhook-id}", - path: { - "webhook-id": webhookId, - }, - }); - } - /** - * Update a webhook - * @returns any A webhook + * Create a webhook + * @returns any Error response. * @throws ApiError */ - public static updateWebhook({ - webhookId, + public static createWebhook({ requestBody, }: { - /** ID of the webhook (UUID) **/ - webhookId: string; requestBody?: { /** * Name of the webhook */ - name?: string; + name: string; /** * Events that will trigger the webhook */ - events?: Array<"workflow-completed" | "job-completed">; + 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; + url: string; + /** + * Whether to enforce TLS certificate verification when delivering the webhook + */ + "verify-tls": boolean; /** * This is a secret used to build an hmac hash of the payload and passed as a header in the webhook request */ - "signing-secret"?: string; + "signing-secret": string; /** - * Whether to enforce TLS certificate verification when delivering the webhook + * The scope in which the relevant events that will trigger webhooks */ - "verify-tls"?: boolean; + scope: { + /** + * ID of the scope being used (at the moment, only project ID is supported) + */ + id: string; + /** + * Type of the scope being used + */ + type: "project"; + }; }; + }): CancelablePromise<{ + message?: string; + }> { + return __request(OpenAPI, { + method: "POST", + url: "/webhook", + body: requestBody, + mediaType: "application/json", + }); + } + /** + * Get a webhook + * Get a webhook by id. + * @returns any A webhook + * @throws ApiError + */ + public static getWebhookById({ + webhookId, + }: { + /** ID of the webhook (UUID) **/ + webhookId: string; }): CancelablePromise<{ /** * URL to deliver the webhook to. Note: protocol must be included as well (only https is supported) @@ -236,26 +190,70 @@ 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. + * Delete a webhook + * @returns any A confirmation message + * @throws ApiError + */ + public static deleteWebhook({ + webhookId, + }: { + /** ID of the webhook (UUID) **/ + webhookId: string; + }): CancelablePromise<{ + /** + * A human-readable message + */ + message: string; + }> { + return __request(OpenAPI, { + method: "DELETE", + url: "/webhook/{webhook-id}", + path: { + "webhook-id": webhookId, + }, + }); + } + /** + * Update a webhook * @returns any A webhook * @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; + /** + * This is a 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) @@ -304,11 +302,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 5904599..ccf4deb 100644 --- a/swagger.json +++ b/swagger.json @@ -26,6 +26,109 @@ ], "paths": { "/context": { + "post": { + "summary": "Create a new context", + "tags": ["Context"], + "operationId": "createContext", + "responses": { + "200": { + "description": "The new context", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The unique ID of the context." + }, + "name": { + "type": "string", + "description": "The user defined name of the context." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "The date and time the context was created.", + "example": "2015-09-21T17:29:21.042Z" + } + }, + "required": ["id", "name", "created_at"], + "title": "Context" + } + } + } + }, + "default": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + }, + "description": "Error response." + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The user defined name of the context." + }, + "owner": { + "oneOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The unique ID of the owner of the context. Specify either this or slug." + }, + "type": { + "enum": ["account", "organization"], + "type": "string", + "description": "The type of the owner. Defaults to \"organization\". Accounts are only used as context owners in server.", + "example": "organization" + } + }, + "required": ["id"] + }, + { + "type": "object", + "properties": { + "slug": { + "type": "string", + "description": "A string that represents an organization. Specify either this or id. Cannot be used for accounts." + }, + "type": { + "enum": ["organization"], + "type": "string", + "description": "The type of owner. Defaults to \"organization\". Accounts are only used as context owners in server and must be specified by an id instead of a slug." + } + }, + "required": ["slug"] + } + ] + } + }, + "required": ["name", "owner"] + } + } + } + } + }, "get": { "summary": "List contexts", "description": "List all contexts for an owner.", @@ -132,14 +235,17 @@ "allowEmptyValue": true } ] - }, - "post": { - "summary": "Create a new context", + } + }, + "/context/{context-id}": { + "get": { + "summary": "Get a context", + "description": "Returns basic information about a context.", "tags": ["Context"], - "operationId": "createContext", + "operationId": "getContext", "responses": { "200": { - "description": "The new context", + "description": "The context", "content": { "application/json": { "schema": { @@ -183,101 +289,6 @@ "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}": { - "delete": { - "summary": "Delete a context", - "tags": ["Context"], - "operationId": "deleteContext", - "responses": { - "200": { - "description": "A confirmation message", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message" - } - }, - "required": ["message"], - "description": "message response", - "title": "MessageResponse" - } - } - } - }, - "default": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - } - } - }, - "description": "Error response." - } - }, "parameters": [ { "in": "path", @@ -291,37 +302,26 @@ } ] }, - "get": { - "summary": "Get a context", - "description": "Returns basic information about a context.", + "delete": { + "summary": "Delete a context", "tags": ["Context"], - "operationId": "getContext", + "operationId": "deleteContext", "responses": { "200": { - "description": "The context", + "description": "A confirmation message", "content": { "application/json": { "schema": { "type": "object", "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "The unique ID of the context." - }, - "name": { - "type": "string", - "description": "The user defined name of the context." - }, - "created_at": { + "message": { "type": "string", - "format": "date-time", - "description": "The date and time the context was created.", - "example": "2015-09-21T17:29:21.042Z" + "description": "A human-readable message" } }, - "required": ["id", "name", "created_at"], - "title": "Context" + "required": ["message"], + "description": "message response", + "title": "MessageResponse" } } } @@ -4576,32 +4576,27 @@ } }, "/project/{project-slug}/envvar/{name}": { - "get": { - "summary": "Get a masked environment variable", - "description": "Returns the masked value of environment variable :name.", + "delete": { + "summary": "Delete an environment variable", + "description": "Deletes the environment variable named :name.", "tags": ["Project"], - "operationId": "getEnvVar", + "operationId": "deleteEnvVar", "responses": { "200": { - "description": "The environment variable.", + "description": "A confirmation message.", "content": { "application/json": { "schema": { "type": "object", "properties": { - "name": { + "message": { "type": "string", - "description": "The name of the environment variable.", - "example": "foo" - }, - "value": { - "type": "string", - "description": "The value of the environment variable.", - "example": "xxxx1234" + "description": "A human-readable message" } }, - "required": ["name", "value"], - "title": "EnvironmentVariablePair" + "required": ["message"], + "description": "message response", + "title": "MessageResponse" } } } @@ -4646,27 +4641,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" } } } @@ -6763,11 +6763,11 @@ } ] }, - "get": { - "summary": "Get a schedule", - "description": "Get a schedule by id.", + "patch": { + "summary": "Update a schedule", + "description": "Updates a schedule and returns the updated schedule.", "tags": ["Schedule"], - "operationId": "getScheduleById", + "operationId": "updateSchedule", "responses": { "200": { "description": "A schedule object.", @@ -6931,13 +6931,99 @@ }, "required": true } - ] + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "description": { + "type": "string", + "x-nullable": true, + "description": "Description of the schedule." + }, + "name": { + "type": "string", + "description": "Name of the schedule." + }, + "timetable": { + "type": "object", + "properties": { + "per-hour": { + "type": "integer", + "format": "integer", + "description": "Number of times a schedule triggers per hour, value must be between 1 and 60" + }, + "hours-of-day": { + "type": "array", + "items": { + "type": "integer", + "format": "integer", + "description": "Hour in a day in UTC, value must be between 0 and 24" + }, + "description": "Hours in a day in which the schedule triggers." + }, + "days-of-week": { + "type": "array", + "items": { + "enum": [ + "TUE", + "SAT", + "SUN", + "MON", + "THU", + "WED", + "FRI" + ], + "type": "string", + "description": "Day in a week, in three letters format" + }, + "description": "Days in a week in which the schedule triggers." + } + }, + "description": "Timetable that specifies when a schedule triggers." + }, + "attribution-actor": { + "enum": ["current", "system"], + "type": "string", + "description": "The attribution-actor of the scheduled pipeline.", + "example": "current" + }, + "parameters": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "description": "Pipeline parameters represented as key-value pairs. Must contain branch or tag.", + "example": { + "deploy_prod": true, + "branch": "feature/design-new-api" + } + } + }, + "description": "The parameters for an update schedule request", + "title": "UpdateScheduleParameters" + } + } + } + } }, - "patch": { - "summary": "Update a schedule", - "description": "Updates a schedule and returns the updated schedule.", + "get": { + "summary": "Get a schedule", + "description": "Get a schedule by id.", "tags": ["Schedule"], - "operationId": "updateSchedule", + "operationId": "getScheduleById", "responses": { "200": { "description": "A schedule object.", @@ -7101,93 +7187,7 @@ }, "required": true } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "description": { - "type": "string", - "x-nullable": true, - "description": "Description of the schedule." - }, - "name": { - "type": "string", - "description": "Name of the schedule." - }, - "timetable": { - "type": "object", - "properties": { - "per-hour": { - "type": "integer", - "format": "integer", - "description": "Number of times a schedule triggers per hour, value must be between 1 and 60" - }, - "hours-of-day": { - "type": "array", - "items": { - "type": "integer", - "format": "integer", - "description": "Hour in a day in UTC, value must be between 0 and 24" - }, - "description": "Hours in a day in which the schedule triggers." - }, - "days-of-week": { - "type": "array", - "items": { - "enum": [ - "TUE", - "SAT", - "SUN", - "MON", - "THU", - "WED", - "FRI" - ], - "type": "string", - "description": "Day in a week, in three letters format" - }, - "description": "Days in a week in which the schedule triggers." - } - }, - "description": "Timetable that specifies when a schedule triggers." - }, - "attribution-actor": { - "enum": ["current", "system"], - "type": "string", - "description": "The attribution-actor of the scheduled pipeline.", - "example": "current" - }, - "parameters": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string" - }, - { - "type": "boolean" - } - ] - }, - "description": "Pipeline parameters represented as key-value pairs. Must contain branch or tag.", - "example": { - "deploy_prod": true, - "branch": "feature/design-new-api" - } - } - }, - "description": "The parameters for an update schedule request", - "title": "UpdateScheduleParameters" - } - } - } - } + ] } }, "/user/{id}": { @@ -7256,178 +7256,14 @@ } }, "/webhook": { - "post": { - "summary": "Create a webhook", + "get": { + "summary": "List webhooks", + "description": "Get a list of webhook that match the given scope-type and scope-id", "tags": ["Webhook"], - "operationId": "createWebhook", + "operationId": "getWebhooks", "responses": { - "201": { - "description": "A webhook", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "URL to deliver the webhook to. Note: protocol must be included as well (only https is supported)" - }, - "verify-tls": { - "type": "boolean", - "description": "Whether to enforce TLS certificate verification when delivering the webhook" - }, - "id": { - "type": "string", - "format": "uuid", - "description": "The unique ID of the webhook" - }, - "signing-secret": { - "type": "string", - "description": "This is a secret used to build an hmac hash of the payload and passed as a header in the webhook request" - }, - "updated-at": { - "type": "string", - "format": "date-time", - "description": "The date and time the webhook was last updated.", - "example": "2015-09-21T17:29:21.042Z" - }, - "name": { - "type": "string", - "description": "Name of the webhook" - }, - "created-at": { - "type": "string", - "format": "date-time", - "description": "The date and time the webhook was created.", - "example": "2015-09-21T17:29:21.042Z" - }, - "scope": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "ID of the scope being used (at the moment, only project ID is supported)" - }, - "type": { - "type": "string", - "description": "Type of the scope being used" - } - }, - "required": ["id", "type"], - "description": "The scope in which the relevant events that will trigger webhooks" - }, - "events": { - "type": "array", - "items": { - "enum": ["workflow-completed", "job-completed"], - "type": "string" - }, - "description": "Events that will trigger the webhook" - } - }, - "required": [ - "id", - "scope", - "name", - "events", - "url", - "verify-tls", - "signing-secret", - "created-at", - "updated-at" - ], - "title": "Webhook" - } - } - } - }, - "default": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - } - } - }, - "description": "Error response." - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Name of the webhook" - }, - "events": { - "type": "array", - "items": { - "enum": ["workflow-completed", "job-completed"], - "type": "string" - }, - "description": "Events that will trigger the webhook" - }, - "url": { - "type": "string", - "description": "URL to deliver the webhook to. Note: protocol must be included as well (only https is supported)" - }, - "verify-tls": { - "type": "boolean", - "description": "Whether to enforce TLS certificate verification when delivering the webhook" - }, - "signing-secret": { - "type": "string", - "description": "This is a secret used to build an hmac hash of the payload and passed as a header in the webhook request" - }, - "scope": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "ID of the scope being used (at the moment, only project ID is supported)" - }, - "type": { - "enum": ["project"], - "type": "string", - "description": "Type of the scope being used" - } - }, - "required": ["id", "type"], - "description": "The scope in which the relevant events that will trigger webhooks" - } - }, - "required": [ - "name", - "events", - "url", - "verify-tls", - "signing-secret", - "scope" - ], - "description": "The parameters for a create webhook request" - } - } - } - } - }, - "get": { - "summary": "List webhooks", - "description": "Get a list of webhook that match the given scope-type and scope-id", - "tags": ["Webhook"], - "operationId": "getWebhooks", - "responses": { - "200": { - "description": "A list of webhooks", + "200": { + "description": "A list of webhooks", "content": { "application/json": { "schema": { @@ -7560,29 +7396,89 @@ "required": true } ] - } - }, - "/webhook/{webhook-id}": { - "delete": { - "summary": "Delete a webhook", + }, + "post": { + "summary": "Create a webhook", "tags": ["Webhook"], - "operationId": "deleteWebhook", + "operationId": "createWebhook", "responses": { - "200": { - "description": "A confirmation message", + "201": { + "description": "A webhook", "content": { "application/json": { "schema": { "type": "object", "properties": { - "message": { + "url": { "type": "string", - "description": "A human-readable message" + "description": "URL to deliver the webhook to. Note: protocol must be included as well (only https is supported)" + }, + "verify-tls": { + "type": "boolean", + "description": "Whether to enforce TLS certificate verification when delivering the webhook" + }, + "id": { + "type": "string", + "format": "uuid", + "description": "The unique ID of the webhook" + }, + "signing-secret": { + "type": "string", + "description": "This is a secret used to build an hmac hash of the payload and passed as a header in the webhook request" + }, + "updated-at": { + "type": "string", + "format": "date-time", + "description": "The date and time the webhook was last updated.", + "example": "2015-09-21T17:29:21.042Z" + }, + "name": { + "type": "string", + "description": "Name of the webhook" + }, + "created-at": { + "type": "string", + "format": "date-time", + "description": "The date and time the webhook was created.", + "example": "2015-09-21T17:29:21.042Z" + }, + "scope": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "ID of the scope being used (at the moment, only project ID is supported)" + }, + "type": { + "type": "string", + "description": "Type of the scope being used" + } + }, + "required": ["id", "type"], + "description": "The scope in which the relevant events that will trigger webhooks" + }, + "events": { + "type": "array", + "items": { + "enum": ["workflow-completed", "job-completed"], + "type": "string" + }, + "description": "Events that will trigger the webhook" } }, - "required": ["message"], - "description": "message response", - "title": "MessageResponse" + "required": [ + "id", + "scope", + "name", + "events", + "url", + "verify-tls", + "signing-secret", + "created-at", + "updated-at" + ], + "title": "Webhook" } } } @@ -7603,23 +7499,75 @@ "description": "Error response." } }, - "parameters": [ - { - "in": "path", - "name": "webhook-id", - "description": "ID of the webhook (UUID)", - "schema": { - "type": "string", - "format": "uuid" - }, - "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)" + }, + "verify-tls": { + "type": "boolean", + "description": "Whether to enforce TLS certificate verification when delivering the webhook" + }, + "signing-secret": { + "type": "string", + "description": "This is a secret used to build an hmac hash of the payload and passed as a header in the webhook request" + }, + "scope": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "ID of the scope being used (at the moment, only project ID is supported)" + }, + "type": { + "enum": ["project"], + "type": "string", + "description": "Type of the scope being used" + } + }, + "required": ["id", "type"], + "description": "The scope in which the relevant events that will trigger webhooks" + } + }, + "required": [ + "name", + "events", + "url", + "verify-tls", + "signing-secret", + "scope" + ], + "description": "The parameters for a create webhook request" + } + } } - ] - }, - "put": { - "summary": "Update a webhook", + } + } + }, + "/webhook/{webhook-id}": { + "get": { + "summary": "Get a webhook", + "description": "Get a webhook by id.", "tags": ["Webhook"], - "operationId": "updateWebhook", + "operationId": "getWebhookById", "responses": { "200": { "description": "A webhook", @@ -7729,49 +7677,65 @@ }, "required": true } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Name of the webhook" + ] + }, + "delete": { + "summary": "Delete a webhook", + "tags": ["Webhook"], + "operationId": "deleteWebhook", + "responses": { + "200": { + "description": "A confirmation message", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message" + } }, - "events": { - "type": "array", - "items": { - "enum": ["workflow-completed", "job-completed"], + "required": ["message"], + "description": "message response", + "title": "MessageResponse" + } + } + } + }, + "default": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { "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": "This is a 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" + } } - } + }, + "description": "Error response." } - } + }, + "parameters": [ + { + "in": "path", + "name": "webhook-id", + "description": "ID of the webhook (UUID)", + "schema": { + "type": "string", + "format": "uuid" + }, + "required": true + } + ] }, - "get": { - "summary": "Get a webhook", - "description": "Get a webhook by id.", + "put": { + "summary": "Update a webhook", "tags": ["Webhook"], - "operationId": "getWebhookById", + "operationId": "updateWebhook", "responses": { "200": { "description": "A webhook", @@ -7881,7 +7845,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": "This is a 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}": {