/* 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 {
ApiWaiverExpirationNotificationConfigDTO,
} from '../models/index';
import {
ApiWaiverExpirationNotificationConfigDTOFromJSON,
ApiWaiverExpirationNotificationConfigDTOToJSON,
} from '../models/index';
export interface WaiverExpirationNotificationConfigApiGetConfig1Request {
ownerType: string;
ownerId: string;
}
export interface WaiverExpirationNotificationConfigApiSaveConfigRequest {
ownerType: string;
ownerId: string;
apiWaiverExpirationNotificationConfigDTO: ApiWaiverExpirationNotificationConfigDTO;
}
/**
* WaiverExpirationNotificationConfigApi - interface
*
* @export
* @interface WaiverExpirationNotificationConfigApiInterface
*/
export interface WaiverExpirationNotificationConfigApiInterface {
/**
* Returns the effective waiver expiration notification configuration for the given owner. If the owner has no custom configuration, the inherited configuration from the parent is returned with inheritConfig=true.
Permissions required: View IQ Elements
* @param {string} ownerType The owner type (organization, repository_manager, or repository_container).
* @param {string} ownerId The internal owner ID assigned by IQ Server.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof WaiverExpirationNotificationConfigApiInterface
*/
getConfig1Raw(requestParameters: WaiverExpirationNotificationConfigApiGetConfig1Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>;
/**
* Returns the effective waiver expiration notification configuration for the given owner. If the owner has no custom configuration, the inherited configuration from the parent is returned with inheritConfig=true.Permissions required: View IQ Elements
*/
getConfig1(requestParameters: WaiverExpirationNotificationConfigApiGetConfig1Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise;
/**
* Sets the waiver expiration notification configuration for the given owner. Set inheritConfig=true to inherit the configuration from the parent.Permissions required: Edit IQ Elements
* @param {string} ownerType The owner type (organization, repository_manager, or repository_container).
* @param {string} ownerId The internal owner ID assigned by IQ Server.
* @param {ApiWaiverExpirationNotificationConfigDTO} apiWaiverExpirationNotificationConfigDTO The notification configuration to save.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof WaiverExpirationNotificationConfigApiInterface
*/
saveConfigRaw(requestParameters: WaiverExpirationNotificationConfigApiSaveConfigRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>;
/**
* Sets the waiver expiration notification configuration for the given owner. Set inheritConfig=true to inherit the configuration from the parent.Permissions required: Edit IQ Elements
*/
saveConfig(requestParameters: WaiverExpirationNotificationConfigApiSaveConfigRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise;
}
/**
*
*/
export class WaiverExpirationNotificationConfigApi extends runtime.BaseAPI implements WaiverExpirationNotificationConfigApiInterface {
/**
* Returns the effective waiver expiration notification configuration for the given owner. If the owner has no custom configuration, the inherited configuration from the parent is returned with inheritConfig=true.Permissions required: View IQ Elements
*/
async getConfig1Raw(requestParameters: WaiverExpirationNotificationConfigApiGetConfig1Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
if (requestParameters['ownerType'] == null) {
throw new runtime.RequiredError(
'ownerType',
'Required parameter "ownerType" was null or undefined when calling getConfig1().'
);
}
if (requestParameters['ownerId'] == null) {
throw new runtime.RequiredError(
'ownerId',
'Required parameter "ownerId" was null or undefined when calling getConfig1().'
);
}
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/waiverExpirationNotificationConfig/{ownerType}/{ownerId}`;
urlPath = urlPath.replace(`{${"ownerType"}}`, encodeURIComponent(String(requestParameters['ownerType'])));
urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => ApiWaiverExpirationNotificationConfigDTOFromJSON(jsonValue));
}
/**
* Returns the effective waiver expiration notification configuration for the given owner. If the owner has no custom configuration, the inherited configuration from the parent is returned with inheritConfig=true.Permissions required: View IQ Elements
*/
async getConfig1(requestParameters: WaiverExpirationNotificationConfigApiGetConfig1Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise {
const response = await this.getConfig1Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* Sets the waiver expiration notification configuration for the given owner. Set inheritConfig=true to inherit the configuration from the parent.Permissions required: Edit IQ Elements
*/
async saveConfigRaw(requestParameters: WaiverExpirationNotificationConfigApiSaveConfigRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
if (requestParameters['ownerType'] == null) {
throw new runtime.RequiredError(
'ownerType',
'Required parameter "ownerType" was null or undefined when calling saveConfig().'
);
}
if (requestParameters['ownerId'] == null) {
throw new runtime.RequiredError(
'ownerId',
'Required parameter "ownerId" was null or undefined when calling saveConfig().'
);
}
if (requestParameters['apiWaiverExpirationNotificationConfigDTO'] == null) {
throw new runtime.RequiredError(
'apiWaiverExpirationNotificationConfigDTO',
'Required parameter "apiWaiverExpirationNotificationConfigDTO" was null or undefined when calling saveConfig().'
);
}
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/waiverExpirationNotificationConfig/{ownerType}/{ownerId}`;
urlPath = urlPath.replace(`{${"ownerType"}}`, encodeURIComponent(String(requestParameters['ownerType'])));
urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId'])));
const response = await this.request({
path: urlPath,
method: 'PUT',
headers: headerParameters,
query: queryParameters,
body: ApiWaiverExpirationNotificationConfigDTOToJSON(requestParameters['apiWaiverExpirationNotificationConfigDTO']),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Sets the waiver expiration notification configuration for the given owner. Set inheritConfig=true to inherit the configuration from the parent.Permissions required: Edit IQ Elements
*/
async saveConfig(requestParameters: WaiverExpirationNotificationConfigApiSaveConfigRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise {
await this.saveConfigRaw(requestParameters, initOverrides);
}
}