import * as protos from '../protos/protos' ; import * as assert from 'assert' ; import * as sinon from 'sinon' ; import { SinonStub } from 'sinon' ; import { describe , it } from 'mocha' ; import * as transitionroutegroupsModule from '../src' ; import { PassThrough } from 'stream' ; import { protobuf } from 'google-gax' ; function generateSampleMessage < T extends object > ( instance ) { const filledObject = ( instance . constructor as typeof protobuf . Message ) . toObject ( instance as protobuf . Message < T > , { defaults : true } ) ; return ( instance . constructor as typeof protobuf . Message ) . fromObject ( filledObject ) as T ; } function stubSimpleCall < ResponseType > ( response ? , error ? ) { return error ? sinon . stub ( ) . rejects ( error ) : sinon . stub ( ) . resolves ( [ response ] ) ; } function stubSimpleCallWithCallback < ResponseType > ( response ? , error ? ) { return error ? sinon . stub ( ) . callsArgWith ( 2 , error ) : sinon . stub ( ) . callsArgWith ( 2 , null , response ) ; } function stubPageStreamingCall < ResponseType > ( responses ? , error ? ) { const pagingStub = sinon . stub ( ) ; if ( responses ) { for ( let i = 0 ; i < responses . length ; ++ i ) { pagingStub . onCall ( i ) . callsArgWith ( 2 , null , responses [ i ] ) ; } } const transformStub = error ? sinon . stub ( ) . callsArgWith ( 2 , error ) : pagingStub ; const mockStream = new PassThrough ( { objectMode : true , transform : transformStub , } ) ; if ( responses ) { for ( let i = 0 ; i < responses . length ; ++ i ) { setImmediate ( ( ) => { mockStream . write ( { } ) ; } ) ; } setImmediate ( ( ) => { mockStream . end ( ) ; } ) ; } else { setImmediate ( ( ) => { mockStream . write ( { } ) ; } ) ; setImmediate ( ( ) => { mockStream . end ( ) ; } ) ; } return sinon . stub ( ) . returns ( mockStream ) ; } function stubAsyncIterationCall < ResponseType > ( responses ? , error ? ) { let counter = 0 ; const asyncIterable = { [ Symbol . asyncIterator ] ( ) { return { async next ( ) { if ( error ) { return Promise . reject ( error ) ; } if ( counter >= responses ! . length ) { return Promise . resolve ( { done : true , value : undefined } ) ; } return Promise . resolve ( { done : false , value : responses ! [ counter ++ ] } ) ; } , } ; } , } ; return sinon . stub ( ) . returns ( asyncIterable ) ; } describe ( 'v3.TransitionRouteGroupsClient' , ( ) => { it ( 'has servicePath' , ( ) => { const servicePath = transitionroutegroupsModule . v3 . TransitionRouteGroupsClient . servicePath ; assert ( servicePath ) ; } ) ; it ( 'has apiEndpoint' , ( ) => { const apiEndpoint = transitionroutegroupsModule . v3 . TransitionRouteGroupsClient . apiEndpoint ; assert ( apiEndpoint ) ; } ) ; it ( 'has port' , ( ) => { const port = transitionroutegroupsModule . v3 . TransitionRouteGroupsClient . port ; assert ( port ) ; assert ( typeof port === 'number' ) ; } ) ; it ( 'should create a client with no option' , ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( ) ; assert ( client ) ; } ) ; it ( 'should create a client with gRPC fallback' , ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { fallback : true , } ) ; assert ( client ) ; } ) ; it ( 'has initialize method and supports deferred initialization' , async ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; assert . strictEqual ( client . transitionRouteGroupsStub , undefined ) ; await client . initialize ( ) ; assert ( client . transitionRouteGroupsStub ) ; } ) ; it ( 'has close method' , ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . close ( ) ; } ) ; it ( 'has getProjectId method' , async ( ) => { const fakeProjectId = 'fake-project-id' ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . auth . getProjectId = sinon . stub ( ) . resolves ( fakeProjectId ) ; const result = await client . getProjectId ( ) ; assert . strictEqual ( result , fakeProjectId ) ; assert ( ( client . auth . getProjectId as SinonStub ) . calledWithExactly ( ) ) ; } ) ; it ( 'has getProjectId method with callback' , async ( ) => { const fakeProjectId = 'fake-project-id' ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . auth . getProjectId = sinon . stub ( ) . callsArgWith ( 0 , null , fakeProjectId ) ; const promise = new Promise ( ( resolve , reject ) => { client . getProjectId ( ( err ? , projectId ? ) => { if ( err ) { reject ( err ) ; } else { resolve ( projectId ) ; } } ) ; } ) ; const result = await promise ; assert . strictEqual ( result , fakeProjectId ) ; } ) ; describe ( 'getTransitionRouteGroup' , ( ) => { it ( 'invokes getTransitionRouteGroup without error' , async ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; const request = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . GetTransitionRouteGroupRequest ( ) ) ; request . name = '' ; const expectedHeaderRequestParams = 'name=' ; const expectedOptions = { otherArgs : { headers : { 'x-goog-request-params' : expectedHeaderRequestParams , } , } , } ; const expectedResponse = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . TransitionRouteGroup ( ) ) ; client . innerApiCalls . getTransitionRouteGroup = stubSimpleCall ( expectedResponse ) ; const [ response ] = await client . getTransitionRouteGroup ( request ) ; assert . deepStrictEqual ( response , expectedResponse ) ; assert ( ( client . innerApiCalls . getTransitionRouteGroup as SinonStub ) . getCall ( 0 ) . calledWith ( request , expectedOptions , undefined ) ) ; } ) ; it ( 'invokes getTransitionRouteGroup without error using callback' , async ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; const request = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . GetTransitionRouteGroupRequest ( ) ) ; request . name = '' ; const expectedHeaderRequestParams = 'name=' ; const expectedOptions = { otherArgs : { headers : { 'x-goog-request-params' : expectedHeaderRequestParams , } , } , } ; const expectedResponse = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . TransitionRouteGroup ( ) ) ; client . innerApiCalls . getTransitionRouteGroup = stubSimpleCallWithCallback ( expectedResponse ) ; const promise = new Promise ( ( resolve , reject ) => { client . getTransitionRouteGroup ( request , ( err ? , result ? ) => { if ( err ) { reject ( err ) ; } else { resolve ( result ) ; } } ) ; } ) ; const response = await promise ; assert . deepStrictEqual ( response , expectedResponse ) ; assert ( ( client . innerApiCalls . getTransitionRouteGroup as SinonStub ) . getCall ( 0 ) . calledWith ( request , expectedOptions ) ) ; } ) ; it ( 'invokes getTransitionRouteGroup with error' , async ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; const request = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . GetTransitionRouteGroupRequest ( ) ) ; request . name = '' ; const expectedHeaderRequestParams = 'name=' ; const expectedOptions = { otherArgs : { headers : { 'x-goog-request-params' : expectedHeaderRequestParams , } , } , } ; const expectedError = new Error ( 'expected' ) ; client . innerApiCalls . getTransitionRouteGroup = stubSimpleCall ( undefined , expectedError ) ; await assert . rejects ( client . getTransitionRouteGroup ( request ) , expectedError ) ; assert ( ( client . innerApiCalls . getTransitionRouteGroup as SinonStub ) . getCall ( 0 ) . calledWith ( request , expectedOptions , undefined ) ) ; } ) ; } ) ; describe ( 'createTransitionRouteGroup' , ( ) => { it ( 'invokes createTransitionRouteGroup without error' , async ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; const request = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . CreateTransitionRouteGroupRequest ( ) ) ; request . parent = '' ; const expectedHeaderRequestParams = 'parent=' ; const expectedOptions = { otherArgs : { headers : { 'x-goog-request-params' : expectedHeaderRequestParams , } , } , } ; const expectedResponse = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . TransitionRouteGroup ( ) ) ; client . innerApiCalls . createTransitionRouteGroup = stubSimpleCall ( expectedResponse ) ; const [ response ] = await client . createTransitionRouteGroup ( request ) ; assert . deepStrictEqual ( response , expectedResponse ) ; assert ( ( client . innerApiCalls . createTransitionRouteGroup as SinonStub ) . getCall ( 0 ) . calledWith ( request , expectedOptions , undefined ) ) ; } ) ; it ( 'invokes createTransitionRouteGroup without error using callback' , async ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; const request = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . CreateTransitionRouteGroupRequest ( ) ) ; request . parent = '' ; const expectedHeaderRequestParams = 'parent=' ; const expectedOptions = { otherArgs : { headers : { 'x-goog-request-params' : expectedHeaderRequestParams , } , } , } ; const expectedResponse = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . TransitionRouteGroup ( ) ) ; client . innerApiCalls . createTransitionRouteGroup = stubSimpleCallWithCallback ( expectedResponse ) ; const promise = new Promise ( ( resolve , reject ) => { client . createTransitionRouteGroup ( request , ( err ? , result ? ) => { if ( err ) { reject ( err ) ; } else { resolve ( result ) ; } } ) ; } ) ; const response = await promise ; assert . deepStrictEqual ( response , expectedResponse ) ; assert ( ( client . innerApiCalls . createTransitionRouteGroup as SinonStub ) . getCall ( 0 ) . calledWith ( request , expectedOptions ) ) ; } ) ; it ( 'invokes createTransitionRouteGroup with error' , async ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; const request = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . CreateTransitionRouteGroupRequest ( ) ) ; request . parent = '' ; const expectedHeaderRequestParams = 'parent=' ; const expectedOptions = { otherArgs : { headers : { 'x-goog-request-params' : expectedHeaderRequestParams , } , } , } ; const expectedError = new Error ( 'expected' ) ; client . innerApiCalls . createTransitionRouteGroup = stubSimpleCall ( undefined , expectedError ) ; await assert . rejects ( client . createTransitionRouteGroup ( request ) , expectedError ) ; assert ( ( client . innerApiCalls . createTransitionRouteGroup as SinonStub ) . getCall ( 0 ) . calledWith ( request , expectedOptions , undefined ) ) ; } ) ; } ) ; describe ( 'updateTransitionRouteGroup' , ( ) => { it ( 'invokes updateTransitionRouteGroup without error' , async ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; const request = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . UpdateTransitionRouteGroupRequest ( ) ) ; request . transitionRouteGroup = { } ; request . transitionRouteGroup . name = '' ; const expectedHeaderRequestParams = 'transition_route_group.name=' ; const expectedOptions = { otherArgs : { headers : { 'x-goog-request-params' : expectedHeaderRequestParams , } , } , } ; const expectedResponse = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . TransitionRouteGroup ( ) ) ; client . innerApiCalls . updateTransitionRouteGroup = stubSimpleCall ( expectedResponse ) ; const [ response ] = await client . updateTransitionRouteGroup ( request ) ; assert . deepStrictEqual ( response , expectedResponse ) ; assert ( ( client . innerApiCalls . updateTransitionRouteGroup as SinonStub ) . getCall ( 0 ) . calledWith ( request , expectedOptions , undefined ) ) ; } ) ; it ( 'invokes updateTransitionRouteGroup without error using callback' , async ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; const request = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . UpdateTransitionRouteGroupRequest ( ) ) ; request . transitionRouteGroup = { } ; request . transitionRouteGroup . name = '' ; const expectedHeaderRequestParams = 'transition_route_group.name=' ; const expectedOptions = { otherArgs : { headers : { 'x-goog-request-params' : expectedHeaderRequestParams , } , } , } ; const expectedResponse = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . TransitionRouteGroup ( ) ) ; client . innerApiCalls . updateTransitionRouteGroup = stubSimpleCallWithCallback ( expectedResponse ) ; const promise = new Promise ( ( resolve , reject ) => { client . updateTransitionRouteGroup ( request , ( err ? , result ? ) => { if ( err ) { reject ( err ) ; } else { resolve ( result ) ; } } ) ; } ) ; const response = await promise ; assert . deepStrictEqual ( response , expectedResponse ) ; assert ( ( client . innerApiCalls . updateTransitionRouteGroup as SinonStub ) . getCall ( 0 ) . calledWith ( request , expectedOptions ) ) ; } ) ; it ( 'invokes updateTransitionRouteGroup with error' , async ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; const request = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . UpdateTransitionRouteGroupRequest ( ) ) ; request . transitionRouteGroup = { } ; request . transitionRouteGroup . name = '' ; const expectedHeaderRequestParams = 'transition_route_group.name=' ; const expectedOptions = { otherArgs : { headers : { 'x-goog-request-params' : expectedHeaderRequestParams , } , } , } ; const expectedError = new Error ( 'expected' ) ; client . innerApiCalls . updateTransitionRouteGroup = stubSimpleCall ( undefined , expectedError ) ; await assert . rejects ( client . updateTransitionRouteGroup ( request ) , expectedError ) ; assert ( ( client . innerApiCalls . updateTransitionRouteGroup as SinonStub ) . getCall ( 0 ) . calledWith ( request , expectedOptions , undefined ) ) ; } ) ; } ) ; describe ( 'deleteTransitionRouteGroup' , ( ) => { it ( 'invokes deleteTransitionRouteGroup without error' , async ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; const request = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . DeleteTransitionRouteGroupRequest ( ) ) ; request . name = '' ; const expectedHeaderRequestParams = 'name=' ; const expectedOptions = { otherArgs : { headers : { 'x-goog-request-params' : expectedHeaderRequestParams , } , } , } ; const expectedResponse = generateSampleMessage ( new protos . google . protobuf . Empty ( ) ) ; client . innerApiCalls . deleteTransitionRouteGroup = stubSimpleCall ( expectedResponse ) ; const [ response ] = await client . deleteTransitionRouteGroup ( request ) ; assert . deepStrictEqual ( response , expectedResponse ) ; assert ( ( client . innerApiCalls . deleteTransitionRouteGroup as SinonStub ) . getCall ( 0 ) . calledWith ( request , expectedOptions , undefined ) ) ; } ) ; it ( 'invokes deleteTransitionRouteGroup without error using callback' , async ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; const request = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . DeleteTransitionRouteGroupRequest ( ) ) ; request . name = '' ; const expectedHeaderRequestParams = 'name=' ; const expectedOptions = { otherArgs : { headers : { 'x-goog-request-params' : expectedHeaderRequestParams , } , } , } ; const expectedResponse = generateSampleMessage ( new protos . google . protobuf . Empty ( ) ) ; client . innerApiCalls . deleteTransitionRouteGroup = stubSimpleCallWithCallback ( expectedResponse ) ; const promise = new Promise ( ( resolve , reject ) => { client . deleteTransitionRouteGroup ( request , ( err ? , result ? ) => { if ( err ) { reject ( err ) ; } else { resolve ( result ) ; } } ) ; } ) ; const response = await promise ; assert . deepStrictEqual ( response , expectedResponse ) ; assert ( ( client . innerApiCalls . deleteTransitionRouteGroup as SinonStub ) . getCall ( 0 ) . calledWith ( request , expectedOptions ) ) ; } ) ; it ( 'invokes deleteTransitionRouteGroup with error' , async ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; const request = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . DeleteTransitionRouteGroupRequest ( ) ) ; request . name = '' ; const expectedHeaderRequestParams = 'name=' ; const expectedOptions = { otherArgs : { headers : { 'x-goog-request-params' : expectedHeaderRequestParams , } , } , } ; const expectedError = new Error ( 'expected' ) ; client . innerApiCalls . deleteTransitionRouteGroup = stubSimpleCall ( undefined , expectedError ) ; await assert . rejects ( client . deleteTransitionRouteGroup ( request ) , expectedError ) ; assert ( ( client . innerApiCalls . deleteTransitionRouteGroup as SinonStub ) . getCall ( 0 ) . calledWith ( request , expectedOptions , undefined ) ) ; } ) ; } ) ; describe ( 'listTransitionRouteGroups' , ( ) => { it ( 'invokes listTransitionRouteGroups without error' , async ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; const request = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . ListTransitionRouteGroupsRequest ( ) ) ; request . parent = '' ; const expectedHeaderRequestParams = 'parent=' ; const expectedOptions = { otherArgs : { headers : { 'x-goog-request-params' : expectedHeaderRequestParams , } , } , } ; const expectedResponse = [ generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . TransitionRouteGroup ( ) ) , generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . TransitionRouteGroup ( ) ) , generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . TransitionRouteGroup ( ) ) , ] ; client . innerApiCalls . listTransitionRouteGroups = stubSimpleCall ( expectedResponse ) ; const [ response ] = await client . listTransitionRouteGroups ( request ) ; assert . deepStrictEqual ( response , expectedResponse ) ; assert ( ( client . innerApiCalls . listTransitionRouteGroups as SinonStub ) . getCall ( 0 ) . calledWith ( request , expectedOptions , undefined ) ) ; } ) ; it ( 'invokes listTransitionRouteGroups without error using callback' , async ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; const request = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . ListTransitionRouteGroupsRequest ( ) ) ; request . parent = '' ; const expectedHeaderRequestParams = 'parent=' ; const expectedOptions = { otherArgs : { headers : { 'x-goog-request-params' : expectedHeaderRequestParams , } , } , } ; const expectedResponse = [ generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . TransitionRouteGroup ( ) ) , generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . TransitionRouteGroup ( ) ) , generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . TransitionRouteGroup ( ) ) , ] ; client . innerApiCalls . listTransitionRouteGroups = stubSimpleCallWithCallback ( expectedResponse ) ; const promise = new Promise ( ( resolve , reject ) => { client . listTransitionRouteGroups ( request , ( err ? , result ? ) => { if ( err ) { reject ( err ) ; } else { resolve ( result ) ; } } ) ; } ) ; const response = await promise ; assert . deepStrictEqual ( response , expectedResponse ) ; assert ( ( client . innerApiCalls . listTransitionRouteGroups as SinonStub ) . getCall ( 0 ) . calledWith ( request , expectedOptions ) ) ; } ) ; it ( 'invokes listTransitionRouteGroups with error' , async ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; const request = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . ListTransitionRouteGroupsRequest ( ) ) ; request . parent = '' ; const expectedHeaderRequestParams = 'parent=' ; const expectedOptions = { otherArgs : { headers : { 'x-goog-request-params' : expectedHeaderRequestParams , } , } , } ; const expectedError = new Error ( 'expected' ) ; client . innerApiCalls . listTransitionRouteGroups = stubSimpleCall ( undefined , expectedError ) ; await assert . rejects ( client . listTransitionRouteGroups ( request ) , expectedError ) ; assert ( ( client . innerApiCalls . listTransitionRouteGroups as SinonStub ) . getCall ( 0 ) . calledWith ( request , expectedOptions , undefined ) ) ; } ) ; it ( 'invokes listTransitionRouteGroupsStream without error' , async ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; const request = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . ListTransitionRouteGroupsRequest ( ) ) ; request . parent = '' ; const expectedHeaderRequestParams = 'parent=' ; const expectedResponse = [ generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . TransitionRouteGroup ( ) ) , generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . TransitionRouteGroup ( ) ) , generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . TransitionRouteGroup ( ) ) , ] ; client . descriptors . page . listTransitionRouteGroups . createStream = stubPageStreamingCall ( expectedResponse ) ; const stream = client . listTransitionRouteGroupsStream ( request ) ; const promise = new Promise ( ( resolve , reject ) => { const responses = [ ] ; stream . on ( 'data' , ( response ) => { responses . push ( response ) ; } ) ; stream . on ( 'end' , ( ) => { resolve ( responses ) ; } ) ; stream . on ( 'error' , ( err ) => { reject ( err ) ; } ) ; } ) ; const responses = await promise ; assert . deepStrictEqual ( responses , expectedResponse ) ; assert ( ( client . descriptors . page . listTransitionRouteGroups . createStream as SinonStub ) . getCall ( 0 ) . calledWith ( client . innerApiCalls . listTransitionRouteGroups , request ) ) ; assert . strictEqual ( ( client . descriptors . page . listTransitionRouteGroups . createStream as SinonStub ) . getCall ( 0 ) . args [ 2 ] . otherArgs . headers [ 'x-goog-request-params' ] , expectedHeaderRequestParams ) ; } ) ; it ( 'invokes listTransitionRouteGroupsStream with error' , async ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; const request = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . ListTransitionRouteGroupsRequest ( ) ) ; request . parent = '' ; const expectedHeaderRequestParams = 'parent=' ; const expectedError = new Error ( 'expected' ) ; client . descriptors . page . listTransitionRouteGroups . createStream = stubPageStreamingCall ( undefined , expectedError ) ; const stream = client . listTransitionRouteGroupsStream ( request ) ; const promise = new Promise ( ( resolve , reject ) => { const responses = [ ] ; stream . on ( 'data' , ( response ) => { responses . push ( response ) ; } ) ; stream . on ( 'end' , ( ) => { resolve ( responses ) ; } ) ; stream . on ( 'error' , ( err ) => { reject ( err ) ; } ) ; } ) ; await assert . rejects ( promise , expectedError ) ; assert ( ( client . descriptors . page . listTransitionRouteGroups . createStream as SinonStub ) . getCall ( 0 ) . calledWith ( client . innerApiCalls . listTransitionRouteGroups , request ) ) ; assert . strictEqual ( ( client . descriptors . page . listTransitionRouteGroups . createStream as SinonStub ) . getCall ( 0 ) . args [ 2 ] . otherArgs . headers [ 'x-goog-request-params' ] , expectedHeaderRequestParams ) ; } ) ; it ( 'uses async iteration with listTransitionRouteGroups without error' , async ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; const request = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . ListTransitionRouteGroupsRequest ( ) ) ; request . parent = '' ; const expectedHeaderRequestParams = 'parent=' ; const expectedResponse = [ generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . TransitionRouteGroup ( ) ) , generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . TransitionRouteGroup ( ) ) , generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . TransitionRouteGroup ( ) ) , ] ; client . descriptors . page . listTransitionRouteGroups . asyncIterate = stubAsyncIterationCall ( expectedResponse ) ; const responses = [ ] ; const iterable = client . listTransitionRouteGroupsAsync ( request ) ; for await ( const resource of iterable ) { responses . push ( resource ! ) ; } assert . deepStrictEqual ( responses , expectedResponse ) ; assert . deepStrictEqual ( ( client . descriptors . page . listTransitionRouteGroups . asyncIterate as SinonStub ) . getCall ( 0 ) . args [ 1 ] , request ) ; assert . strictEqual ( ( client . descriptors . page . listTransitionRouteGroups . asyncIterate as SinonStub ) . getCall ( 0 ) . args [ 2 ] . otherArgs . headers [ 'x-goog-request-params' ] , expectedHeaderRequestParams ) ; } ) ; it ( 'uses async iteration with listTransitionRouteGroups with error' , async ( ) => { const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; const request = generateSampleMessage ( new protos . google . cloud . dialogflow . cx . v3 . ListTransitionRouteGroupsRequest ( ) ) ; request . parent = '' ; const expectedHeaderRequestParams = 'parent=' ; const expectedError = new Error ( 'expected' ) ; client . descriptors . page . listTransitionRouteGroups . asyncIterate = stubAsyncIterationCall ( undefined , expectedError ) ; const iterable = client . listTransitionRouteGroupsAsync ( request ) ; await assert . rejects ( async ( ) => { const responses = [ ] ; for await ( const resource of iterable ) { responses . push ( resource ! ) ; } } ) ; assert . deepStrictEqual ( ( client . descriptors . page . listTransitionRouteGroups . asyncIterate as SinonStub ) . getCall ( 0 ) . args [ 1 ] , request ) ; assert . strictEqual ( ( client . descriptors . page . listTransitionRouteGroups . asyncIterate as SinonStub ) . getCall ( 0 ) . args [ 2 ] . otherArgs . headers [ 'x-goog-request-params' ] , expectedHeaderRequestParams ) ; } ) ; } ) ; describe ( 'Path templates' , ( ) => { describe ( 'agent' , ( ) => { const fakePath = '/rendered/path/agent' ; const expectedParameters = { project : 'projectValue' , location : 'locationValue' , agent : 'agentValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . agentPathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . agentPathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'agentPath' , ( ) => { const result = client . agentPath ( 'projectValue' , 'locationValue' , 'agentValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . agentPathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromAgentName' , ( ) => { const result = client . matchProjectFromAgentName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . agentPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchLocationFromAgentName' , ( ) => { const result = client . matchLocationFromAgentName ( fakePath ) ; assert . strictEqual ( result , 'locationValue' ) ; assert ( ( client . pathTemplates . agentPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchAgentFromAgentName' , ( ) => { const result = client . matchAgentFromAgentName ( fakePath ) ; assert . strictEqual ( result , 'agentValue' ) ; assert ( ( client . pathTemplates . agentPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; describe ( 'agentValidationResult' , ( ) => { const fakePath = '/rendered/path/agentValidationResult' ; const expectedParameters = { project : 'projectValue' , location : 'locationValue' , agent : 'agentValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . agentValidationResultPathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . agentValidationResultPathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'agentValidationResultPath' , ( ) => { const result = client . agentValidationResultPath ( 'projectValue' , 'locationValue' , 'agentValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . agentValidationResultPathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromAgentValidationResultName' , ( ) => { const result = client . matchProjectFromAgentValidationResultName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . agentValidationResultPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchLocationFromAgentValidationResultName' , ( ) => { const result = client . matchLocationFromAgentValidationResultName ( fakePath ) ; assert . strictEqual ( result , 'locationValue' ) ; assert ( ( client . pathTemplates . agentValidationResultPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchAgentFromAgentValidationResultName' , ( ) => { const result = client . matchAgentFromAgentValidationResultName ( fakePath ) ; assert . strictEqual ( result , 'agentValue' ) ; assert ( ( client . pathTemplates . agentValidationResultPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; describe ( 'changelog' , ( ) => { const fakePath = '/rendered/path/changelog' ; const expectedParameters = { project : 'projectValue' , location : 'locationValue' , agent : 'agentValue' , changelog : 'changelogValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . changelogPathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . changelogPathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'changelogPath' , ( ) => { const result = client . changelogPath ( 'projectValue' , 'locationValue' , 'agentValue' , 'changelogValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . changelogPathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromChangelogName' , ( ) => { const result = client . matchProjectFromChangelogName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . changelogPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchLocationFromChangelogName' , ( ) => { const result = client . matchLocationFromChangelogName ( fakePath ) ; assert . strictEqual ( result , 'locationValue' ) ; assert ( ( client . pathTemplates . changelogPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchAgentFromChangelogName' , ( ) => { const result = client . matchAgentFromChangelogName ( fakePath ) ; assert . strictEqual ( result , 'agentValue' ) ; assert ( ( client . pathTemplates . changelogPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchChangelogFromChangelogName' , ( ) => { const result = client . matchChangelogFromChangelogName ( fakePath ) ; assert . strictEqual ( result , 'changelogValue' ) ; assert ( ( client . pathTemplates . changelogPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; describe ( 'continuousTestResult' , ( ) => { const fakePath = '/rendered/path/continuousTestResult' ; const expectedParameters = { project : 'projectValue' , location : 'locationValue' , agent : 'agentValue' , environment : 'environmentValue' , continuous_test_result : 'continuousTestResultValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . continuousTestResultPathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . continuousTestResultPathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'continuousTestResultPath' , ( ) => { const result = client . continuousTestResultPath ( 'projectValue' , 'locationValue' , 'agentValue' , 'environmentValue' , 'continuousTestResultValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . continuousTestResultPathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromContinuousTestResultName' , ( ) => { const result = client . matchProjectFromContinuousTestResultName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . continuousTestResultPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchLocationFromContinuousTestResultName' , ( ) => { const result = client . matchLocationFromContinuousTestResultName ( fakePath ) ; assert . strictEqual ( result , 'locationValue' ) ; assert ( ( client . pathTemplates . continuousTestResultPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchAgentFromContinuousTestResultName' , ( ) => { const result = client . matchAgentFromContinuousTestResultName ( fakePath ) ; assert . strictEqual ( result , 'agentValue' ) ; assert ( ( client . pathTemplates . continuousTestResultPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchEnvironmentFromContinuousTestResultName' , ( ) => { const result = client . matchEnvironmentFromContinuousTestResultName ( fakePath ) ; assert . strictEqual ( result , 'environmentValue' ) ; assert ( ( client . pathTemplates . continuousTestResultPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchContinuousTestResultFromContinuousTestResultName' , ( ) => { const result = client . matchContinuousTestResultFromContinuousTestResultName ( fakePath ) ; assert . strictEqual ( result , 'continuousTestResultValue' ) ; assert ( ( client . pathTemplates . continuousTestResultPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; describe ( 'deployment' , ( ) => { const fakePath = '/rendered/path/deployment' ; const expectedParameters = { project : 'projectValue' , location : 'locationValue' , agent : 'agentValue' , environment : 'environmentValue' , deployment : 'deploymentValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . deploymentPathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . deploymentPathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'deploymentPath' , ( ) => { const result = client . deploymentPath ( 'projectValue' , 'locationValue' , 'agentValue' , 'environmentValue' , 'deploymentValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . deploymentPathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromDeploymentName' , ( ) => { const result = client . matchProjectFromDeploymentName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . deploymentPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchLocationFromDeploymentName' , ( ) => { const result = client . matchLocationFromDeploymentName ( fakePath ) ; assert . strictEqual ( result , 'locationValue' ) ; assert ( ( client . pathTemplates . deploymentPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchAgentFromDeploymentName' , ( ) => { const result = client . matchAgentFromDeploymentName ( fakePath ) ; assert . strictEqual ( result , 'agentValue' ) ; assert ( ( client . pathTemplates . deploymentPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchEnvironmentFromDeploymentName' , ( ) => { const result = client . matchEnvironmentFromDeploymentName ( fakePath ) ; assert . strictEqual ( result , 'environmentValue' ) ; assert ( ( client . pathTemplates . deploymentPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchDeploymentFromDeploymentName' , ( ) => { const result = client . matchDeploymentFromDeploymentName ( fakePath ) ; assert . strictEqual ( result , 'deploymentValue' ) ; assert ( ( client . pathTemplates . deploymentPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; describe ( 'entityType' , ( ) => { const fakePath = '/rendered/path/entityType' ; const expectedParameters = { project : 'projectValue' , location : 'locationValue' , agent : 'agentValue' , entity_type : 'entityTypeValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . entityTypePathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . entityTypePathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'entityTypePath' , ( ) => { const result = client . entityTypePath ( 'projectValue' , 'locationValue' , 'agentValue' , 'entityTypeValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . entityTypePathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromEntityTypeName' , ( ) => { const result = client . matchProjectFromEntityTypeName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . entityTypePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchLocationFromEntityTypeName' , ( ) => { const result = client . matchLocationFromEntityTypeName ( fakePath ) ; assert . strictEqual ( result , 'locationValue' ) ; assert ( ( client . pathTemplates . entityTypePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchAgentFromEntityTypeName' , ( ) => { const result = client . matchAgentFromEntityTypeName ( fakePath ) ; assert . strictEqual ( result , 'agentValue' ) ; assert ( ( client . pathTemplates . entityTypePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchEntityTypeFromEntityTypeName' , ( ) => { const result = client . matchEntityTypeFromEntityTypeName ( fakePath ) ; assert . strictEqual ( result , 'entityTypeValue' ) ; assert ( ( client . pathTemplates . entityTypePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; describe ( 'environment' , ( ) => { const fakePath = '/rendered/path/environment' ; const expectedParameters = { project : 'projectValue' , location : 'locationValue' , agent : 'agentValue' , environment : 'environmentValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . environmentPathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . environmentPathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'environmentPath' , ( ) => { const result = client . environmentPath ( 'projectValue' , 'locationValue' , 'agentValue' , 'environmentValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . environmentPathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromEnvironmentName' , ( ) => { const result = client . matchProjectFromEnvironmentName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . environmentPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchLocationFromEnvironmentName' , ( ) => { const result = client . matchLocationFromEnvironmentName ( fakePath ) ; assert . strictEqual ( result , 'locationValue' ) ; assert ( ( client . pathTemplates . environmentPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchAgentFromEnvironmentName' , ( ) => { const result = client . matchAgentFromEnvironmentName ( fakePath ) ; assert . strictEqual ( result , 'agentValue' ) ; assert ( ( client . pathTemplates . environmentPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchEnvironmentFromEnvironmentName' , ( ) => { const result = client . matchEnvironmentFromEnvironmentName ( fakePath ) ; assert . strictEqual ( result , 'environmentValue' ) ; assert ( ( client . pathTemplates . environmentPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; describe ( 'experiment' , ( ) => { const fakePath = '/rendered/path/experiment' ; const expectedParameters = { project : 'projectValue' , location : 'locationValue' , agent : 'agentValue' , environment : 'environmentValue' , experiment : 'experimentValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . experimentPathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . experimentPathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'experimentPath' , ( ) => { const result = client . experimentPath ( 'projectValue' , 'locationValue' , 'agentValue' , 'environmentValue' , 'experimentValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . experimentPathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromExperimentName' , ( ) => { const result = client . matchProjectFromExperimentName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . experimentPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchLocationFromExperimentName' , ( ) => { const result = client . matchLocationFromExperimentName ( fakePath ) ; assert . strictEqual ( result , 'locationValue' ) ; assert ( ( client . pathTemplates . experimentPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchAgentFromExperimentName' , ( ) => { const result = client . matchAgentFromExperimentName ( fakePath ) ; assert . strictEqual ( result , 'agentValue' ) ; assert ( ( client . pathTemplates . experimentPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchEnvironmentFromExperimentName' , ( ) => { const result = client . matchEnvironmentFromExperimentName ( fakePath ) ; assert . strictEqual ( result , 'environmentValue' ) ; assert ( ( client . pathTemplates . experimentPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchExperimentFromExperimentName' , ( ) => { const result = client . matchExperimentFromExperimentName ( fakePath ) ; assert . strictEqual ( result , 'experimentValue' ) ; assert ( ( client . pathTemplates . experimentPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; describe ( 'flow' , ( ) => { const fakePath = '/rendered/path/flow' ; const expectedParameters = { project : 'projectValue' , location : 'locationValue' , agent : 'agentValue' , flow : 'flowValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . flowPathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . flowPathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'flowPath' , ( ) => { const result = client . flowPath ( 'projectValue' , 'locationValue' , 'agentValue' , 'flowValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . flowPathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromFlowName' , ( ) => { const result = client . matchProjectFromFlowName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . flowPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchLocationFromFlowName' , ( ) => { const result = client . matchLocationFromFlowName ( fakePath ) ; assert . strictEqual ( result , 'locationValue' ) ; assert ( ( client . pathTemplates . flowPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchAgentFromFlowName' , ( ) => { const result = client . matchAgentFromFlowName ( fakePath ) ; assert . strictEqual ( result , 'agentValue' ) ; assert ( ( client . pathTemplates . flowPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchFlowFromFlowName' , ( ) => { const result = client . matchFlowFromFlowName ( fakePath ) ; assert . strictEqual ( result , 'flowValue' ) ; assert ( ( client . pathTemplates . flowPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; describe ( 'flowValidationResult' , ( ) => { const fakePath = '/rendered/path/flowValidationResult' ; const expectedParameters = { project : 'projectValue' , location : 'locationValue' , agent : 'agentValue' , flow : 'flowValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . flowValidationResultPathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . flowValidationResultPathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'flowValidationResultPath' , ( ) => { const result = client . flowValidationResultPath ( 'projectValue' , 'locationValue' , 'agentValue' , 'flowValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . flowValidationResultPathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromFlowValidationResultName' , ( ) => { const result = client . matchProjectFromFlowValidationResultName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . flowValidationResultPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchLocationFromFlowValidationResultName' , ( ) => { const result = client . matchLocationFromFlowValidationResultName ( fakePath ) ; assert . strictEqual ( result , 'locationValue' ) ; assert ( ( client . pathTemplates . flowValidationResultPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchAgentFromFlowValidationResultName' , ( ) => { const result = client . matchAgentFromFlowValidationResultName ( fakePath ) ; assert . strictEqual ( result , 'agentValue' ) ; assert ( ( client . pathTemplates . flowValidationResultPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchFlowFromFlowValidationResultName' , ( ) => { const result = client . matchFlowFromFlowValidationResultName ( fakePath ) ; assert . strictEqual ( result , 'flowValue' ) ; assert ( ( client . pathTemplates . flowValidationResultPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; describe ( 'intent' , ( ) => { const fakePath = '/rendered/path/intent' ; const expectedParameters = { project : 'projectValue' , location : 'locationValue' , agent : 'agentValue' , intent : 'intentValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . intentPathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . intentPathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'intentPath' , ( ) => { const result = client . intentPath ( 'projectValue' , 'locationValue' , 'agentValue' , 'intentValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . intentPathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromIntentName' , ( ) => { const result = client . matchProjectFromIntentName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . intentPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchLocationFromIntentName' , ( ) => { const result = client . matchLocationFromIntentName ( fakePath ) ; assert . strictEqual ( result , 'locationValue' ) ; assert ( ( client . pathTemplates . intentPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchAgentFromIntentName' , ( ) => { const result = client . matchAgentFromIntentName ( fakePath ) ; assert . strictEqual ( result , 'agentValue' ) ; assert ( ( client . pathTemplates . intentPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchIntentFromIntentName' , ( ) => { const result = client . matchIntentFromIntentName ( fakePath ) ; assert . strictEqual ( result , 'intentValue' ) ; assert ( ( client . pathTemplates . intentPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; describe ( 'location' , ( ) => { const fakePath = '/rendered/path/location' ; const expectedParameters = { project : 'projectValue' , location : 'locationValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . locationPathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . locationPathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'locationPath' , ( ) => { const result = client . locationPath ( 'projectValue' , 'locationValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . locationPathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromLocationName' , ( ) => { const result = client . matchProjectFromLocationName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . locationPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchLocationFromLocationName' , ( ) => { const result = client . matchLocationFromLocationName ( fakePath ) ; assert . strictEqual ( result , 'locationValue' ) ; assert ( ( client . pathTemplates . locationPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; describe ( 'page' , ( ) => { const fakePath = '/rendered/path/page' ; const expectedParameters = { project : 'projectValue' , location : 'locationValue' , agent : 'agentValue' , flow : 'flowValue' , page : 'pageValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . pagePathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . pagePathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'pagePath' , ( ) => { const result = client . pagePath ( 'projectValue' , 'locationValue' , 'agentValue' , 'flowValue' , 'pageValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . pagePathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromPageName' , ( ) => { const result = client . matchProjectFromPageName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . pagePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchLocationFromPageName' , ( ) => { const result = client . matchLocationFromPageName ( fakePath ) ; assert . strictEqual ( result , 'locationValue' ) ; assert ( ( client . pathTemplates . pagePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchAgentFromPageName' , ( ) => { const result = client . matchAgentFromPageName ( fakePath ) ; assert . strictEqual ( result , 'agentValue' ) ; assert ( ( client . pathTemplates . pagePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchFlowFromPageName' , ( ) => { const result = client . matchFlowFromPageName ( fakePath ) ; assert . strictEqual ( result , 'flowValue' ) ; assert ( ( client . pathTemplates . pagePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchPageFromPageName' , ( ) => { const result = client . matchPageFromPageName ( fakePath ) ; assert . strictEqual ( result , 'pageValue' ) ; assert ( ( client . pathTemplates . pagePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; describe ( 'project' , ( ) => { const fakePath = '/rendered/path/project' ; const expectedParameters = { project : 'projectValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . projectPathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . projectPathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'projectPath' , ( ) => { const result = client . projectPath ( 'projectValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . projectPathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromProjectName' , ( ) => { const result = client . matchProjectFromProjectName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . projectPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; describe ( 'projectLocationAgentEnvironmentSessionEntityType' , ( ) => { const fakePath = '/rendered/path/projectLocationAgentEnvironmentSessionEntityType' ; const expectedParameters = { project : 'projectValue' , location : 'locationValue' , agent : 'agentValue' , environment : 'environmentValue' , session : 'sessionValue' , entity_type : 'entityTypeValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . projectLocationAgentEnvironmentSessionEntityTypePathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . projectLocationAgentEnvironmentSessionEntityTypePathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'projectLocationAgentEnvironmentSessionEntityTypePath' , ( ) => { const result = client . projectLocationAgentEnvironmentSessionEntityTypePath ( 'projectValue' , 'locationValue' , 'agentValue' , 'environmentValue' , 'sessionValue' , 'entityTypeValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . projectLocationAgentEnvironmentSessionEntityTypePathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName' , ( ) => { const result = client . matchProjectFromProjectLocationAgentEnvironmentSessionEntityTypeName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . projectLocationAgentEnvironmentSessionEntityTypePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName' , ( ) => { const result = client . matchLocationFromProjectLocationAgentEnvironmentSessionEntityTypeName ( fakePath ) ; assert . strictEqual ( result , 'locationValue' ) ; assert ( ( client . pathTemplates . projectLocationAgentEnvironmentSessionEntityTypePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName' , ( ) => { const result = client . matchAgentFromProjectLocationAgentEnvironmentSessionEntityTypeName ( fakePath ) ; assert . strictEqual ( result , 'agentValue' ) ; assert ( ( client . pathTemplates . projectLocationAgentEnvironmentSessionEntityTypePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName' , ( ) => { const result = client . matchEnvironmentFromProjectLocationAgentEnvironmentSessionEntityTypeName ( fakePath ) ; assert . strictEqual ( result , 'environmentValue' ) ; assert ( ( client . pathTemplates . projectLocationAgentEnvironmentSessionEntityTypePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName' , ( ) => { const result = client . matchSessionFromProjectLocationAgentEnvironmentSessionEntityTypeName ( fakePath ) ; assert . strictEqual ( result , 'sessionValue' ) ; assert ( ( client . pathTemplates . projectLocationAgentEnvironmentSessionEntityTypePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName' , ( ) => { const result = client . matchEntityTypeFromProjectLocationAgentEnvironmentSessionEntityTypeName ( fakePath ) ; assert . strictEqual ( result , 'entityTypeValue' ) ; assert ( ( client . pathTemplates . projectLocationAgentEnvironmentSessionEntityTypePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; describe ( 'projectLocationAgentSessionEntityType' , ( ) => { const fakePath = '/rendered/path/projectLocationAgentSessionEntityType' ; const expectedParameters = { project : 'projectValue' , location : 'locationValue' , agent : 'agentValue' , session : 'sessionValue' , entity_type : 'entityTypeValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . projectLocationAgentSessionEntityTypePathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . projectLocationAgentSessionEntityTypePathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'projectLocationAgentSessionEntityTypePath' , ( ) => { const result = client . projectLocationAgentSessionEntityTypePath ( 'projectValue' , 'locationValue' , 'agentValue' , 'sessionValue' , 'entityTypeValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . projectLocationAgentSessionEntityTypePathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromProjectLocationAgentSessionEntityTypeName' , ( ) => { const result = client . matchProjectFromProjectLocationAgentSessionEntityTypeName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . projectLocationAgentSessionEntityTypePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchLocationFromProjectLocationAgentSessionEntityTypeName' , ( ) => { const result = client . matchLocationFromProjectLocationAgentSessionEntityTypeName ( fakePath ) ; assert . strictEqual ( result , 'locationValue' ) ; assert ( ( client . pathTemplates . projectLocationAgentSessionEntityTypePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchAgentFromProjectLocationAgentSessionEntityTypeName' , ( ) => { const result = client . matchAgentFromProjectLocationAgentSessionEntityTypeName ( fakePath ) ; assert . strictEqual ( result , 'agentValue' ) ; assert ( ( client . pathTemplates . projectLocationAgentSessionEntityTypePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchSessionFromProjectLocationAgentSessionEntityTypeName' , ( ) => { const result = client . matchSessionFromProjectLocationAgentSessionEntityTypeName ( fakePath ) ; assert . strictEqual ( result , 'sessionValue' ) ; assert ( ( client . pathTemplates . projectLocationAgentSessionEntityTypePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchEntityTypeFromProjectLocationAgentSessionEntityTypeName' , ( ) => { const result = client . matchEntityTypeFromProjectLocationAgentSessionEntityTypeName ( fakePath ) ; assert . strictEqual ( result , 'entityTypeValue' ) ; assert ( ( client . pathTemplates . projectLocationAgentSessionEntityTypePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; describe ( 'securitySettings' , ( ) => { const fakePath = '/rendered/path/securitySettings' ; const expectedParameters = { project : 'projectValue' , location : 'locationValue' , security_settings : 'securitySettingsValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . securitySettingsPathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . securitySettingsPathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'securitySettingsPath' , ( ) => { const result = client . securitySettingsPath ( 'projectValue' , 'locationValue' , 'securitySettingsValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . securitySettingsPathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromSecuritySettingsName' , ( ) => { const result = client . matchProjectFromSecuritySettingsName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . securitySettingsPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchLocationFromSecuritySettingsName' , ( ) => { const result = client . matchLocationFromSecuritySettingsName ( fakePath ) ; assert . strictEqual ( result , 'locationValue' ) ; assert ( ( client . pathTemplates . securitySettingsPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchSecuritySettingsFromSecuritySettingsName' , ( ) => { const result = client . matchSecuritySettingsFromSecuritySettingsName ( fakePath ) ; assert . strictEqual ( result , 'securitySettingsValue' ) ; assert ( ( client . pathTemplates . securitySettingsPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; describe ( 'testCase' , ( ) => { const fakePath = '/rendered/path/testCase' ; const expectedParameters = { project : 'projectValue' , location : 'locationValue' , agent : 'agentValue' , test_case : 'testCaseValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . testCasePathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . testCasePathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'testCasePath' , ( ) => { const result = client . testCasePath ( 'projectValue' , 'locationValue' , 'agentValue' , 'testCaseValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . testCasePathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromTestCaseName' , ( ) => { const result = client . matchProjectFromTestCaseName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . testCasePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchLocationFromTestCaseName' , ( ) => { const result = client . matchLocationFromTestCaseName ( fakePath ) ; assert . strictEqual ( result , 'locationValue' ) ; assert ( ( client . pathTemplates . testCasePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchAgentFromTestCaseName' , ( ) => { const result = client . matchAgentFromTestCaseName ( fakePath ) ; assert . strictEqual ( result , 'agentValue' ) ; assert ( ( client . pathTemplates . testCasePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchTestCaseFromTestCaseName' , ( ) => { const result = client . matchTestCaseFromTestCaseName ( fakePath ) ; assert . strictEqual ( result , 'testCaseValue' ) ; assert ( ( client . pathTemplates . testCasePathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; describe ( 'testCaseResult' , ( ) => { const fakePath = '/rendered/path/testCaseResult' ; const expectedParameters = { project : 'projectValue' , location : 'locationValue' , agent : 'agentValue' , test_case : 'testCaseValue' , result : 'resultValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . testCaseResultPathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . testCaseResultPathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'testCaseResultPath' , ( ) => { const result = client . testCaseResultPath ( 'projectValue' , 'locationValue' , 'agentValue' , 'testCaseValue' , 'resultValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . testCaseResultPathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromTestCaseResultName' , ( ) => { const result = client . matchProjectFromTestCaseResultName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . testCaseResultPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchLocationFromTestCaseResultName' , ( ) => { const result = client . matchLocationFromTestCaseResultName ( fakePath ) ; assert . strictEqual ( result , 'locationValue' ) ; assert ( ( client . pathTemplates . testCaseResultPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchAgentFromTestCaseResultName' , ( ) => { const result = client . matchAgentFromTestCaseResultName ( fakePath ) ; assert . strictEqual ( result , 'agentValue' ) ; assert ( ( client . pathTemplates . testCaseResultPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchTestCaseFromTestCaseResultName' , ( ) => { const result = client . matchTestCaseFromTestCaseResultName ( fakePath ) ; assert . strictEqual ( result , 'testCaseValue' ) ; assert ( ( client . pathTemplates . testCaseResultPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchResultFromTestCaseResultName' , ( ) => { const result = client . matchResultFromTestCaseResultName ( fakePath ) ; assert . strictEqual ( result , 'resultValue' ) ; assert ( ( client . pathTemplates . testCaseResultPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; describe ( 'transitionRouteGroup' , ( ) => { const fakePath = '/rendered/path/transitionRouteGroup' ; const expectedParameters = { project : 'projectValue' , location : 'locationValue' , agent : 'agentValue' , flow : 'flowValue' , transition_route_group : 'transitionRouteGroupValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . transitionRouteGroupPathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . transitionRouteGroupPathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'transitionRouteGroupPath' , ( ) => { const result = client . transitionRouteGroupPath ( 'projectValue' , 'locationValue' , 'agentValue' , 'flowValue' , 'transitionRouteGroupValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . transitionRouteGroupPathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromTransitionRouteGroupName' , ( ) => { const result = client . matchProjectFromTransitionRouteGroupName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . transitionRouteGroupPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchLocationFromTransitionRouteGroupName' , ( ) => { const result = client . matchLocationFromTransitionRouteGroupName ( fakePath ) ; assert . strictEqual ( result , 'locationValue' ) ; assert ( ( client . pathTemplates . transitionRouteGroupPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchAgentFromTransitionRouteGroupName' , ( ) => { const result = client . matchAgentFromTransitionRouteGroupName ( fakePath ) ; assert . strictEqual ( result , 'agentValue' ) ; assert ( ( client . pathTemplates . transitionRouteGroupPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchFlowFromTransitionRouteGroupName' , ( ) => { const result = client . matchFlowFromTransitionRouteGroupName ( fakePath ) ; assert . strictEqual ( result , 'flowValue' ) ; assert ( ( client . pathTemplates . transitionRouteGroupPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchTransitionRouteGroupFromTransitionRouteGroupName' , ( ) => { const result = client . matchTransitionRouteGroupFromTransitionRouteGroupName ( fakePath ) ; assert . strictEqual ( result , 'transitionRouteGroupValue' ) ; assert ( ( client . pathTemplates . transitionRouteGroupPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; describe ( 'version' , ( ) => { const fakePath = '/rendered/path/version' ; const expectedParameters = { project : 'projectValue' , location : 'locationValue' , agent : 'agentValue' , flow : 'flowValue' , version : 'versionValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . versionPathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . versionPathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'versionPath' , ( ) => { const result = client . versionPath ( 'projectValue' , 'locationValue' , 'agentValue' , 'flowValue' , 'versionValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . versionPathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromVersionName' , ( ) => { const result = client . matchProjectFromVersionName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . versionPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchLocationFromVersionName' , ( ) => { const result = client . matchLocationFromVersionName ( fakePath ) ; assert . strictEqual ( result , 'locationValue' ) ; assert ( ( client . pathTemplates . versionPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchAgentFromVersionName' , ( ) => { const result = client . matchAgentFromVersionName ( fakePath ) ; assert . strictEqual ( result , 'agentValue' ) ; assert ( ( client . pathTemplates . versionPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchFlowFromVersionName' , ( ) => { const result = client . matchFlowFromVersionName ( fakePath ) ; assert . strictEqual ( result , 'flowValue' ) ; assert ( ( client . pathTemplates . versionPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchVersionFromVersionName' , ( ) => { const result = client . matchVersionFromVersionName ( fakePath ) ; assert . strictEqual ( result , 'versionValue' ) ; assert ( ( client . pathTemplates . versionPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; describe ( 'webhook' , ( ) => { const fakePath = '/rendered/path/webhook' ; const expectedParameters = { project : 'projectValue' , location : 'locationValue' , agent : 'agentValue' , webhook : 'webhookValue' , } ; const client = new transitionroutegroupsModule . v3 . TransitionRouteGroupsClient ( { credentials : { client_email : 'bogus' , private_key : 'bogus' } , projectId : 'bogus' , } ) ; client . initialize ( ) ; client . pathTemplates . webhookPathTemplate . render = sinon . stub ( ) . returns ( fakePath ) ; client . pathTemplates . webhookPathTemplate . match = sinon . stub ( ) . returns ( expectedParameters ) ; it ( 'webhookPath' , ( ) => { const result = client . webhookPath ( 'projectValue' , 'locationValue' , 'agentValue' , 'webhookValue' ) ; assert . strictEqual ( result , fakePath ) ; assert ( ( client . pathTemplates . webhookPathTemplate . render as SinonStub ) . getCall ( - 1 ) . calledWith ( expectedParameters ) ) ; } ) ; it ( 'matchProjectFromWebhookName' , ( ) => { const result = client . matchProjectFromWebhookName ( fakePath ) ; assert . strictEqual ( result , 'projectValue' ) ; assert ( ( client . pathTemplates . webhookPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchLocationFromWebhookName' , ( ) => { const result = client . matchLocationFromWebhookName ( fakePath ) ; assert . strictEqual ( result , 'locationValue' ) ; assert ( ( client . pathTemplates . webhookPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchAgentFromWebhookName' , ( ) => { const result = client . matchAgentFromWebhookName ( fakePath ) ; assert . strictEqual ( result , 'agentValue' ) ; assert ( ( client . pathTemplates . webhookPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; it ( 'matchWebhookFromWebhookName' , ( ) => { const result = client . matchWebhookFromWebhookName ( fakePath ) ; assert . strictEqual ( result , 'webhookValue' ) ; assert ( ( client . pathTemplates . webhookPathTemplate . match as SinonStub ) . getCall ( - 1 ) . calledWith ( fakePath ) ) ; } ) ; } ) ; } ) ; } ) ;