text:
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 dataformModule from '../src';

import {PassThrough} from 'stream';

import {protobuf, IamProtos, LocationProtos} from 'google-gax';

// Dynamically loaded proto JSON is needed to get the type information
// to fill in default values for request objects
const root = protobuf.Root.fromJSON(
  require('../protos/protos.json')
).resolveAll();

// eslint-disable-next-line @typescript-eslint/no-unused-vars
function getTypeDefaultValue(typeName: string, fields: string[]) {
  let type = root.lookupType(typeName) as protobuf.Type;
  for (const field of fields.slice(0, -1)) {
    type = type.fields[field]?.resolvedType as protobuf.Type;
  }
  return type.fields[fields[fields.length - 1]]?.defaultValue;
}

function generateSampleMessage<T extends object>(instance: T) {
  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?: ResponseType, error?: Error) {
  return error
    ? sinon.stub().rejects(error)
    : sinon.stub().resolves([response]);
}

function stubSimpleCallWithCallback<ResponseType>(
  response?: ResponseType,
  error?: Error
) {
  return error
    ? sinon.stub().callsArgWith(2, error)
    : sinon.stub().callsArgWith(2, null, response);
}

function stubPageStreamingCall<ResponseType>(
  responses?: ResponseType[],
  error?: 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,
  });
  // trigger as many responses as needed
  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?: ResponseType[],
  error?: 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('v1beta1.DataformClient', () => {
  describe('Common methods', () => {
    it('has servicePath', () => {
      const servicePath = dataformModule.v1beta1.DataformClient.servicePath;
      assert(servicePath);
    });

    it('has apiEndpoint', () => {
      const apiEndpoint = dataformModule.v1beta1.DataformClient.apiEndpoint;
      assert(apiEndpoint);
    });

    it('has port', () => {
      const port = dataformModule.v1beta1.DataformClient.port;
      assert(port);
      assert(typeof port === 'number');
    });

    it('should create a client with no option', () => {
      const client = new dataformModule.v1beta1.DataformClient();
      assert(client);
    });

    it('should create a client with gRPC fallback', () => {
      const client = new dataformModule.v1beta1.DataformClient({
        fallback: true,
      });
      assert(client);
    });

    it('has initialize method and supports deferred initialization', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      assert.strictEqual(client.dataformStub, undefined);
      await client.initialize();
      assert(client.dataformStub);
    });

    it('has close method for the initialized client', done => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      assert(client.dataformStub);
      client.close().then(() => {
        done();
      });
    });

    it('has close method for the non-initialized client', done => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      assert.strictEqual(client.dataformStub, undefined);
      client.close().then(() => {
        done();
      });
    });

    it('has getProjectId method', async () => {
      const fakeProjectId = 'fake-project-id';
      const client = new dataformModule.v1beta1.DataformClient({
        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 dataformModule.v1beta1.DataformClient({
        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?: Error | null, projectId?: string | null) => {
          if (err) {
            reject(err);
          } else {
            resolve(projectId);
          }
        });
      });
      const result = await promise;
      assert.strictEqual(result, fakeProjectId);
    });
  });

  describe('getRepository', () => {
    it('invokes getRepository without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.GetRepositoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.GetRepositoryRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.Repository()
      );
      client.innerApiCalls.getRepository = stubSimpleCall(expectedResponse);
      const [response] = await client.getRepository(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.getRepository as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.getRepository as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes getRepository without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.GetRepositoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.GetRepositoryRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.Repository()
      );
      client.innerApiCalls.getRepository =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.getRepository(
          request,
          (
            err?: Error | null,
            result?: protos.google.cloud.dataform.v1beta1.IRepository | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.getRepository as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.getRepository as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes getRepository with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.GetRepositoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.GetRepositoryRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.getRepository = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(client.getRepository(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.getRepository as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.getRepository as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes getRepository with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.GetRepositoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.GetRepositoryRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.getRepository(request), expectedError);
    });
  });

  describe('createRepository', () => {
    it('invokes createRepository without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CreateRepositoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CreateRepositoryRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.Repository()
      );
      client.innerApiCalls.createRepository = stubSimpleCall(expectedResponse);
      const [response] = await client.createRepository(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.createRepository as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.createRepository as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes createRepository without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CreateRepositoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CreateRepositoryRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.Repository()
      );
      client.innerApiCalls.createRepository =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.createRepository(
          request,
          (
            err?: Error | null,
            result?: protos.google.cloud.dataform.v1beta1.IRepository | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.createRepository as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.createRepository as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes createRepository with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CreateRepositoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CreateRepositoryRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.createRepository = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(client.createRepository(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.createRepository as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.createRepository as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes createRepository with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CreateRepositoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CreateRepositoryRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.createRepository(request), expectedError);
    });
  });

  describe('updateRepository', () => {
    it('invokes updateRepository without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.UpdateRepositoryRequest()
      );
      request.repository ??= {};
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.UpdateRepositoryRequest',
        ['repository', 'name']
      );
      request.repository.name = defaultValue1;
      const expectedHeaderRequestParams = `repository.name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.Repository()
      );
      client.innerApiCalls.updateRepository = stubSimpleCall(expectedResponse);
      const [response] = await client.updateRepository(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.updateRepository as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.updateRepository as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes updateRepository without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.UpdateRepositoryRequest()
      );
      request.repository ??= {};
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.UpdateRepositoryRequest',
        ['repository', 'name']
      );
      request.repository.name = defaultValue1;
      const expectedHeaderRequestParams = `repository.name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.Repository()
      );
      client.innerApiCalls.updateRepository =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.updateRepository(
          request,
          (
            err?: Error | null,
            result?: protos.google.cloud.dataform.v1beta1.IRepository | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.updateRepository as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.updateRepository as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes updateRepository with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.UpdateRepositoryRequest()
      );
      request.repository ??= {};
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.UpdateRepositoryRequest',
        ['repository', 'name']
      );
      request.repository.name = defaultValue1;
      const expectedHeaderRequestParams = `repository.name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.updateRepository = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(client.updateRepository(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.updateRepository as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.updateRepository as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes updateRepository with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.UpdateRepositoryRequest()
      );
      request.repository ??= {};
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.UpdateRepositoryRequest',
        ['repository', 'name']
      );
      request.repository.name = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.updateRepository(request), expectedError);
    });
  });

  describe('deleteRepository', () => {
    it('invokes deleteRepository without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.DeleteRepositoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.DeleteRepositoryRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.protobuf.Empty()
      );
      client.innerApiCalls.deleteRepository = stubSimpleCall(expectedResponse);
      const [response] = await client.deleteRepository(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.deleteRepository as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.deleteRepository as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes deleteRepository without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.DeleteRepositoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.DeleteRepositoryRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.protobuf.Empty()
      );
      client.innerApiCalls.deleteRepository =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.deleteRepository(
          request,
          (
            err?: Error | null,
            result?: protos.google.protobuf.IEmpty | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.deleteRepository as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.deleteRepository as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes deleteRepository with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.DeleteRepositoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.DeleteRepositoryRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.deleteRepository = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(client.deleteRepository(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.deleteRepository as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.deleteRepository as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes deleteRepository with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.DeleteRepositoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.DeleteRepositoryRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.deleteRepository(request), expectedError);
    });
  });

  describe('fetchRemoteBranches', () => {
    it('invokes fetchRemoteBranches without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchRemoteBranchesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.FetchRemoteBranchesRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchRemoteBranchesResponse()
      );
      client.innerApiCalls.fetchRemoteBranches =
        stubSimpleCall(expectedResponse);
      const [response] = await client.fetchRemoteBranches(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.fetchRemoteBranches as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.fetchRemoteBranches as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes fetchRemoteBranches without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchRemoteBranchesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.FetchRemoteBranchesRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchRemoteBranchesResponse()
      );
      client.innerApiCalls.fetchRemoteBranches =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.fetchRemoteBranches(
          request,
          (
            err?: Error | null,
            result?: protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesResponse | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.fetchRemoteBranches as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.fetchRemoteBranches as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes fetchRemoteBranches with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchRemoteBranchesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.FetchRemoteBranchesRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.fetchRemoteBranches = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(client.fetchRemoteBranches(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.fetchRemoteBranches as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.fetchRemoteBranches as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes fetchRemoteBranches with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchRemoteBranchesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.FetchRemoteBranchesRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.fetchRemoteBranches(request), expectedError);
    });
  });

  describe('getWorkspace', () => {
    it('invokes getWorkspace without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.GetWorkspaceRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.GetWorkspaceRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.Workspace()
      );
      client.innerApiCalls.getWorkspace = stubSimpleCall(expectedResponse);
      const [response] = await client.getWorkspace(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.getWorkspace as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.getWorkspace as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes getWorkspace without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.GetWorkspaceRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.GetWorkspaceRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.Workspace()
      );
      client.innerApiCalls.getWorkspace =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.getWorkspace(
          request,
          (
            err?: Error | null,
            result?: protos.google.cloud.dataform.v1beta1.IWorkspace | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.getWorkspace as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.getWorkspace as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes getWorkspace with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.GetWorkspaceRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.GetWorkspaceRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.getWorkspace = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(client.getWorkspace(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.getWorkspace as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.getWorkspace as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes getWorkspace with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.GetWorkspaceRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.GetWorkspaceRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.getWorkspace(request), expectedError);
    });
  });

  describe('createWorkspace', () => {
    it('invokes createWorkspace without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CreateWorkspaceRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CreateWorkspaceRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.Workspace()
      );
      client.innerApiCalls.createWorkspace = stubSimpleCall(expectedResponse);
      const [response] = await client.createWorkspace(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.createWorkspace as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.createWorkspace as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes createWorkspace without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CreateWorkspaceRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CreateWorkspaceRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.Workspace()
      );
      client.innerApiCalls.createWorkspace =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.createWorkspace(
          request,
          (
            err?: Error | null,
            result?: protos.google.cloud.dataform.v1beta1.IWorkspace | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.createWorkspace as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.createWorkspace as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes createWorkspace with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CreateWorkspaceRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CreateWorkspaceRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.createWorkspace = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(client.createWorkspace(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.createWorkspace as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.createWorkspace as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes createWorkspace with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CreateWorkspaceRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CreateWorkspaceRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.createWorkspace(request), expectedError);
    });
  });

  describe('deleteWorkspace', () => {
    it('invokes deleteWorkspace without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.DeleteWorkspaceRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.DeleteWorkspaceRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.protobuf.Empty()
      );
      client.innerApiCalls.deleteWorkspace = stubSimpleCall(expectedResponse);
      const [response] = await client.deleteWorkspace(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.deleteWorkspace as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.deleteWorkspace as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes deleteWorkspace without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.DeleteWorkspaceRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.DeleteWorkspaceRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.protobuf.Empty()
      );
      client.innerApiCalls.deleteWorkspace =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.deleteWorkspace(
          request,
          (
            err?: Error | null,
            result?: protos.google.protobuf.IEmpty | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.deleteWorkspace as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.deleteWorkspace as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes deleteWorkspace with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.DeleteWorkspaceRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.DeleteWorkspaceRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.deleteWorkspace = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(client.deleteWorkspace(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.deleteWorkspace as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.deleteWorkspace as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes deleteWorkspace with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.DeleteWorkspaceRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.DeleteWorkspaceRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.deleteWorkspace(request), expectedError);
    });
  });

  describe('installNpmPackages', () => {
    it('invokes installNpmPackages without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.InstallNpmPackagesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.InstallNpmPackagesRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.InstallNpmPackagesResponse()
      );
      client.innerApiCalls.installNpmPackages =
        stubSimpleCall(expectedResponse);
      const [response] = await client.installNpmPackages(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.installNpmPackages as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.installNpmPackages as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes installNpmPackages without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.InstallNpmPackagesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.InstallNpmPackagesRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.InstallNpmPackagesResponse()
      );
      client.innerApiCalls.installNpmPackages =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.installNpmPackages(
          request,
          (
            err?: Error | null,
            result?: protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesResponse | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.installNpmPackages as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.installNpmPackages as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes installNpmPackages with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.InstallNpmPackagesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.InstallNpmPackagesRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.installNpmPackages = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(client.installNpmPackages(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.installNpmPackages as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.installNpmPackages as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes installNpmPackages with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.InstallNpmPackagesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.InstallNpmPackagesRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.installNpmPackages(request), expectedError);
    });
  });

  describe('pullGitCommits', () => {
    it('invokes pullGitCommits without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.PullGitCommitsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.PullGitCommitsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.protobuf.Empty()
      );
      client.innerApiCalls.pullGitCommits = stubSimpleCall(expectedResponse);
      const [response] = await client.pullGitCommits(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.pullGitCommits as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.pullGitCommits as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes pullGitCommits without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.PullGitCommitsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.PullGitCommitsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.protobuf.Empty()
      );
      client.innerApiCalls.pullGitCommits =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.pullGitCommits(
          request,
          (
            err?: Error | null,
            result?: protos.google.protobuf.IEmpty | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.pullGitCommits as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.pullGitCommits as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes pullGitCommits with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.PullGitCommitsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.PullGitCommitsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.pullGitCommits = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(client.pullGitCommits(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.pullGitCommits as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.pullGitCommits as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes pullGitCommits with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.PullGitCommitsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.PullGitCommitsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.pullGitCommits(request), expectedError);
    });
  });

  describe('pushGitCommits', () => {
    it('invokes pushGitCommits without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.PushGitCommitsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.PushGitCommitsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.protobuf.Empty()
      );
      client.innerApiCalls.pushGitCommits = stubSimpleCall(expectedResponse);
      const [response] = await client.pushGitCommits(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.pushGitCommits as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.pushGitCommits as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes pushGitCommits without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.PushGitCommitsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.PushGitCommitsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.protobuf.Empty()
      );
      client.innerApiCalls.pushGitCommits =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.pushGitCommits(
          request,
          (
            err?: Error | null,
            result?: protos.google.protobuf.IEmpty | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.pushGitCommits as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.pushGitCommits as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes pushGitCommits with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.PushGitCommitsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.PushGitCommitsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.pushGitCommits = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(client.pushGitCommits(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.pushGitCommits as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.pushGitCommits as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes pushGitCommits with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.PushGitCommitsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.PushGitCommitsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.pushGitCommits(request), expectedError);
    });
  });

  describe('fetchFileGitStatuses', () => {
    it('invokes fetchFileGitStatuses without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchFileGitStatusesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.FetchFileGitStatusesRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchFileGitStatusesResponse()
      );
      client.innerApiCalls.fetchFileGitStatuses =
        stubSimpleCall(expectedResponse);
      const [response] = await client.fetchFileGitStatuses(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.fetchFileGitStatuses as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.fetchFileGitStatuses as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes fetchFileGitStatuses without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchFileGitStatusesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.FetchFileGitStatusesRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchFileGitStatusesResponse()
      );
      client.innerApiCalls.fetchFileGitStatuses =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.fetchFileGitStatuses(
          request,
          (
            err?: Error | null,
            result?: protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesResponse | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.fetchFileGitStatuses as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.fetchFileGitStatuses as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes fetchFileGitStatuses with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchFileGitStatusesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.FetchFileGitStatusesRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.fetchFileGitStatuses = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(client.fetchFileGitStatuses(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.fetchFileGitStatuses as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.fetchFileGitStatuses as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes fetchFileGitStatuses with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchFileGitStatusesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.FetchFileGitStatusesRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.fetchFileGitStatuses(request), expectedError);
    });
  });

  describe('fetchGitAheadBehind', () => {
    it('invokes fetchGitAheadBehind without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchGitAheadBehindRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.FetchGitAheadBehindRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchGitAheadBehindResponse()
      );
      client.innerApiCalls.fetchGitAheadBehind =
        stubSimpleCall(expectedResponse);
      const [response] = await client.fetchGitAheadBehind(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.fetchGitAheadBehind as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.fetchGitAheadBehind as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes fetchGitAheadBehind without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchGitAheadBehindRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.FetchGitAheadBehindRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchGitAheadBehindResponse()
      );
      client.innerApiCalls.fetchGitAheadBehind =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.fetchGitAheadBehind(
          request,
          (
            err?: Error | null,
            result?: protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindResponse | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.fetchGitAheadBehind as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.fetchGitAheadBehind as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes fetchGitAheadBehind with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchGitAheadBehindRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.FetchGitAheadBehindRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.fetchGitAheadBehind = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(client.fetchGitAheadBehind(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.fetchGitAheadBehind as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.fetchGitAheadBehind as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes fetchGitAheadBehind with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchGitAheadBehindRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.FetchGitAheadBehindRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.fetchGitAheadBehind(request), expectedError);
    });
  });

  describe('commitWorkspaceChanges', () => {
    it('invokes commitWorkspaceChanges without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CommitWorkspaceChangesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CommitWorkspaceChangesRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.protobuf.Empty()
      );
      client.innerApiCalls.commitWorkspaceChanges =
        stubSimpleCall(expectedResponse);
      const [response] = await client.commitWorkspaceChanges(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.commitWorkspaceChanges as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.commitWorkspaceChanges as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes commitWorkspaceChanges without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CommitWorkspaceChangesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CommitWorkspaceChangesRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.protobuf.Empty()
      );
      client.innerApiCalls.commitWorkspaceChanges =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.commitWorkspaceChanges(
          request,
          (
            err?: Error | null,
            result?: protos.google.protobuf.IEmpty | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.commitWorkspaceChanges as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.commitWorkspaceChanges as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes commitWorkspaceChanges with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CommitWorkspaceChangesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CommitWorkspaceChangesRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.commitWorkspaceChanges = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(
        client.commitWorkspaceChanges(request),
        expectedError
      );
      const actualRequest = (
        client.innerApiCalls.commitWorkspaceChanges as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.commitWorkspaceChanges as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes commitWorkspaceChanges with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CommitWorkspaceChangesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CommitWorkspaceChangesRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(
        client.commitWorkspaceChanges(request),
        expectedError
      );
    });
  });

  describe('resetWorkspaceChanges', () => {
    it('invokes resetWorkspaceChanges without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ResetWorkspaceChangesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ResetWorkspaceChangesRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.protobuf.Empty()
      );
      client.innerApiCalls.resetWorkspaceChanges =
        stubSimpleCall(expectedResponse);
      const [response] = await client.resetWorkspaceChanges(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.resetWorkspaceChanges as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.resetWorkspaceChanges as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes resetWorkspaceChanges without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ResetWorkspaceChangesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ResetWorkspaceChangesRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.protobuf.Empty()
      );
      client.innerApiCalls.resetWorkspaceChanges =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.resetWorkspaceChanges(
          request,
          (
            err?: Error | null,
            result?: protos.google.protobuf.IEmpty | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.resetWorkspaceChanges as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.resetWorkspaceChanges as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes resetWorkspaceChanges with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ResetWorkspaceChangesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ResetWorkspaceChangesRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.resetWorkspaceChanges = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(
        client.resetWorkspaceChanges(request),
        expectedError
      );
      const actualRequest = (
        client.innerApiCalls.resetWorkspaceChanges as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.resetWorkspaceChanges as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes resetWorkspaceChanges with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ResetWorkspaceChangesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ResetWorkspaceChangesRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(
        client.resetWorkspaceChanges(request),
        expectedError
      );
    });
  });

  describe('fetchFileDiff', () => {
    it('invokes fetchFileDiff without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchFileDiffRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.FetchFileDiffRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchFileDiffResponse()
      );
      client.innerApiCalls.fetchFileDiff = stubSimpleCall(expectedResponse);
      const [response] = await client.fetchFileDiff(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.fetchFileDiff as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.fetchFileDiff as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes fetchFileDiff without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchFileDiffRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.FetchFileDiffRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchFileDiffResponse()
      );
      client.innerApiCalls.fetchFileDiff =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.fetchFileDiff(
          request,
          (
            err?: Error | null,
            result?: protos.google.cloud.dataform.v1beta1.IFetchFileDiffResponse | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.fetchFileDiff as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.fetchFileDiff as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes fetchFileDiff with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchFileDiffRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.FetchFileDiffRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.fetchFileDiff = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(client.fetchFileDiff(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.fetchFileDiff as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.fetchFileDiff as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes fetchFileDiff with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.FetchFileDiffRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.FetchFileDiffRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.fetchFileDiff(request), expectedError);
    });
  });

  describe('makeDirectory', () => {
    it('invokes makeDirectory without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.MakeDirectoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.MakeDirectoryRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.MakeDirectoryResponse()
      );
      client.innerApiCalls.makeDirectory = stubSimpleCall(expectedResponse);
      const [response] = await client.makeDirectory(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.makeDirectory as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.makeDirectory as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes makeDirectory without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.MakeDirectoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.MakeDirectoryRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.MakeDirectoryResponse()
      );
      client.innerApiCalls.makeDirectory =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.makeDirectory(
          request,
          (
            err?: Error | null,
            result?: protos.google.cloud.dataform.v1beta1.IMakeDirectoryResponse | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.makeDirectory as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.makeDirectory as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes makeDirectory with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.MakeDirectoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.MakeDirectoryRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.makeDirectory = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(client.makeDirectory(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.makeDirectory as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.makeDirectory as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes makeDirectory with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.MakeDirectoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.MakeDirectoryRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.makeDirectory(request), expectedError);
    });
  });

  describe('removeDirectory', () => {
    it('invokes removeDirectory without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.RemoveDirectoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.RemoveDirectoryRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.protobuf.Empty()
      );
      client.innerApiCalls.removeDirectory = stubSimpleCall(expectedResponse);
      const [response] = await client.removeDirectory(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.removeDirectory as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.removeDirectory as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes removeDirectory without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.RemoveDirectoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.RemoveDirectoryRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.protobuf.Empty()
      );
      client.innerApiCalls.removeDirectory =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.removeDirectory(
          request,
          (
            err?: Error | null,
            result?: protos.google.protobuf.IEmpty | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.removeDirectory as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.removeDirectory as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes removeDirectory with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.RemoveDirectoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.RemoveDirectoryRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.removeDirectory = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(client.removeDirectory(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.removeDirectory as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.removeDirectory as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes removeDirectory with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.RemoveDirectoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.RemoveDirectoryRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.removeDirectory(request), expectedError);
    });
  });

  describe('moveDirectory', () => {
    it('invokes moveDirectory without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.MoveDirectoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.MoveDirectoryRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.MoveDirectoryResponse()
      );
      client.innerApiCalls.moveDirectory = stubSimpleCall(expectedResponse);
      const [response] = await client.moveDirectory(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.moveDirectory as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.moveDirectory as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes moveDirectory without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.MoveDirectoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.MoveDirectoryRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.MoveDirectoryResponse()
      );
      client.innerApiCalls.moveDirectory =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.moveDirectory(
          request,
          (
            err?: Error | null,
            result?: protos.google.cloud.dataform.v1beta1.IMoveDirectoryResponse | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.moveDirectory as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.moveDirectory as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes moveDirectory with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.MoveDirectoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.MoveDirectoryRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.moveDirectory = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(client.moveDirectory(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.moveDirectory as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.moveDirectory as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes moveDirectory with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.MoveDirectoryRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.MoveDirectoryRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.moveDirectory(request), expectedError);
    });
  });

  describe('readFile', () => {
    it('invokes readFile without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ReadFileRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ReadFileRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ReadFileResponse()
      );
      client.innerApiCalls.readFile = stubSimpleCall(expectedResponse);
      const [response] = await client.readFile(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.readFile as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.readFile as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes readFile without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ReadFileRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ReadFileRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ReadFileResponse()
      );
      client.innerApiCalls.readFile =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.readFile(
          request,
          (
            err?: Error | null,
            result?: protos.google.cloud.dataform.v1beta1.IReadFileResponse | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.readFile as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.readFile as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes readFile with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ReadFileRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ReadFileRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.readFile = stubSimpleCall(undefined, expectedError);
      await assert.rejects(client.readFile(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.readFile as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.readFile as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes readFile with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ReadFileRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ReadFileRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.readFile(request), expectedError);
    });
  });

  describe('removeFile', () => {
    it('invokes removeFile without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.RemoveFileRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.RemoveFileRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.protobuf.Empty()
      );
      client.innerApiCalls.removeFile = stubSimpleCall(expectedResponse);
      const [response] = await client.removeFile(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.removeFile as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.removeFile as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes removeFile without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.RemoveFileRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.RemoveFileRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.protobuf.Empty()
      );
      client.innerApiCalls.removeFile =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.removeFile(
          request,
          (
            err?: Error | null,
            result?: protos.google.protobuf.IEmpty | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.removeFile as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.removeFile as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes removeFile with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.RemoveFileRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.RemoveFileRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.removeFile = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(client.removeFile(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.removeFile as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.removeFile as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes removeFile with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.RemoveFileRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.RemoveFileRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.removeFile(request), expectedError);
    });
  });

  describe('moveFile', () => {
    it('invokes moveFile without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.MoveFileRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.MoveFileRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.MoveFileResponse()
      );
      client.innerApiCalls.moveFile = stubSimpleCall(expectedResponse);
      const [response] = await client.moveFile(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.moveFile as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.moveFile as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes moveFile without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.MoveFileRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.MoveFileRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.MoveFileResponse()
      );
      client.innerApiCalls.moveFile =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.moveFile(
          request,
          (
            err?: Error | null,
            result?: protos.google.cloud.dataform.v1beta1.IMoveFileResponse | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.moveFile as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.moveFile as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes moveFile with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.MoveFileRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.MoveFileRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.moveFile = stubSimpleCall(undefined, expectedError);
      await assert.rejects(client.moveFile(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.moveFile as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.moveFile as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes moveFile with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.MoveFileRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.MoveFileRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.moveFile(request), expectedError);
    });
  });

  describe('writeFile', () => {
    it('invokes writeFile without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.WriteFileRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.WriteFileRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.WriteFileResponse()
      );
      client.innerApiCalls.writeFile = stubSimpleCall(expectedResponse);
      const [response] = await client.writeFile(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.writeFile as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.writeFile as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes writeFile without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.WriteFileRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.WriteFileRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.WriteFileResponse()
      );
      client.innerApiCalls.writeFile =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.writeFile(
          request,
          (
            err?: Error | null,
            result?: protos.google.cloud.dataform.v1beta1.IWriteFileResponse | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.writeFile as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.writeFile as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes writeFile with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.WriteFileRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.WriteFileRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.writeFile = stubSimpleCall(undefined, expectedError);
      await assert.rejects(client.writeFile(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.writeFile as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.writeFile as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes writeFile with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.WriteFileRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.WriteFileRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.writeFile(request), expectedError);
    });
  });

  describe('getCompilationResult', () => {
    it('invokes getCompilationResult without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.GetCompilationResultRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.GetCompilationResultRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CompilationResult()
      );
      client.innerApiCalls.getCompilationResult =
        stubSimpleCall(expectedResponse);
      const [response] = await client.getCompilationResult(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.getCompilationResult as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.getCompilationResult as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes getCompilationResult without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.GetCompilationResultRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.GetCompilationResultRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CompilationResult()
      );
      client.innerApiCalls.getCompilationResult =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.getCompilationResult(
          request,
          (
            err?: Error | null,
            result?: protos.google.cloud.dataform.v1beta1.ICompilationResult | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.getCompilationResult as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.getCompilationResult as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes getCompilationResult with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.GetCompilationResultRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.GetCompilationResultRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.getCompilationResult = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(client.getCompilationResult(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.getCompilationResult as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.getCompilationResult as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes getCompilationResult with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.GetCompilationResultRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.GetCompilationResultRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(client.getCompilationResult(request), expectedError);
    });
  });

  describe('createCompilationResult', () => {
    it('invokes createCompilationResult without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CreateCompilationResultRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CreateCompilationResultRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CompilationResult()
      );
      client.innerApiCalls.createCompilationResult =
        stubSimpleCall(expectedResponse);
      const [response] = await client.createCompilationResult(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.createCompilationResult as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.createCompilationResult as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes createCompilationResult without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CreateCompilationResultRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CreateCompilationResultRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CompilationResult()
      );
      client.innerApiCalls.createCompilationResult =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.createCompilationResult(
          request,
          (
            err?: Error | null,
            result?: protos.google.cloud.dataform.v1beta1.ICompilationResult | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.createCompilationResult as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.createCompilationResult as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes createCompilationResult with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CreateCompilationResultRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CreateCompilationResultRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.createCompilationResult = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(
        client.createCompilationResult(request),
        expectedError
      );
      const actualRequest = (
        client.innerApiCalls.createCompilationResult as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.createCompilationResult as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes createCompilationResult with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CreateCompilationResultRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CreateCompilationResultRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(
        client.createCompilationResult(request),
        expectedError
      );
    });
  });

  describe('getWorkflowInvocation', () => {
    it('invokes getWorkflowInvocation without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.GetWorkflowInvocationRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.GetWorkflowInvocationRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()
      );
      client.innerApiCalls.getWorkflowInvocation =
        stubSimpleCall(expectedResponse);
      const [response] = await client.getWorkflowInvocation(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.getWorkflowInvocation as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.getWorkflowInvocation as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes getWorkflowInvocation without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.GetWorkflowInvocationRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.GetWorkflowInvocationRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()
      );
      client.innerApiCalls.getWorkflowInvocation =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.getWorkflowInvocation(
          request,
          (
            err?: Error | null,
            result?: protos.google.cloud.dataform.v1beta1.IWorkflowInvocation | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.getWorkflowInvocation as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.getWorkflowInvocation as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes getWorkflowInvocation with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.GetWorkflowInvocationRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.GetWorkflowInvocationRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.getWorkflowInvocation = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(
        client.getWorkflowInvocation(request),
        expectedError
      );
      const actualRequest = (
        client.innerApiCalls.getWorkflowInvocation as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.getWorkflowInvocation as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes getWorkflowInvocation with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.GetWorkflowInvocationRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.GetWorkflowInvocationRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(
        client.getWorkflowInvocation(request),
        expectedError
      );
    });
  });

  describe('createWorkflowInvocation', () => {
    it('invokes createWorkflowInvocation without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CreateWorkflowInvocationRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CreateWorkflowInvocationRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()
      );
      client.innerApiCalls.createWorkflowInvocation =
        stubSimpleCall(expectedResponse);
      const [response] = await client.createWorkflowInvocation(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.createWorkflowInvocation as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.createWorkflowInvocation as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes createWorkflowInvocation without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CreateWorkflowInvocationRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CreateWorkflowInvocationRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()
      );
      client.innerApiCalls.createWorkflowInvocation =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.createWorkflowInvocation(
          request,
          (
            err?: Error | null,
            result?: protos.google.cloud.dataform.v1beta1.IWorkflowInvocation | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.createWorkflowInvocation as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.createWorkflowInvocation as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes createWorkflowInvocation with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CreateWorkflowInvocationRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CreateWorkflowInvocationRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.createWorkflowInvocation = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(
        client.createWorkflowInvocation(request),
        expectedError
      );
      const actualRequest = (
        client.innerApiCalls.createWorkflowInvocation as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.createWorkflowInvocation as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes createWorkflowInvocation with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CreateWorkflowInvocationRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CreateWorkflowInvocationRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(
        client.createWorkflowInvocation(request),
        expectedError
      );
    });
  });

  describe('deleteWorkflowInvocation', () => {
    it('invokes deleteWorkflowInvocation without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.DeleteWorkflowInvocationRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.DeleteWorkflowInvocationRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.protobuf.Empty()
      );
      client.innerApiCalls.deleteWorkflowInvocation =
        stubSimpleCall(expectedResponse);
      const [response] = await client.deleteWorkflowInvocation(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.deleteWorkflowInvocation as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.deleteWorkflowInvocation as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes deleteWorkflowInvocation without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.DeleteWorkflowInvocationRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.DeleteWorkflowInvocationRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.protobuf.Empty()
      );
      client.innerApiCalls.deleteWorkflowInvocation =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.deleteWorkflowInvocation(
          request,
          (
            err?: Error | null,
            result?: protos.google.protobuf.IEmpty | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.deleteWorkflowInvocation as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.deleteWorkflowInvocation as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes deleteWorkflowInvocation with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.DeleteWorkflowInvocationRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.DeleteWorkflowInvocationRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.deleteWorkflowInvocation = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(
        client.deleteWorkflowInvocation(request),
        expectedError
      );
      const actualRequest = (
        client.innerApiCalls.deleteWorkflowInvocation as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.deleteWorkflowInvocation as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes deleteWorkflowInvocation with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.DeleteWorkflowInvocationRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.DeleteWorkflowInvocationRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(
        client.deleteWorkflowInvocation(request),
        expectedError
      );
    });
  });

  describe('cancelWorkflowInvocation', () => {
    it('invokes cancelWorkflowInvocation without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CancelWorkflowInvocationRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CancelWorkflowInvocationRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.protobuf.Empty()
      );
      client.innerApiCalls.cancelWorkflowInvocation =
        stubSimpleCall(expectedResponse);
      const [response] = await client.cancelWorkflowInvocation(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.cancelWorkflowInvocation as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.cancelWorkflowInvocation as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes cancelWorkflowInvocation without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CancelWorkflowInvocationRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CancelWorkflowInvocationRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = generateSampleMessage(
        new protos.google.protobuf.Empty()
      );
      client.innerApiCalls.cancelWorkflowInvocation =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.cancelWorkflowInvocation(
          request,
          (
            err?: Error | null,
            result?: protos.google.protobuf.IEmpty | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.cancelWorkflowInvocation as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.cancelWorkflowInvocation as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes cancelWorkflowInvocation with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CancelWorkflowInvocationRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CancelWorkflowInvocationRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.cancelWorkflowInvocation = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(
        client.cancelWorkflowInvocation(request),
        expectedError
      );
      const actualRequest = (
        client.innerApiCalls.cancelWorkflowInvocation as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.cancelWorkflowInvocation as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes cancelWorkflowInvocation with closed client', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.CancelWorkflowInvocationRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.CancelWorkflowInvocationRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedError = new Error('The client has already been closed.');
      client.close();
      await assert.rejects(
        client.cancelWorkflowInvocation(request),
        expectedError
      );
    });
  });

  describe('listRepositories', () => {
    it('invokes listRepositories without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListRepositoriesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListRepositoriesRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Repository()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Repository()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Repository()
        ),
      ];
      client.innerApiCalls.listRepositories = stubSimpleCall(expectedResponse);
      const [response] = await client.listRepositories(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.listRepositories as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.listRepositories as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes listRepositories without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListRepositoriesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListRepositoriesRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Repository()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Repository()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Repository()
        ),
      ];
      client.innerApiCalls.listRepositories =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.listRepositories(
          request,
          (
            err?: Error | null,
            result?: protos.google.cloud.dataform.v1beta1.IRepository[] | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.listRepositories as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.listRepositories as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes listRepositories with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListRepositoriesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListRepositoriesRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.listRepositories = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(client.listRepositories(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.listRepositories as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.listRepositories as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes listRepositoriesStream without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListRepositoriesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListRepositoriesRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Repository()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Repository()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Repository()
        ),
      ];
      client.descriptors.page.listRepositories.createStream =
        stubPageStreamingCall(expectedResponse);
      const stream = client.listRepositoriesStream(request);
      const promise = new Promise((resolve, reject) => {
        const responses: protos.google.cloud.dataform.v1beta1.Repository[] = [];
        stream.on(
          'data',
          (response: protos.google.cloud.dataform.v1beta1.Repository) => {
            responses.push(response);
          }
        );
        stream.on('end', () => {
          resolve(responses);
        });
        stream.on('error', (err: Error) => {
          reject(err);
        });
      });
      const responses = await promise;
      assert.deepStrictEqual(responses, expectedResponse);
      assert(
        (client.descriptors.page.listRepositories.createStream as SinonStub)
          .getCall(0)
          .calledWith(client.innerApiCalls.listRepositories, request)
      );
      assert(
        (client.descriptors.page.listRepositories.createStream as SinonStub)
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });

    it('invokes listRepositoriesStream with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListRepositoriesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListRepositoriesRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.descriptors.page.listRepositories.createStream =
        stubPageStreamingCall(undefined, expectedError);
      const stream = client.listRepositoriesStream(request);
      const promise = new Promise((resolve, reject) => {
        const responses: protos.google.cloud.dataform.v1beta1.Repository[] = [];
        stream.on(
          'data',
          (response: protos.google.cloud.dataform.v1beta1.Repository) => {
            responses.push(response);
          }
        );
        stream.on('end', () => {
          resolve(responses);
        });
        stream.on('error', (err: Error) => {
          reject(err);
        });
      });
      await assert.rejects(promise, expectedError);
      assert(
        (client.descriptors.page.listRepositories.createStream as SinonStub)
          .getCall(0)
          .calledWith(client.innerApiCalls.listRepositories, request)
      );
      assert(
        (client.descriptors.page.listRepositories.createStream as SinonStub)
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });

    it('uses async iteration with listRepositories without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListRepositoriesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListRepositoriesRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Repository()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Repository()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Repository()
        ),
      ];
      client.descriptors.page.listRepositories.asyncIterate =
        stubAsyncIterationCall(expectedResponse);
      const responses: protos.google.cloud.dataform.v1beta1.IRepository[] = [];
      const iterable = client.listRepositoriesAsync(request);
      for await (const resource of iterable) {
        responses.push(resource!);
      }
      assert.deepStrictEqual(responses, expectedResponse);
      assert.deepStrictEqual(
        (
          client.descriptors.page.listRepositories.asyncIterate as SinonStub
        ).getCall(0).args[1],
        request
      );
      assert(
        (client.descriptors.page.listRepositories.asyncIterate as SinonStub)
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });

    it('uses async iteration with listRepositories with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListRepositoriesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListRepositoriesRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.descriptors.page.listRepositories.asyncIterate =
        stubAsyncIterationCall(undefined, expectedError);
      const iterable = client.listRepositoriesAsync(request);
      await assert.rejects(async () => {
        const responses: protos.google.cloud.dataform.v1beta1.IRepository[] =
          [];
        for await (const resource of iterable) {
          responses.push(resource!);
        }
      });
      assert.deepStrictEqual(
        (
          client.descriptors.page.listRepositories.asyncIterate as SinonStub
        ).getCall(0).args[1],
        request
      );
      assert(
        (client.descriptors.page.listRepositories.asyncIterate as SinonStub)
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });
  });

  describe('listWorkspaces', () => {
    it('invokes listWorkspaces without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListWorkspacesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListWorkspacesRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Workspace()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Workspace()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Workspace()
        ),
      ];
      client.innerApiCalls.listWorkspaces = stubSimpleCall(expectedResponse);
      const [response] = await client.listWorkspaces(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.listWorkspaces as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.listWorkspaces as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes listWorkspaces without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListWorkspacesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListWorkspacesRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Workspace()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Workspace()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Workspace()
        ),
      ];
      client.innerApiCalls.listWorkspaces =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.listWorkspaces(
          request,
          (
            err?: Error | null,
            result?: protos.google.cloud.dataform.v1beta1.IWorkspace[] | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.listWorkspaces as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.listWorkspaces as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes listWorkspaces with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListWorkspacesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListWorkspacesRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.listWorkspaces = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(client.listWorkspaces(request), expectedError);
      const actualRequest = (
        client.innerApiCalls.listWorkspaces as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.listWorkspaces as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes listWorkspacesStream without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListWorkspacesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListWorkspacesRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Workspace()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Workspace()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Workspace()
        ),
      ];
      client.descriptors.page.listWorkspaces.createStream =
        stubPageStreamingCall(expectedResponse);
      const stream = client.listWorkspacesStream(request);
      const promise = new Promise((resolve, reject) => {
        const responses: protos.google.cloud.dataform.v1beta1.Workspace[] = [];
        stream.on(
          'data',
          (response: protos.google.cloud.dataform.v1beta1.Workspace) => {
            responses.push(response);
          }
        );
        stream.on('end', () => {
          resolve(responses);
        });
        stream.on('error', (err: Error) => {
          reject(err);
        });
      });
      const responses = await promise;
      assert.deepStrictEqual(responses, expectedResponse);
      assert(
        (client.descriptors.page.listWorkspaces.createStream as SinonStub)
          .getCall(0)
          .calledWith(client.innerApiCalls.listWorkspaces, request)
      );
      assert(
        (client.descriptors.page.listWorkspaces.createStream as SinonStub)
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });

    it('invokes listWorkspacesStream with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListWorkspacesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListWorkspacesRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.descriptors.page.listWorkspaces.createStream =
        stubPageStreamingCall(undefined, expectedError);
      const stream = client.listWorkspacesStream(request);
      const promise = new Promise((resolve, reject) => {
        const responses: protos.google.cloud.dataform.v1beta1.Workspace[] = [];
        stream.on(
          'data',
          (response: protos.google.cloud.dataform.v1beta1.Workspace) => {
            responses.push(response);
          }
        );
        stream.on('end', () => {
          resolve(responses);
        });
        stream.on('error', (err: Error) => {
          reject(err);
        });
      });
      await assert.rejects(promise, expectedError);
      assert(
        (client.descriptors.page.listWorkspaces.createStream as SinonStub)
          .getCall(0)
          .calledWith(client.innerApiCalls.listWorkspaces, request)
      );
      assert(
        (client.descriptors.page.listWorkspaces.createStream as SinonStub)
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });

    it('uses async iteration with listWorkspaces without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListWorkspacesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListWorkspacesRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Workspace()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Workspace()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.Workspace()
        ),
      ];
      client.descriptors.page.listWorkspaces.asyncIterate =
        stubAsyncIterationCall(expectedResponse);
      const responses: protos.google.cloud.dataform.v1beta1.IWorkspace[] = [];
      const iterable = client.listWorkspacesAsync(request);
      for await (const resource of iterable) {
        responses.push(resource!);
      }
      assert.deepStrictEqual(responses, expectedResponse);
      assert.deepStrictEqual(
        (
          client.descriptors.page.listWorkspaces.asyncIterate as SinonStub
        ).getCall(0).args[1],
        request
      );
      assert(
        (client.descriptors.page.listWorkspaces.asyncIterate as SinonStub)
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });

    it('uses async iteration with listWorkspaces with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListWorkspacesRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListWorkspacesRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.descriptors.page.listWorkspaces.asyncIterate =
        stubAsyncIterationCall(undefined, expectedError);
      const iterable = client.listWorkspacesAsync(request);
      await assert.rejects(async () => {
        const responses: protos.google.cloud.dataform.v1beta1.IWorkspace[] = [];
        for await (const resource of iterable) {
          responses.push(resource!);
        }
      });
      assert.deepStrictEqual(
        (
          client.descriptors.page.listWorkspaces.asyncIterate as SinonStub
        ).getCall(0).args[1],
        request
      );
      assert(
        (client.descriptors.page.listWorkspaces.asyncIterate as SinonStub)
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });
  });

  describe('queryDirectoryContents', () => {
    it('invokes queryDirectoryContents without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()
        ),
      ];
      client.innerApiCalls.queryDirectoryContents =
        stubSimpleCall(expectedResponse);
      const [response] = await client.queryDirectoryContents(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.queryDirectoryContents as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.queryDirectoryContents as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes queryDirectoryContents without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()
        ),
      ];
      client.innerApiCalls.queryDirectoryContents =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.queryDirectoryContents(
          request,
          (
            err?: Error | null,
            result?:
              | protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.IDirectoryEntry[]
              | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.queryDirectoryContents as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.queryDirectoryContents as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes queryDirectoryContents with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.queryDirectoryContents = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(
        client.queryDirectoryContents(request),
        expectedError
      );
      const actualRequest = (
        client.innerApiCalls.queryDirectoryContents as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.queryDirectoryContents as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes queryDirectoryContentsStream without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()
        ),
      ];
      client.descriptors.page.queryDirectoryContents.createStream =
        stubPageStreamingCall(expectedResponse);
      const stream = client.queryDirectoryContentsStream(request);
      const promise = new Promise((resolve, reject) => {
        const responses: protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry[] =
          [];
        stream.on(
          'data',
          (
            response: protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry
          ) => {
            responses.push(response);
          }
        );
        stream.on('end', () => {
          resolve(responses);
        });
        stream.on('error', (err: Error) => {
          reject(err);
        });
      });
      const responses = await promise;
      assert.deepStrictEqual(responses, expectedResponse);
      assert(
        (
          client.descriptors.page.queryDirectoryContents
            .createStream as SinonStub
        )
          .getCall(0)
          .calledWith(client.innerApiCalls.queryDirectoryContents, request)
      );
      assert(
        (
          client.descriptors.page.queryDirectoryContents
            .createStream as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });

    it('invokes queryDirectoryContentsStream with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.descriptors.page.queryDirectoryContents.createStream =
        stubPageStreamingCall(undefined, expectedError);
      const stream = client.queryDirectoryContentsStream(request);
      const promise = new Promise((resolve, reject) => {
        const responses: protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry[] =
          [];
        stream.on(
          'data',
          (
            response: protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry
          ) => {
            responses.push(response);
          }
        );
        stream.on('end', () => {
          resolve(responses);
        });
        stream.on('error', (err: Error) => {
          reject(err);
        });
      });
      await assert.rejects(promise, expectedError);
      assert(
        (
          client.descriptors.page.queryDirectoryContents
            .createStream as SinonStub
        )
          .getCall(0)
          .calledWith(client.innerApiCalls.queryDirectoryContents, request)
      );
      assert(
        (
          client.descriptors.page.queryDirectoryContents
            .createStream as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });

    it('uses async iteration with queryDirectoryContents without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()
        ),
      ];
      client.descriptors.page.queryDirectoryContents.asyncIterate =
        stubAsyncIterationCall(expectedResponse);
      const responses: protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.IDirectoryEntry[] =
        [];
      const iterable = client.queryDirectoryContentsAsync(request);
      for await (const resource of iterable) {
        responses.push(resource!);
      }
      assert.deepStrictEqual(responses, expectedResponse);
      assert.deepStrictEqual(
        (
          client.descriptors.page.queryDirectoryContents
            .asyncIterate as SinonStub
        ).getCall(0).args[1],
        request
      );
      assert(
        (
          client.descriptors.page.queryDirectoryContents
            .asyncIterate as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });

    it('uses async iteration with queryDirectoryContents with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest',
        ['workspace']
      );
      request.workspace = defaultValue1;
      const expectedHeaderRequestParams = `workspace=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.descriptors.page.queryDirectoryContents.asyncIterate =
        stubAsyncIterationCall(undefined, expectedError);
      const iterable = client.queryDirectoryContentsAsync(request);
      await assert.rejects(async () => {
        const responses: protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.IDirectoryEntry[] =
          [];
        for await (const resource of iterable) {
          responses.push(resource!);
        }
      });
      assert.deepStrictEqual(
        (
          client.descriptors.page.queryDirectoryContents
            .asyncIterate as SinonStub
        ).getCall(0).args[1],
        request
      );
      assert(
        (
          client.descriptors.page.queryDirectoryContents
            .asyncIterate as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });
  });

  describe('listCompilationResults', () => {
    it('invokes listCompilationResults without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListCompilationResultsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListCompilationResultsRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResult()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResult()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResult()
        ),
      ];
      client.innerApiCalls.listCompilationResults =
        stubSimpleCall(expectedResponse);
      const [response] = await client.listCompilationResults(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.listCompilationResults as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.listCompilationResults as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes listCompilationResults without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListCompilationResultsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListCompilationResultsRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResult()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResult()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResult()
        ),
      ];
      client.innerApiCalls.listCompilationResults =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.listCompilationResults(
          request,
          (
            err?: Error | null,
            result?:
              | protos.google.cloud.dataform.v1beta1.ICompilationResult[]
              | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.listCompilationResults as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.listCompilationResults as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes listCompilationResults with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListCompilationResultsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListCompilationResultsRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.listCompilationResults = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(
        client.listCompilationResults(request),
        expectedError
      );
      const actualRequest = (
        client.innerApiCalls.listCompilationResults as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.listCompilationResults as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes listCompilationResultsStream without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListCompilationResultsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListCompilationResultsRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResult()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResult()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResult()
        ),
      ];
      client.descriptors.page.listCompilationResults.createStream =
        stubPageStreamingCall(expectedResponse);
      const stream = client.listCompilationResultsStream(request);
      const promise = new Promise((resolve, reject) => {
        const responses: protos.google.cloud.dataform.v1beta1.CompilationResult[] =
          [];
        stream.on(
          'data',
          (
            response: protos.google.cloud.dataform.v1beta1.CompilationResult
          ) => {
            responses.push(response);
          }
        );
        stream.on('end', () => {
          resolve(responses);
        });
        stream.on('error', (err: Error) => {
          reject(err);
        });
      });
      const responses = await promise;
      assert.deepStrictEqual(responses, expectedResponse);
      assert(
        (
          client.descriptors.page.listCompilationResults
            .createStream as SinonStub
        )
          .getCall(0)
          .calledWith(client.innerApiCalls.listCompilationResults, request)
      );
      assert(
        (
          client.descriptors.page.listCompilationResults
            .createStream as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });

    it('invokes listCompilationResultsStream with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListCompilationResultsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListCompilationResultsRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.descriptors.page.listCompilationResults.createStream =
        stubPageStreamingCall(undefined, expectedError);
      const stream = client.listCompilationResultsStream(request);
      const promise = new Promise((resolve, reject) => {
        const responses: protos.google.cloud.dataform.v1beta1.CompilationResult[] =
          [];
        stream.on(
          'data',
          (
            response: protos.google.cloud.dataform.v1beta1.CompilationResult
          ) => {
            responses.push(response);
          }
        );
        stream.on('end', () => {
          resolve(responses);
        });
        stream.on('error', (err: Error) => {
          reject(err);
        });
      });
      await assert.rejects(promise, expectedError);
      assert(
        (
          client.descriptors.page.listCompilationResults
            .createStream as SinonStub
        )
          .getCall(0)
          .calledWith(client.innerApiCalls.listCompilationResults, request)
      );
      assert(
        (
          client.descriptors.page.listCompilationResults
            .createStream as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });

    it('uses async iteration with listCompilationResults without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListCompilationResultsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListCompilationResultsRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResult()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResult()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResult()
        ),
      ];
      client.descriptors.page.listCompilationResults.asyncIterate =
        stubAsyncIterationCall(expectedResponse);
      const responses: protos.google.cloud.dataform.v1beta1.ICompilationResult[] =
        [];
      const iterable = client.listCompilationResultsAsync(request);
      for await (const resource of iterable) {
        responses.push(resource!);
      }
      assert.deepStrictEqual(responses, expectedResponse);
      assert.deepStrictEqual(
        (
          client.descriptors.page.listCompilationResults
            .asyncIterate as SinonStub
        ).getCall(0).args[1],
        request
      );
      assert(
        (
          client.descriptors.page.listCompilationResults
            .asyncIterate as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });

    it('uses async iteration with listCompilationResults with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListCompilationResultsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListCompilationResultsRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.descriptors.page.listCompilationResults.asyncIterate =
        stubAsyncIterationCall(undefined, expectedError);
      const iterable = client.listCompilationResultsAsync(request);
      await assert.rejects(async () => {
        const responses: protos.google.cloud.dataform.v1beta1.ICompilationResult[] =
          [];
        for await (const resource of iterable) {
          responses.push(resource!);
        }
      });
      assert.deepStrictEqual(
        (
          client.descriptors.page.listCompilationResults
            .asyncIterate as SinonStub
        ).getCall(0).args[1],
        request
      );
      assert(
        (
          client.descriptors.page.listCompilationResults
            .asyncIterate as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });
  });

  describe('queryCompilationResultActions', () => {
    it('invokes queryCompilationResultActions without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResultAction()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResultAction()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResultAction()
        ),
      ];
      client.innerApiCalls.queryCompilationResultActions =
        stubSimpleCall(expectedResponse);
      const [response] = await client.queryCompilationResultActions(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.queryCompilationResultActions as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.queryCompilationResultActions as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes queryCompilationResultActions without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResultAction()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResultAction()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResultAction()
        ),
      ];
      client.innerApiCalls.queryCompilationResultActions =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.queryCompilationResultActions(
          request,
          (
            err?: Error | null,
            result?:
              | protos.google.cloud.dataform.v1beta1.ICompilationResultAction[]
              | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.queryCompilationResultActions as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.queryCompilationResultActions as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes queryCompilationResultActions with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.queryCompilationResultActions = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(
        client.queryCompilationResultActions(request),
        expectedError
      );
      const actualRequest = (
        client.innerApiCalls.queryCompilationResultActions as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.queryCompilationResultActions as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes queryCompilationResultActionsStream without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResultAction()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResultAction()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResultAction()
        ),
      ];
      client.descriptors.page.queryCompilationResultActions.createStream =
        stubPageStreamingCall(expectedResponse);
      const stream = client.queryCompilationResultActionsStream(request);
      const promise = new Promise((resolve, reject) => {
        const responses: protos.google.cloud.dataform.v1beta1.CompilationResultAction[] =
          [];
        stream.on(
          'data',
          (
            response: protos.google.cloud.dataform.v1beta1.CompilationResultAction
          ) => {
            responses.push(response);
          }
        );
        stream.on('end', () => {
          resolve(responses);
        });
        stream.on('error', (err: Error) => {
          reject(err);
        });
      });
      const responses = await promise;
      assert.deepStrictEqual(responses, expectedResponse);
      assert(
        (
          client.descriptors.page.queryCompilationResultActions
            .createStream as SinonStub
        )
          .getCall(0)
          .calledWith(
            client.innerApiCalls.queryCompilationResultActions,
            request
          )
      );
      assert(
        (
          client.descriptors.page.queryCompilationResultActions
            .createStream as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });

    it('invokes queryCompilationResultActionsStream with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.descriptors.page.queryCompilationResultActions.createStream =
        stubPageStreamingCall(undefined, expectedError);
      const stream = client.queryCompilationResultActionsStream(request);
      const promise = new Promise((resolve, reject) => {
        const responses: protos.google.cloud.dataform.v1beta1.CompilationResultAction[] =
          [];
        stream.on(
          'data',
          (
            response: protos.google.cloud.dataform.v1beta1.CompilationResultAction
          ) => {
            responses.push(response);
          }
        );
        stream.on('end', () => {
          resolve(responses);
        });
        stream.on('error', (err: Error) => {
          reject(err);
        });
      });
      await assert.rejects(promise, expectedError);
      assert(
        (
          client.descriptors.page.queryCompilationResultActions
            .createStream as SinonStub
        )
          .getCall(0)
          .calledWith(
            client.innerApiCalls.queryCompilationResultActions,
            request
          )
      );
      assert(
        (
          client.descriptors.page.queryCompilationResultActions
            .createStream as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });

    it('uses async iteration with queryCompilationResultActions without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResultAction()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResultAction()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.CompilationResultAction()
        ),
      ];
      client.descriptors.page.queryCompilationResultActions.asyncIterate =
        stubAsyncIterationCall(expectedResponse);
      const responses: protos.google.cloud.dataform.v1beta1.ICompilationResultAction[] =
        [];
      const iterable = client.queryCompilationResultActionsAsync(request);
      for await (const resource of iterable) {
        responses.push(resource!);
      }
      assert.deepStrictEqual(responses, expectedResponse);
      assert.deepStrictEqual(
        (
          client.descriptors.page.queryCompilationResultActions
            .asyncIterate as SinonStub
        ).getCall(0).args[1],
        request
      );
      assert(
        (
          client.descriptors.page.queryCompilationResultActions
            .asyncIterate as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });

    it('uses async iteration with queryCompilationResultActions with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.descriptors.page.queryCompilationResultActions.asyncIterate =
        stubAsyncIterationCall(undefined, expectedError);
      const iterable = client.queryCompilationResultActionsAsync(request);
      await assert.rejects(async () => {
        const responses: protos.google.cloud.dataform.v1beta1.ICompilationResultAction[] =
          [];
        for await (const resource of iterable) {
          responses.push(resource!);
        }
      });
      assert.deepStrictEqual(
        (
          client.descriptors.page.queryCompilationResultActions
            .asyncIterate as SinonStub
        ).getCall(0).args[1],
        request
      );
      assert(
        (
          client.descriptors.page.queryCompilationResultActions
            .asyncIterate as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });
  });

  describe('listWorkflowInvocations', () => {
    it('invokes listWorkflowInvocations without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()
        ),
      ];
      client.innerApiCalls.listWorkflowInvocations =
        stubSimpleCall(expectedResponse);
      const [response] = await client.listWorkflowInvocations(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.listWorkflowInvocations as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.listWorkflowInvocations as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes listWorkflowInvocations without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()
        ),
      ];
      client.innerApiCalls.listWorkflowInvocations =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.listWorkflowInvocations(
          request,
          (
            err?: Error | null,
            result?:
              | protos.google.cloud.dataform.v1beta1.IWorkflowInvocation[]
              | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.listWorkflowInvocations as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.listWorkflowInvocations as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes listWorkflowInvocations with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.listWorkflowInvocations = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(
        client.listWorkflowInvocations(request),
        expectedError
      );
      const actualRequest = (
        client.innerApiCalls.listWorkflowInvocations as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.listWorkflowInvocations as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes listWorkflowInvocationsStream without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()
        ),
      ];
      client.descriptors.page.listWorkflowInvocations.createStream =
        stubPageStreamingCall(expectedResponse);
      const stream = client.listWorkflowInvocationsStream(request);
      const promise = new Promise((resolve, reject) => {
        const responses: protos.google.cloud.dataform.v1beta1.WorkflowInvocation[] =
          [];
        stream.on(
          'data',
          (
            response: protos.google.cloud.dataform.v1beta1.WorkflowInvocation
          ) => {
            responses.push(response);
          }
        );
        stream.on('end', () => {
          resolve(responses);
        });
        stream.on('error', (err: Error) => {
          reject(err);
        });
      });
      const responses = await promise;
      assert.deepStrictEqual(responses, expectedResponse);
      assert(
        (
          client.descriptors.page.listWorkflowInvocations
            .createStream as SinonStub
        )
          .getCall(0)
          .calledWith(client.innerApiCalls.listWorkflowInvocations, request)
      );
      assert(
        (
          client.descriptors.page.listWorkflowInvocations
            .createStream as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });

    it('invokes listWorkflowInvocationsStream with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.descriptors.page.listWorkflowInvocations.createStream =
        stubPageStreamingCall(undefined, expectedError);
      const stream = client.listWorkflowInvocationsStream(request);
      const promise = new Promise((resolve, reject) => {
        const responses: protos.google.cloud.dataform.v1beta1.WorkflowInvocation[] =
          [];
        stream.on(
          'data',
          (
            response: protos.google.cloud.dataform.v1beta1.WorkflowInvocation
          ) => {
            responses.push(response);
          }
        );
        stream.on('end', () => {
          resolve(responses);
        });
        stream.on('error', (err: Error) => {
          reject(err);
        });
      });
      await assert.rejects(promise, expectedError);
      assert(
        (
          client.descriptors.page.listWorkflowInvocations
            .createStream as SinonStub
        )
          .getCall(0)
          .calledWith(client.innerApiCalls.listWorkflowInvocations, request)
      );
      assert(
        (
          client.descriptors.page.listWorkflowInvocations
            .createStream as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });

    it('uses async iteration with listWorkflowInvocations without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()
        ),
      ];
      client.descriptors.page.listWorkflowInvocations.asyncIterate =
        stubAsyncIterationCall(expectedResponse);
      const responses: protos.google.cloud.dataform.v1beta1.IWorkflowInvocation[] =
        [];
      const iterable = client.listWorkflowInvocationsAsync(request);
      for await (const resource of iterable) {
        responses.push(resource!);
      }
      assert.deepStrictEqual(responses, expectedResponse);
      assert.deepStrictEqual(
        (
          client.descriptors.page.listWorkflowInvocations
            .asyncIterate as SinonStub
        ).getCall(0).args[1],
        request
      );
      assert(
        (
          client.descriptors.page.listWorkflowInvocations
            .asyncIterate as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });

    it('uses async iteration with listWorkflowInvocations with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest',
        ['parent']
      );
      request.parent = defaultValue1;
      const expectedHeaderRequestParams = `parent=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.descriptors.page.listWorkflowInvocations.asyncIterate =
        stubAsyncIterationCall(undefined, expectedError);
      const iterable = client.listWorkflowInvocationsAsync(request);
      await assert.rejects(async () => {
        const responses: protos.google.cloud.dataform.v1beta1.IWorkflowInvocation[] =
          [];
        for await (const resource of iterable) {
          responses.push(resource!);
        }
      });
      assert.deepStrictEqual(
        (
          client.descriptors.page.listWorkflowInvocations
            .asyncIterate as SinonStub
        ).getCall(0).args[1],
        request
      );
      assert(
        (
          client.descriptors.page.listWorkflowInvocations
            .asyncIterate as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });
  });

  describe('queryWorkflowInvocationActions', () => {
    it('invokes queryWorkflowInvocationActions without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()
        ),
      ];
      client.innerApiCalls.queryWorkflowInvocationActions =
        stubSimpleCall(expectedResponse);
      const [response] = await client.queryWorkflowInvocationActions(request);
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.queryWorkflowInvocationActions as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.queryWorkflowInvocationActions as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes queryWorkflowInvocationActions without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()
        ),
      ];
      client.innerApiCalls.queryWorkflowInvocationActions =
        stubSimpleCallWithCallback(expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.queryWorkflowInvocationActions(
          request,
          (
            err?: Error | null,
            result?:
              | protos.google.cloud.dataform.v1beta1.IWorkflowInvocationAction[]
              | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      const actualRequest = (
        client.innerApiCalls.queryWorkflowInvocationActions as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.queryWorkflowInvocationActions as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes queryWorkflowInvocationActions with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.innerApiCalls.queryWorkflowInvocationActions = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(
        client.queryWorkflowInvocationActions(request),
        expectedError
      );
      const actualRequest = (
        client.innerApiCalls.queryWorkflowInvocationActions as SinonStub
      ).getCall(0).args[0];
      assert.deepStrictEqual(actualRequest, request);
      const actualHeaderRequestParams = (
        client.innerApiCalls.queryWorkflowInvocationActions as SinonStub
      ).getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
      assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
    });

    it('invokes queryWorkflowInvocationActionsStream without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()
        ),
      ];
      client.descriptors.page.queryWorkflowInvocationActions.createStream =
        stubPageStreamingCall(expectedResponse);
      const stream = client.queryWorkflowInvocationActionsStream(request);
      const promise = new Promise((resolve, reject) => {
        const responses: protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction[] =
          [];
        stream.on(
          'data',
          (
            response: protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction
          ) => {
            responses.push(response);
          }
        );
        stream.on('end', () => {
          resolve(responses);
        });
        stream.on('error', (err: Error) => {
          reject(err);
        });
      });
      const responses = await promise;
      assert.deepStrictEqual(responses, expectedResponse);
      assert(
        (
          client.descriptors.page.queryWorkflowInvocationActions
            .createStream as SinonStub
        )
          .getCall(0)
          .calledWith(
            client.innerApiCalls.queryWorkflowInvocationActions,
            request
          )
      );
      assert(
        (
          client.descriptors.page.queryWorkflowInvocationActions
            .createStream as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });

    it('invokes queryWorkflowInvocationActionsStream with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.descriptors.page.queryWorkflowInvocationActions.createStream =
        stubPageStreamingCall(undefined, expectedError);
      const stream = client.queryWorkflowInvocationActionsStream(request);
      const promise = new Promise((resolve, reject) => {
        const responses: protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction[] =
          [];
        stream.on(
          'data',
          (
            response: protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction
          ) => {
            responses.push(response);
          }
        );
        stream.on('end', () => {
          resolve(responses);
        });
        stream.on('error', (err: Error) => {
          reject(err);
        });
      });
      await assert.rejects(promise, expectedError);
      assert(
        (
          client.descriptors.page.queryWorkflowInvocationActions
            .createStream as SinonStub
        )
          .getCall(0)
          .calledWith(
            client.innerApiCalls.queryWorkflowInvocationActions,
            request
          )
      );
      assert(
        (
          client.descriptors.page.queryWorkflowInvocationActions
            .createStream as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });

    it('uses async iteration with queryWorkflowInvocationActions without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedResponse = [
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()
        ),
        generateSampleMessage(
          new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()
        ),
      ];
      client.descriptors.page.queryWorkflowInvocationActions.asyncIterate =
        stubAsyncIterationCall(expectedResponse);
      const responses: protos.google.cloud.dataform.v1beta1.IWorkflowInvocationAction[] =
        [];
      const iterable = client.queryWorkflowInvocationActionsAsync(request);
      for await (const resource of iterable) {
        responses.push(resource!);
      }
      assert.deepStrictEqual(responses, expectedResponse);
      assert.deepStrictEqual(
        (
          client.descriptors.page.queryWorkflowInvocationActions
            .asyncIterate as SinonStub
        ).getCall(0).args[1],
        request
      );
      assert(
        (
          client.descriptors.page.queryWorkflowInvocationActions
            .asyncIterate as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });

    it('uses async iteration with queryWorkflowInvocationActions with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new protos.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest()
      );
      const defaultValue1 = getTypeDefaultValue(
        '.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest',
        ['name']
      );
      request.name = defaultValue1;
      const expectedHeaderRequestParams = `name=${defaultValue1}`;
      const expectedError = new Error('expected');
      client.descriptors.page.queryWorkflowInvocationActions.asyncIterate =
        stubAsyncIterationCall(undefined, expectedError);
      const iterable = client.queryWorkflowInvocationActionsAsync(request);
      await assert.rejects(async () => {
        const responses: protos.google.cloud.dataform.v1beta1.IWorkflowInvocationAction[] =
          [];
        for await (const resource of iterable) {
          responses.push(resource!);
        }
      });
      assert.deepStrictEqual(
        (
          client.descriptors.page.queryWorkflowInvocationActions
            .asyncIterate as SinonStub
        ).getCall(0).args[1],
        request
      );
      assert(
        (
          client.descriptors.page.queryWorkflowInvocationActions
            .asyncIterate as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });
  });
  describe('getIamPolicy', () => {
    it('invokes getIamPolicy without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new IamProtos.google.iam.v1.GetIamPolicyRequest()
      );
      request.resource = '';
      const expectedHeaderRequestParams = 'resource=';
      const expectedOptions = {
        otherArgs: {
          headers: {
            'x-goog-request-params': expectedHeaderRequestParams,
          },
        },
      };
      const expectedResponse = generateSampleMessage(
        new IamProtos.google.iam.v1.Policy()
      );
      client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse);
      const response = await client.getIamPolicy(request, expectedOptions);
      assert.deepStrictEqual(response, [expectedResponse]);
      assert(
        (client.iamClient.getIamPolicy as SinonStub)
          .getCall(0)
          .calledWith(request, expectedOptions, undefined)
      );
    });
    it('invokes getIamPolicy without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new IamProtos.google.iam.v1.GetIamPolicyRequest()
      );
      request.resource = '';
      const expectedHeaderRequestParams = 'resource=';
      const expectedOptions = {
        otherArgs: {
          headers: {
            'x-goog-request-params': expectedHeaderRequestParams,
          },
        },
      };
      const expectedResponse = generateSampleMessage(
        new IamProtos.google.iam.v1.Policy()
      );
      client.iamClient.getIamPolicy = sinon
        .stub()
        .callsArgWith(2, null, expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.getIamPolicy(
          request,
          expectedOptions,
          (
            err?: Error | null,
            result?: IamProtos.google.iam.v1.Policy | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      assert((client.iamClient.getIamPolicy as SinonStub).getCall(0));
    });
    it('invokes getIamPolicy with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new IamProtos.google.iam.v1.GetIamPolicyRequest()
      );
      request.resource = '';
      const expectedHeaderRequestParams = 'resource=';
      const expectedOptions = {
        otherArgs: {
          headers: {
            'x-goog-request-params': expectedHeaderRequestParams,
          },
        },
      };
      const expectedError = new Error('expected');
      client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError);
      await assert.rejects(
        client.getIamPolicy(request, expectedOptions),
        expectedError
      );
      assert(
        (client.iamClient.getIamPolicy as SinonStub)
          .getCall(0)
          .calledWith(request, expectedOptions, undefined)
      );
    });
  });
  describe('setIamPolicy', () => {
    it('invokes setIamPolicy without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new IamProtos.google.iam.v1.SetIamPolicyRequest()
      );
      request.resource = '';
      const expectedHeaderRequestParams = 'resource=';
      const expectedOptions = {
        otherArgs: {
          headers: {
            'x-goog-request-params': expectedHeaderRequestParams,
          },
        },
      };
      const expectedResponse = generateSampleMessage(
        new IamProtos.google.iam.v1.Policy()
      );
      client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse);
      const response = await client.setIamPolicy(request, expectedOptions);
      assert.deepStrictEqual(response, [expectedResponse]);
      assert(
        (client.iamClient.setIamPolicy as SinonStub)
          .getCall(0)
          .calledWith(request, expectedOptions, undefined)
      );
    });
    it('invokes setIamPolicy without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new IamProtos.google.iam.v1.SetIamPolicyRequest()
      );
      request.resource = '';
      const expectedHeaderRequestParams = 'resource=';
      const expectedOptions = {
        otherArgs: {
          headers: {
            'x-goog-request-params': expectedHeaderRequestParams,
          },
        },
      };
      const expectedResponse = generateSampleMessage(
        new IamProtos.google.iam.v1.Policy()
      );
      client.iamClient.setIamPolicy = sinon
        .stub()
        .callsArgWith(2, null, expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.setIamPolicy(
          request,
          expectedOptions,
          (
            err?: Error | null,
            result?: IamProtos.google.iam.v1.Policy | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      assert((client.iamClient.setIamPolicy as SinonStub).getCall(0));
    });
    it('invokes setIamPolicy with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new IamProtos.google.iam.v1.SetIamPolicyRequest()
      );
      request.resource = '';
      const expectedHeaderRequestParams = 'resource=';
      const expectedOptions = {
        otherArgs: {
          headers: {
            'x-goog-request-params': expectedHeaderRequestParams,
          },
        },
      };
      const expectedError = new Error('expected');
      client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError);
      await assert.rejects(
        client.setIamPolicy(request, expectedOptions),
        expectedError
      );
      assert(
        (client.iamClient.setIamPolicy as SinonStub)
          .getCall(0)
          .calledWith(request, expectedOptions, undefined)
      );
    });
  });
  describe('testIamPermissions', () => {
    it('invokes testIamPermissions without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new IamProtos.google.iam.v1.TestIamPermissionsRequest()
      );
      request.resource = '';
      const expectedHeaderRequestParams = 'resource=';
      const expectedOptions = {
        otherArgs: {
          headers: {
            'x-goog-request-params': expectedHeaderRequestParams,
          },
        },
      };
      const expectedResponse = generateSampleMessage(
        new IamProtos.google.iam.v1.TestIamPermissionsResponse()
      );
      client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse);
      const response = await client.testIamPermissions(
        request,
        expectedOptions
      );
      assert.deepStrictEqual(response, [expectedResponse]);
      assert(
        (client.iamClient.testIamPermissions as SinonStub)
          .getCall(0)
          .calledWith(request, expectedOptions, undefined)
      );
    });
    it('invokes testIamPermissions without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new IamProtos.google.iam.v1.TestIamPermissionsRequest()
      );
      request.resource = '';
      const expectedHeaderRequestParams = 'resource=';
      const expectedOptions = {
        otherArgs: {
          headers: {
            'x-goog-request-params': expectedHeaderRequestParams,
          },
        },
      };
      const expectedResponse = generateSampleMessage(
        new IamProtos.google.iam.v1.TestIamPermissionsResponse()
      );
      client.iamClient.testIamPermissions = sinon
        .stub()
        .callsArgWith(2, null, expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.testIamPermissions(
          request,
          expectedOptions,
          (
            err?: Error | null,
            result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      assert((client.iamClient.testIamPermissions as SinonStub).getCall(0));
    });
    it('invokes testIamPermissions with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new IamProtos.google.iam.v1.TestIamPermissionsRequest()
      );
      request.resource = '';
      const expectedHeaderRequestParams = 'resource=';
      const expectedOptions = {
        otherArgs: {
          headers: {
            'x-goog-request-params': expectedHeaderRequestParams,
          },
        },
      };
      const expectedError = new Error('expected');
      client.iamClient.testIamPermissions = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(
        client.testIamPermissions(request, expectedOptions),
        expectedError
      );
      assert(
        (client.iamClient.testIamPermissions as SinonStub)
          .getCall(0)
          .calledWith(request, expectedOptions, undefined)
      );
    });
  });
  describe('getLocation', () => {
    it('invokes getLocation without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new LocationProtos.google.cloud.location.GetLocationRequest()
      );
      request.name = '';
      const expectedHeaderRequestParams = 'name=';
      const expectedOptions = {
        otherArgs: {
          headers: {
            'x-goog-request-params': expectedHeaderRequestParams,
          },
        },
      };
      const expectedResponse = generateSampleMessage(
        new LocationProtos.google.cloud.location.Location()
      );
      client.locationsClient.getLocation = stubSimpleCall(expectedResponse);
      const response = await client.getLocation(request, expectedOptions);
      assert.deepStrictEqual(response, [expectedResponse]);
      assert(
        (client.locationsClient.getLocation as SinonStub)
          .getCall(0)
          .calledWith(request, expectedOptions, undefined)
      );
    });
    it('invokes getLocation without error using callback', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new LocationProtos.google.cloud.location.GetLocationRequest()
      );
      request.name = '';
      const expectedHeaderRequestParams = 'name=';
      const expectedOptions = {
        otherArgs: {
          headers: {
            'x-goog-request-params': expectedHeaderRequestParams,
          },
        },
      };
      const expectedResponse = generateSampleMessage(
        new LocationProtos.google.cloud.location.Location()
      );
      client.locationsClient.getLocation = sinon
        .stub()
        .callsArgWith(2, null, expectedResponse);
      const promise = new Promise((resolve, reject) => {
        client.getLocation(
          request,
          expectedOptions,
          (
            err?: Error | null,
            result?: LocationProtos.google.cloud.location.ILocation | null
          ) => {
            if (err) {
              reject(err);
            } else {
              resolve(result);
            }
          }
        );
      });
      const response = await promise;
      assert.deepStrictEqual(response, expectedResponse);
      assert((client.locationsClient.getLocation as SinonStub).getCall(0));
    });
    it('invokes getLocation with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new LocationProtos.google.cloud.location.GetLocationRequest()
      );
      request.name = '';
      const expectedHeaderRequestParams = 'name=';
      const expectedOptions = {
        otherArgs: {
          headers: {
            'x-goog-request-params': expectedHeaderRequestParams,
          },
        },
      };
      const expectedError = new Error('expected');
      client.locationsClient.getLocation = stubSimpleCall(
        undefined,
        expectedError
      );
      await assert.rejects(
        client.getLocation(request, expectedOptions),
        expectedError
      );
      assert(
        (client.locationsClient.getLocation as SinonStub)
          .getCall(0)
          .calledWith(request, expectedOptions, undefined)
      );
    });
  });
  describe('listLocationsAsync', () => {
    it('uses async iteration with listLocations without error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new LocationProtos.google.cloud.location.ListLocationsRequest()
      );
      request.name = '';
      const expectedHeaderRequestParams = 'name=';
      const expectedResponse = [
        generateSampleMessage(
          new LocationProtos.google.cloud.location.Location()
        ),
        generateSampleMessage(
          new LocationProtos.google.cloud.location.Location()
        ),
        generateSampleMessage(
          new LocationProtos.google.cloud.location.Location()
        ),
      ];
      client.locationsClient.descriptors.page.listLocations.asyncIterate =
        stubAsyncIterationCall(expectedResponse);
      const responses: LocationProtos.google.cloud.location.ILocation[] = [];
      const iterable = client.listLocationsAsync(request);
      for await (const resource of iterable) {
        responses.push(resource!);
      }
      assert.deepStrictEqual(responses, expectedResponse);
      assert.deepStrictEqual(
        (
          client.locationsClient.descriptors.page.listLocations
            .asyncIterate as SinonStub
        ).getCall(0).args[1],
        request
      );
      assert(
        (
          client.locationsClient.descriptors.page.listLocations
            .asyncIterate as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });
    it('uses async iteration with listLocations with error', async () => {
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      const request = generateSampleMessage(
        new LocationProtos.google.cloud.location.ListLocationsRequest()
      );
      request.name = '';
      const expectedHeaderRequestParams = 'name=';
      const expectedError = new Error('expected');
      client.locationsClient.descriptors.page.listLocations.asyncIterate =
        stubAsyncIterationCall(undefined, expectedError);
      const iterable = client.listLocationsAsync(request);
      await assert.rejects(async () => {
        const responses: LocationProtos.google.cloud.location.ILocation[] = [];
        for await (const resource of iterable) {
          responses.push(resource!);
        }
      });
      assert.deepStrictEqual(
        (
          client.locationsClient.descriptors.page.listLocations
            .asyncIterate as SinonStub
        ).getCall(0).args[1],
        request
      );
      assert(
        (
          client.locationsClient.descriptors.page.listLocations
            .asyncIterate as SinonStub
        )
          .getCall(0)
          .args[2].otherArgs.headers['x-goog-request-params'].includes(
            expectedHeaderRequestParams
          )
      );
    });
  });

  describe('Path templates', () => {
    describe('compilationResult', () => {
      const fakePath = '/rendered/path/compilationResult';
      const expectedParameters = {
        project: 'projectValue',
        location: 'locationValue',
        repository: 'repositoryValue',
        compilation_result: 'compilationResultValue',
      };
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      client.pathTemplates.compilationResultPathTemplate.render = sinon
        .stub()
        .returns(fakePath);
      client.pathTemplates.compilationResultPathTemplate.match = sinon
        .stub()
        .returns(expectedParameters);

      it('compilationResultPath', () => {
        const result = client.compilationResultPath(
          'projectValue',
          'locationValue',
          'repositoryValue',
          'compilationResultValue'
        );
        assert.strictEqual(result, fakePath);
        assert(
          (
            client.pathTemplates.compilationResultPathTemplate
              .render as SinonStub
          )
            .getCall(-1)
            .calledWith(expectedParameters)
        );
      });

      it('matchProjectFromCompilationResultName', () => {
        const result = client.matchProjectFromCompilationResultName(fakePath);
        assert.strictEqual(result, 'projectValue');
        assert(
          (
            client.pathTemplates.compilationResultPathTemplate
              .match as SinonStub
          )
            .getCall(-1)
            .calledWith(fakePath)
        );
      });

      it('matchLocationFromCompilationResultName', () => {
        const result = client.matchLocationFromCompilationResultName(fakePath);
        assert.strictEqual(result, 'locationValue');
        assert(
          (
            client.pathTemplates.compilationResultPathTemplate
              .match as SinonStub
          )
            .getCall(-1)
            .calledWith(fakePath)
        );
      });

      it('matchRepositoryFromCompilationResultName', () => {
        const result =
          client.matchRepositoryFromCompilationResultName(fakePath);
        assert.strictEqual(result, 'repositoryValue');
        assert(
          (
            client.pathTemplates.compilationResultPathTemplate
              .match as SinonStub
          )
            .getCall(-1)
            .calledWith(fakePath)
        );
      });

      it('matchCompilationResultFromCompilationResultName', () => {
        const result =
          client.matchCompilationResultFromCompilationResultName(fakePath);
        assert.strictEqual(result, 'compilationResultValue');
        assert(
          (
            client.pathTemplates.compilationResultPathTemplate
              .match as SinonStub
          )
            .getCall(-1)
            .calledWith(fakePath)
        );
      });
    });

    describe('location', () => {
      const fakePath = '/rendered/path/location';
      const expectedParameters = {
        project: 'projectValue',
        location: 'locationValue',
      };
      const client = new dataformModule.v1beta1.DataformClient({
        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('repository', () => {
      const fakePath = '/rendered/path/repository';
      const expectedParameters = {
        project: 'projectValue',
        location: 'locationValue',
        repository: 'repositoryValue',
      };
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      client.pathTemplates.repositoryPathTemplate.render = sinon
        .stub()
        .returns(fakePath);
      client.pathTemplates.repositoryPathTemplate.match = sinon
        .stub()
        .returns(expectedParameters);

      it('repositoryPath', () => {
        const result = client.repositoryPath(
          'projectValue',
          'locationValue',
          'repositoryValue'
        );
        assert.strictEqual(result, fakePath);
        assert(
          (client.pathTemplates.repositoryPathTemplate.render as SinonStub)
            .getCall(-1)
            .calledWith(expectedParameters)
        );
      });

      it('matchProjectFromRepositoryName', () => {
        const result = client.matchProjectFromRepositoryName(fakePath);
        assert.strictEqual(result, 'projectValue');
        assert(
          (client.pathTemplates.repositoryPathTemplate.match as SinonStub)
            .getCall(-1)
            .calledWith(fakePath)
        );
      });

      it('matchLocationFromRepositoryName', () => {
        const result = client.matchLocationFromRepositoryName(fakePath);
        assert.strictEqual(result, 'locationValue');
        assert(
          (client.pathTemplates.repositoryPathTemplate.match as SinonStub)
            .getCall(-1)
            .calledWith(fakePath)
        );
      });

      it('matchRepositoryFromRepositoryName', () => {
        const result = client.matchRepositoryFromRepositoryName(fakePath);
        assert.strictEqual(result, 'repositoryValue');
        assert(
          (client.pathTemplates.repositoryPathTemplate.match as SinonStub)
            .getCall(-1)
            .calledWith(fakePath)
        );
      });
    });

    describe('workflowInvocation', () => {
      const fakePath = '/rendered/path/workflowInvocation';
      const expectedParameters = {
        project: 'projectValue',
        location: 'locationValue',
        repository: 'repositoryValue',
        workflow_invocation: 'workflowInvocationValue',
      };
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      client.pathTemplates.workflowInvocationPathTemplate.render = sinon
        .stub()
        .returns(fakePath);
      client.pathTemplates.workflowInvocationPathTemplate.match = sinon
        .stub()
        .returns(expectedParameters);

      it('workflowInvocationPath', () => {
        const result = client.workflowInvocationPath(
          'projectValue',
          'locationValue',
          'repositoryValue',
          'workflowInvocationValue'
        );
        assert.strictEqual(result, fakePath);
        assert(
          (
            client.pathTemplates.workflowInvocationPathTemplate
              .render as SinonStub
          )
            .getCall(-1)
            .calledWith(expectedParameters)
        );
      });

      it('matchProjectFromWorkflowInvocationName', () => {
        const result = client.matchProjectFromWorkflowInvocationName(fakePath);
        assert.strictEqual(result, 'projectValue');
        assert(
          (
            client.pathTemplates.workflowInvocationPathTemplate
              .match as SinonStub
          )
            .getCall(-1)
            .calledWith(fakePath)
        );
      });

      it('matchLocationFromWorkflowInvocationName', () => {
        const result = client.matchLocationFromWorkflowInvocationName(fakePath);
        assert.strictEqual(result, 'locationValue');
        assert(
          (
            client.pathTemplates.workflowInvocationPathTemplate
              .match as SinonStub
          )
            .getCall(-1)
            .calledWith(fakePath)
        );
      });

      it('matchRepositoryFromWorkflowInvocationName', () => {
        const result =
          client.matchRepositoryFromWorkflowInvocationName(fakePath);
        assert.strictEqual(result, 'repositoryValue');
        assert(
          (
            client.pathTemplates.workflowInvocationPathTemplate
              .match as SinonStub
          )
            .getCall(-1)
            .calledWith(fakePath)
        );
      });

      it('matchWorkflowInvocationFromWorkflowInvocationName', () => {
        const result =
          client.matchWorkflowInvocationFromWorkflowInvocationName(fakePath);
        assert.strictEqual(result, 'workflowInvocationValue');
        assert(
          (
            client.pathTemplates.workflowInvocationPathTemplate
              .match as SinonStub
          )
            .getCall(-1)
            .calledWith(fakePath)
        );
      });
    });

    describe('workspace', () => {
      const fakePath = '/rendered/path/workspace';
      const expectedParameters = {
        project: 'projectValue',
        location: 'locationValue',
        repository: 'repositoryValue',
        workspace: 'workspaceValue',
      };
      const client = new dataformModule.v1beta1.DataformClient({
        credentials: {client_email: 'bogus', private_key: 'bogus'},
        projectId: 'bogus',
      });
      client.initialize();
      client.pathTemplates.workspacePathTemplate.render = sinon
        .stub()
        .returns(fakePath);
      client.pathTemplates.workspacePathTemplate.match = sinon
        .stub()
        .returns(expectedParameters);

      it('workspacePath', () => {
        const result = client.workspacePath(
          'projectValue',
          'locationValue',
          'repositoryValue',
          'workspaceValue'
        );
        assert.strictEqual(result, fakePath);
        assert(
          (client.pathTemplates.workspacePathTemplate.render as SinonStub)
            .getCall(-1)
            .calledWith(expectedParameters)
        );
      });

      it('matchProjectFromWorkspaceName', () => {
        const result = client.matchProjectFromWorkspaceName(fakePath);
        assert.strictEqual(result, 'projectValue');
        assert(
          (client.pathTemplates.workspacePathTemplate.match as SinonStub)
            .getCall(-1)
            .calledWith(fakePath)
        );
      });

      it('matchLocationFromWorkspaceName', () => {
        const result = client.matchLocationFromWorkspaceName(fakePath);
        assert.strictEqual(result, 'locationValue');
        assert(
          (client.pathTemplates.workspacePathTemplate.match as SinonStub)
            .getCall(-1)
            .calledWith(fakePath)
        );
      });

      it('matchRepositoryFromWorkspaceName', () => {
        const result = client.matchRepositoryFromWorkspaceName(fakePath);
        assert.strictEqual(result, 'repositoryValue');
        assert(
          (client.pathTemplates.workspacePathTemplate.match as SinonStub)
            .getCall(-1)
            .calledWith(fakePath)
        );
      });

      it('matchWorkspaceFromWorkspaceName', () => {
        const result = client.matchWorkspaceFromWorkspaceName(fakePath);
        assert.strictEqual(result, 'workspaceValue');
        assert(
          (client.pathTemplates.workspacePathTemplate.match as SinonStub)
            .getCall(-1)
            .calledWith(fakePath)
        );
      });
    });
  });
});

redpajama_set_name: RedPajamaGithub