Path: blob/main/src/publish/netlify/api/services/SnippetService.ts
6464 views
/* istanbul ignore file */1/* tslint:disable */2/* eslint-disable */3import type { CancelablePromise } from "../core/CancelablePromise.ts";4import type { BaseHttpRequest } from "../core/BaseHttpRequest.ts";56export class SnippetService {7constructor(public readonly httpRequest: BaseHttpRequest) {}89/**10* @returns any OK11* @throws ApiError12*/13public listSiteSnippets({14siteId,15}: {16siteId: string;17}): CancelablePromise<18Array<{19id?: number;20site_id?: string;21title?: string;22general?: string;23general_position?: string;24goal?: string;25goal_position?: string;26}>27> {28return this.httpRequest.request({29method: "GET",30url: "/sites/{site_id}/snippets",31path: {32"site_id": siteId,33},34});35}3637/**38* @returns any error39* @throws ApiError40*/41public createSiteSnippet({42siteId,43snippet,44}: {45siteId: string;46snippet: {47id?: number;48site_id?: string;49title?: string;50general?: string;51general_position?: string;52goal?: string;53goal_position?: string;54};55}): CancelablePromise<{56code?: number;57message: string;58}> {59return this.httpRequest.request({60method: "POST",61url: "/sites/{site_id}/snippets",62path: {63"site_id": siteId,64},65body: snippet,66});67}6869/**70* @returns any OK71* @throws ApiError72*/73public getSiteSnippet({74siteId,75snippetId,76}: {77siteId: string;78snippetId: string;79}): CancelablePromise<{80id?: number;81site_id?: string;82title?: string;83general?: string;84general_position?: string;85goal?: string;86goal_position?: string;87}> {88return this.httpRequest.request({89method: "GET",90url: "/sites/{site_id}/snippets/{snippet_id}",91path: {92"site_id": siteId,93"snippet_id": snippetId,94},95});96}9798/**99* @returns any error100* @throws ApiError101*/102public updateSiteSnippet({103siteId,104snippetId,105snippet,106}: {107siteId: string;108snippetId: string;109snippet: {110id?: number;111site_id?: string;112title?: string;113general?: string;114general_position?: string;115goal?: string;116goal_position?: string;117};118}): CancelablePromise<{119code?: number;120message: string;121}> {122return this.httpRequest.request({123method: "PUT",124url: "/sites/{site_id}/snippets/{snippet_id}",125path: {126"site_id": siteId,127"snippet_id": snippetId,128},129body: snippet,130});131}132133/**134* @returns any error135* @throws ApiError136*/137public deleteSiteSnippet({138siteId,139snippetId,140}: {141siteId: string;142snippetId: string;143}): CancelablePromise<{144code?: number;145message: string;146}> {147return this.httpRequest.request({148method: "DELETE",149url: "/sites/{site_id}/snippets/{snippet_id}",150path: {151"site_id": siteId,152"snippet_id": snippetId,153},154});155}156}157158159