# Class v1beta4.SqlFlagsServiceClient (0.23.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [0.23.0 (latest)](https://docs.cloud.google.com/nodejs/docs/reference/sql/latest/sql/v1beta4.sqlflagsserviceclient)
- [0.19.1](https://docs.cloud.google.com/nodejs/docs/reference/sql/0.19.1/sql/v1beta4.sqlflagsserviceclient)
- [0.16.0](https://docs.cloud.google.com/nodejs/docs/reference/sql/0.16.0/sql/v1beta4.sqlflagsserviceclient)
- [0.15.0](https://docs.cloud.google.com/nodejs/docs/reference/sql/0.15.0/sql/v1beta4.sqlflagsserviceclient)
- [0.14.0](https://docs.cloud.google.com/nodejs/docs/reference/sql/0.14.0/sql/v1beta4.sqlflagsserviceclient)
- [0.13.0](https://docs.cloud.google.com/nodejs/docs/reference/sql/0.13.0/sql/v1beta4.sqlflagsserviceclient)
- [0.11.0](https://docs.cloud.google.com/nodejs/docs/reference/sql/0.11.0/sql/v1beta4.sqlflagsserviceclient)
- [0.8.0](https://docs.cloud.google.com/nodejs/docs/reference/sql/0.8.0/sql/v1beta4.sqlflagsserviceclient)
- [0.7.0](https://docs.cloud.google.com/nodejs/docs/reference/sql/0.7.0/sql/v1beta4.sqlflagsserviceclient)
- [0.5.0](https://docs.cloud.google.com/nodejs/docs/reference/sql/0.5.0/sql/v1beta4.sqlflagsserviceclient)
- [0.4.0](https://docs.cloud.google.com/nodejs/docs/reference/sql/0.4.0/sql/v1beta4.sqlflagsserviceclient)
v1beta4

## Package

[@google-cloud/sql](https://docs.cloud.google.com/nodejs/docs/reference/sql/latest/overview.html)

## Constructors

### (constructor)(opts, gaxInstance)

    constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of SqlFlagsServiceClient.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `opts` | `ClientOptions` |
| `gaxInstance` | `typeof gax | typeof fallback` : loaded instance of `google-gax`. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: \`\`\` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new SqlFlagsServiceClient({fallback: true}, gax); \`\`\` |

## Properties

### apiEndpoint

    get apiEndpoint(): string;

The DNS address for this API service.

### apiEndpoint

    static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath.

### auth

    auth: gax.GoogleAuth;

### descriptors

    descriptors: Descriptors;

### innerApiCalls

    innerApiCalls: {
            [name: string]: Function;
        };

### locationsClient

    locationsClient: LocationsClient;

### port

    static get port(): number;

The port for this API service.

### scopes

    static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

### servicePath

    static get servicePath(): string;

The DNS address for this API service.

### sqlFlagsServiceStub

    sqlFlagsServiceStub?: Promise<{
            [name: string]: Function;
        }>;

### universeDomain

    get universeDomain(): string;

### warn

    warn: (code: string, message: string, warnType?: string) => void;

## Methods

### close()

    close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<void>` | {Promise} A promise that resolves when the client is closed. |

### getLocation(request, options, callback)

    getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;

Gets information about a location.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `LocationProtos.google.cloud.location.IGetLocationRequest` The request object that will be sent. |
| `options` | `CallOptions | Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |
| `callback` | `Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<google.cloud.location.ILocation>` | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |

**Example**


    const [response] = await client.getLocation(request);

### getProjectId()

    getProjectId(): Promise<string>;

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<string>` |   |

### getProjectId(callback)

    getProjectId(callback: Callback<string, undefined, undefined>): void;

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `callback` | `Callback<string, undefined, undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### initialize()

    initialize(): Promise<{
            [name: string]: Function;
        }>;

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<{ [name: string]: Function; }>` | {Promise} A promise that resolves to an authenticated service stub. |

### list(request, options)

    list(request?: protos.google.cloud.sql.v1beta4.ISqlFlagsListRequest, options?: CallOptions): Promise<[
            protos.google.cloud.sql.v1beta4.IFlagsListResponse,
            protos.google.cloud.sql.v1beta4.ISqlFlagsListRequest | undefined,
            {} | undefined
        ]>;

Lists all available database flags for Cloud SQL instances.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/sql/latest/sql/protos.google.cloud.sql.v1beta4.isqlflagslistrequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Promise<[ https://docs.cloud.google.com/nodejs/docs/reference/sql/latest/sql/protos.google.cloud.sql.v1beta4.iflagslistresponse, https://docs.cloud.google.com/nodejs/docs/reference/sql/latest/sql/protos.google.cloud.sql.v1beta4.isqlflagslistrequest | undefined, {} | undefined ]>` | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [FlagsListResponse](https://docs.cloud.google.com/nodejs/docs/reference/sql/latest/sql/protos.google.cloud.sql.v1beta4.flagslistresponse). Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |

**Example**


      /**
       * This snippet has been automatically generated and should be regarded as a code template only.
       * It will require modifications to work.
       * It may require correct/in-range values for request initialization.
       * TODO(developer): Uncomment these variables before running the sample.
       */
      /**
       *  Database type and version you want to retrieve flags for. By default, this
       *  method returns flags for all database types and versions.
       */
      // const databaseVersion = 'abc123'

      // Imports the Sql library
      const {SqlFlagsServiceClient} = require('https://docs.cloud.google.com/nodejs/docs/reference/sql/latest/overview.html').v1beta4;

      // Instantiates a client
      const sqlClient = new https://docs.cloud.google.com/nodejs/docs/reference/sql/latest/overview.html();

      async function callList() {
        // Construct request
        const request = {
        };

        // Run request
        const response = await sqlClient.list(request);
        console.log(response);
      }

      callList();

### list(request, options, callback)

    list(request: protos.google.cloud.sql.v1beta4.ISqlFlagsListRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IFlagsListResponse, protos.google.cloud.sql.v1beta4.ISqlFlagsListRequest | null | undefined, {} | null | undefined>): void;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/sql/latest/sql/protos.google.cloud.sql.v1beta4.isqlflagslistrequest` |
| `options` | `CallOptions` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/sql/latest/sql/protos.google.cloud.sql.v1beta4.iflagslistresponse, https://docs.cloud.google.com/nodejs/docs/reference/sql/latest/sql/protos.google.cloud.sql.v1beta4.isqlflagslistrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### list(request, callback)

    list(request: protos.google.cloud.sql.v1beta4.ISqlFlagsListRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IFlagsListResponse, protos.google.cloud.sql.v1beta4.ISqlFlagsListRequest | null | undefined, {} | null | undefined>): void;

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/nodejs/docs/reference/sql/latest/sql/protos.google.cloud.sql.v1beta4.isqlflagslistrequest` |
| `callback` | `Callback<https://docs.cloud.google.com/nodejs/docs/reference/sql/latest/sql/protos.google.cloud.sql.v1beta4.iflagslistresponse, https://docs.cloud.google.com/nodejs/docs/reference/sql/latest/sql/protos.google.cloud.sql.v1beta4.isqlflagslistrequest | null | undefined, {} | null | undefined>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `void` |   |

### listLocationsAsync(request, options)

    listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;

Lists information about the supported locations for this service. Returns an iterable object.

`for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `LocationProtos.google.cloud.location.IListLocationsRequest` The request object that will be sent. |
| `options` | `CallOptions` Call options. See [CallOptions](https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html) for more details. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncIterable<google.cloud.location.ILocation>` | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |

**Example**


    const iterable = client.listLocationsAsync(request);
    for await (const response of iterable) {
      // process response
    }