/**
 * Java Management Service API
 * API for the Java Management Service. Use this API to view, create, and manage Fleets.
 * OpenAPI spec version: 20210610
 *
 *
 * 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 { JavaManagementServiceWaiter } from "./javamanagementservice-waiter" ; import { composeResponse , composeRequest , GenericRetrier } from "oci-common" ; export enum JavaManagementServiceApiKeys { } /**
 * 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 JavaManagementServiceClient { protected static serviceEndpointTemplate = "https://javamanagement.{region}.oci.{secondLevelDomain}" ; protected "_endpoint" : string = "" ; protected "_defaultHeaders" : any = { } ; protected "_waiters" : JavaManagementServiceWaiter ; 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 + "/20210610" ; if ( this . logger ) this . logger . info ( `JavaManagementServiceClient 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 ( JavaManagementServiceClient . 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 ( JavaManagementServiceClient . serviceEndpointTemplate , regionId ) ; } param config return public createWaiters ( config ? ) { this . _waiters = new JavaManagementServiceWaiter ( this , config ) ; return this . _waiters ; } return public getWaiters ( ) { if ( this . _waiters ) { return this . _waiters ; } throw Error ( "Waiters do not exist. Please create waiters." ) ; } /**
     * Move a specified Fleet into the compartment identified in the POST form. When provided, If-Match is checked against ETag values of the resource.
     *
     * This operation uses  common . OciSdkDefaultRetryConfiguration by default if no retry configuration is defined by the user.
     *  param ChangeFleetCompartmentRequest return throws example Click  https to see how to use ChangeFleetCompartment API.
      public async changeFleetCompartment ( changeFleetCompartmentRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation JavaManagementServiceClient#changeFleetCompartment." ) ; const pathParams = { "{fleetId}" : changeFleetCompartmentRequest . fleetId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "if-match" : changeFleetCompartmentRequest . ifMatch , "opc-retry-token" : changeFleetCompartmentRequest . opcRetryToken , "opc-request-id" : changeFleetCompartmentRequest . opcRequestId } ; const specRetryConfiguration = common . OciSdkDefaultRetryConfiguration ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , changeFleetCompartmentRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/fleets/{fleetId}/actions/changeCompartment" , method : "POST" , bodyContent : common . ObjectSerializer . serialize ( changeFleetCompartmentRequest . changeFleetCompartmentDetails , "ChangeFleetCompartmentDetails" , model . ChangeFleetCompartmentDetails . getJsonObj ) , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . ChangeFleetCompartmentResponse > { } , 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 ; } } /**
     * Create a new Fleet using the information provided.
     *
     * This operation uses  common . OciSdkDefaultRetryConfiguration by default if no retry configuration is defined by the user.
     *  param CreateFleetRequest return throws example Click  https to see how to use CreateFleet API.
      public async createFleet ( createFleetRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation JavaManagementServiceClient#createFleet." ) ; const pathParams = { } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-retry-token" : createFleetRequest . opcRetryToken , "opc-request-id" : createFleetRequest . opcRequestId } ; const specRetryConfiguration = common . OciSdkDefaultRetryConfiguration ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , createFleetRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/fleets" , method : "POST" , bodyContent : common . ObjectSerializer . serialize ( createFleetRequest . createFleetDetails , "CreateFleetDetails" , model . CreateFleetDetails . getJsonObj ) , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . CreateFleetResponse > { } , 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 ; } } /**
     * Deletes the Fleet specified by an identifier.
     * This operation uses  common . OciSdkDefaultRetryConfiguration by default if no retry configuration is defined by the user.
     *  param DeleteFleetRequest return throws example Click  https to see how to use DeleteFleet API.
      public async deleteFleet ( deleteFleetRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation JavaManagementServiceClient#deleteFleet." ) ; const pathParams = { "{fleetId}" : deleteFleetRequest . fleetId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "if-match" : deleteFleetRequest . ifMatch , "opc-request-id" : deleteFleetRequest . opcRequestId } ; const specRetryConfiguration = common . OciSdkDefaultRetryConfiguration ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , deleteFleetRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/fleets/{fleetId}" , method : "DELETE" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . DeleteFleetResponse > { } , 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 ; } } /**
     * Retrieve a Fleet with the specified identifier.
     * This operation uses  common . OciSdkDefaultRetryConfiguration by default if no retry configuration is defined by the user.
     *  param GetFleetRequest return throws example Click  https to see how to use GetFleet API.
      public async getFleet ( getFleetRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation JavaManagementServiceClient#getFleet." ) ; const pathParams = { "{fleetId}" : getFleetRequest . fleetId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : getFleetRequest . opcRequestId } ; const specRetryConfiguration = common . OciSdkDefaultRetryConfiguration ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , getFleetRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/fleets/{fleetId}" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . GetFleetResponse > { } , body : await response . json ( ) , bodyKey : "fleet" , bodyModel : model . Fleet , type : "model.Fleet" , 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 ; } } /**
     * Retrieve a Fleet Agent Configuration for the specified Fleet.
     * This operation uses  common . OciSdkDefaultRetryConfiguration by default if no retry configuration is defined by the user.
     *  param GetFleetAgentConfigurationRequest return throws example Click  https to see how to use GetFleetAgentConfiguration API.
      public async getFleetAgentConfiguration ( getFleetAgentConfigurationRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation JavaManagementServiceClient#getFleetAgentConfiguration." ) ; const pathParams = { "{fleetId}" : getFleetAgentConfigurationRequest . fleetId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : getFleetAgentConfigurationRequest . opcRequestId } ; const specRetryConfiguration = common . OciSdkDefaultRetryConfiguration ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , getFleetAgentConfigurationRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/fleets/{fleetId}/agentConfiguration" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . GetFleetAgentConfigurationResponse > { } , body : await response . json ( ) , bodyKey : "fleetAgentConfiguration" , bodyModel : model . FleetAgentConfiguration , type : "model.FleetAgentConfiguration" , 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 ; } } /**
     * Retrieve the details of a work request with the specified ID.
     * This operation uses  common . OciSdkDefaultRetryConfiguration by default if no retry configuration is defined by the user.
     *  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 JavaManagementServiceClient#getWorkRequest." ) ; const pathParams = { "{workRequestId}" : getWorkRequestRequest . workRequestId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : getWorkRequestRequest . opcRequestId } ; const specRetryConfiguration = common . OciSdkDefaultRetryConfiguration ; 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 ; } } /**
     * Returns a list of all the Fleets contained by a compartment. The query parameter `compartmentId`
     * is required unless the query parameter `id` is specified.
     *
     * This operation uses  common . OciSdkDefaultRetryConfiguration by default if no retry configuration is defined by the user.
     *  param ListFleetsRequest return throws example Click  https to see how to use ListFleets API.
      public async listFleets ( listFleetsRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation JavaManagementServiceClient#listFleets." ) ; const pathParams = { } ; const queryParams = { "compartmentId" : listFleetsRequest . compartmentId , "id" : listFleetsRequest . id , "lifecycleState" : listFleetsRequest . lifecycleState , "displayName" : listFleetsRequest . displayName , "limit" : listFleetsRequest . limit , "page" : listFleetsRequest . page , "sortOrder" : listFleetsRequest . sortOrder , "sortBy" : listFleetsRequest . sortBy } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : listFleetsRequest . opcRequestId } ; const specRetryConfiguration = common . OciSdkDefaultRetryConfiguration ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , listFleetsRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/fleets" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . ListFleetsResponse > { } , body : await response . json ( ) , bodyKey : "fleetCollection" , bodyModel : model . FleetCollection , type : "model.FleetCollection" , 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 ; } } /**
     * List Java Runtime usage in a specified host filtered by query parameters.
     * This operation uses  common . OciSdkDefaultRetryConfiguration by default if no retry configuration is defined by the user.
     *  param ListJreUsageRequest return throws example Click  https to see how to use ListJreUsage API.
      public async listJreUsage ( listJreUsageRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation JavaManagementServiceClient#listJreUsage." ) ; const pathParams = { } ; const queryParams = { "compartmentId" : listJreUsageRequest . compartmentId , "hostId" : listJreUsageRequest . hostId , "applicationId" : listJreUsageRequest . applicationId , "applicationName" : listJreUsageRequest . applicationName , "timeStart" : listJreUsageRequest . timeStart , "timeEnd" : listJreUsageRequest . timeEnd , "limit" : listJreUsageRequest . limit , "page" : listJreUsageRequest . page , "sortOrder" : listJreUsageRequest . sortOrder , "sortBy" : listJreUsageRequest . sortBy } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : listJreUsageRequest . opcRequestId } ; const specRetryConfiguration = common . OciSdkDefaultRetryConfiguration ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , listJreUsageRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/listJreUsage" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . ListJreUsageResponse > { } , body : await response . json ( ) , bodyKey : "jreUsageCollection" , bodyModel : model . JreUsageCollection , type : "model.JreUsageCollection" , 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 ; } } /**
     * Retrieve a (paginated) list of errors for a specified work request.
     *
     * This operation uses  common . OciSdkDefaultRetryConfiguration by default if no retry configuration is defined by the user.
     *  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 JavaManagementServiceClient#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 . OciSdkDefaultRetryConfiguration ; 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 : "workRequestErrorCollection" , bodyModel : model . WorkRequestErrorCollection , type : "model.WorkRequestErrorCollection" , 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 ; } } /**
     * Retrieve a (paginated) list of logs for a specified work request.
     *
     * This operation uses  common . OciSdkDefaultRetryConfiguration by default if no retry configuration is defined by the user.
     *  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 JavaManagementServiceClient#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 . OciSdkDefaultRetryConfiguration ; 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 : "workRequestLogEntryCollection" , bodyModel : model . WorkRequestLogEntryCollection , type : "model.WorkRequestLogEntryCollection" , 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 ; } } /**
     * List the work requests in a compartment. The query parameter `compartmentId` is required unless the query parameter `id` is specified.
     *
     * This operation uses  common . OciSdkDefaultRetryConfiguration by default if no retry configuration is defined by the user.
     *  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 JavaManagementServiceClient#listWorkRequests." ) ; const pathParams = { } ; const queryParams = { "compartmentId" : listWorkRequestsRequest . compartmentId , "id" : listWorkRequestsRequest . id , "page" : listWorkRequestsRequest . page , "limit" : listWorkRequestsRequest . limit } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : listWorkRequestsRequest . opcRequestId } ; const specRetryConfiguration = common . OciSdkDefaultRetryConfiguration ; 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 : "workRequestCollection" , bodyModel : model . WorkRequestCollection , type : "model.WorkRequestCollection" , 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 ; } } /**
     * List application usage in a Fleet filtered by query parameters.
     * This operation uses  common . OciSdkDefaultRetryConfiguration by default if no retry configuration is defined by the user.
     *  param SummarizeApplicationUsageRequest return throws example Click  https to see how to use SummarizeApplicationUsage API.
      public async summarizeApplicationUsage ( summarizeApplicationUsageRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation JavaManagementServiceClient#summarizeApplicationUsage." ) ; const pathParams = { "{fleetId}" : summarizeApplicationUsageRequest . fleetId } ; const queryParams = { "applicationId" : summarizeApplicationUsageRequest . applicationId , "displayName" : summarizeApplicationUsageRequest . displayName , "applicationType" : summarizeApplicationUsageRequest . applicationType , "jreVendor" : summarizeApplicationUsageRequest . jreVendor , "jreDistribution" : summarizeApplicationUsageRequest . jreDistribution , "jreVersion" : summarizeApplicationUsageRequest . jreVersion , "installationPath" : summarizeApplicationUsageRequest . installationPath , "managedInstanceId" : summarizeApplicationUsageRequest . managedInstanceId , "fields" : summarizeApplicationUsageRequest . fields , "timeStart" : summarizeApplicationUsageRequest . timeStart , "timeEnd" : summarizeApplicationUsageRequest . timeEnd , "limit" : summarizeApplicationUsageRequest . limit , "page" : summarizeApplicationUsageRequest . page , "sortOrder" : summarizeApplicationUsageRequest . sortOrder , "sortBy" : summarizeApplicationUsageRequest . sortBy , "osFamily" : summarizeApplicationUsageRequest . osFamily } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : summarizeApplicationUsageRequest . opcRequestId } ; const specRetryConfiguration = common . OciSdkDefaultRetryConfiguration ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , summarizeApplicationUsageRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/fleets/{fleetId}/actions/summarizeApplicationUsage" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . SummarizeApplicationUsageResponse > { } , body : await response . json ( ) , bodyKey : "applicationUsageCollection" , bodyModel : model . ApplicationUsageCollection , type : "model.ApplicationUsageCollection" , 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 ; } } /**
     * List Java installation usage in a Fleet filtered by query parameters.
     * This operation uses  common . OciSdkDefaultRetryConfiguration by default if no retry configuration is defined by the user.
     *  param SummarizeInstallationUsageRequest return throws example Click  https to see how to use SummarizeInstallationUsage API.
      public async summarizeInstallationUsage ( summarizeInstallationUsageRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation JavaManagementServiceClient#summarizeInstallationUsage." ) ; const pathParams = { "{fleetId}" : summarizeInstallationUsageRequest . fleetId } ; const queryParams = { "jreVendor" : summarizeInstallationUsageRequest . jreVendor , "jreDistribution" : summarizeInstallationUsageRequest . jreDistribution , "jreVersion" : summarizeInstallationUsageRequest . jreVersion , "installationPath" : summarizeInstallationUsageRequest . installationPath , "applicationId" : summarizeInstallationUsageRequest . applicationId , "managedInstanceId" : summarizeInstallationUsageRequest . managedInstanceId , "fields" : summarizeInstallationUsageRequest . fields , "timeStart" : summarizeInstallationUsageRequest . timeStart , "timeEnd" : summarizeInstallationUsageRequest . timeEnd , "limit" : summarizeInstallationUsageRequest . limit , "page" : summarizeInstallationUsageRequest . page , "sortOrder" : summarizeInstallationUsageRequest . sortOrder , "sortBy" : summarizeInstallationUsageRequest . sortBy , "osFamily" : summarizeInstallationUsageRequest . osFamily } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : summarizeInstallationUsageRequest . opcRequestId } ; const specRetryConfiguration = common . OciSdkDefaultRetryConfiguration ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , summarizeInstallationUsageRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/fleets/{fleetId}/actions/summarizeInstallationUsage" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . SummarizeInstallationUsageResponse > { } , body : await response . json ( ) , bodyKey : "installationUsageCollection" , bodyModel : model . InstallationUsageCollection , type : "model.InstallationUsageCollection" , 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 ; } } /**
     * List Java Runtime usage in a specified Fleet filtered by query parameters.
     * This operation uses  common . OciSdkDefaultRetryConfiguration by default if no retry configuration is defined by the user.
     *  param SummarizeJreUsageRequest return throws example Click  https to see how to use SummarizeJreUsage API.
      public async summarizeJreUsage ( summarizeJreUsageRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation JavaManagementServiceClient#summarizeJreUsage." ) ; const pathParams = { "{fleetId}" : summarizeJreUsageRequest . fleetId } ; const queryParams = { "jreVendor" : summarizeJreUsageRequest . jreVendor , "jreDistribution" : summarizeJreUsageRequest . jreDistribution , "jreVersion" : summarizeJreUsageRequest . jreVersion , "applicationId" : summarizeJreUsageRequest . applicationId , "managedInstanceId" : summarizeJreUsageRequest . managedInstanceId , "fields" : summarizeJreUsageRequest . fields , "timeStart" : summarizeJreUsageRequest . timeStart , "timeEnd" : summarizeJreUsageRequest . timeEnd , "limit" : summarizeJreUsageRequest . limit , "page" : summarizeJreUsageRequest . page , "sortOrder" : summarizeJreUsageRequest . sortOrder , "sortBy" : summarizeJreUsageRequest . sortBy , "osFamily" : summarizeJreUsageRequest . osFamily , "jreSecurityStatus" : summarizeJreUsageRequest . jreSecurityStatus } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : summarizeJreUsageRequest . opcRequestId } ; const specRetryConfiguration = common . OciSdkDefaultRetryConfiguration ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , summarizeJreUsageRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/fleets/{fleetId}/actions/summarizeJreUsage" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . SummarizeJreUsageResponse > { } , body : await response . json ( ) , bodyKey : "jreUsageCollection" , bodyModel : model . JreUsageCollection , type : "model.JreUsageCollection" , 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 ; } } /**
     * List managed instance usage in a Fleet filtered by query parameters.
     * This operation uses  common . OciSdkDefaultRetryConfiguration by default if no retry configuration is defined by the user.
     *  param SummarizeManagedInstanceUsageRequest return throws example Click  https to see how to use SummarizeManagedInstanceUsage API.
      public async summarizeManagedInstanceUsage ( summarizeManagedInstanceUsageRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation JavaManagementServiceClient#summarizeManagedInstanceUsage." ) ; const pathParams = { "{fleetId}" : summarizeManagedInstanceUsageRequest . fleetId } ; const queryParams = { "managedInstanceId" : summarizeManagedInstanceUsageRequest . managedInstanceId , "managedInstanceType" : summarizeManagedInstanceUsageRequest . managedInstanceType , "jreVendor" : summarizeManagedInstanceUsageRequest . jreVendor , "jreDistribution" : summarizeManagedInstanceUsageRequest . jreDistribution , "jreVersion" : summarizeManagedInstanceUsageRequest . jreVersion , "installationPath" : summarizeManagedInstanceUsageRequest . installationPath , "applicationId" : summarizeManagedInstanceUsageRequest . applicationId , "fields" : summarizeManagedInstanceUsageRequest . fields , "timeStart" : summarizeManagedInstanceUsageRequest . timeStart , "timeEnd" : summarizeManagedInstanceUsageRequest . timeEnd , "limit" : summarizeManagedInstanceUsageRequest . limit , "page" : summarizeManagedInstanceUsageRequest . page , "sortOrder" : summarizeManagedInstanceUsageRequest . sortOrder , "sortBy" : summarizeManagedInstanceUsageRequest . sortBy , "osFamily" : summarizeManagedInstanceUsageRequest . osFamily } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : summarizeManagedInstanceUsageRequest . opcRequestId } ; const specRetryConfiguration = common . OciSdkDefaultRetryConfiguration ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , summarizeManagedInstanceUsageRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/fleets/{fleetId}/actions/summarizeManagedInstanceUsage" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . SummarizeManagedInstanceUsageResponse > { } , body : await response . json ( ) , bodyKey : "managedInstanceUsageCollection" , bodyModel : model . ManagedInstanceUsageCollection , type : "model.ManagedInstanceUsageCollection" , 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 ; } } /**
     * Retrieve the inventory of JMS resources in the specified compartment: a list of the number of _active_ fleets, managed instances, Java Runtimes, Java installations, and applications.
     *
     * This operation uses  common . OciSdkDefaultRetryConfiguration by default if no retry configuration is defined by the user.
     *  param SummarizeResourceInventoryRequest return throws example Click  https to see how to use SummarizeResourceInventory API.
      public async summarizeResourceInventory ( summarizeResourceInventoryRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation JavaManagementServiceClient#summarizeResourceInventory." ) ; const pathParams = { } ; const queryParams = { "compartmentId" : summarizeResourceInventoryRequest . compartmentId , "timeStart" : summarizeResourceInventoryRequest . timeStart , "timeEnd" : summarizeResourceInventoryRequest . timeEnd } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : summarizeResourceInventoryRequest . opcRequestId } ; const specRetryConfiguration = common . OciSdkDefaultRetryConfiguration ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , summarizeResourceInventoryRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/summarizeResourceInventory" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . SummarizeResourceInventoryResponse > { } , body : await response . json ( ) , bodyKey : "resourceInventory" , bodyModel : model . ResourceInventory , type : "model.ResourceInventory" , responseHeaders : [ { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } /**
     * Update the Fleet specified by an identifier.
     * This operation uses  common . OciSdkDefaultRetryConfiguration by default if no retry configuration is defined by the user.
     *  param UpdateFleetRequest return throws example Click  https to see how to use UpdateFleet API.
      public async updateFleet ( updateFleetRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation JavaManagementServiceClient#updateFleet." ) ; const pathParams = { "{fleetId}" : updateFleetRequest . fleetId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "if-match" : updateFleetRequest . ifMatch , "opc-request-id" : updateFleetRequest . opcRequestId } ; const specRetryConfiguration = common . OciSdkDefaultRetryConfiguration ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , updateFleetRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/fleets/{fleetId}" , method : "PUT" , bodyContent : common . ObjectSerializer . serialize ( updateFleetRequest . updateFleetDetails , "UpdateFleetDetails" , model . UpdateFleetDetails . getJsonObj ) , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . UpdateFleetResponse > { } , 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 ; } } /**
     * Update the Fleet Agent Configuration for the specified Fleet.
     * This operation uses  common . OciSdkDefaultRetryConfiguration by default if no retry configuration is defined by the user.
     *  param UpdateFleetAgentConfigurationRequest return throws example Click  https to see how to use UpdateFleetAgentConfiguration API.
      public async updateFleetAgentConfiguration ( updateFleetAgentConfigurationRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation JavaManagementServiceClient#updateFleetAgentConfiguration." ) ; const pathParams = { "{fleetId}" : updateFleetAgentConfigurationRequest . fleetId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "if-match" : updateFleetAgentConfigurationRequest . ifMatch , "opc-request-id" : updateFleetAgentConfigurationRequest . opcRequestId } ; const specRetryConfiguration = common . OciSdkDefaultRetryConfiguration ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , updateFleetAgentConfigurationRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/fleets/{fleetId}/agentConfiguration" , method : "PUT" , bodyContent : common . ObjectSerializer . serialize ( updateFleetAgentConfigurationRequest . updateFleetAgentConfigurationDetails , "UpdateFleetAgentConfigurationDetails" , model . UpdateFleetAgentConfigurationDetails . getJsonObj ) , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . UpdateFleetAgentConfigurationResponse > { } , 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 ; } } }