/**
 * Application Migration API
 * Application Migration simplifies the migration of applications from Oracle Cloud Infrastructure Classic to Oracle Cloud Infrastructure.
You can use Application Migration API to migrate applications, such as Oracle Java Cloud Service, SOA Cloud Service, and Integration Classic
instances, to Oracle Cloud Infrastructure. For more information, see
[Overview of Application Migration](/iaas/application-migration/appmigrationoverview.htm).

 * OpenAPI spec version: 20191031
 *
 *
 * 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 { ApplicationMigrationWaiter } from "./applicationmigration-waiter" ; import { composeResponse , composeRequest , GenericRetrier } from "oci-common" ; export enum ApplicationMigrationApiKeys { } /**
 * 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 ApplicationMigrationClient { protected static serviceEndpointTemplate = "https://applicationmigration.{region}.oci.{secondLevelDomain}" ; protected "_endpoint" : string = "" ; protected "_defaultHeaders" : any = { } ; protected "_waiters" : ApplicationMigrationWaiter ; 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 + "/20191031" ; if ( this . logger ) this . logger . info ( `ApplicationMigrationClient 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 ( ApplicationMigrationClient . 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 ( ApplicationMigrationClient . serviceEndpointTemplate , regionId ) ; } param config return public createWaiters ( config ? ) { this . _waiters = new ApplicationMigrationWaiter ( this , config ) ; return this . _waiters ; } return public getWaiters ( ) { if ( this . _waiters ) { return this . _waiters ; } throw Error ( "Waiters do not exist. Please create waiters." ) ; } param CancelWorkRequestRequest return throws example Click  https to see how to use CancelWorkRequest API.
        public async cancelWorkRequest ( cancelWorkRequestRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation ApplicationMigrationClient#cancelWorkRequest." ) ; const pathParams = { "{workRequestId}" : cancelWorkRequestRequest . workRequestId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : cancelWorkRequestRequest . opcRequestId , "if-match" : cancelWorkRequestRequest . ifMatch } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , cancelWorkRequestRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/workRequests/{workRequestId}" , method : "DELETE" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . CancelWorkRequestResponse > { } , responseHeaders : [ { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param ChangeMigrationCompartmentRequest return throws example Click  https to see how to use ChangeMigrationCompartment API.
      public async changeMigrationCompartment ( changeMigrationCompartmentRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation ApplicationMigrationClient#changeMigrationCompartment." ) ; const pathParams = { "{migrationId}" : changeMigrationCompartmentRequest . migrationId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "if-match" : changeMigrationCompartmentRequest . ifMatch , "opc-request-id" : changeMigrationCompartmentRequest . opcRequestId , "opc-retry-token" : changeMigrationCompartmentRequest . opcRetryToken } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , changeMigrationCompartmentRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/migrations/{migrationId}/actions/changeCompartment" , method : "POST" , bodyContent : common . ObjectSerializer . serialize ( changeMigrationCompartmentRequest . changeMigrationCompartmentDetails , "ChangeCompartmentDetails" , model . ChangeCompartmentDetails . getJsonObj ) , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . ChangeMigrationCompartmentResponse > { } , responseHeaders : [ { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } , { value : response . headers . get ( "opc-work-request-id" ) , key : "opcWorkRequestId" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param ChangeSourceCompartmentRequest return throws example Click  https to see how to use ChangeSourceCompartment API.
      public async changeSourceCompartment ( changeSourceCompartmentRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation ApplicationMigrationClient#changeSourceCompartment." ) ; const pathParams = { "{sourceId}" : changeSourceCompartmentRequest . sourceId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "if-match" : changeSourceCompartmentRequest . ifMatch , "opc-request-id" : changeSourceCompartmentRequest . opcRequestId , "opc-retry-token" : changeSourceCompartmentRequest . opcRetryToken } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , changeSourceCompartmentRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/sources/{sourceId}/actions/changeCompartment" , method : "POST" , bodyContent : common . ObjectSerializer . serialize ( changeSourceCompartmentRequest . changeSourceCompartmentDetails , "ChangeCompartmentDetails" , model . ChangeCompartmentDetails . getJsonObj ) , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . ChangeSourceCompartmentResponse > { } , responseHeaders : [ { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } , { value : response . headers . get ( "opc-work-request-id" ) , key : "opcWorkRequestId" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } /**
       * Creates a migration. A migration represents the end-to-end workflow of moving an application from a source environment to Oracle Cloud
  * Infrastructure. Each migration moves a single application to Oracle Cloud Infrastructure. For more information,
  * see [Manage Migrations](https://docs.cloud.oracle.com/iaas/application-migration/manage_migrations.htm).
  * <p>
  When you create a migration, provide the required information to let Application Migration access the source environment.
  * Application Migration uses this information to access the application in the source environment and discover application artifacts.
  * <p>
  All Oracle Cloud Infrastructure resources, including migrations, get an Oracle-assigned, unique ID called an Oracle Cloud Identifier (OCID).
  * When you create a resource, you can find its OCID in the response. You can also retrieve a resource's OCID by using a List API operation on
  * that resource type, or by viewing the resource in the Console. For more information, see Resource Identifiers.
  * <p>
  After you send your request, a migration is created in the compartment that contains the source. The new migration's lifecycle state
  * will temporarily be <code>CREATING</code> and the state of the migration will be <code>DISCOVERING_APPLICATION</code>. During this phase,
  * Application Migration sets the template for the <code>serviceConfig</code> and <code>applicationConfig</code> fields of the migration.
  * When this operation is complete, the state of the migration changes to <code>MISSING_CONFIG_VALUES</code>.
  * Next, you'll need to update the migration to provide configuration values. Before updating the
  * migration, ensure that its state has changed to <code>MISSING_CONFIG_VALUES</code>.
  * <p>
  To track the progress of this operation, you can monitor the status of the Create Migration and Discover Application work requests
  * by using the <code> {@link #getWorkRequest(GetWorkRequestRequest) getWorkRequest} </code> REST API operation on the work request or by viewing the status of the work request in
  * the console.
  *
       * This operation does not retry by default if the user has not defined a retry configuration.
       *  param CreateMigrationRequest return throws example Click  https to see how to use CreateMigration API.
        public async createMigration ( createMigrationRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation ApplicationMigrationClient#createMigration." ) ; const pathParams = { } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : createMigrationRequest . opcRequestId , "opc-retry-token" : createMigrationRequest . opcRetryToken } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , createMigrationRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/migrations" , method : "POST" , bodyContent : common . ObjectSerializer . serialize ( createMigrationRequest . createMigrationDetails , "CreateMigrationDetails" , model . CreateMigrationDetails . getJsonObj ) , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . CreateMigrationResponse > { } , body : await response . json ( ) , bodyKey : "migration" , bodyModel : model . Migration , type : "model.Migration" , responseHeaders : [ { value : response . headers . get ( "etag" ) , key : "etag" , dataType : "string" } , { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } , { value : response . headers . get ( "opc-work-request-id" ) , key : "opcWorkRequestId" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } /**
       * Creates a source in the specified compartment. In Application Migration, a source refers to the environment from which the application
  * is being migrated. For more information, see [Manage Sources](https://docs.cloud.oracle.com/iaas/application-migration/manage_sources.htm).
  * <p>
  All Oracle Cloud Infrastructure resources, including sources, get an Oracle-assigned, unique ID called an Oracle Cloud Identifier (OCID).
  * When you create a resource, you can find its OCID in the response. You can also retrieve a resource's OCID by using a List API operation
  * on that resource type, or by viewing the resource in the Console.
  * <p>
  After you send your request, a source is created in the specified compartment. The new source's lifecycle state will temporarily be
  * <code>CREATING</code>. Application Migration connects to the source environment with the authentication credentials that you have provided.
  * If the connection is established, the status of the source changes to <code>ACTIVE</code> and Application Migration fetches the list of
  * applications that are available for migration in the source environment.
  * <p>
  To track the progress of the operation, you can monitor the status of the Create Source work request by using the
  * <code> {@link #getWorkRequest(GetWorkRequestRequest) getWorkRequest} </code> REST API operation on the work request or by viewing the status of the work request in the console.
  * <p>
  Ensure that the state of the source has changed to <code>ACTIVE</code>, before you retrieve the list of applications from
  * the source environment using the <code> {@link #listSourceApplications(ListSourceApplicationsRequest) listSourceApplications} </code> REST API call.
  *
       * This operation does not retry by default if the user has not defined a retry configuration.
       *  param CreateSourceRequest return throws example Click  https to see how to use CreateSource API.
        public async createSource ( createSourceRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation ApplicationMigrationClient#createSource." ) ; const pathParams = { } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : createSourceRequest . opcRequestId , "opc-retry-token" : createSourceRequest . opcRetryToken } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , createSourceRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/sources" , method : "POST" , bodyContent : common . ObjectSerializer . serialize ( createSourceRequest . createSourceDetails , "CreateSourceDetails" , model . CreateSourceDetails . getJsonObj ) , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . CreateSourceResponse > { } , body : await response . json ( ) , bodyKey : "source" , bodyModel : model . Source , type : "model.Source" , responseHeaders : [ { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } , { value : response . headers . get ( "opc-work-request-id" ) , key : "opcWorkRequestId" , dataType : "string" } , { value : response . headers . get ( "etag" ) , key : "etag" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param DeleteMigrationRequest return throws example Click  https to see how to use DeleteMigration API.
        public async deleteMigration ( deleteMigrationRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation ApplicationMigrationClient#deleteMigration." ) ; const pathParams = { "{migrationId}" : deleteMigrationRequest . migrationId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : deleteMigrationRequest . opcRequestId , "if-match" : deleteMigrationRequest . ifMatch } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , deleteMigrationRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/migrations/{migrationId}" , method : "DELETE" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . DeleteMigrationResponse > { } , responseHeaders : [ { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } , { value : response . headers . get ( "opc-work-request-id" ) , key : "opcWorkRequestId" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param DeleteSourceRequest return throws example Click  https to see how to use DeleteSource API.
        public async deleteSource ( deleteSourceRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation ApplicationMigrationClient#deleteSource." ) ; const pathParams = { "{sourceId}" : deleteSourceRequest . sourceId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : deleteSourceRequest . opcRequestId , "if-match" : deleteSourceRequest . ifMatch } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , deleteSourceRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/sources/{sourceId}" , method : "DELETE" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . DeleteSourceResponse > { } , responseHeaders : [ { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } , { value : response . headers . get ( "opc-work-request-id" ) , key : "opcWorkRequestId" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param GetMigrationRequest return throws example Click  https to see how to use GetMigration API.
      public async getMigration ( getMigrationRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation ApplicationMigrationClient#getMigration." ) ; const pathParams = { "{migrationId}" : getMigrationRequest . migrationId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : getMigrationRequest . opcRequestId } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , getMigrationRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/migrations/{migrationId}" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . GetMigrationResponse > { } , body : await response . json ( ) , bodyKey : "migration" , bodyModel : model . Migration , type : "model.Migration" , responseHeaders : [ { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } , { value : response . headers . get ( "etag" ) , key : "etag" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param GetSourceRequest return throws example Click  https to see how to use GetSource API.
      public async getSource ( getSourceRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation ApplicationMigrationClient#getSource." ) ; const pathParams = { "{sourceId}" : getSourceRequest . sourceId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : getSourceRequest . opcRequestId } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , getSourceRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/sources/{sourceId}" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . GetSourceResponse > { } , body : await response . json ( ) , bodyKey : "source" , bodyModel : model . Source , type : "model.Source" , responseHeaders : [ { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } , { value : response . headers . get ( "etag" ) , key : "etag" , 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 ApplicationMigrationClient#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 ( "etag" ) , key : "etag" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param ListMigrationsRequest return throws example Click  https to see how to use ListMigrations API.
      public async listMigrations ( listMigrationsRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation ApplicationMigrationClient#listMigrations." ) ; const pathParams = { } ; const queryParams = { "compartmentId" : listMigrationsRequest . compartmentId , "id" : listMigrationsRequest . id , "limit" : listMigrationsRequest . limit , "page" : listMigrationsRequest . page , "sortOrder" : listMigrationsRequest . sortOrder , "sortBy" : listMigrationsRequest . sortBy , "displayName" : listMigrationsRequest . displayName , "lifecycleState" : listMigrationsRequest . lifecycleState } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : listMigrationsRequest . opcRequestId } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , listMigrationsRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/migrations" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . ListMigrationsResponse > { } , body : await response . json ( ) , bodyKey : "items" , bodyModel : model . MigrationSummary , type : "Array<model.MigrationSummary>" , 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 listAllMigrations ( request ) { return paginateRecords ( request , req => this . listMigrations ( req ) ) ; } param request public listAllMigrationsResponses ( request ) { return paginateResponses ( request , req => this . listMigrations ( req ) ) ; } param request public listMigrationsRecordIterator ( request ) { return paginateRecords ( request , req => this . listMigrations ( req ) ) ; } param request public listMigrationsResponseIterator ( request ) { return paginateResponses ( request , req => this . listMigrations ( req ) ) ; } param ListSourceApplicationsRequest return throws example Click  https to see how to use ListSourceApplications API.
      public async listSourceApplications ( listSourceApplicationsRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation ApplicationMigrationClient#listSourceApplications." ) ; const pathParams = { "{sourceId}" : listSourceApplicationsRequest . sourceId } ; const queryParams = { "limit" : listSourceApplicationsRequest . limit , "page" : listSourceApplicationsRequest . page , "sortOrder" : listSourceApplicationsRequest . sortOrder , "sortBy" : listSourceApplicationsRequest . sortBy , "compartmentId" : listSourceApplicationsRequest . compartmentId , "displayName" : listSourceApplicationsRequest . displayName } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : listSourceApplicationsRequest . opcRequestId } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , listSourceApplicationsRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/sources/{sourceId}/applications" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . ListSourceApplicationsResponse > { } , body : await response . json ( ) , bodyKey : "items" , bodyModel : model . SourceApplicationSummary , type : "Array<model.SourceApplicationSummary>" , 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 listAllSourceApplications ( request ) { return paginateRecords ( request , req => this . listSourceApplications ( req ) ) ; } param request public listAllSourceApplicationsResponses ( request ) { return paginateResponses ( request , req => this . listSourceApplications ( req ) ) ; } param request public listSourceApplicationsRecordIterator ( request ) { return paginateRecords ( request , req => this . listSourceApplications ( req ) ) ; } param request public listSourceApplicationsResponseIterator ( request ) { return paginateResponses ( request , req => this . listSourceApplications ( req ) ) ; } param ListSourcesRequest return throws example Click  https to see how to use ListSources API.
      public async listSources ( listSourcesRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation ApplicationMigrationClient#listSources." ) ; const pathParams = { } ; const queryParams = { "compartmentId" : listSourcesRequest . compartmentId , "id" : listSourcesRequest . id , "limit" : listSourcesRequest . limit , "page" : listSourcesRequest . page , "sortOrder" : listSourcesRequest . sortOrder , "sortBy" : listSourcesRequest . sortBy , "displayName" : listSourcesRequest . displayName , "lifecycleState" : listSourcesRequest . lifecycleState } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : listSourcesRequest . opcRequestId } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , listSourcesRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/sources" , method : "GET" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . ListSourcesResponse > { } , body : await response . json ( ) , bodyKey : "items" , bodyModel : model . SourceSummary , type : "Array<model.SourceSummary>" , 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 listAllSources ( request ) { return paginateRecords ( request , req => this . listSources ( req ) ) ; } param request public listAllSourcesResponses ( request ) { return paginateResponses ( request , req => this . listSources ( req ) ) ; } param request public listSourcesRecordIterator ( request ) { return paginateRecords ( request , req => this . listSources ( req ) ) ; } param request public listSourcesResponseIterator ( request ) { return paginateResponses ( request , req => this . listSources ( 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 ApplicationMigrationClient#listWorkRequestErrors." ) ; const pathParams = { "{workRequestId}" : listWorkRequestErrorsRequest . workRequestId } ; const queryParams = { "limit" : listWorkRequestErrorsRequest . limit , "page" : listWorkRequestErrorsRequest . page , "sortOrder" : listWorkRequestErrorsRequest . sortOrder } ; 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 ApplicationMigrationClient#listWorkRequestLogs." ) ; const pathParams = { "{workRequestId}" : listWorkRequestLogsRequest . workRequestId } ; const queryParams = { "limit" : listWorkRequestLogsRequest . limit , "page" : listWorkRequestLogsRequest . page , "sortOrder" : listWorkRequestLogsRequest . sortOrder } ; 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 ApplicationMigrationClient#listWorkRequests." ) ; const pathParams = { } ; const queryParams = { "compartmentId" : listWorkRequestsRequest . compartmentId , "resourceId" : listWorkRequestsRequest . resourceId , "limit" : listWorkRequestsRequest . limit , "page" : listWorkRequestsRequest . page } ; 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-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 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 ) ) ; } /**
       * Starts migrating the specified application to Oracle Cloud Infrastructure.
  * <p>
  Before sending this request, ensure that you have provided configuration details to update the migration and the state of the migration
  * is <code>READY</code>.
  * <p>
  After you send this request, the migration's state will temporarily be <code>MIGRATING</code>.
  * <p>
  To track the progress of the operation, you can monitor the status of the Migrate Application work request by using the
  * <code> {@link #getWorkRequest(GetWorkRequestRequest) getWorkRequest} </code> REST API operation on the work request or by viewing the status of the work request in the console.
  * When this work request is processed successfully, Application Migration creates the required resources in the target environment
  * and the state of the migration changes to <code>MIGRATION_SUCCEEDED</code>.
  *
       * This operation does not retry by default if the user has not defined a retry configuration.
       *  param MigrateApplicationRequest return throws example Click  https to see how to use MigrateApplication API.
        public async migrateApplication ( migrateApplicationRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation ApplicationMigrationClient#migrateApplication." ) ; const pathParams = { "{migrationId}" : migrateApplicationRequest . migrationId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : migrateApplicationRequest . opcRequestId , "if-match" : migrateApplicationRequest . ifMatch , "opc-retry-token" : migrateApplicationRequest . opcRetryToken } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , migrateApplicationRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/migrations/{migrationId}/actions/migrate" , method : "POST" , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . MigrateApplicationResponse > { } , responseHeaders : [ { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } , { value : response . headers . get ( "opc-work-request-id" ) , key : "opcWorkRequestId" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } /**
       * Updates the configuration details for the specified migration.
  * <p>
  When you create a migration, Application Migration sets the template for the <code>serviceConfig</code> and <code>applicationConfig</code>
  * attributes of the migration.
  * When you update the migration, you must provide values for these fields to specify configuration information for the application in the
  * target environment.
  * <p>
  
  * <p>
  Before updating the migration, complete the following tasks:
  * <ol>
  * <li>Identify the migration that you want to update and ensure that the migration is in the <code>MISSING_CONFIG_VALUES</code> state.</li>
  * <li>Get details of the migration using the <code>GetMigration</code> command. This returns the  template for the <code>serviceConfig</code>
  * and <code>applicationConfig</code> attributes of the migration.</li>
  * <li>You must fill out the required details for the <code>serviceConfig</code> and <code>applicationConfig</code> attributes.
  * The <code>isRequired</code> attribute of a configuration property indicates whether it is mandatory to provide a value.</li>
  * <li>You can provide values for the optional configuration properties or you can delete the optional properties for which you do not
  * provide values. Note that you cannot add any property that is not present in the template.</li>
  * </ol>
  * <p>
  To update the migration, pass the configuration values in the request body. The information that you must provide depends on the type
  * of application that you are migrating. For reference information about configuration fields, see
  * [Provide Configuration Information](https://docs.cloud.oracle.com/iaas/application-migration/manage_migrations.htm#provide_configuration_details).
  * <p>
  To track the progress of the operation, you can monitor the status of the Update Migration work request by using the
  * <code> {@link #getWorkRequest(GetWorkRequestRequest) getWorkRequest} </code> REST API operation on the work request or by viewing the status of the work request in the console.
  * <p>
  When the migration has been updated, the state of the migration changes to <code>READY</code>. After updating the migration,
  * you can start the migration whenever you are ready.
  *
       * This operation does not retry by default if the user has not defined a retry configuration.
       *  param UpdateMigrationRequest return throws example Click  https to see how to use UpdateMigration API.
        public async updateMigration ( updateMigrationRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation ApplicationMigrationClient#updateMigration." ) ; const pathParams = { "{migrationId}" : updateMigrationRequest . migrationId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : updateMigrationRequest . opcRequestId , "opc-retry-token" : updateMigrationRequest . opcRetryToken , "if-match" : updateMigrationRequest . ifMatch } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , updateMigrationRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/migrations/{migrationId}" , method : "PUT" , bodyContent : common . ObjectSerializer . serialize ( updateMigrationRequest . updateMigrationDetails , "UpdateMigrationDetails" , model . UpdateMigrationDetails . getJsonObj ) , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . UpdateMigrationResponse > { } , responseHeaders : [ { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } , { value : response . headers . get ( "opc-work-request-id" ) , key : "opcWorkRequestId" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } param UpdateSourceRequest return throws example Click  https to see how to use UpdateSource API.
      public async updateSource ( updateSourceRequest ) { if ( this . logger ) this . logger . debug ( "Calling operation ApplicationMigrationClient#updateSource." ) ; const pathParams = { "{sourceId}" : updateSourceRequest . sourceId } ; const queryParams = { } ; let headerParams = { "Content-Type" : common . Constants . APPLICATION_JSON , "opc-request-id" : updateSourceRequest . opcRequestId , "if-match" : updateSourceRequest . ifMatch } ; const specRetryConfiguration = common . NoRetryConfigurationDetails ; const retrier = GenericRetrier . createPreferredRetrier ( this . _clientConfiguration ? this . _clientConfiguration . retryConfiguration : undefined , updateSourceRequest . retryConfiguration , specRetryConfiguration ) ; if ( this . logger ) retrier . logger = this . logger ; const request = await composeRequest ( { baseEndpoint : this . _endpoint , defaultHeaders : this . _defaultHeaders , path : "/sources/{sourceId}" , method : "PUT" , bodyContent : common . ObjectSerializer . serialize ( updateSourceRequest . updateSourceDetails , "UpdateSourceDetails" , model . UpdateSourceDetails . getJsonObj ) , pathParams : pathParams , headerParams : headerParams , queryParams : queryParams } ) ; try { const response = await retrier . makeServiceCall ( this . _httpClient , request ) ; const sdkResponse = composeResponse ( { responseObject : < responses . UpdateSourceResponse > { } , responseHeaders : [ { value : response . headers . get ( "opc-request-id" ) , key : "opcRequestId" , dataType : "string" } , { value : response . headers . get ( "opc-work-request-id" ) , key : "opcWorkRequestId" , dataType : "string" } ] } ) ; return sdkResponse ; } catch ( err ) { throw err ; } } }