/* tslint:disable */ /* eslint-disable */ /** * Sonatype Lifecycle Public REST API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.207.0-01 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime'; import type { AttributionReportTemplateDTO, } from '../models/index'; import { AttributionReportTemplateDTOFromJSON, AttributionReportTemplateDTOToJSON, } from '../models/index'; export interface LicenseLegalMetadataTemplateApiDeleteAttributionReportTemplateRequest { id: string; } export interface LicenseLegalMetadataTemplateApiGetAttributionReportTemplateByIdRequest { id: string; } export interface LicenseLegalMetadataTemplateApiSaveAttributionReportTemplateRequest { attributionReportTemplateDTO?: AttributionReportTemplateDTO; } /** * LicenseLegalMetadataTemplateApi - interface * * @export * @interface LicenseLegalMetadataTemplateApiInterface */ export interface LicenseLegalMetadataTemplateApiInterface { /** * Use this method to delete an existing template. Permissions required: Review Legal Obligations For Components Licenses for the root organization * @param {string} id Enter the template id for the template to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LicenseLegalMetadataTemplateApiInterface */ deleteAttributionReportTemplateRaw(requestParameters: LicenseLegalMetadataTemplateApiDeleteAttributionReportTemplateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to delete an existing template. Permissions required: Review Legal Obligations For Components Licenses for the root organization */ deleteAttributionReportTemplate(requestParameters: LicenseLegalMetadataTemplateApiDeleteAttributionReportTemplateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to retrieve templates for all reports. Permissions required: Review Legal Obligations For Components Licenses for the root organization * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LicenseLegalMetadataTemplateApiInterface */ getAllAttributionReportTemplatesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>>; /** * Use this method to retrieve templates for all reports. Permissions required: Review Legal Obligations For Components Licenses for the root organization */ getAllAttributionReportTemplates(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to retrieve a template for license legal metadata. Permissions required: Review Legal Obligations For Components Licenses for the root organization. * @param {string} id Enter the templateId for the report. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LicenseLegalMetadataTemplateApiInterface */ getAttributionReportTemplateByIdRaw(requestParameters: LicenseLegalMetadataTemplateApiGetAttributionReportTemplateByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to retrieve a template for license legal metadata. Permissions required: Review Legal Obligations For Components Licenses for the root organization. */ getAttributionReportTemplateById(requestParameters: LicenseLegalMetadataTemplateApiGetAttributionReportTemplateByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to create or update a template. Permissions required: Review Legal Obligations For Components Licenses for the root organization * @param {AttributionReportTemplateDTO} [attributionReportTemplateDTO] Specify the details for the template as:<ul><li>`id` is the template id.</li><li>`templateName` indicates the name of the stored template.</li><li>`documentTitle` is the title that is displayed at the top of the report.</li><li>`header` is the text that will be displayed above the `documentTitle`.</li><li>`footer` is the text that will be displayed at the bottom of the report.<li><li>`includeTableOfContents` is `true` if a table of contents containing links to the components and their licenses will be added to the report.<li>`includeAppendix` is `true` if standard license text will be grouped in the report appendix.</li><li>`includeStandardLicenseTexts` is `true` if the standard license text will be displayed for components with no license files.</li><li>`includeSonatypeSpecialLicenses` is `true` if Sonatype Special Licenses (e.g. Generic-Copyleft-Clause, Generic-Liberal-Clause, See-License-Clause, Identity-Clause etc.) will be included in the report.</li><li>`includeInnerSource` is `true` if InnerSource components will be included in the report.</li></ul> * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LicenseLegalMetadataTemplateApiInterface */ saveAttributionReportTemplateRaw(requestParameters: LicenseLegalMetadataTemplateApiSaveAttributionReportTemplateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to create or update a template. Permissions required: Review Legal Obligations For Components Licenses for the root organization */ saveAttributionReportTemplate(requestParameters: LicenseLegalMetadataTemplateApiSaveAttributionReportTemplateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; } /** * */ export class LicenseLegalMetadataTemplateApi extends runtime.BaseAPI implements LicenseLegalMetadataTemplateApiInterface { /** * Use this method to delete an existing template. Permissions required: Review Legal Obligations For Components Licenses for the root organization */ async deleteAttributionReportTemplateRaw(requestParameters: LicenseLegalMetadataTemplateApiDeleteAttributionReportTemplateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['id'] == null) { throw new runtime.RequiredError( 'id', 'Required parameter "id" was null or undefined when calling deleteAttributionReportTemplate().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("BearerAuth", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/api/v2/licenseLegalMetadata/report-template/{id}`; urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); const response = await this.request({ path: urlPath, method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Use this method to delete an existing template. Permissions required: Review Legal Obligations For Components Licenses for the root organization */ async deleteAttributionReportTemplate(requestParameters: LicenseLegalMetadataTemplateApiDeleteAttributionReportTemplateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { await this.deleteAttributionReportTemplateRaw(requestParameters, initOverrides); } /** * Use this method to retrieve templates for all reports. Permissions required: Review Legal Obligations For Components Licenses for the root organization */ async getAllAttributionReportTemplatesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("BearerAuth", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/api/v2/licenseLegalMetadata/report-template`; const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AttributionReportTemplateDTOFromJSON)); } /** * Use this method to retrieve templates for all reports. Permissions required: Review Legal Obligations For Components Licenses for the root organization */ async getAllAttributionReportTemplates(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.getAllAttributionReportTemplatesRaw(initOverrides); return await response.value(); } /** * Use this method to retrieve a template for license legal metadata. Permissions required: Review Legal Obligations For Components Licenses for the root organization. */ async getAttributionReportTemplateByIdRaw(requestParameters: LicenseLegalMetadataTemplateApiGetAttributionReportTemplateByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['id'] == null) { throw new runtime.RequiredError( 'id', 'Required parameter "id" was null or undefined when calling getAttributionReportTemplateById().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("BearerAuth", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/api/v2/licenseLegalMetadata/report-template/{id}`; urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => AttributionReportTemplateDTOFromJSON(jsonValue)); } /** * Use this method to retrieve a template for license legal metadata. Permissions required: Review Legal Obligations For Components Licenses for the root organization. */ async getAttributionReportTemplateById(requestParameters: LicenseLegalMetadataTemplateApiGetAttributionReportTemplateByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getAttributionReportTemplateByIdRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to create or update a template. Permissions required: Review Legal Obligations For Components Licenses for the root organization */ async saveAttributionReportTemplateRaw(requestParameters: LicenseLegalMetadataTemplateApiSaveAttributionReportTemplateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("BearerAuth", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/api/v2/licenseLegalMetadata/report-template`; const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: AttributionReportTemplateDTOToJSON(requestParameters['attributionReportTemplateDTO']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => AttributionReportTemplateDTOFromJSON(jsonValue)); } /** * Use this method to create or update a template. Permissions required: Review Legal Obligations For Components Licenses for the root organization */ async saveAttributionReportTemplate(requestParameters: LicenseLegalMetadataTemplateApiSaveAttributionReportTemplateRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.saveAttributionReportTemplateRaw(requestParameters, initOverrides); return await response.value(); } }