/**
 * Bastion API
 * Oracle Cloud Infrastructure Bastion provides restricted and time-limited access to target resources that don't have public endpoints. Through the configuration of a bastion, you can let authorized users connect from specific IP addresses to target resources by way of Secure Shell (SSH) sessions hosted on the bastion.
 * OpenAPI spec version: 20210331
 *
 *
 * NOTE: This class is auto generated by OracleSDKGenerator.
 * Do not edit the class manually.
 *
 * Copyright (c) 2020, 2022, Oracle and/or its affiliates.  All rights reserved.
 * This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
 */ import common = require ( "oci-common" ) ; import * as requests from "./request" ; import * as model from "./model" ; import * as responses from "./response" ; import { paginateRecords , paginateResponses } from "oci-common" ; import { BastionWaiter } from "./bastion-waiter" ; import { composeResponse , composeRequest , GenericRetrier } from "oci-common" ; export enum BastionApiKeys { } /**
 * This service client uses  common . CircuitBreaker . DefaultConfiguration for all the operations by default if no circuit breaker configuration is defined by the user.
  export class BastionClient { protected static serviceEndpointTemplate = "https://bastion.{region}.oci.{secondLevelDomain}" ; protected "_endpoint" : string = "" ; protected "_defaultHeaders" : any = { } ; protected "_waiters" : BastionWaiter ; protected "_clientConfiguration" : common . ClientConfiguration ; protected _circuitBreaker = null ; protected _httpClient : common . HttpClient ; constructor ( params , clientConfiguration ? ) { const requestSigner = params . authenticationDetailsProvider ? new common . DefaultRequestSigner ( params . authenticationDetailsProvider ) : null ; if ( clientConfiguration ) { this . _clientConfiguration = clientConfiguration ; this . _circuitBreaker = clientConfiguration . circuitBreaker ? clientConfiguration . circuitBreaker ! . circuit : null ; } const specCircuitBreakerEnabled = true ; if ( ! this . _circuitBreaker && common . utils . isCircuitBreakerSystemEnabled ( clientConfiguration ! ) && ( specCircuitBreakerEnabled || common . CircuitBreaker . DefaultCircuitBreakerOverriden ) ) { this . _circuitBreaker = new common . CircuitBreaker ( ) . circuit ; } this . _httpClient = params . httpClient || new common . FetchHttpClient ( requestSigner , this . _circuitBreaker ) ; if ( params . authenticationDetailsProvider && common . isRegionProvider ( params . authenticationDetailsProvider ) ) { const provider = params . authenticationDetailsProvider ; if ( provider . getRegion ( ) ) { this . region = provider . getRegion ( ) ; } } } /**
     * Get the endpoint that is being used to call (ex, https://www.example.com).
     */ public get endpoint ( ) { return this . _endpoint ; } param endpoint public set endpoint ( endpoint ) { this . _endpoint = endpoint ; this . _endpoint = this . _endpoint + "/20210331" ; if ( this . logger ) this . logger . info ( `BastionClient endpoint set to ${ this . _endpoint }` ) ; } public get logger ( ) { return common . LOG . logger ; } /**
     * Sets the region to call (ex, Region.US_PHOENIX_1).
     * Note, this will call  {@link #endpoint(String) endpoint} after resolving the endpoint.
     *  param region public set region ( region ) { this . endpoint = common . EndpointBuilder . createEndpointFromRegion ( BastionClient . serviceEndpointTemplate , region ) ; } /**
     * Sets the regionId to call (ex, 'us-phoenix-1').
     *
     * Note, this will first try to map the region ID to a known Region and call  {@link #region(Region) region} .
     * If no known Region could be determined, it will create an endpoint assuming its in default Realm OC1
     * and then call  {@link #endpoint(String) endpoint} .
     *  param regionId public set regionId ( regionId ) { this . endpoint = common . EndpointBuilder . createEndpointFromRegionId ( BastionClient . serviceEndpointTemplate , regionId ) ; } param config return public createWaiters ( config ? ) { this . _waiters = new BastionWaiter ( this , config ) ; return this . _waiters ; } return public getWaiters ( ) { if ( this . _waiters ) { return this . _waiters ; } throw Error ( "Waiters do not exist. Please create waiters." ) ; } param ChangeBastionCompartmentRequest return throws example Click  https to see how to use ChangeBastionCompartment API.
      public async changeBastionCompartment ( changeBastionCompartmentRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation BastionClient#changeBastionCompartment." ) ; const pathParams = { "{bastionId}" : changeBastionCompartmentRequest . bastionId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "if-match" : changeBastionCompartmentRequest . ifMatch , "opc-request-id" : changeBastionCompartmentRequest . opcRequestId } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , changeBastionCompartmentRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/bastions/{bastionId}/actions/changeCompartment" , method : "POST" , bodyContent : common . ObjectSerializer . serialize ( changeBastionCompartmentRequest . changeBastionCompartmentDetails , "ChangeBastionCompartmentDetails" , model . ChangeBastionCompartmentDetails . getJsonObj ) , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . ChangeBastionCompartmentResponse > { } , responseHeaders : [ { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param CreateBastionRequest return throws example Click  https to see how to use CreateBastion API.
      public async createBastion ( createBastionRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation BastionClient#createBastion." ) ; const pathParams = { } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-retry-token" : createBastionRequest . opcRetryToken , "opc-request-id" : createBastionRequest . opcRequestId } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , createBastionRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/bastions" , method : "POST" , bodyContent : common . ObjectSerializer . serialize ( createBastionRequest . createBastionDetails , "CreateBastionDetails" , model . CreateBastionDetails . getJsonObj ) , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . CreateBastionResponse > { } , body : await response . json ( ) , bodyKey : "bastion" , bodyModel : model . Bastion , type : "model.Bastion" , responseHeaders : [ { value : response . headers . get ( "opc-work-request-id" ) , key : "opcWorkRequestId" , dataType : "string" } , { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } , { value : response . headers . get ( "location" ) , key : "location" , dataType : "string" } , { value : response . headers . get ( "etag" ) , key : "etag" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param CreateSessionRequest return throws example Click  https to see how to use CreateSession API.
      public async createSession ( createSessionRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation BastionClient#createSession." ) ; const pathParams = { } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-retry-token" : createSessionRequest . opcRetryToken , "opc-request-id" : createSessionRequest . opcRequestId } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , createSessionRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/sessions" , method : "POST" , bodyContent : common . ObjectSerializer . serialize ( createSessionRequest . createSessionDetails , "CreateSessionDetails" , model . CreateSessionDetails . getJsonObj ) , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . CreateSessionResponse > { } , body : await response . json ( ) , bodyKey : "session" , bodyModel : model . Session , type : "model.Session" , responseHeaders : [ { value : response . headers . get ( "opc-work-request-id" ) , key : "opcWorkRequestId" , dataType : "string" } , { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } , { value : response . headers . get ( "location" ) , key : "location" , dataType : "string" } , { value : response . headers . get ( "etag" ) , key : "etag" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param DeleteBastionRequest return throws example Click  https to see how to use DeleteBastion API.
      public async deleteBastion ( deleteBastionRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation BastionClient#deleteBastion." ) ; const pathParams = { "{bastionId}" : deleteBastionRequest . bastionId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "if-match" : deleteBastionRequest . ifMatch , "opc-request-id" : deleteBastionRequest . opcRequestId } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , deleteBastionRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/bastions/{bastionId}" , method : "DELETE" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . DeleteBastionResponse > { } , responseHeaders : [ { value : response . headers . get ( "opc-work-request-id" ) , key : "opcWorkRequestId" , dataType : "string" } , { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param DeleteSessionRequest return throws example Click  https to see how to use DeleteSession API.
      public async deleteSession ( deleteSessionRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation BastionClient#deleteSession." ) ; const pathParams = { "{sessionId}" : deleteSessionRequest . sessionId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "if-match" : deleteSessionRequest . ifMatch , "opc-request-id" : deleteSessionRequest . opcRequestId } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , deleteSessionRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/sessions/{sessionId}" , method : "DELETE" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . DeleteSessionResponse > { } , responseHeaders : [ { value : response . headers . get ( "opc-work-request-id" ) , key : "opcWorkRequestId" , dataType : "string" } , { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param GetBastionRequest return throws example Click  https to see how to use GetBastion API.
      public async getBastion ( getBastionRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation BastionClient#getBastion." ) ; const pathParams = { "{bastionId}" : getBastionRequest . bastionId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : getBastionRequest . opcRequestId } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , getBastionRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/bastions/{bastionId}" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . GetBastionResponse > { } , body : await response . json ( ) , bodyKey : "bastion" , bodyModel : model . Bastion , type : "model.Bastion" , responseHeaders : [ { value : response . headers . get ( "etag" ) , key : "etag" , dataType : "string" } , { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param GetSessionRequest return throws example Click  https to see how to use GetSession API.
      public async getSession ( getSessionRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation BastionClient#getSession." ) ; const pathParams = { "{sessionId}" : getSessionRequest . sessionId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : getSessionRequest . opcRequestId } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , getSessionRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/sessions/{sessionId}" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . GetSessionResponse > { } , body : await response . json ( ) , bodyKey : "session" , bodyModel : model . Session , type : "model.Session" , responseHeaders : [ { value : response . headers . get ( "etag" ) , key : "etag" , dataType : "string" } , { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param GetWorkRequestRequest return throws example Click  https to see how to use GetWorkRequest API.
      public async getWorkRequest ( getWorkRequestRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation BastionClient#getWorkRequest." ) ; const pathParams = { "{workRequestId}" : getWorkRequestRequest . workRequestId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : getWorkRequestRequest . opcRequestId } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , getWorkRequestRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/workRequests/{workRequestId}" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . GetWorkRequestResponse > { } , body : await response . json ( ) , bodyKey : "workRequest" , bodyModel : model . WorkRequest , type : "model.WorkRequest" , responseHeaders : [ { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } , { value : response . headers . get ( "retry-after" ) , key : "retryAfter" , dataType : "number" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param ListBastionsRequest return throws example Click  https to see how to use ListBastions API.
      public async listBastions ( listBastionsRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation BastionClient#listBastions." ) ; const pathParams = { } ; const queryParams = { "compartmentId" : listBastionsRequest . compartmentId , "bastionLifecycleState" : listBastionsRequest . bastionLifecycleState , "bastionId" : listBastionsRequest . bastionId , "name" : listBastionsRequest . name , "limit" : listBastionsRequest . limit , "page" : listBastionsRequest . page , "sortOrder" : listBastionsRequest . sortOrder , "sortBy" : listBastionsRequest . sortBy } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : listBastionsRequest . opcRequestId } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , listBastionsRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/bastions" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . ListBastionsResponse > { } , body : await response . json ( ) , bodyKey : "items" , bodyModel : model . BastionSummary , type : "Array<model.BastionSummary>" , responseHeaders : [ { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } , { value : response . headers . get ( "opc-next-page" ) , key : "opcNextPage" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param request public listAllBastions ( request ) { return paginateRecords ( request , req => this . listBastions ( req ) ) ; } param request public listAllBastionsResponses ( request ) { return paginateResponses ( request , req => this . listBastions ( req ) ) ; } param request public listBastionsRecordIterator ( request ) { return paginateRecords ( request , req => this . listBastions ( req ) ) ; } param request public listBastionsResponseIterator ( request ) { return paginateResponses ( request , req => this . listBastions ( req ) ) ; } param ListSessionsRequest return throws example Click  https to see how to use ListSessions API.
      public async listSessions ( listSessionsRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation BastionClient#listSessions." ) ; const pathParams = { } ; const queryParams = { "displayName" : listSessionsRequest . displayName , "bastionId" : listSessionsRequest . bastionId , "sessionLifecycleState" : listSessionsRequest . sessionLifecycleState , "sessionId" : listSessionsRequest . sessionId , "limit" : listSessionsRequest . limit , "page" : listSessionsRequest . page , "sortOrder" : listSessionsRequest . sortOrder , "sortBy" : listSessionsRequest . sortBy } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : listSessionsRequest . opcRequestId } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , listSessionsRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/sessions" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . ListSessionsResponse > { } , body : await response . json ( ) , bodyKey : "items" , bodyModel : model . SessionSummary , type : "Array<model.SessionSummary>" , responseHeaders : [ { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } , { value : response . headers . get ( "opc-next-page" ) , key : "opcNextPage" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param request public listAllSessions ( request ) { return paginateRecords ( request , req => this . listSessions ( req ) ) ; } param request public listAllSessionsResponses ( request ) { return paginateResponses ( request , req => this . listSessions ( req ) ) ; } param request public listSessionsRecordIterator ( request ) { return paginateRecords ( request , req => this . listSessions ( req ) ) ; } param request public listSessionsResponseIterator ( request ) { return paginateResponses ( request , req => this . listSessions ( req ) ) ; } param ListWorkRequestErrorsRequest return throws example Click  https to see how to use ListWorkRequestErrors API.
      public async listWorkRequestErrors ( listWorkRequestErrorsRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation BastionClient#listWorkRequestErrors." ) ; const pathParams = { "{workRequestId}" : listWorkRequestErrorsRequest . workRequestId } ; const queryParams = { "page" : listWorkRequestErrorsRequest . page , "limit" : listWorkRequestErrorsRequest . limit } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : listWorkRequestErrorsRequest . opcRequestId } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , listWorkRequestErrorsRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/workRequests/{workRequestId}/errors" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . ListWorkRequestErrorsResponse > { } , body : await response . json ( ) , bodyKey : "items" , bodyModel : model . WorkRequestError , type : "Array<model.WorkRequestError>" , responseHeaders : [ { value : response . headers . get ( "opc-next-page" ) , key : "opcNextPage" , dataType : "string" } , { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param request public listAllWorkRequestErrors ( request ) { return paginateRecords ( request , req => this . listWorkRequestErrors ( req ) ) ; } param request public listAllWorkRequestErrorsResponses ( request ) { return paginateResponses ( request , req => this . listWorkRequestErrors ( req ) ) ; } param request public listWorkRequestErrorsRecordIterator ( request ) { return paginateRecords ( request , req => this . listWorkRequestErrors ( req ) ) ; } param request public listWorkRequestErrorsResponseIterator ( request ) { return paginateResponses ( request , req => this . listWorkRequestErrors ( req ) ) ; } param ListWorkRequestLogsRequest return throws example Click  https to see how to use ListWorkRequestLogs API.
      public async listWorkRequestLogs ( listWorkRequestLogsRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation BastionClient#listWorkRequestLogs." ) ; const pathParams = { "{workRequestId}" : listWorkRequestLogsRequest . workRequestId } ; const queryParams = { "page" : listWorkRequestLogsRequest . page , "limit" : listWorkRequestLogsRequest . limit } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : listWorkRequestLogsRequest . opcRequestId } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , listWorkRequestLogsRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/workRequests/{workRequestId}/logs" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . ListWorkRequestLogsResponse > { } , body : await response . json ( ) , bodyKey : "items" , bodyModel : model . WorkRequestLogEntry , type : "Array<model.WorkRequestLogEntry>" , responseHeaders : [ { value : response . headers . get ( "opc-next-page" ) , key : "opcNextPage" , dataType : "string" } , { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param request public listAllWorkRequestLogs ( request ) { return paginateRecords ( request , req => this . listWorkRequestLogs ( req ) ) ; } param request public listAllWorkRequestLogsResponses ( request ) { return paginateResponses ( request , req => this . listWorkRequestLogs ( req ) ) ; } param request public listWorkRequestLogsRecordIterator ( request ) { return paginateRecords ( request , req => this . listWorkRequestLogs ( req ) ) ; } param request public listWorkRequestLogsResponseIterator ( request ) { return paginateResponses ( request , req => this . listWorkRequestLogs ( req ) ) ; } param ListWorkRequestsRequest return throws example Click  https to see how to use ListWorkRequests API.
      public async listWorkRequests ( listWorkRequestsRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation BastionClient#listWorkRequests." ) ; const pathParams = { } ; const queryParams = { "compartmentId" : listWorkRequestsRequest . compartmentId , "page" : listWorkRequestsRequest . page , "limit" : listWorkRequestsRequest . limit } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : listWorkRequestsRequest . opcRequestId } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , listWorkRequestsRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/workRequests" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . ListWorkRequestsResponse > { } , body : await response . json ( ) , bodyKey : "items" , bodyModel : model . WorkRequestSummary , type : "Array<model.WorkRequestSummary>" , responseHeaders : [ { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } , { value : response . headers . get ( "opc-next-page" ) , key : "opcNextPage" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param request public listAllWorkRequests ( request ) { return paginateRecords ( request , req => this . listWorkRequests ( req ) ) ; } param request public listAllWorkRequestsResponses ( request ) { return paginateResponses ( request , req => this . listWorkRequests ( req ) ) ; } param request public listWorkRequestsRecordIterator ( request ) { return paginateRecords ( request , req => this . listWorkRequests ( req ) ) ; } param request public listWorkRequestsResponseIterator ( request ) { return paginateResponses ( request , req => this . listWorkRequests ( req ) ) ; } param UpdateBastionRequest return throws example Click  https to see how to use UpdateBastion API.
      public async updateBastion ( updateBastionRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation BastionClient#updateBastion." ) ; const pathParams = { "{bastionId}" : updateBastionRequest . bastionId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "if-match" : updateBastionRequest . ifMatch , "opc-request-id" : updateBastionRequest . opcRequestId } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , updateBastionRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/bastions/{bastionId}" , method : "PUT" , bodyContent : common . ObjectSerializer . serialize ( updateBastionRequest . updateBastionDetails , "UpdateBastionDetails" , model . UpdateBastionDetails . getJsonObj ) , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . UpdateBastionResponse > { } , responseHeaders : [ { value : response . headers . get ( "opc-work-request-id" ) , key : "opcWorkRequestId" , dataType : "string" } , { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param UpdateSessionRequest return throws example Click  https to see how to use UpdateSession API.
      public async updateSession ( updateSessionRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation BastionClient#updateSession." ) ; const pathParams = { "{sessionId}" : updateSessionRequest . sessionId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "if-match" : updateSessionRequest . ifMatch , "opc-request-id" : updateSessionRequest . opcRequestId } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , updateSessionRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/sessions/{sessionId}" , method : "PUT" , bodyContent : common . ObjectSerializer . serialize ( updateSessionRequest . updateSessionDetails , "UpdateSessionDetails" , model . UpdateSessionDetails . getJsonObj ) , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . UpdateSessionResponse > { } , body : await response . json ( ) , bodyKey : "session" , bodyModel : model . Session , type : "model.Session" , responseHeaders : [ { value : response . headers . get ( "etag" ) , key : "etag" , dataType : "string" } , { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } }