/* 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 { ApiAutoPolicyWaiverDTO, ApiAutoPolicyWaiverStatusDTO, } from '../models/index'; import { ApiAutoPolicyWaiverDTOFromJSON, ApiAutoPolicyWaiverDTOToJSON, ApiAutoPolicyWaiverStatusDTOFromJSON, ApiAutoPolicyWaiverStatusDTOToJSON, } from '../models/index'; export interface AutoPolicyWaiversApiAddAutoPolicyWaiverRequest { ownerType: AddAutoPolicyWaiverOwnerTypeEnum; ownerId: string; apiAutoPolicyWaiverDTO: ApiAutoPolicyWaiverDTO; } export interface AutoPolicyWaiversApiAddAutoPolicyWaiversRequest { ownerType: AddAutoPolicyWaiversOwnerTypeEnum; ownerId: string; apiAutoPolicyWaiverDTO: Array; } export interface AutoPolicyWaiversApiDeleteAutoPolicyWaiverRequest { ownerType: DeleteAutoPolicyWaiverOwnerTypeEnum; ownerId: string; autoPolicyWaiverId: string; } export interface AutoPolicyWaiversApiGetApplicableAutoWaiversRequest { ownerType: GetApplicableAutoWaiversOwnerTypeEnum; ownerId: string; } export interface AutoPolicyWaiversApiGetAutoPolicyWaiverRequest { ownerType: GetAutoPolicyWaiverOwnerTypeEnum; ownerId: string; autoPolicyWaiverId: string; } export interface AutoPolicyWaiversApiGetAutoPolicyWaiverStatusRequest { ownerType: GetAutoPolicyWaiverStatusOwnerTypeEnum; ownerId: string; } export interface AutoPolicyWaiversApiGetAutoPolicyWaiversRequest { ownerType: GetAutoPolicyWaiversOwnerTypeEnum; ownerId: string; } export interface AutoPolicyWaiversApiUpdateAutoPolicyWaiverRequest { ownerType: UpdateAutoPolicyWaiverOwnerTypeEnum; ownerId: string; autoPolicyWaiverId: string; apiAutoPolicyWaiverDTO: ApiAutoPolicyWaiverDTO; } /** * AutoPolicyWaiversApi - interface * * @export * @interface AutoPolicyWaiversApiInterface */ export interface AutoPolicyWaiversApiInterface { /** * Use this method to create an auto policy waiver configuration. Only one configuration can exist at a time for a given application or organization. Permissions required: Waive Policy Violations * @param {'application' | 'organization'} ownerType Enter the ownerType to specify the scope. The response will contain the details for waivers within the scope. * @param {string} ownerId Enter the corresponding id for the ownerType specified above. * @param {ApiAutoPolicyWaiverDTO} apiAutoPolicyWaiverDTO The request JSON can include the fields<ol><li>threatLevel</li><li>pathForward</li><li>reachable</li></ol> * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AutoPolicyWaiversApiInterface */ addAutoPolicyWaiverRaw(requestParameters: AutoPolicyWaiversApiAddAutoPolicyWaiverRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to create an auto policy waiver configuration. Only one configuration can exist at a time for a given application or organization. Permissions required: Waive Policy Violations */ addAutoPolicyWaiver(requestParameters: AutoPolicyWaiversApiAddAutoPolicyWaiverRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to create an auto policy waiver configuration. Only three configurations can exist at a time for a given application or organization. With different combinations for reachable/pathForward Permissions required: Waive Policy Violations * @param {'application' | 'organization'} ownerType Enter the ownerType to specify the scope. The response will contain the details for waivers within the scope. * @param {string} ownerId Enter the corresponding id for the ownerType specified above. * @param {Array} apiAutoPolicyWaiverDTO The request JSON can be an array that include the fields<ol><li>threatLevel</li><li>pathForward</li><li>reachable</li></ol> * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AutoPolicyWaiversApiInterface */ addAutoPolicyWaiversRaw(requestParameters: AutoPolicyWaiversApiAddAutoPolicyWaiversRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>>; /** * Use this method to create an auto policy waiver configuration. Only three configurations can exist at a time for a given application or organization. With different combinations for reachable/pathForward Permissions required: Waive Policy Violations */ addAutoPolicyWaivers(requestParameters: AutoPolicyWaiversApiAddAutoPolicyWaiversRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to delete an auto policy waiver, specified by the autoPolicyWaiverId. Permissions required: Waive Policy Violations * @param {'application' | 'organization'} ownerType Enter the ownerType to specify the scope. A waiver corresponding to the autoPolicyWaiverId provided and within the scope specified will be deleted. * @param {string} ownerId Enter the corresponding id for the ownerType specified above. * @param {string} autoPolicyWaiverId Enter the autoPolicyWaiverId to be deleted * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AutoPolicyWaiversApiInterface */ deleteAutoPolicyWaiverRaw(requestParameters: AutoPolicyWaiversApiDeleteAutoPolicyWaiverRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to delete an auto policy waiver, specified by the autoPolicyWaiverId. Permissions required: Waive Policy Violations */ deleteAutoPolicyWaiver(requestParameters: AutoPolicyWaiversApiDeleteAutoPolicyWaiverRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to retrieve all applicable auto waivers for the scope specified. You can specify the scope by using the parameters ownerType and ownerId. Permissions required: View IQ Elements * @param {'application' | 'organization'} ownerType Enter the ownerType to specify the scope. The response will contain applicable auto policy waivers, if any, that are within the scope specified. * @param {string} ownerId Enter the corresponding id for the ownerType. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AutoPolicyWaiversApiInterface */ getApplicableAutoWaiversRaw(requestParameters: AutoPolicyWaiversApiGetApplicableAutoWaiversRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>>; /** * Use this method to retrieve all applicable auto waivers for the scope specified. You can specify the scope by using the parameters ownerType and ownerId. Permissions required: View IQ Elements */ getApplicableAutoWaivers(requestParameters: AutoPolicyWaiversApiGetApplicableAutoWaiversRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to retrieve auto policy waiver details for the autoPolicyWaiverId specified. Permissions required: View IQ Elements * @param {'application' | 'organization'} ownerType Enter the ownerType to specify the scope. The response will contain the details for waivers within the scope. * @param {string} ownerId Enter the corresponding id for the ownerType specified above. * @param {string} autoPolicyWaiverId Enter the autoPolicyWaiverId for which you want to retrieve the auto policy waiver details. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AutoPolicyWaiversApiInterface */ getAutoPolicyWaiverRaw(requestParameters: AutoPolicyWaiversApiGetAutoPolicyWaiverRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to retrieve auto policy waiver details for the autoPolicyWaiverId specified. Permissions required: View IQ Elements */ getAutoPolicyWaiver(requestParameters: AutoPolicyWaiversApiGetAutoPolicyWaiverRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to retrieve status details for any auto policy waiver enabled for the scope specified. You can specify the scope by using the parameters ownerType and ownerId. Permissions required: View IQ Elements * @param {'application' | 'organization'} ownerType Enter the ownerType to specify the scope. The response will contain status details for the active auto policy waiver, if any, that is within the scope specified. * @param {string} ownerId Enter the corresponding id for the ownerType specified above. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AutoPolicyWaiversApiInterface */ getAutoPolicyWaiverStatusRaw(requestParameters: AutoPolicyWaiversApiGetAutoPolicyWaiverStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to retrieve status details for any auto policy waiver enabled for the scope specified. You can specify the scope by using the parameters ownerType and ownerId. Permissions required: View IQ Elements */ getAutoPolicyWaiverStatus(requestParameters: AutoPolicyWaiversApiGetAutoPolicyWaiverStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to retrieve waiver details for all auto policy waivers for the scope specified. You can specify the scope by using the parameters ownerType and ownerId. Permissions required: View IQ Elements * @param {'application' | 'organization'} ownerType Enter the ownerType to specify the scope. The response will contain waivers that are within the scope specified. * @param {string} ownerId Enter the corresponding id for the ownerType specified above. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AutoPolicyWaiversApiInterface */ getAutoPolicyWaiversRaw(requestParameters: AutoPolicyWaiversApiGetAutoPolicyWaiversRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>>; /** * Use this method to retrieve waiver details for all auto policy waivers for the scope specified. You can specify the scope by using the parameters ownerType and ownerId. Permissions required: View IQ Elements */ getAutoPolicyWaivers(requestParameters: AutoPolicyWaiversApiGetAutoPolicyWaiversRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to update an auto policy waiver, specified by the autoPolicyWaiverId. Permissions required: Write IQ Elements * @param {'application' | 'organization'} ownerType Enter the ownerType to specify the scope. The response will contain the details for waivers within the scope. * @param {string} ownerId Enter the corresponding id for the ownerType specified above. * @param {string} autoPolicyWaiverId Enter the autoPolicyWaiverId to be updated. * @param {ApiAutoPolicyWaiverDTO} apiAutoPolicyWaiverDTO The request JSON can include the fields<ol><li>autoPolicyWaiverId</li><li>threatLevel</li><li>pathForward</li><li>reachable</li></ol> * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AutoPolicyWaiversApiInterface */ updateAutoPolicyWaiverRaw(requestParameters: AutoPolicyWaiversApiUpdateAutoPolicyWaiverRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to update an auto policy waiver, specified by the autoPolicyWaiverId. Permissions required: Write IQ Elements */ updateAutoPolicyWaiver(requestParameters: AutoPolicyWaiversApiUpdateAutoPolicyWaiverRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; } /** * */ export class AutoPolicyWaiversApi extends runtime.BaseAPI implements AutoPolicyWaiversApiInterface { /** * Use this method to create an auto policy waiver configuration. Only one configuration can exist at a time for a given application or organization. Permissions required: Waive Policy Violations */ async addAutoPolicyWaiverRaw(requestParameters: AutoPolicyWaiversApiAddAutoPolicyWaiverRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['ownerType'] == null) { throw new runtime.RequiredError( 'ownerType', 'Required parameter "ownerType" was null or undefined when calling addAutoPolicyWaiver().' ); } if (requestParameters['ownerId'] == null) { throw new runtime.RequiredError( 'ownerId', 'Required parameter "ownerId" was null or undefined when calling addAutoPolicyWaiver().' ); } if (requestParameters['apiAutoPolicyWaiverDTO'] == null) { throw new runtime.RequiredError( 'apiAutoPolicyWaiverDTO', 'Required parameter "apiAutoPolicyWaiverDTO" was null or undefined when calling addAutoPolicyWaiver().' ); } 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/autoPolicyWaivers/{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: 'POST', headers: headerParameters, query: queryParameters, body: ApiAutoPolicyWaiverDTOToJSON(requestParameters['apiAutoPolicyWaiverDTO']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiAutoPolicyWaiverDTOFromJSON(jsonValue)); } /** * Use this method to create an auto policy waiver configuration. Only one configuration can exist at a time for a given application or organization. Permissions required: Waive Policy Violations */ async addAutoPolicyWaiver(requestParameters: AutoPolicyWaiversApiAddAutoPolicyWaiverRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.addAutoPolicyWaiverRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to create an auto policy waiver configuration. Only three configurations can exist at a time for a given application or organization. With different combinations for reachable/pathForward Permissions required: Waive Policy Violations */ async addAutoPolicyWaiversRaw(requestParameters: AutoPolicyWaiversApiAddAutoPolicyWaiversRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { if (requestParameters['ownerType'] == null) { throw new runtime.RequiredError( 'ownerType', 'Required parameter "ownerType" was null or undefined when calling addAutoPolicyWaivers().' ); } if (requestParameters['ownerId'] == null) { throw new runtime.RequiredError( 'ownerId', 'Required parameter "ownerId" was null or undefined when calling addAutoPolicyWaivers().' ); } if (requestParameters['apiAutoPolicyWaiverDTO'] == null) { throw new runtime.RequiredError( 'apiAutoPolicyWaiverDTO', 'Required parameter "apiAutoPolicyWaiverDTO" was null or undefined when calling addAutoPolicyWaivers().' ); } 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/autoPolicyWaivers/v2/{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: 'POST', headers: headerParameters, query: queryParameters, body: requestParameters['apiAutoPolicyWaiverDTO']!.map(ApiAutoPolicyWaiverDTOToJSON), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ApiAutoPolicyWaiverDTOFromJSON)); } /** * Use this method to create an auto policy waiver configuration. Only three configurations can exist at a time for a given application or organization. With different combinations for reachable/pathForward Permissions required: Waive Policy Violations */ async addAutoPolicyWaivers(requestParameters: AutoPolicyWaiversApiAddAutoPolicyWaiversRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.addAutoPolicyWaiversRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to delete an auto policy waiver, specified by the autoPolicyWaiverId. Permissions required: Waive Policy Violations */ async deleteAutoPolicyWaiverRaw(requestParameters: AutoPolicyWaiversApiDeleteAutoPolicyWaiverRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['ownerType'] == null) { throw new runtime.RequiredError( 'ownerType', 'Required parameter "ownerType" was null or undefined when calling deleteAutoPolicyWaiver().' ); } if (requestParameters['ownerId'] == null) { throw new runtime.RequiredError( 'ownerId', 'Required parameter "ownerId" was null or undefined when calling deleteAutoPolicyWaiver().' ); } if (requestParameters['autoPolicyWaiverId'] == null) { throw new runtime.RequiredError( 'autoPolicyWaiverId', 'Required parameter "autoPolicyWaiverId" was null or undefined when calling deleteAutoPolicyWaiver().' ); } 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/autoPolicyWaivers/{ownerType}/{ownerId}/{autoPolicyWaiverId}`; urlPath = urlPath.replace(`{${"ownerType"}}`, encodeURIComponent(String(requestParameters['ownerType']))); urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId']))); urlPath = urlPath.replace(`{${"autoPolicyWaiverId"}}`, encodeURIComponent(String(requestParameters['autoPolicyWaiverId']))); 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 auto policy waiver, specified by the autoPolicyWaiverId. Permissions required: Waive Policy Violations */ async deleteAutoPolicyWaiver(requestParameters: AutoPolicyWaiversApiDeleteAutoPolicyWaiverRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { await this.deleteAutoPolicyWaiverRaw(requestParameters, initOverrides); } /** * Use this method to retrieve all applicable auto waivers for the scope specified. You can specify the scope by using the parameters ownerType and ownerId. Permissions required: View IQ Elements */ async getApplicableAutoWaiversRaw(requestParameters: AutoPolicyWaiversApiGetApplicableAutoWaiversRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { if (requestParameters['ownerType'] == null) { throw new runtime.RequiredError( 'ownerType', 'Required parameter "ownerType" was null or undefined when calling getApplicableAutoWaivers().' ); } if (requestParameters['ownerId'] == null) { throw new runtime.RequiredError( 'ownerId', 'Required parameter "ownerId" was null or undefined when calling getApplicableAutoWaivers().' ); } 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/autoPolicyWaivers/v2/{ownerType}/{ownerId}/applicableAutoWaivers`; 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) => jsonValue.map(ApiAutoPolicyWaiverStatusDTOFromJSON)); } /** * Use this method to retrieve all applicable auto waivers for the scope specified. You can specify the scope by using the parameters ownerType and ownerId. Permissions required: View IQ Elements */ async getApplicableAutoWaivers(requestParameters: AutoPolicyWaiversApiGetApplicableAutoWaiversRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.getApplicableAutoWaiversRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to retrieve auto policy waiver details for the autoPolicyWaiverId specified. Permissions required: View IQ Elements */ async getAutoPolicyWaiverRaw(requestParameters: AutoPolicyWaiversApiGetAutoPolicyWaiverRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['ownerType'] == null) { throw new runtime.RequiredError( 'ownerType', 'Required parameter "ownerType" was null or undefined when calling getAutoPolicyWaiver().' ); } if (requestParameters['ownerId'] == null) { throw new runtime.RequiredError( 'ownerId', 'Required parameter "ownerId" was null or undefined when calling getAutoPolicyWaiver().' ); } if (requestParameters['autoPolicyWaiverId'] == null) { throw new runtime.RequiredError( 'autoPolicyWaiverId', 'Required parameter "autoPolicyWaiverId" was null or undefined when calling getAutoPolicyWaiver().' ); } 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/autoPolicyWaivers/{ownerType}/{ownerId}/{autoPolicyWaiverId}`; urlPath = urlPath.replace(`{${"ownerType"}}`, encodeURIComponent(String(requestParameters['ownerType']))); urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId']))); urlPath = urlPath.replace(`{${"autoPolicyWaiverId"}}`, encodeURIComponent(String(requestParameters['autoPolicyWaiverId']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiAutoPolicyWaiverDTOFromJSON(jsonValue)); } /** * Use this method to retrieve auto policy waiver details for the autoPolicyWaiverId specified. Permissions required: View IQ Elements */ async getAutoPolicyWaiver(requestParameters: AutoPolicyWaiversApiGetAutoPolicyWaiverRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getAutoPolicyWaiverRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to retrieve status details for any auto policy waiver enabled for the scope specified. You can specify the scope by using the parameters ownerType and ownerId. Permissions required: View IQ Elements */ async getAutoPolicyWaiverStatusRaw(requestParameters: AutoPolicyWaiversApiGetAutoPolicyWaiverStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['ownerType'] == null) { throw new runtime.RequiredError( 'ownerType', 'Required parameter "ownerType" was null or undefined when calling getAutoPolicyWaiverStatus().' ); } if (requestParameters['ownerId'] == null) { throw new runtime.RequiredError( 'ownerId', 'Required parameter "ownerId" was null or undefined when calling getAutoPolicyWaiverStatus().' ); } 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/autoPolicyWaivers/{ownerType}/{ownerId}/status`; 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) => ApiAutoPolicyWaiverStatusDTOFromJSON(jsonValue)); } /** * Use this method to retrieve status details for any auto policy waiver enabled for the scope specified. You can specify the scope by using the parameters ownerType and ownerId. Permissions required: View IQ Elements */ async getAutoPolicyWaiverStatus(requestParameters: AutoPolicyWaiversApiGetAutoPolicyWaiverStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getAutoPolicyWaiverStatusRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to retrieve waiver details for all auto policy waivers for the scope specified. You can specify the scope by using the parameters ownerType and ownerId. Permissions required: View IQ Elements */ async getAutoPolicyWaiversRaw(requestParameters: AutoPolicyWaiversApiGetAutoPolicyWaiversRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { if (requestParameters['ownerType'] == null) { throw new runtime.RequiredError( 'ownerType', 'Required parameter "ownerType" was null or undefined when calling getAutoPolicyWaivers().' ); } if (requestParameters['ownerId'] == null) { throw new runtime.RequiredError( 'ownerId', 'Required parameter "ownerId" was null or undefined when calling getAutoPolicyWaivers().' ); } 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/autoPolicyWaivers/{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) => jsonValue.map(ApiAutoPolicyWaiverDTOFromJSON)); } /** * Use this method to retrieve waiver details for all auto policy waivers for the scope specified. You can specify the scope by using the parameters ownerType and ownerId. Permissions required: View IQ Elements */ async getAutoPolicyWaivers(requestParameters: AutoPolicyWaiversApiGetAutoPolicyWaiversRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.getAutoPolicyWaiversRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to update an auto policy waiver, specified by the autoPolicyWaiverId. Permissions required: Write IQ Elements */ async updateAutoPolicyWaiverRaw(requestParameters: AutoPolicyWaiversApiUpdateAutoPolicyWaiverRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['ownerType'] == null) { throw new runtime.RequiredError( 'ownerType', 'Required parameter "ownerType" was null or undefined when calling updateAutoPolicyWaiver().' ); } if (requestParameters['ownerId'] == null) { throw new runtime.RequiredError( 'ownerId', 'Required parameter "ownerId" was null or undefined when calling updateAutoPolicyWaiver().' ); } if (requestParameters['autoPolicyWaiverId'] == null) { throw new runtime.RequiredError( 'autoPolicyWaiverId', 'Required parameter "autoPolicyWaiverId" was null or undefined when calling updateAutoPolicyWaiver().' ); } if (requestParameters['apiAutoPolicyWaiverDTO'] == null) { throw new runtime.RequiredError( 'apiAutoPolicyWaiverDTO', 'Required parameter "apiAutoPolicyWaiverDTO" was null or undefined when calling updateAutoPolicyWaiver().' ); } 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/autoPolicyWaivers/{ownerType}/{ownerId}/{autoPolicyWaiverId}`; urlPath = urlPath.replace(`{${"ownerType"}}`, encodeURIComponent(String(requestParameters['ownerType']))); urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId']))); urlPath = urlPath.replace(`{${"autoPolicyWaiverId"}}`, encodeURIComponent(String(requestParameters['autoPolicyWaiverId']))); const response = await this.request({ path: urlPath, method: 'PUT', headers: headerParameters, query: queryParameters, body: ApiAutoPolicyWaiverDTOToJSON(requestParameters['apiAutoPolicyWaiverDTO']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiAutoPolicyWaiverDTOFromJSON(jsonValue)); } /** * Use this method to update an auto policy waiver, specified by the autoPolicyWaiverId. Permissions required: Write IQ Elements */ async updateAutoPolicyWaiver(requestParameters: AutoPolicyWaiversApiUpdateAutoPolicyWaiverRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.updateAutoPolicyWaiverRaw(requestParameters, initOverrides); return await response.value(); } } /** * @export */ export const AddAutoPolicyWaiverOwnerTypeEnum = { Application: 'application', Organization: 'organization' } as const; export type AddAutoPolicyWaiverOwnerTypeEnum = typeof AddAutoPolicyWaiverOwnerTypeEnum[keyof typeof AddAutoPolicyWaiverOwnerTypeEnum]; /** * @export */ export const AddAutoPolicyWaiversOwnerTypeEnum = { Application: 'application', Organization: 'organization' } as const; export type AddAutoPolicyWaiversOwnerTypeEnum = typeof AddAutoPolicyWaiversOwnerTypeEnum[keyof typeof AddAutoPolicyWaiversOwnerTypeEnum]; /** * @export */ export const DeleteAutoPolicyWaiverOwnerTypeEnum = { Application: 'application', Organization: 'organization' } as const; export type DeleteAutoPolicyWaiverOwnerTypeEnum = typeof DeleteAutoPolicyWaiverOwnerTypeEnum[keyof typeof DeleteAutoPolicyWaiverOwnerTypeEnum]; /** * @export */ export const GetApplicableAutoWaiversOwnerTypeEnum = { Application: 'application', Organization: 'organization' } as const; export type GetApplicableAutoWaiversOwnerTypeEnum = typeof GetApplicableAutoWaiversOwnerTypeEnum[keyof typeof GetApplicableAutoWaiversOwnerTypeEnum]; /** * @export */ export const GetAutoPolicyWaiverOwnerTypeEnum = { Application: 'application', Organization: 'organization' } as const; export type GetAutoPolicyWaiverOwnerTypeEnum = typeof GetAutoPolicyWaiverOwnerTypeEnum[keyof typeof GetAutoPolicyWaiverOwnerTypeEnum]; /** * @export */ export const GetAutoPolicyWaiverStatusOwnerTypeEnum = { Application: 'application', Organization: 'organization' } as const; export type GetAutoPolicyWaiverStatusOwnerTypeEnum = typeof GetAutoPolicyWaiverStatusOwnerTypeEnum[keyof typeof GetAutoPolicyWaiverStatusOwnerTypeEnum]; /** * @export */ export const GetAutoPolicyWaiversOwnerTypeEnum = { Application: 'application', Organization: 'organization' } as const; export type GetAutoPolicyWaiversOwnerTypeEnum = typeof GetAutoPolicyWaiversOwnerTypeEnum[keyof typeof GetAutoPolicyWaiversOwnerTypeEnum]; /** * @export */ export const UpdateAutoPolicyWaiverOwnerTypeEnum = { Application: 'application', Organization: 'organization' } as const; export type UpdateAutoPolicyWaiverOwnerTypeEnum = typeof UpdateAutoPolicyWaiverOwnerTypeEnum[keyof typeof UpdateAutoPolicyWaiverOwnerTypeEnum];